From 35e6facd5cf67217929d0408ff2a4f82616537e3 Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Wed, 30 Aug 2017 21:25:12 +0100 Subject: [PATCH] Import libgdata_0.17.9.orig.tar.xz [dgit import orig libgdata_0.17.9.orig.tar.xz] --- AUTHORS | 1 + COPYING | 504 + ChangeLog | 26798 ++++++++++++++++ HACKING | 216 + INSTALL | 370 + Makefile.am | 874 + Makefile.in | 4137 +++ NEWS | 1558 + README | 64 + aclocal.m4 | 1177 + autogen.sh | 39 + build-aux/compile | 347 + build-aux/config.guess | 1462 + build-aux/config.sub | 1823 ++ build-aux/depcomp | 791 + build-aux/install-sh | 501 + build-aux/ltmain.sh | 11147 +++++++ build-aux/missing | 215 + build-aux/test-driver | 148 + config.h.in | 135 + configure | 23120 +++++++++++++ configure.ac | 221 + demos/calendar/calendar-cli.c | 553 + demos/docs-list/docs-list.c | 120 + demos/scrapbook/scrapbook.c | 721 + demos/scrapbook/scrapbook.h | 188 + demos/tasks/tasks-cli.c | 350 + demos/youtube/youtube-cli.c | 585 + docs/Makefile.am | 3 + docs/Makefile.in | 724 + docs/reference/Makefile.am | 119 + docs/reference/Makefile.in | 1294 + docs/reference/cancellation.dia | Bin 0 -> 1273 bytes docs/reference/cancellation.png | Bin 0 -> 7849 bytes docs/reference/data-flow.dia | Bin 0 -> 1657 bytes docs/reference/data-flow.png | Bin 0 -> 24681 bytes docs/reference/gdata-docs.xml | 309 + docs/reference/gdata-overrides.txt | 0 docs/reference/gdata-overview.xml | 244 + docs/reference/gdata-running.xml | 84 + docs/reference/gdata-sections.txt | 2880 ++ docs/reference/gdata.types | 101 + docs/reference/html/GDataAPPCategories.html | 216 + docs/reference/html/GDataAccessHandler.html | 361 + docs/reference/html/GDataAccessRule.html | 638 + docs/reference/html/GDataAuthor.html | 468 + .../html/GDataAuthorizationDomain.html | 241 + docs/reference/html/GDataAuthorizer.html | 527 + docs/reference/html/GDataBatchOperation.html | 966 + docs/reference/html/GDataBatchable.html | 206 + .../html/GDataCalendarAccessRule.html | 222 + .../reference/html/GDataCalendarCalendar.html | 787 + docs/reference/html/GDataCalendarEvent.html | 1644 + docs/reference/html/GDataCalendarFeed.html | 250 + docs/reference/html/GDataCalendarQuery.html | 1346 + docs/reference/html/GDataCalendarService.html | 1162 + docs/reference/html/GDataCategory.html | 524 + .../html/GDataClientLoginAuthorizer.html | 1153 + docs/reference/html/GDataComment.html | 113 + docs/reference/html/GDataCommentable.html | 909 + docs/reference/html/GDataComparable.html | 210 + docs/reference/html/GDataContactsContact.html | 4641 +++ docs/reference/html/GDataContactsGroup.html | 625 + docs/reference/html/GDataContactsQuery.html | 676 + docs/reference/html/GDataContactsService.html | 975 + .../html/GDataDocumentsAccessRule.html | 156 + .../html/GDataDocumentsDocument.html | 717 + .../reference/html/GDataDocumentsDrawing.html | 222 + docs/reference/html/GDataDocumentsEntry.html | 854 + docs/reference/html/GDataDocumentsFeed.html | 110 + docs/reference/html/GDataDocumentsFolder.html | 250 + .../html/GDataDocumentsMetadata.html | 236 + docs/reference/html/GDataDocumentsPdf.html | 162 + .../html/GDataDocumentsPresentation.html | 243 + docs/reference/html/GDataDocumentsQuery.html | 891 + .../reference/html/GDataDocumentsService.html | 2032 ++ .../html/GDataDocumentsSpreadsheet.html | 418 + docs/reference/html/GDataDocumentsText.html | 297 + .../html/GDataDocumentsUploadQuery.html | 593 + docs/reference/html/GDataDownloadStream.html | 632 + docs/reference/html/GDataEntry.html | 1249 + docs/reference/html/GDataFeed.html | 1019 + docs/reference/html/GDataFreebaseQuery.html | 248 + docs/reference/html/GDataFreebaseResult.html | 222 + .../html/GDataFreebaseSearchQuery.html | 628 + .../html/GDataFreebaseSearchResult.html | 572 + docs/reference/html/GDataFreebaseService.html | 708 + .../html/GDataFreebaseTopicQuery.html | 390 + .../html/GDataFreebaseTopicResult.html | 1130 + .../reference/html/GDataGContactCalendar.html | 614 + docs/reference/html/GDataGContactEvent.html | 500 + .../html/GDataGContactExternalID.html | 530 + docs/reference/html/GDataGContactJot.html | 428 + .../reference/html/GDataGContactLanguage.html | 373 + .../reference/html/GDataGContactRelation.html | 663 + docs/reference/html/GDataGContactWebsite.html | 670 + docs/reference/html/GDataGDEmailAddress.html | 695 + docs/reference/html/GDataGDIMAddress.html | 803 + docs/reference/html/GDataGDName.html | 758 + docs/reference/html/GDataGDOrganization.html | 1065 + docs/reference/html/GDataGDPhoneNumber.html | 905 + docs/reference/html/GDataGDPostalAddress.html | 1857 ++ docs/reference/html/GDataGDReminder.html | 557 + docs/reference/html/GDataGDWhen.html | 747 + docs/reference/html/GDataGDWhere.html | 505 + docs/reference/html/GDataGDWho.html | 517 + docs/reference/html/GDataGenerator.html | 296 + docs/reference/html/GDataGoaAuthorizer.html | 274 + docs/reference/html/GDataLink.html | 882 + docs/reference/html/GDataMediaCategory.html | 453 + docs/reference/html/GDataMediaContent.html | 753 + docs/reference/html/GDataMediaCredit.html | 282 + docs/reference/html/GDataMediaThumbnail.html | 396 + .../reference/html/GDataOAuth1Authorizer.html | 1323 + .../reference/html/GDataOAuth2Authorizer.html | 1282 + docs/reference/html/GDataParsable.html | 520 + docs/reference/html/GDataPicasaWebAlbum.html | 1394 + .../reference/html/GDataPicasaWebComment.html | 152 + docs/reference/html/GDataPicasaWebFeed.html | 108 + docs/reference/html/GDataPicasaWebFile.html | 2123 ++ docs/reference/html/GDataPicasaWebQuery.html | 814 + .../reference/html/GDataPicasaWebService.html | 1134 + docs/reference/html/GDataPicasaWebUser.html | 447 + docs/reference/html/GDataQuery.html | 1353 + docs/reference/html/GDataService.html | 2152 ++ docs/reference/html/GDataTasksQuery.html | 809 + docs/reference/html/GDataTasksService.html | 1281 + docs/reference/html/GDataTasksTask.html | 819 + docs/reference/html/GDataTasksTasklist.html | 152 + docs/reference/html/GDataUploadStream.html | 1077 + docs/reference/html/GDataYouTubeCategory.html | 284 + docs/reference/html/GDataYouTubeComment.html | 269 + docs/reference/html/GDataYouTubeContent.html | 201 + docs/reference/html/GDataYouTubeCredit.html | 218 + docs/reference/html/GDataYouTubeFeed.html | 113 + docs/reference/html/GDataYouTubeQuery.html | 1502 + docs/reference/html/GDataYouTubeService.html | 1652 + docs/reference/html/GDataYouTubeState.html | 336 + docs/reference/html/GDataYouTubeVideo.html | 2155 ++ docs/reference/html/annotation-glossary.html | 81 + docs/reference/html/cancellation.png | Bin 0 -> 7849 bytes docs/reference/html/ch01.html | 137 + docs/reference/html/ch02.html | 61 + docs/reference/html/ch03.html | 37 + docs/reference/html/ch04.html | 37 + docs/reference/html/ch05.html | 49 + docs/reference/html/ch06.html | 37 + docs/reference/html/ch07.html | 43 + docs/reference/html/ch08.html | 32 + docs/reference/html/ch09.html | 61 + docs/reference/html/ch10.html | 52 + docs/reference/html/ch11.html | 43 + docs/reference/html/ch12.html | 43 + docs/reference/html/ch13.html | 46 + docs/reference/html/ch14.html | 49 + docs/reference/html/ch15.html | 43 + docs/reference/html/ch16.html | 73 + docs/reference/html/ch17.html | 52 + docs/reference/html/ch18.html | 43 + docs/reference/html/ch19.html | 52 + docs/reference/html/data-flow.png | Bin 0 -> 24681 bytes docs/reference/html/gdata-GData-Types.html | 218 + .../html/gdata-Version-Information.html | 48 + docs/reference/html/gdata-overview.html | 276 + docs/reference/html/gdata-running.html | 132 + docs/reference/html/gdata.devhelp2 | 2118 ++ docs/reference/html/home.png | Bin 0 -> 256 bytes docs/reference/html/index.html | 398 + docs/reference/html/left-insensitive.png | Bin 0 -> 395 bytes docs/reference/html/left.png | Bin 0 -> 262 bytes docs/reference/html/pt01.html | 41 + docs/reference/html/pt02.html | 115 + docs/reference/html/pt03.html | 140 + docs/reference/html/pt04.html | 196 + docs/reference/html/pt05.html | 33 + docs/reference/html/right-insensitive.png | Bin 0 -> 373 bytes docs/reference/html/right.png | Bin 0 -> 261 bytes docs/reference/html/structure.png | Bin 0 -> 22102 bytes docs/reference/html/style.css | 479 + docs/reference/html/up-insensitive.png | Bin 0 -> 374 bytes docs/reference/html/up.png | Bin 0 -> 260 bytes docs/reference/structure.dia | Bin 0 -> 1803 bytes docs/reference/structure.png | Bin 0 -> 22102 bytes gdata/GData-0.0.metadata | 12 + gdata/app/gdata-app-categories.c | 258 + gdata/app/gdata-app-categories.h | 77 + gdata/atom/gdata-author.c | 377 + gdata/atom/gdata-author.h | 81 + gdata/atom/gdata-category.c | 377 + gdata/atom/gdata-category.h | 121 + gdata/atom/gdata-generator.c | 264 + gdata/atom/gdata-generator.h | 74 + gdata/atom/gdata-link.c | 625 + gdata/atom/gdata-link.h | 190 + gdata/exif/gdata-exif-tags.c | 343 + gdata/exif/gdata-exif-tags.h | 83 + gdata/gcontact/gdata-gcontact-calendar.c | 478 + gdata/gcontact/gdata-gcontact-calendar.h | 123 + gdata/gcontact/gdata-gcontact-event.c | 446 + gdata/gcontact/gdata-gcontact-event.h | 108 + gdata/gcontact/gdata-gcontact-external-id.c | 406 + gdata/gcontact/gdata-gcontact-external-id.h | 132 + gdata/gcontact/gdata-gcontact-jot.c | 308 + gdata/gcontact/gdata-gcontact-jot.h | 140 + gdata/gcontact/gdata-gcontact-language.c | 327 + gdata/gcontact/gdata-gcontact-language.h | 80 + gdata/gcontact/gdata-gcontact-relation.c | 406 + gdata/gcontact/gdata-gcontact-relation.h | 252 + gdata/gcontact/gdata-gcontact-website.c | 481 + gdata/gcontact/gdata-gcontact-website.h | 171 + gdata/gd/gdata-gd-email-address.c | 520 + gdata/gd/gdata-gd-email-address.h | 117 + gdata/gd/gdata-gd-feed-link.c | 447 + gdata/gd/gdata-gd-feed-link.h | 84 + gdata/gd/gdata-gd-im-address.c | 526 + gdata/gd/gdata-gd-im-address.h | 198 + gdata/gd/gdata-gd-name.c | 589 + gdata/gd/gdata-gd-name.h | 92 + gdata/gd/gdata-gd-organization.c | 826 + gdata/gd/gdata-gd-organization.h | 121 + gdata/gd/gdata-gd-phone-number.c | 562 + gdata/gd/gdata-gd-phone-number.h | 270 + gdata/gd/gdata-gd-postal-address.c | 1342 + gdata/gd/gdata-gd-postal-address.h | 205 + gdata/gd/gdata-gd-reminder.c | 467 + gdata/gd/gdata-gd-reminder.h | 111 + gdata/gd/gdata-gd-when.c | 596 + gdata/gd/gdata-gd-when.h | 172 + gdata/gd/gdata-gd-where.c | 407 + gdata/gd/gdata-gd-where.h | 110 + gdata/gd/gdata-gd-who.c | 414 + gdata/gd/gdata-gd-who.h | 122 + gdata/gdata-access-handler.c | 251 + gdata/gdata-access-handler.h | 109 + gdata/gdata-access-rule.c | 661 + gdata/gdata-access-rule.h | 118 + gdata/gdata-authorization-domain.c | 197 + gdata/gdata-authorization-domain.h | 78 + gdata/gdata-authorizer.c | 312 + gdata/gdata-authorizer.h | 91 + gdata/gdata-batch-feed.c | 170 + gdata/gdata-batch-feed.h | 73 + gdata/gdata-batch-operation.c | 825 + gdata/gdata-batch-operation.h | 150 + gdata/gdata-batch-private.h | 44 + gdata/gdata-batchable.c | 81 + gdata/gdata-batchable.h | 76 + gdata/gdata-buffer.c | 351 + gdata/gdata-buffer.h | 59 + gdata/gdata-client-login-authorizer.c | 1344 + gdata/gdata-client-login-authorizer.h | 140 + gdata/gdata-comment.c | 54 + gdata/gdata-comment.h | 72 + gdata/gdata-commentable.c | 598 + gdata/gdata-commentable.h | 103 + gdata/gdata-comparable.c | 95 + gdata/gdata-comparable.h | 66 + gdata/gdata-core.symbols | 1126 + gdata/gdata-download-stream.c | 1087 + gdata/gdata-download-stream.h | 87 + gdata/gdata-entry.c | 1306 + gdata/gdata-entry.h | 111 + gdata/gdata-enums.c | 114 + gdata/gdata-enums.h | 29 + gdata/gdata-feed.c | 1187 + gdata/gdata-feed.h | 98 + gdata/gdata-goa-authorizer.c | 607 + gdata/gdata-goa-authorizer.h | 77 + gdata/gdata-goa.symbols | 3 + gdata/gdata-marshal.c | 151 + gdata/gdata-marshal.h | 28 + gdata/gdata-marshal.list | 2 + gdata/gdata-oauth1-authorizer.c | 1468 + gdata/gdata-oauth1-authorizer.h | 107 + gdata/gdata-oauth2-authorizer.c | 1592 + gdata/gdata-oauth2-authorizer.h | 136 + gdata/gdata-parsable.c | 781 + gdata/gdata-parsable.h | 135 + gdata/gdata-parser.c | 1312 + gdata/gdata-parser.h | 123 + gdata/gdata-private.h | 174 + gdata/gdata-query.c | 1222 + gdata/gdata-query.h | 102 + gdata/gdata-service.c | 2499 ++ gdata/gdata-service.h | 247 + gdata/gdata-types.c | 134 + gdata/gdata-types.h | 50 + gdata/gdata-upload-stream.c | 1646 + gdata/gdata-upload-stream.h | 123 + gdata/gdata-version.h | 80 + gdata/gdata-version.h.in | 80 + gdata/gdata.h | 161 + gdata/georss/gdata-georss-where.c | 223 + gdata/georss/gdata-georss-where.h | 77 + gdata/media/gdata-media-category.c | 388 + gdata/media/gdata-media-category.h | 81 + gdata/media/gdata-media-content.c | 573 + gdata/media/gdata-media-content.h | 121 + gdata/media/gdata-media-credit.c | 268 + gdata/media/gdata-media-credit.h | 74 + gdata/media/gdata-media-enums.c | 43 + gdata/media/gdata-media-enums.h | 20 + gdata/media/gdata-media-group.c | 673 + gdata/media/gdata-media-group.h | 93 + gdata/media/gdata-media-thumbnail.c | 434 + gdata/media/gdata-media-thumbnail.h | 80 + .../calendar/gdata-calendar-access-rule.c | 277 + .../calendar/gdata-calendar-access-rule.h | 125 + .../calendar/gdata-calendar-calendar.c | 805 + .../calendar/gdata-calendar-calendar.h | 86 + .../services/calendar/gdata-calendar-event.c | 1824 ++ .../services/calendar/gdata-calendar-event.h | 105 + gdata/services/calendar/gdata-calendar-feed.c | 158 + gdata/services/calendar/gdata-calendar-feed.h | 78 + .../services/calendar/gdata-calendar-query.c | 974 + .../services/calendar/gdata-calendar-query.h | 99 + .../calendar/gdata-calendar-service.c | 918 + .../calendar/gdata-calendar-service.h | 129 + .../contacts/gdata-contacts-contact.c | 3529 ++ .../contacts/gdata-contacts-contact.h | 305 + .../services/contacts/gdata-contacts-group.c | 601 + .../services/contacts/gdata-contacts-group.h | 118 + .../services/contacts/gdata-contacts-query.c | 485 + .../services/contacts/gdata-contacts-query.h | 85 + .../contacts/gdata-contacts-service.c | 568 + .../contacts/gdata-contacts-service.h | 110 + .../documents/gdata-documents-access-rule.c | 230 + .../documents/gdata-documents-access-rule.h | 75 + .../documents/gdata-documents-document.c | 536 + .../documents/gdata-documents-document.h | 84 + .../documents/gdata-documents-drawing.c | 88 + .../documents/gdata-documents-drawing.h | 130 + .../documents/gdata-documents-entry.c | 1147 + .../documents/gdata-documents-entry.h | 124 + .../documents/gdata-documents-enums.c | 28 + .../documents/gdata-documents-enums.h | 18 + .../services/documents/gdata-documents-feed.c | 185 + .../services/documents/gdata-documents-feed.h | 73 + .../documents/gdata-documents-folder.c | 136 + .../documents/gdata-documents-folder.h | 76 + .../documents/gdata-documents-metadata.c | 230 + .../documents/gdata-documents-metadata.h | 77 + .../services/documents/gdata-documents-pdf.c | 88 + .../services/documents/gdata-documents-pdf.h | 77 + .../documents/gdata-documents-presentation.c | 87 + .../documents/gdata-documents-presentation.h | 147 + .../documents/gdata-documents-query.c | 709 + .../documents/gdata-documents-query.h | 93 + .../documents/gdata-documents-service.c | 1553 + .../documents/gdata-documents-service.h | 163 + .../documents/gdata-documents-spreadsheet.c | 189 + .../documents/gdata-documents-spreadsheet.h | 159 + .../services/documents/gdata-documents-text.c | 87 + .../services/documents/gdata-documents-text.h | 192 + .../documents/gdata-documents-upload-query.c | 423 + .../documents/gdata-documents-upload-query.h | 84 + .../documents/gdata-documents-utils.c | 154 + .../documents/gdata-documents-utils.h | 43 + .../services/freebase/gdata-freebase-enums.c | 27 + .../services/freebase/gdata-freebase-enums.h | 18 + .../services/freebase/gdata-freebase-query.c | 259 + .../services/freebase/gdata-freebase-query.h | 81 + .../services/freebase/gdata-freebase-result.c | 205 + .../services/freebase/gdata-freebase-result.h | 81 + .../freebase/gdata-freebase-search-query.c | 626 + .../freebase/gdata-freebase-search-query.h | 106 + .../freebase/gdata-freebase-search-result.c | 432 + .../freebase/gdata-freebase-search-result.h | 104 + .../freebase/gdata-freebase-service.c | 509 + .../freebase/gdata-freebase-service.h | 111 + .../freebase/gdata-freebase-topic-query.c | 351 + .../freebase/gdata-freebase-topic-query.h | 84 + .../freebase/gdata-freebase-topic-result.c | 1047 + .../freebase/gdata-freebase-topic-result.h | 135 + .../picasaweb/gdata-picasaweb-album.c | 1268 + .../picasaweb/gdata-picasaweb-album.h | 114 + .../picasaweb/gdata-picasaweb-comment.c | 114 + .../picasaweb/gdata-picasaweb-comment.h | 75 + .../picasaweb/gdata-picasaweb-enums.c | 24 + .../picasaweb/gdata-picasaweb-enums.h | 18 + .../services/picasaweb/gdata-picasaweb-feed.c | 91 + .../services/picasaweb/gdata-picasaweb-feed.h | 73 + .../services/picasaweb/gdata-picasaweb-file.c | 1801 ++ .../services/picasaweb/gdata-picasaweb-file.h | 154 + .../picasaweb/gdata-picasaweb-query.c | 608 + .../picasaweb/gdata-picasaweb-query.h | 92 + .../picasaweb/gdata-picasaweb-service.c | 741 + .../picasaweb/gdata-picasaweb-service.h | 120 + .../services/picasaweb/gdata-picasaweb-user.c | 376 + .../services/picasaweb/gdata-picasaweb-user.h | 82 + gdata/services/tasks/gdata-tasks-query.c | 659 + gdata/services/tasks/gdata-tasks-query.h | 90 + gdata/services/tasks/gdata-tasks-service.c | 872 + gdata/services/tasks/gdata-tasks-service.h | 115 + gdata/services/tasks/gdata-tasks-task.c | 680 + gdata/services/tasks/gdata-tasks-task.h | 116 + gdata/services/tasks/gdata-tasks-tasklist.c | 134 + gdata/services/tasks/gdata-tasks-tasklist.h | 73 + .../services/youtube/gdata-youtube-category.c | 242 + .../services/youtube/gdata-youtube-category.h | 77 + .../services/youtube/gdata-youtube-comment.c | 576 + .../services/youtube/gdata-youtube-comment.h | 77 + .../services/youtube/gdata-youtube-content.c | 157 + .../services/youtube/gdata-youtube-content.h | 108 + gdata/services/youtube/gdata-youtube-credit.c | 179 + gdata/services/youtube/gdata-youtube-credit.h | 97 + gdata/services/youtube/gdata-youtube-enums.c | 145 + gdata/services/youtube/gdata-youtube-enums.h | 35 + gdata/services/youtube/gdata-youtube-feed.c | 102 + gdata/services/youtube/gdata-youtube-feed.h | 74 + gdata/services/youtube/gdata-youtube-query.c | 1127 + gdata/services/youtube/gdata-youtube-query.h | 197 + .../services/youtube/gdata-youtube-service.c | 1229 + .../services/youtube/gdata-youtube-service.h | 201 + gdata/services/youtube/gdata-youtube-state.c | 285 + gdata/services/youtube/gdata-youtube-state.h | 75 + gdata/services/youtube/gdata-youtube-video.c | 2477 ++ gdata/services/youtube/gdata-youtube-video.h | 238 + gdata/tests/Makefile.am | 409 + gdata/tests/Makefile.in | 2020 ++ gdata/tests/authorization.c | 793 + gdata/tests/buffer.c | 165 + gdata/tests/calendar.c | 1595 + gdata/tests/cert.pem | 23 + gdata/tests/common.c | 1050 + gdata/tests/common.h | 344 + gdata/tests/contacts.c | 2702 ++ gdata/tests/gdata-dummy-authorizer.c | 222 + gdata/tests/gdata-dummy-authorizer.h | 76 + gdata/tests/general.c | 4902 +++ gdata/tests/key.pem | 28 + gdata/tests/oauth1-authorizer.c | 1114 + gdata/tests/oauth2-authorizer.c | 1033 + gdata/tests/perf.c | 118 + gdata/tests/photo.jpg | Bin 0 -> 17659 bytes gdata/tests/sample.ogg | Bin 0 -> 96839 bytes gdata/tests/streams.c | 1105 + gdata/tests/tasks.c | 1435 + gdata/tests/test.doc | Bin 0 -> 7680 bytes gdata/tests/test.ods | Bin 0 -> 7564 bytes gdata/tests/test.odt | Bin 0 -> 8033 bytes gdata/tests/test.ppt | Bin 0 -> 71168 bytes gdata/tests/test.xls | Bin 0 -> 7680 bytes gdata/tests/test_updated.odt | Bin 0 -> 8649 bytes gdata/tests/test_updated_file.ppt | Bin 0 -> 72192 bytes .../tests/traces/calendar/access-rule-delete | 23 + gdata/tests/traces/calendar/access-rule-get | 65 + .../tests/traces/calendar/access-rule-insert | 43 + .../tests/traces/calendar/access-rule-update | 43 + gdata/tests/traces/calendar/authentication | 35 + .../traces/calendar/authentication-async | 27 + .../authentication-async-cancellation | 27 + gdata/tests/traces/calendar/event-insert | 76 + .../tests/traces/calendar/event_insert-async | 76 + .../calendar/event_insert-async-cancellation | 76 + .../traces/calendar/global-authentication | 35 + .../tests/traces/calendar/query-all-calendars | 145 + ...query-all-calendars-async-progress-closure | 145 + gdata/tests/traces/calendar/query-events | 140 + .../query-events-async-progress-closure | 140 + .../tests/traces/calendar/query-own-calendars | 117 + ...query-own-calendars-async-progress-closure | 117 + .../traces/calendar/query_all_calendars-async | 145 + .../query_all_calendars-async-cancellation | 145 + .../tests/traces/calendar/query_events-async | 140 + .../calendar/query_events-async-cancellation | 140 + .../traces/calendar/query_own_calendars-async | 117 + .../query_own_calendars-async-cancellation | 117 + .../traces/calendar/setup-query-calendars | 78 + .../tests/traces/calendar/setup-query-events | 199 + .../tests/traces/calendar/setup-temp-calendar | 39 + .../traces/calendar/setup-temp-calendar-acls | 43 + .../traces/calendar/teardown-insert-event | 24 + .../traces/calendar/teardown-query-calendars | 48 + .../traces/calendar/teardown-query-events | 72 + .../traces/calendar/teardown-temp-calendar | 24 + .../calendar/teardown-temp-calendar-acls | 23 + gdata/tests/traces/contacts/authentication | 35 + .../traces/contacts/authentication-async | 27 + .../authentication-async-cancellation | 27 + gdata/tests/traces/contacts/batch | 242 + gdata/tests/traces/contacts/batch-async | 57 + .../traces/contacts/batch-async-cancellation | 0 gdata/tests/traces/contacts/contact-insert | 90 + gdata/tests/traces/contacts/contact-update | 63 + .../traces/contacts/global-authentication | 35 + gdata/tests/traces/contacts/group-insert | 45 + .../tests/traces/contacts/group_insert-async | 45 + .../contacts/group_insert-async-cancellation | 45 + gdata/tests/traces/contacts/photo-add | 33 + gdata/tests/traces/contacts/photo-delete | 27 + gdata/tests/traces/contacts/photo-get | 29 + gdata/tests/traces/contacts/photo_add-async | 33 + .../contacts/photo_add-async-cancellation | 31 + .../tests/traces/contacts/photo_delete-async | 27 + .../contacts/photo_delete-async-cancellation | 34 + gdata/tests/traces/contacts/photo_get-async | 29 + .../contacts/photo_get-async-cancellation | 29 + .../tests/traces/contacts/query-all-contacts | 373 + .../query-all-contacts-async-progress-closure | 373 + gdata/tests/traces/contacts/query-all-groups | 166 + .../query-all-groups-async-progress-closure | 166 + .../traces/contacts/query_all_contacts-async | 373 + .../query_all_contacts-async-cancellation | 373 + .../traces/contacts/query_all_groups-async | 166 + .../query_all_groups-async-cancellation | 166 + gdata/tests/traces/contacts/setup-batch-async | 49 + .../traces/contacts/setup-query-all-contacts | 135 + .../traces/contacts/setup-query-all-groups | 132 + .../tests/traces/contacts/setup-temp-contact | 45 + .../contacts/setup-temp-contact-with-photo | 75 + .../traces/contacts/teardown-batch-async | 30 + gdata/tests/traces/contacts/teardown-insert | 30 + .../traces/contacts/teardown-insert-group | 30 + .../contacts/teardown-query-all-contacts | 90 + .../traces/contacts/teardown-query-all-groups | 90 + .../traces/contacts/teardown-temp-contact | 72 + .../tests/traces/documents/access-rule-insert | 32 + gdata/tests/traces/documents/authentication | 81 + .../traces/documents/authentication-async | 81 + .../authentication-async-cancellation | 135 + gdata/tests/traces/documents/batch | 196 + gdata/tests/traces/documents/batch-async | 28 + .../traces/documents/batch-async-cancellation | 0 gdata/tests/traces/documents/copy-document | 32 + gdata/tests/traces/documents/delete-document | 53 + gdata/tests/traces/documents/delete-folder | 53 + .../tests/traces/documents/download-document | 112 + .../traces/documents/folders-add-to-folder | 32 + .../documents/folders-remove-from-folder | 53 + .../documents/folders_add_to_folder-async | 32 + .../folders_add_to_folder-async-cancellation | 32 + .../folders_remove_from_folder-async | 53 + ...ders_remove_from_folder-async-cancellation | 53 + .../folders_remove_from_folder-async-epilogue | 56 + .../traces/documents/global-authentication | 81 + .../traces/documents/query-all-documents | 28 + ...query-all-documents-async-progress-closure | 28 + .../documents/query-all-documents-with-folder | 28 + .../documents/query_all_documents-async | 28 + .../query_all_documents-async-cancellation | 112 + .../tests/traces/documents/setup-batch-async | 33 + .../documents/setup-folders-add-to-folder | 93 + .../setup-folders-remove-from-folder | 93 + .../documents/setup-temp-document-spreadsheet | 80 + .../traces/documents/setup-temp-documents | 179 + .../tests/traces/documents/setup-temp-folder | 33 + ...ocument_content-and-metadata-non-resumable | 80 + ...te-document_content-and-metadata-resumable | 80 + ...update-document_content-only-non-resumable | 80 + ...tup-update-document_content-only-resumable | 80 + ...pdate-document_metadata-only-non-resumable | 80 + ...tadata-in-folder-non-resumable-odt-convert | 33 + ...etadata-in-folder-resumable-bin-no-convert | 33 + ...d-metadata-in-folder-resumable-odt-convert | 33 + ...etadata-in-folder-resumable-odt-no-convert | 33 + ...data-root-folder-non-resumable-odt-convert | 0 ...adata-root-folder-resumable-bin-no-convert | 0 ...metadata-root-folder-resumable-odt-convert | 0 ...adata-root-folder-resumable-odt-no-convert | 0 ...t-only-in-folder-non-resumable-odt-convert | 33 + ...nt-only-in-folder-resumable-bin-no-convert | 33 + ...ntent-only-in-folder-resumable-odt-convert | 33 + ...nt-only-in-folder-resumable-odt-no-convert | 33 + ...only-root-folder-non-resumable-odt-convert | 0 ...-only-root-folder-resumable-bin-no-convert | 0 ...ent-only-root-folder-resumable-odt-convert | 0 ...-only-root-folder-resumable-odt-no-convert | 0 ...a-only-in-folder-non-resumable-odt-convert | 33 + ...only-root-folder-non-resumable-odt-convert | 0 .../traces/documents/teardown-batch-async | 53 + .../traces/documents/teardown-copy-document | 53 + .../documents/teardown-folders-add-to-folder | 106 + .../traces/documents/teardown-temp-document | 53 + .../traces/documents/teardown-temp-documents | 212 + .../traces/documents/teardown-temp-folder | 53 + ...ocument_content-and-metadata-non-resumable | 53 + ...te-document_content-and-metadata-resumable | 53 + ...update-document_content-only-non-resumable | 53 + ...own-update-document_content-only-resumable | 53 + ...pdate-document_metadata-only-non-resumable | 53 + ...tadata-in-folder-non-resumable-odt-convert | 106 + ...etadata-in-folder-resumable-bin-no-convert | 106 + ...d-metadata-in-folder-resumable-odt-convert | 106 + ...etadata-in-folder-resumable-odt-no-convert | 106 + ...data-root-folder-non-resumable-odt-convert | 53 + ...adata-root-folder-resumable-bin-no-convert | 53 + ...metadata-root-folder-resumable-odt-convert | 53 + ...adata-root-folder-resumable-odt-no-convert | 53 + ...t-only-in-folder-non-resumable-odt-convert | 106 + ...nt-only-in-folder-resumable-bin-no-convert | 106 + ...ntent-only-in-folder-resumable-odt-convert | 106 + ...nt-only-in-folder-resumable-odt-no-convert | 106 + ...only-root-folder-non-resumable-odt-convert | 53 + ...-only-root-folder-resumable-bin-no-convert | 53 + ...ent-only-root-folder-resumable-odt-convert | 53 + ...-only-root-folder-resumable-odt-no-convert | 53 + ...a-only-in-folder-non-resumable-odt-convert | 106 + ...only-root-folder-non-resumable-odt-convert | 53 + .../update_content-and-metadata-non-resumable | 30 + .../update_content-and-metadata-resumable | 48 + .../update_content-only-non-resumable | 30 + .../documents/update_content-only-resumable | 48 + .../update_metadata-only-non-resumable | 30 + ...tadata-in-folder-non-resumable-odt-convert | 32 + ...etadata-in-folder-resumable-bin-no-convert | 52 + ...d-metadata-in-folder-resumable-odt-convert | 52 + ...etadata-in-folder-resumable-odt-no-convert | 52 + ...data-root-folder-non-resumable-odt-convert | 32 + ...adata-root-folder-resumable-bin-no-convert | 52 + ...metadata-root-folder-resumable-odt-convert | 52 + ...adata-root-folder-resumable-odt-no-convert | 52 + ...t-only-in-folder-non-resumable-odt-convert | 32 + ...nt-only-in-folder-resumable-bin-no-convert | 52 + ...ntent-only-in-folder-resumable-odt-convert | 52 + ...nt-only-in-folder-resumable-odt-no-convert | 52 + ...only-root-folder-non-resumable-odt-convert | 32 + ...-only-root-folder-resumable-bin-no-convert | 52 + ...ent-only-root-folder-resumable-odt-convert | 52 + ...-only-root-folder-resumable-odt-no-convert | 52 + ...a-only-in-folder-non-resumable-odt-convert | 33 + ...only-root-folder-non-resumable-odt-convert | 33 + ...uthorizer-interactive-data-bad-credentials | 25 + .../oauth1-authorizer-refresh-authorization | 0 ...uthorizer-request-authentication-uri-async | 25 + ...uest-authentication-uri-async-cancellation | 0 ...authorizer-request-authentication-uri-sync | 25 + ...quest-authentication-uri-sync-cancellation | 0 ...th1-authorizer-request-authorization-async | 25 + ...equest-authorization-async-bad-credentials | 26 + ...r-request-authorization-async-cancellation | 0 ...uth1-authorizer-request-authorization-sync | 25 + ...request-authorization-sync-bad-credentials | 26 + ...er-request-authorization-sync-cancellation | 0 ...setup-oauth1-authorizer-data-authenticated | 50 + .../setup-oauth1-authorizer-interactive-data | 25 + ...uthorizer-refresh-authorization-authorized | 34 + ...horizer-refresh-authorization-unauthorized | 0 ...th2-authorizer-request-authorization-async | 35 + ...equest-authorization-async-bad-credentials | 31 + ...r-request-authorization-async-cancellation | 0 ...uth2-authorizer-request-authorization-sync | 35 + ...request-authorization-sync-bad-credentials | 31 + ...er-request-authorization-sync-cancellation | 0 ...setup-oauth2-authorizer-data-authenticated | 35 + gdata/tests/traces/picasaweb/authentication | 35 + .../traces/picasaweb/authentication-async | 27 + .../authentication-async-cancellation | 41 + gdata/tests/traces/picasaweb/comment-delete | 26 + gdata/tests/traces/picasaweb/comment-insert | 34 + gdata/tests/traces/picasaweb/comment-query | 30 + .../comment-query-async-progress-closure | 30 + .../traces/picasaweb/comment_delete-async | 26 + .../comment_delete-async-cancellation | 26 + .../traces/picasaweb/comment_insert-async | 34 + .../comment_insert-async-cancellation | 34 + .../traces/picasaweb/comment_query-async | 30 + .../comment_query-async-cancellation | 30 + gdata/tests/traces/picasaweb/download-photo | 25 + .../traces/picasaweb/download-thumbnails | 101 + .../traces/picasaweb/global-authentication | 35 + gdata/tests/traces/picasaweb/insert-album | 64 + .../tests/traces/picasaweb/insert_album-async | 34 + .../picasaweb/insert_album-async-cancellation | 50 + gdata/tests/traces/picasaweb/query-all-albums | 30 + .../query-all-albums-async-progress-closure | 30 + .../picasaweb/query-all-albums-with-limits | 90 + gdata/tests/traces/picasaweb/query-files | 30 + .../query-files-async-progress-closure | 30 + .../tests/traces/picasaweb/query-files-single | 30 + gdata/tests/traces/picasaweb/query-user | 30 + .../traces/picasaweb/query_all_albums-async | 30 + .../query_all_albums-async-cancellation | 98 + .../tests/traces/picasaweb/query_files-async | 30 + .../picasaweb/query_files-async-cancellation | 30 + gdata/tests/traces/picasaweb/query_user-async | 30 + .../picasaweb/query_user-async-cancellation | 90 + .../picasaweb/query_user_by_username-async | 30 + .../query_user_by_username-async-cancellation | 120 + .../traces/picasaweb/setup-query-all-albums | 136 + .../traces/picasaweb/setup-query-comments | 102 + .../tests/traces/picasaweb/setup-query-files | 170 + gdata/tests/traces/picasaweb/setup-upload | 0 .../traces/picasaweb/teardown-insert-album | 27 + .../traces/picasaweb/teardown-insert-comment | 26 + .../picasaweb/teardown-query-all-albums | 108 + .../traces/picasaweb/teardown-query-comments | 78 + .../traces/picasaweb/teardown-query-files | 57 + gdata/tests/traces/picasaweb/teardown-upload | 27 + .../traces/picasaweb/upload-default-album | 34 + .../picasaweb/upload_default_album-async | 34 + .../upload_default_album-async-cancellation | 34 + gdata/tests/traces/tasks/authentication | 35 + .../tests/traces/tasks/global-authentication | 35 + gdata/tests/traces/tasks/setup-delete-task | 84 + .../tests/traces/tasks/setup-delete-tasklist | 41 + gdata/tests/traces/tasks/setup-insert-task | 41 + gdata/tests/traces/tasks/setup-list-task | 170 + gdata/tests/traces/tasks/setup-list-tasklist | 123 + gdata/tests/traces/tasks/setup-update-task | 84 + .../tests/traces/tasks/setup-update-tasklist | 41 + gdata/tests/traces/tasks/task-delete | 25 + gdata/tests/traces/tasks/task-insert | 43 + gdata/tests/traces/tasks/task-list | 65 + gdata/tests/traces/tasks/task-update | 44 + gdata/tests/traces/tasks/tasklist-delete | 25 + gdata/tests/traces/tasks/tasklist-insert | 41 + .../traces/tasks/tasklist-insert-unauthorised | 46 + gdata/tests/traces/tasks/tasklist-list | 91 + gdata/tests/traces/tasks/tasklist-update | 42 + gdata/tests/traces/tasks/teardown-delete-task | 25 + gdata/tests/traces/tasks/teardown-insert-task | 50 + .../traces/tasks/teardown-insert-tasklist | 25 + gdata/tests/traces/tasks/teardown-list-task | 100 + .../tests/traces/tasks/teardown-list-tasklist | 75 + gdata/tests/traces/tasks/teardown-update-task | 50 + .../traces/tasks/teardown-update-tasklist | 25 + gdata/tests/traces/youtube/authentication | 35 + .../tests/traces/youtube/authentication-async | 27 + .../youtube/authentication-async-cancellation | 27 + gdata/tests/traces/youtube/batch | 0 gdata/tests/traces/youtube/batch-async | 0 .../traces/youtube/batch-async-cancellation | 0 gdata/tests/traces/youtube/categories | 701 + gdata/tests/traces/youtube/categories-async | 355 + .../youtube/categories-async-cancellation | 355 + gdata/tests/traces/youtube/comment-delete | 0 gdata/tests/traces/youtube/comment-insert | 68 + gdata/tests/traces/youtube/comment-query | 703 + .../comment-query-async-progress-closure | 705 + .../tests/traces/youtube/comment_delete-async | 0 .../youtube/comment_delete-async-cancellation | 0 .../tests/traces/youtube/comment_insert-async | 68 + .../youtube/comment_insert-async-cancellation | 68 + .../tests/traces/youtube/comment_query-async | 705 + .../youtube/comment_query-async-cancellation | 705 + .../traces/youtube/global-authentication | 35 + gdata/tests/traces/youtube/query-related | 175 + .../query-related-async-progress-closure | 175 + gdata/tests/traces/youtube/query-single | 103 + .../tests/traces/youtube/query-standard-feed | 325 + ...query-standard-feed-async-progress-closure | 325 + .../youtube/query-standard-feed-with-query | 325 + .../tests/traces/youtube/query-standard-feeds | 3250 ++ .../tests/traces/youtube/query_related-async | 175 + .../youtube/query_related-async-cancellation | 175 + gdata/tests/traces/youtube/query_single-async | 103 + .../youtube/query_single-async-cancellation | 103 + .../traces/youtube/query_standard_feed-async | 325 + .../query_standard_feed-async-cancellation | 325 + gdata/tests/traces/youtube/setup-batch | 190 + gdata/tests/traces/youtube/setup-comment | 95 + .../tests/traces/youtube/setup-insert-comment | 0 .../traces/youtube/teardown-insert-comment | 0 gdata/tests/traces/youtube/teardown-upload | 25 + gdata/tests/traces/youtube/upload-async | 77 + .../traces/youtube/upload-async-cancellation | 76 + gdata/tests/traces/youtube/upload-simple | 77 + gdata/tests/youtube.c | 2499 ++ glib-tap.mk | 135 + gtk-doc.make | 302 + libgdata.doap | 18 + libgdata.pc.in | 13 + m4/ax_append_compile_flags.m4 | 67 + m4/ax_append_flag.m4 | 71 + m4/ax_append_link_flags.m4 | 65 + m4/ax_check_compile_flag.m4 | 74 + m4/ax_check_link_flag.m4 | 74 + m4/ax_code_coverage.m4 | 264 + m4/ax_compiler_flags.m4 | 158 + m4/ax_compiler_flags_cflags.m4 | 140 + m4/ax_compiler_flags_cxxflags.m4 | 136 + m4/ax_compiler_flags_gir.m4 | 60 + m4/ax_compiler_flags_ldflags.m4 | 92 + m4/ax_generate_changelog.m4 | 99 + m4/ax_is_release.m4 | 80 + m4/ax_require_defined.m4 | 37 + m4/gtk-doc.m4 | 88 + m4/intltool.m4 | 212 + m4/introspection.m4 | 94 + m4/libtool.m4 | 8372 +++++ m4/ltoptions.m4 | 437 + m4/ltsugar.m4 | 124 + m4/ltversion.m4 | 23 + m4/lt~obsolete.m4 | 99 + m4/nls.m4 | 32 + m4/pkg.m4 | 343 + m4/vapigen.m4 | 101 + po/LINGUAS | 60 + po/Makefile.in.in | 221 + po/POTFILES.in | 30 + po/ar.po | 494 + po/as.po | 563 + po/be.po | 626 + po/bg.po | 582 + po/bn_IN.po | 444 + po/bs.po | 570 + po/ca.po | 566 + po/ca@valencia.po | 564 + po/cs.po | 595 + po/da.po | 603 + po/de.po | 624 + po/el.po | 663 + po/en_GB.po | 613 + po/eo.po | 472 + po/es.po | 644 + po/et.po | 450 + po/eu.po | 628 + po/fi.po | 634 + po/fr.po | 598 + po/fur.po | 594 + po/gl.po | 644 + po/gu.po | 551 + po/he.po | 595 + po/hi.po | 496 + po/hu.po | 630 + po/id.po | 600 + po/it.po | 614 + po/ja.po | 517 + po/kn.po | 469 + po/ko.po | 591 + po/lt.po | 626 + po/lv.po | 610 + po/ml.po | 478 + po/mr.po | 482 + po/nb.po | 585 + po/nl.po | 491 + po/oc.po | 640 + po/or.po | 494 + po/pa.po | 563 + po/pl.po | 589 + po/pt.po | 624 + po/pt_BR.po | 637 + po/ro.po | 455 + po/ru.po | 625 + po/sk.po | 625 + po/sl.po | 656 + po/sr.po | 615 + po/sr@latin.po | 615 + po/sv.po | 615 + po/ta.po | 485 + po/te.po | 498 + po/tg.po | 483 + po/th.po | 589 + po/tr.po | 602 + po/ug.po | 476 + po/uk.po | 483 + po/vi.po | 601 + po/zh_CN.po | 609 + po/zh_HK.po | 545 + po/zh_TW.po | 602 + tap-driver.sh | 652 + tap-test | 5 + 853 files changed, 339171 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 HACKING create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 aclocal.m4 create mode 100755 autogen.sh create mode 100755 build-aux/compile create mode 100755 build-aux/config.guess create mode 100755 build-aux/config.sub create mode 100755 build-aux/depcomp create mode 100755 build-aux/install-sh create mode 100644 build-aux/ltmain.sh create mode 100755 build-aux/missing create mode 100755 build-aux/test-driver create mode 100644 config.h.in create mode 100755 configure create mode 100644 configure.ac create mode 100644 demos/calendar/calendar-cli.c create mode 100644 demos/docs-list/docs-list.c create mode 100644 demos/scrapbook/scrapbook.c create mode 100644 demos/scrapbook/scrapbook.h create mode 100644 demos/tasks/tasks-cli.c create mode 100644 demos/youtube/youtube-cli.c create mode 100644 docs/Makefile.am create mode 100644 docs/Makefile.in create mode 100644 docs/reference/Makefile.am create mode 100644 docs/reference/Makefile.in create mode 100644 docs/reference/cancellation.dia create mode 100644 docs/reference/cancellation.png create mode 100644 docs/reference/data-flow.dia create mode 100644 docs/reference/data-flow.png create mode 100644 docs/reference/gdata-docs.xml create mode 100644 docs/reference/gdata-overrides.txt create mode 100644 docs/reference/gdata-overview.xml create mode 100644 docs/reference/gdata-running.xml create mode 100644 docs/reference/gdata-sections.txt create mode 100644 docs/reference/gdata.types create mode 100644 docs/reference/html/GDataAPPCategories.html create mode 100644 docs/reference/html/GDataAccessHandler.html create mode 100644 docs/reference/html/GDataAccessRule.html create mode 100644 docs/reference/html/GDataAuthor.html create mode 100644 docs/reference/html/GDataAuthorizationDomain.html create mode 100644 docs/reference/html/GDataAuthorizer.html create mode 100644 docs/reference/html/GDataBatchOperation.html create mode 100644 docs/reference/html/GDataBatchable.html create mode 100644 docs/reference/html/GDataCalendarAccessRule.html create mode 100644 docs/reference/html/GDataCalendarCalendar.html create mode 100644 docs/reference/html/GDataCalendarEvent.html create mode 100644 docs/reference/html/GDataCalendarFeed.html create mode 100644 docs/reference/html/GDataCalendarQuery.html create mode 100644 docs/reference/html/GDataCalendarService.html create mode 100644 docs/reference/html/GDataCategory.html create mode 100644 docs/reference/html/GDataClientLoginAuthorizer.html create mode 100644 docs/reference/html/GDataComment.html create mode 100644 docs/reference/html/GDataCommentable.html create mode 100644 docs/reference/html/GDataComparable.html create mode 100644 docs/reference/html/GDataContactsContact.html create mode 100644 docs/reference/html/GDataContactsGroup.html create mode 100644 docs/reference/html/GDataContactsQuery.html create mode 100644 docs/reference/html/GDataContactsService.html create mode 100644 docs/reference/html/GDataDocumentsAccessRule.html create mode 100644 docs/reference/html/GDataDocumentsDocument.html create mode 100644 docs/reference/html/GDataDocumentsDrawing.html create mode 100644 docs/reference/html/GDataDocumentsEntry.html create mode 100644 docs/reference/html/GDataDocumentsFeed.html create mode 100644 docs/reference/html/GDataDocumentsFolder.html create mode 100644 docs/reference/html/GDataDocumentsMetadata.html create mode 100644 docs/reference/html/GDataDocumentsPdf.html create mode 100644 docs/reference/html/GDataDocumentsPresentation.html create mode 100644 docs/reference/html/GDataDocumentsQuery.html create mode 100644 docs/reference/html/GDataDocumentsService.html create mode 100644 docs/reference/html/GDataDocumentsSpreadsheet.html create mode 100644 docs/reference/html/GDataDocumentsText.html create mode 100644 docs/reference/html/GDataDocumentsUploadQuery.html create mode 100644 docs/reference/html/GDataDownloadStream.html create mode 100644 docs/reference/html/GDataEntry.html create mode 100644 docs/reference/html/GDataFeed.html create mode 100644 docs/reference/html/GDataFreebaseQuery.html create mode 100644 docs/reference/html/GDataFreebaseResult.html create mode 100644 docs/reference/html/GDataFreebaseSearchQuery.html create mode 100644 docs/reference/html/GDataFreebaseSearchResult.html create mode 100644 docs/reference/html/GDataFreebaseService.html create mode 100644 docs/reference/html/GDataFreebaseTopicQuery.html create mode 100644 docs/reference/html/GDataFreebaseTopicResult.html create mode 100644 docs/reference/html/GDataGContactCalendar.html create mode 100644 docs/reference/html/GDataGContactEvent.html create mode 100644 docs/reference/html/GDataGContactExternalID.html create mode 100644 docs/reference/html/GDataGContactJot.html create mode 100644 docs/reference/html/GDataGContactLanguage.html create mode 100644 docs/reference/html/GDataGContactRelation.html create mode 100644 docs/reference/html/GDataGContactWebsite.html create mode 100644 docs/reference/html/GDataGDEmailAddress.html create mode 100644 docs/reference/html/GDataGDIMAddress.html create mode 100644 docs/reference/html/GDataGDName.html create mode 100644 docs/reference/html/GDataGDOrganization.html create mode 100644 docs/reference/html/GDataGDPhoneNumber.html create mode 100644 docs/reference/html/GDataGDPostalAddress.html create mode 100644 docs/reference/html/GDataGDReminder.html create mode 100644 docs/reference/html/GDataGDWhen.html create mode 100644 docs/reference/html/GDataGDWhere.html create mode 100644 docs/reference/html/GDataGDWho.html create mode 100644 docs/reference/html/GDataGenerator.html create mode 100644 docs/reference/html/GDataGoaAuthorizer.html create mode 100644 docs/reference/html/GDataLink.html create mode 100644 docs/reference/html/GDataMediaCategory.html create mode 100644 docs/reference/html/GDataMediaContent.html create mode 100644 docs/reference/html/GDataMediaCredit.html create mode 100644 docs/reference/html/GDataMediaThumbnail.html create mode 100644 docs/reference/html/GDataOAuth1Authorizer.html create mode 100644 docs/reference/html/GDataOAuth2Authorizer.html create mode 100644 docs/reference/html/GDataParsable.html create mode 100644 docs/reference/html/GDataPicasaWebAlbum.html create mode 100644 docs/reference/html/GDataPicasaWebComment.html create mode 100644 docs/reference/html/GDataPicasaWebFeed.html create mode 100644 docs/reference/html/GDataPicasaWebFile.html create mode 100644 docs/reference/html/GDataPicasaWebQuery.html create mode 100644 docs/reference/html/GDataPicasaWebService.html create mode 100644 docs/reference/html/GDataPicasaWebUser.html create mode 100644 docs/reference/html/GDataQuery.html create mode 100644 docs/reference/html/GDataService.html create mode 100644 docs/reference/html/GDataTasksQuery.html create mode 100644 docs/reference/html/GDataTasksService.html create mode 100644 docs/reference/html/GDataTasksTask.html create mode 100644 docs/reference/html/GDataTasksTasklist.html create mode 100644 docs/reference/html/GDataUploadStream.html create mode 100644 docs/reference/html/GDataYouTubeCategory.html create mode 100644 docs/reference/html/GDataYouTubeComment.html create mode 100644 docs/reference/html/GDataYouTubeContent.html create mode 100644 docs/reference/html/GDataYouTubeCredit.html create mode 100644 docs/reference/html/GDataYouTubeFeed.html create mode 100644 docs/reference/html/GDataYouTubeQuery.html create mode 100644 docs/reference/html/GDataYouTubeService.html create mode 100644 docs/reference/html/GDataYouTubeState.html create mode 100644 docs/reference/html/GDataYouTubeVideo.html create mode 100644 docs/reference/html/annotation-glossary.html create mode 100644 docs/reference/html/cancellation.png create mode 100644 docs/reference/html/ch01.html create mode 100644 docs/reference/html/ch02.html create mode 100644 docs/reference/html/ch03.html create mode 100644 docs/reference/html/ch04.html create mode 100644 docs/reference/html/ch05.html create mode 100644 docs/reference/html/ch06.html create mode 100644 docs/reference/html/ch07.html create mode 100644 docs/reference/html/ch08.html create mode 100644 docs/reference/html/ch09.html create mode 100644 docs/reference/html/ch10.html create mode 100644 docs/reference/html/ch11.html create mode 100644 docs/reference/html/ch12.html create mode 100644 docs/reference/html/ch13.html create mode 100644 docs/reference/html/ch14.html create mode 100644 docs/reference/html/ch15.html create mode 100644 docs/reference/html/ch16.html create mode 100644 docs/reference/html/ch17.html create mode 100644 docs/reference/html/ch18.html create mode 100644 docs/reference/html/ch19.html create mode 100644 docs/reference/html/data-flow.png create mode 100644 docs/reference/html/gdata-GData-Types.html create mode 100644 docs/reference/html/gdata-Version-Information.html create mode 100644 docs/reference/html/gdata-overview.html create mode 100644 docs/reference/html/gdata-running.html create mode 100644 docs/reference/html/gdata.devhelp2 create mode 100644 docs/reference/html/home.png create mode 100644 docs/reference/html/index.html create mode 100644 docs/reference/html/left-insensitive.png create mode 100644 docs/reference/html/left.png create mode 100644 docs/reference/html/pt01.html create mode 100644 docs/reference/html/pt02.html create mode 100644 docs/reference/html/pt03.html create mode 100644 docs/reference/html/pt04.html create mode 100644 docs/reference/html/pt05.html create mode 100644 docs/reference/html/right-insensitive.png create mode 100644 docs/reference/html/right.png create mode 100644 docs/reference/html/structure.png create mode 100644 docs/reference/html/style.css create mode 100644 docs/reference/html/up-insensitive.png create mode 100644 docs/reference/html/up.png create mode 100644 docs/reference/structure.dia create mode 100644 docs/reference/structure.png create mode 100644 gdata/GData-0.0.metadata create mode 100644 gdata/app/gdata-app-categories.c create mode 100644 gdata/app/gdata-app-categories.h create mode 100644 gdata/atom/gdata-author.c create mode 100644 gdata/atom/gdata-author.h create mode 100644 gdata/atom/gdata-category.c create mode 100644 gdata/atom/gdata-category.h create mode 100644 gdata/atom/gdata-generator.c create mode 100644 gdata/atom/gdata-generator.h create mode 100644 gdata/atom/gdata-link.c create mode 100644 gdata/atom/gdata-link.h create mode 100644 gdata/exif/gdata-exif-tags.c create mode 100644 gdata/exif/gdata-exif-tags.h create mode 100644 gdata/gcontact/gdata-gcontact-calendar.c create mode 100644 gdata/gcontact/gdata-gcontact-calendar.h create mode 100644 gdata/gcontact/gdata-gcontact-event.c create mode 100644 gdata/gcontact/gdata-gcontact-event.h create mode 100644 gdata/gcontact/gdata-gcontact-external-id.c create mode 100644 gdata/gcontact/gdata-gcontact-external-id.h create mode 100644 gdata/gcontact/gdata-gcontact-jot.c create mode 100644 gdata/gcontact/gdata-gcontact-jot.h create mode 100644 gdata/gcontact/gdata-gcontact-language.c create mode 100644 gdata/gcontact/gdata-gcontact-language.h create mode 100644 gdata/gcontact/gdata-gcontact-relation.c create mode 100644 gdata/gcontact/gdata-gcontact-relation.h create mode 100644 gdata/gcontact/gdata-gcontact-website.c create mode 100644 gdata/gcontact/gdata-gcontact-website.h create mode 100644 gdata/gd/gdata-gd-email-address.c create mode 100644 gdata/gd/gdata-gd-email-address.h create mode 100644 gdata/gd/gdata-gd-feed-link.c create mode 100644 gdata/gd/gdata-gd-feed-link.h create mode 100644 gdata/gd/gdata-gd-im-address.c create mode 100644 gdata/gd/gdata-gd-im-address.h create mode 100644 gdata/gd/gdata-gd-name.c create mode 100644 gdata/gd/gdata-gd-name.h create mode 100644 gdata/gd/gdata-gd-organization.c create mode 100644 gdata/gd/gdata-gd-organization.h create mode 100644 gdata/gd/gdata-gd-phone-number.c create mode 100644 gdata/gd/gdata-gd-phone-number.h create mode 100644 gdata/gd/gdata-gd-postal-address.c create mode 100644 gdata/gd/gdata-gd-postal-address.h create mode 100644 gdata/gd/gdata-gd-reminder.c create mode 100644 gdata/gd/gdata-gd-reminder.h create mode 100644 gdata/gd/gdata-gd-when.c create mode 100644 gdata/gd/gdata-gd-when.h create mode 100644 gdata/gd/gdata-gd-where.c create mode 100644 gdata/gd/gdata-gd-where.h create mode 100644 gdata/gd/gdata-gd-who.c create mode 100644 gdata/gd/gdata-gd-who.h create mode 100644 gdata/gdata-access-handler.c create mode 100644 gdata/gdata-access-handler.h create mode 100644 gdata/gdata-access-rule.c create mode 100644 gdata/gdata-access-rule.h create mode 100644 gdata/gdata-authorization-domain.c create mode 100644 gdata/gdata-authorization-domain.h create mode 100644 gdata/gdata-authorizer.c create mode 100644 gdata/gdata-authorizer.h create mode 100644 gdata/gdata-batch-feed.c create mode 100644 gdata/gdata-batch-feed.h create mode 100644 gdata/gdata-batch-operation.c create mode 100644 gdata/gdata-batch-operation.h create mode 100644 gdata/gdata-batch-private.h create mode 100644 gdata/gdata-batchable.c create mode 100644 gdata/gdata-batchable.h create mode 100644 gdata/gdata-buffer.c create mode 100644 gdata/gdata-buffer.h create mode 100644 gdata/gdata-client-login-authorizer.c create mode 100644 gdata/gdata-client-login-authorizer.h create mode 100644 gdata/gdata-comment.c create mode 100644 gdata/gdata-comment.h create mode 100644 gdata/gdata-commentable.c create mode 100644 gdata/gdata-commentable.h create mode 100644 gdata/gdata-comparable.c create mode 100644 gdata/gdata-comparable.h create mode 100644 gdata/gdata-core.symbols create mode 100644 gdata/gdata-download-stream.c create mode 100644 gdata/gdata-download-stream.h create mode 100644 gdata/gdata-entry.c create mode 100644 gdata/gdata-entry.h create mode 100644 gdata/gdata-enums.c create mode 100644 gdata/gdata-enums.h create mode 100644 gdata/gdata-feed.c create mode 100644 gdata/gdata-feed.h create mode 100644 gdata/gdata-goa-authorizer.c create mode 100644 gdata/gdata-goa-authorizer.h create mode 100644 gdata/gdata-goa.symbols create mode 100644 gdata/gdata-marshal.c create mode 100644 gdata/gdata-marshal.h create mode 100644 gdata/gdata-marshal.list create mode 100644 gdata/gdata-oauth1-authorizer.c create mode 100644 gdata/gdata-oauth1-authorizer.h create mode 100644 gdata/gdata-oauth2-authorizer.c create mode 100644 gdata/gdata-oauth2-authorizer.h create mode 100644 gdata/gdata-parsable.c create mode 100644 gdata/gdata-parsable.h create mode 100644 gdata/gdata-parser.c create mode 100644 gdata/gdata-parser.h create mode 100644 gdata/gdata-private.h create mode 100644 gdata/gdata-query.c create mode 100644 gdata/gdata-query.h create mode 100644 gdata/gdata-service.c create mode 100644 gdata/gdata-service.h create mode 100644 gdata/gdata-types.c create mode 100644 gdata/gdata-types.h create mode 100644 gdata/gdata-upload-stream.c create mode 100644 gdata/gdata-upload-stream.h create mode 100644 gdata/gdata-version.h create mode 100644 gdata/gdata-version.h.in create mode 100644 gdata/gdata.h create mode 100644 gdata/georss/gdata-georss-where.c create mode 100644 gdata/georss/gdata-georss-where.h create mode 100644 gdata/media/gdata-media-category.c create mode 100644 gdata/media/gdata-media-category.h create mode 100644 gdata/media/gdata-media-content.c create mode 100644 gdata/media/gdata-media-content.h create mode 100644 gdata/media/gdata-media-credit.c create mode 100644 gdata/media/gdata-media-credit.h create mode 100644 gdata/media/gdata-media-enums.c create mode 100644 gdata/media/gdata-media-enums.h create mode 100644 gdata/media/gdata-media-group.c create mode 100644 gdata/media/gdata-media-group.h create mode 100644 gdata/media/gdata-media-thumbnail.c create mode 100644 gdata/media/gdata-media-thumbnail.h create mode 100644 gdata/services/calendar/gdata-calendar-access-rule.c create mode 100644 gdata/services/calendar/gdata-calendar-access-rule.h create mode 100644 gdata/services/calendar/gdata-calendar-calendar.c create mode 100644 gdata/services/calendar/gdata-calendar-calendar.h create mode 100644 gdata/services/calendar/gdata-calendar-event.c create mode 100644 gdata/services/calendar/gdata-calendar-event.h create mode 100644 gdata/services/calendar/gdata-calendar-feed.c create mode 100644 gdata/services/calendar/gdata-calendar-feed.h create mode 100644 gdata/services/calendar/gdata-calendar-query.c create mode 100644 gdata/services/calendar/gdata-calendar-query.h create mode 100644 gdata/services/calendar/gdata-calendar-service.c create mode 100644 gdata/services/calendar/gdata-calendar-service.h create mode 100644 gdata/services/contacts/gdata-contacts-contact.c create mode 100644 gdata/services/contacts/gdata-contacts-contact.h create mode 100644 gdata/services/contacts/gdata-contacts-group.c create mode 100644 gdata/services/contacts/gdata-contacts-group.h create mode 100644 gdata/services/contacts/gdata-contacts-query.c create mode 100644 gdata/services/contacts/gdata-contacts-query.h create mode 100644 gdata/services/contacts/gdata-contacts-service.c create mode 100644 gdata/services/contacts/gdata-contacts-service.h create mode 100644 gdata/services/documents/gdata-documents-access-rule.c create mode 100644 gdata/services/documents/gdata-documents-access-rule.h create mode 100644 gdata/services/documents/gdata-documents-document.c create mode 100644 gdata/services/documents/gdata-documents-document.h create mode 100644 gdata/services/documents/gdata-documents-drawing.c create mode 100644 gdata/services/documents/gdata-documents-drawing.h create mode 100644 gdata/services/documents/gdata-documents-entry.c create mode 100644 gdata/services/documents/gdata-documents-entry.h create mode 100644 gdata/services/documents/gdata-documents-enums.c create mode 100644 gdata/services/documents/gdata-documents-enums.h create mode 100644 gdata/services/documents/gdata-documents-feed.c create mode 100644 gdata/services/documents/gdata-documents-feed.h create mode 100644 gdata/services/documents/gdata-documents-folder.c create mode 100644 gdata/services/documents/gdata-documents-folder.h create mode 100644 gdata/services/documents/gdata-documents-metadata.c create mode 100644 gdata/services/documents/gdata-documents-metadata.h create mode 100644 gdata/services/documents/gdata-documents-pdf.c create mode 100644 gdata/services/documents/gdata-documents-pdf.h create mode 100644 gdata/services/documents/gdata-documents-presentation.c create mode 100644 gdata/services/documents/gdata-documents-presentation.h create mode 100644 gdata/services/documents/gdata-documents-query.c create mode 100644 gdata/services/documents/gdata-documents-query.h create mode 100644 gdata/services/documents/gdata-documents-service.c create mode 100644 gdata/services/documents/gdata-documents-service.h create mode 100644 gdata/services/documents/gdata-documents-spreadsheet.c create mode 100644 gdata/services/documents/gdata-documents-spreadsheet.h create mode 100644 gdata/services/documents/gdata-documents-text.c create mode 100644 gdata/services/documents/gdata-documents-text.h create mode 100644 gdata/services/documents/gdata-documents-upload-query.c create mode 100644 gdata/services/documents/gdata-documents-upload-query.h create mode 100644 gdata/services/documents/gdata-documents-utils.c create mode 100644 gdata/services/documents/gdata-documents-utils.h create mode 100644 gdata/services/freebase/gdata-freebase-enums.c create mode 100644 gdata/services/freebase/gdata-freebase-enums.h create mode 100644 gdata/services/freebase/gdata-freebase-query.c create mode 100644 gdata/services/freebase/gdata-freebase-query.h create mode 100644 gdata/services/freebase/gdata-freebase-result.c create mode 100644 gdata/services/freebase/gdata-freebase-result.h create mode 100644 gdata/services/freebase/gdata-freebase-search-query.c create mode 100644 gdata/services/freebase/gdata-freebase-search-query.h create mode 100644 gdata/services/freebase/gdata-freebase-search-result.c create mode 100644 gdata/services/freebase/gdata-freebase-search-result.h create mode 100644 gdata/services/freebase/gdata-freebase-service.c create mode 100644 gdata/services/freebase/gdata-freebase-service.h create mode 100644 gdata/services/freebase/gdata-freebase-topic-query.c create mode 100644 gdata/services/freebase/gdata-freebase-topic-query.h create mode 100644 gdata/services/freebase/gdata-freebase-topic-result.c create mode 100644 gdata/services/freebase/gdata-freebase-topic-result.h create mode 100644 gdata/services/picasaweb/gdata-picasaweb-album.c create mode 100644 gdata/services/picasaweb/gdata-picasaweb-album.h create mode 100644 gdata/services/picasaweb/gdata-picasaweb-comment.c create mode 100644 gdata/services/picasaweb/gdata-picasaweb-comment.h create mode 100644 gdata/services/picasaweb/gdata-picasaweb-enums.c create mode 100644 gdata/services/picasaweb/gdata-picasaweb-enums.h create mode 100644 gdata/services/picasaweb/gdata-picasaweb-feed.c create mode 100644 gdata/services/picasaweb/gdata-picasaweb-feed.h create mode 100644 gdata/services/picasaweb/gdata-picasaweb-file.c create mode 100644 gdata/services/picasaweb/gdata-picasaweb-file.h create mode 100644 gdata/services/picasaweb/gdata-picasaweb-query.c create mode 100644 gdata/services/picasaweb/gdata-picasaweb-query.h create mode 100644 gdata/services/picasaweb/gdata-picasaweb-service.c create mode 100644 gdata/services/picasaweb/gdata-picasaweb-service.h create mode 100644 gdata/services/picasaweb/gdata-picasaweb-user.c create mode 100644 gdata/services/picasaweb/gdata-picasaweb-user.h create mode 100644 gdata/services/tasks/gdata-tasks-query.c create mode 100644 gdata/services/tasks/gdata-tasks-query.h create mode 100644 gdata/services/tasks/gdata-tasks-service.c create mode 100644 gdata/services/tasks/gdata-tasks-service.h create mode 100644 gdata/services/tasks/gdata-tasks-task.c create mode 100644 gdata/services/tasks/gdata-tasks-task.h create mode 100644 gdata/services/tasks/gdata-tasks-tasklist.c create mode 100644 gdata/services/tasks/gdata-tasks-tasklist.h create mode 100644 gdata/services/youtube/gdata-youtube-category.c create mode 100644 gdata/services/youtube/gdata-youtube-category.h create mode 100644 gdata/services/youtube/gdata-youtube-comment.c create mode 100644 gdata/services/youtube/gdata-youtube-comment.h create mode 100644 gdata/services/youtube/gdata-youtube-content.c create mode 100644 gdata/services/youtube/gdata-youtube-content.h create mode 100644 gdata/services/youtube/gdata-youtube-credit.c create mode 100644 gdata/services/youtube/gdata-youtube-credit.h create mode 100644 gdata/services/youtube/gdata-youtube-enums.c create mode 100644 gdata/services/youtube/gdata-youtube-enums.h create mode 100644 gdata/services/youtube/gdata-youtube-feed.c create mode 100644 gdata/services/youtube/gdata-youtube-feed.h create mode 100644 gdata/services/youtube/gdata-youtube-query.c create mode 100644 gdata/services/youtube/gdata-youtube-query.h create mode 100644 gdata/services/youtube/gdata-youtube-service.c create mode 100644 gdata/services/youtube/gdata-youtube-service.h create mode 100644 gdata/services/youtube/gdata-youtube-state.c create mode 100644 gdata/services/youtube/gdata-youtube-state.h create mode 100644 gdata/services/youtube/gdata-youtube-video.c create mode 100644 gdata/services/youtube/gdata-youtube-video.h create mode 100644 gdata/tests/Makefile.am create mode 100644 gdata/tests/Makefile.in create mode 100644 gdata/tests/authorization.c create mode 100644 gdata/tests/buffer.c create mode 100644 gdata/tests/calendar.c create mode 100644 gdata/tests/cert.pem create mode 100644 gdata/tests/common.c create mode 100644 gdata/tests/common.h create mode 100644 gdata/tests/contacts.c create mode 100644 gdata/tests/gdata-dummy-authorizer.c create mode 100644 gdata/tests/gdata-dummy-authorizer.h create mode 100644 gdata/tests/general.c create mode 100644 gdata/tests/key.pem create mode 100644 gdata/tests/oauth1-authorizer.c create mode 100644 gdata/tests/oauth2-authorizer.c create mode 100644 gdata/tests/perf.c create mode 100644 gdata/tests/photo.jpg create mode 100644 gdata/tests/sample.ogg create mode 100644 gdata/tests/streams.c create mode 100644 gdata/tests/tasks.c create mode 100644 gdata/tests/test.doc create mode 100644 gdata/tests/test.ods create mode 100644 gdata/tests/test.odt create mode 100644 gdata/tests/test.ppt create mode 100644 gdata/tests/test.xls create mode 100644 gdata/tests/test_updated.odt create mode 100644 gdata/tests/test_updated_file.ppt create mode 100644 gdata/tests/traces/calendar/access-rule-delete create mode 100644 gdata/tests/traces/calendar/access-rule-get create mode 100644 gdata/tests/traces/calendar/access-rule-insert create mode 100644 gdata/tests/traces/calendar/access-rule-update create mode 100644 gdata/tests/traces/calendar/authentication create mode 100644 gdata/tests/traces/calendar/authentication-async create mode 100644 gdata/tests/traces/calendar/authentication-async-cancellation create mode 100644 gdata/tests/traces/calendar/event-insert create mode 100644 gdata/tests/traces/calendar/event_insert-async create mode 100644 gdata/tests/traces/calendar/event_insert-async-cancellation create mode 100644 gdata/tests/traces/calendar/global-authentication create mode 100644 gdata/tests/traces/calendar/query-all-calendars create mode 100644 gdata/tests/traces/calendar/query-all-calendars-async-progress-closure create mode 100644 gdata/tests/traces/calendar/query-events create mode 100644 gdata/tests/traces/calendar/query-events-async-progress-closure create mode 100644 gdata/tests/traces/calendar/query-own-calendars create mode 100644 gdata/tests/traces/calendar/query-own-calendars-async-progress-closure create mode 100644 gdata/tests/traces/calendar/query_all_calendars-async create mode 100644 gdata/tests/traces/calendar/query_all_calendars-async-cancellation create mode 100644 gdata/tests/traces/calendar/query_events-async create mode 100644 gdata/tests/traces/calendar/query_events-async-cancellation create mode 100644 gdata/tests/traces/calendar/query_own_calendars-async create mode 100644 gdata/tests/traces/calendar/query_own_calendars-async-cancellation create mode 100644 gdata/tests/traces/calendar/setup-query-calendars create mode 100644 gdata/tests/traces/calendar/setup-query-events create mode 100644 gdata/tests/traces/calendar/setup-temp-calendar create mode 100644 gdata/tests/traces/calendar/setup-temp-calendar-acls create mode 100644 gdata/tests/traces/calendar/teardown-insert-event create mode 100644 gdata/tests/traces/calendar/teardown-query-calendars create mode 100644 gdata/tests/traces/calendar/teardown-query-events create mode 100644 gdata/tests/traces/calendar/teardown-temp-calendar create mode 100644 gdata/tests/traces/calendar/teardown-temp-calendar-acls create mode 100644 gdata/tests/traces/contacts/authentication create mode 100644 gdata/tests/traces/contacts/authentication-async create mode 100644 gdata/tests/traces/contacts/authentication-async-cancellation create mode 100644 gdata/tests/traces/contacts/batch create mode 100644 gdata/tests/traces/contacts/batch-async create mode 100644 gdata/tests/traces/contacts/batch-async-cancellation create mode 100644 gdata/tests/traces/contacts/contact-insert create mode 100644 gdata/tests/traces/contacts/contact-update create mode 100644 gdata/tests/traces/contacts/global-authentication create mode 100644 gdata/tests/traces/contacts/group-insert create mode 100644 gdata/tests/traces/contacts/group_insert-async create mode 100644 gdata/tests/traces/contacts/group_insert-async-cancellation create mode 100644 gdata/tests/traces/contacts/photo-add create mode 100644 gdata/tests/traces/contacts/photo-delete create mode 100644 gdata/tests/traces/contacts/photo-get create mode 100644 gdata/tests/traces/contacts/photo_add-async create mode 100644 gdata/tests/traces/contacts/photo_add-async-cancellation create mode 100644 gdata/tests/traces/contacts/photo_delete-async create mode 100644 gdata/tests/traces/contacts/photo_delete-async-cancellation create mode 100644 gdata/tests/traces/contacts/photo_get-async create mode 100644 gdata/tests/traces/contacts/photo_get-async-cancellation create mode 100644 gdata/tests/traces/contacts/query-all-contacts create mode 100644 gdata/tests/traces/contacts/query-all-contacts-async-progress-closure create mode 100644 gdata/tests/traces/contacts/query-all-groups create mode 100644 gdata/tests/traces/contacts/query-all-groups-async-progress-closure create mode 100644 gdata/tests/traces/contacts/query_all_contacts-async create mode 100644 gdata/tests/traces/contacts/query_all_contacts-async-cancellation create mode 100644 gdata/tests/traces/contacts/query_all_groups-async create mode 100644 gdata/tests/traces/contacts/query_all_groups-async-cancellation create mode 100644 gdata/tests/traces/contacts/setup-batch-async create mode 100644 gdata/tests/traces/contacts/setup-query-all-contacts create mode 100644 gdata/tests/traces/contacts/setup-query-all-groups create mode 100644 gdata/tests/traces/contacts/setup-temp-contact create mode 100644 gdata/tests/traces/contacts/setup-temp-contact-with-photo create mode 100644 gdata/tests/traces/contacts/teardown-batch-async create mode 100644 gdata/tests/traces/contacts/teardown-insert create mode 100644 gdata/tests/traces/contacts/teardown-insert-group create mode 100644 gdata/tests/traces/contacts/teardown-query-all-contacts create mode 100644 gdata/tests/traces/contacts/teardown-query-all-groups create mode 100644 gdata/tests/traces/contacts/teardown-temp-contact create mode 100644 gdata/tests/traces/documents/access-rule-insert create mode 100644 gdata/tests/traces/documents/authentication create mode 100644 gdata/tests/traces/documents/authentication-async create mode 100644 gdata/tests/traces/documents/authentication-async-cancellation create mode 100644 gdata/tests/traces/documents/batch create mode 100644 gdata/tests/traces/documents/batch-async create mode 100644 gdata/tests/traces/documents/batch-async-cancellation create mode 100644 gdata/tests/traces/documents/copy-document create mode 100644 gdata/tests/traces/documents/delete-document create mode 100644 gdata/tests/traces/documents/delete-folder create mode 100644 gdata/tests/traces/documents/download-document create mode 100644 gdata/tests/traces/documents/folders-add-to-folder create mode 100644 gdata/tests/traces/documents/folders-remove-from-folder create mode 100644 gdata/tests/traces/documents/folders_add_to_folder-async create mode 100644 gdata/tests/traces/documents/folders_add_to_folder-async-cancellation create mode 100644 gdata/tests/traces/documents/folders_remove_from_folder-async create mode 100644 gdata/tests/traces/documents/folders_remove_from_folder-async-cancellation create mode 100644 gdata/tests/traces/documents/folders_remove_from_folder-async-epilogue create mode 100644 gdata/tests/traces/documents/global-authentication create mode 100644 gdata/tests/traces/documents/query-all-documents create mode 100644 gdata/tests/traces/documents/query-all-documents-async-progress-closure create mode 100644 gdata/tests/traces/documents/query-all-documents-with-folder create mode 100644 gdata/tests/traces/documents/query_all_documents-async create mode 100644 gdata/tests/traces/documents/query_all_documents-async-cancellation create mode 100644 gdata/tests/traces/documents/setup-batch-async create mode 100644 gdata/tests/traces/documents/setup-folders-add-to-folder create mode 100644 gdata/tests/traces/documents/setup-folders-remove-from-folder create mode 100644 gdata/tests/traces/documents/setup-temp-document-spreadsheet create mode 100644 gdata/tests/traces/documents/setup-temp-documents create mode 100644 gdata/tests/traces/documents/setup-temp-folder create mode 100644 gdata/tests/traces/documents/setup-update-document_content-and-metadata-non-resumable create mode 100644 gdata/tests/traces/documents/setup-update-document_content-and-metadata-resumable create mode 100644 gdata/tests/traces/documents/setup-update-document_content-only-non-resumable create mode 100644 gdata/tests/traces/documents/setup-update-document_content-only-resumable create mode 100644 gdata/tests/traces/documents/setup-update-document_metadata-only-non-resumable create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-and-metadata-in-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-and-metadata-root-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-only-in-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-only-in-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-only-in-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-only-in-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-only-root-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-only-root-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-only-root-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_content-only-root-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_metadata-only-in-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/setup-upload-document_metadata-only-root-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-batch-async create mode 100644 gdata/tests/traces/documents/teardown-copy-document create mode 100644 gdata/tests/traces/documents/teardown-folders-add-to-folder create mode 100644 gdata/tests/traces/documents/teardown-temp-document create mode 100644 gdata/tests/traces/documents/teardown-temp-documents create mode 100644 gdata/tests/traces/documents/teardown-temp-folder create mode 100644 gdata/tests/traces/documents/teardown-update-document_content-and-metadata-non-resumable create mode 100644 gdata/tests/traces/documents/teardown-update-document_content-and-metadata-resumable create mode 100644 gdata/tests/traces/documents/teardown-update-document_content-only-non-resumable create mode 100644 gdata/tests/traces/documents/teardown-update-document_content-only-resumable create mode 100644 gdata/tests/traces/documents/teardown-update-document_metadata-only-non-resumable create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-in-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-root-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-only-in-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-only-in-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-only-in-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-only-in-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-only-root-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-only-root-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-only-root-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_content-only-root-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_metadata-only-in-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/teardown-upload-document_metadata-only-root-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/update_content-and-metadata-non-resumable create mode 100644 gdata/tests/traces/documents/update_content-and-metadata-resumable create mode 100644 gdata/tests/traces/documents/update_content-only-non-resumable create mode 100644 gdata/tests/traces/documents/update_content-only-resumable create mode 100644 gdata/tests/traces/documents/update_metadata-only-non-resumable create mode 100644 gdata/tests/traces/documents/upload_content-and-metadata-in-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/upload_content-and-metadata-in-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/upload_content-and-metadata-in-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/upload_content-and-metadata-in-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/upload_content-and-metadata-root-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/upload_content-and-metadata-root-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/upload_content-and-metadata-root-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/upload_content-and-metadata-root-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/upload_content-only-in-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/upload_content-only-in-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/upload_content-only-in-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/upload_content-only-in-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/upload_content-only-root-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/upload_content-only-root-folder-resumable-bin-no-convert create mode 100644 gdata/tests/traces/documents/upload_content-only-root-folder-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/upload_content-only-root-folder-resumable-odt-no-convert create mode 100644 gdata/tests/traces/documents/upload_metadata-only-in-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/documents/upload_metadata-only-root-folder-non-resumable-odt-convert create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-interactive-data-bad-credentials create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-refresh-authorization create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-async create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-async-cancellation create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-sync create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-sync-cancellation create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async-bad-credentials create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async-cancellation create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync-bad-credentials create mode 100644 gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync-cancellation create mode 100644 gdata/tests/traces/oauth1-authorizer/setup-oauth1-authorizer-data-authenticated create mode 100644 gdata/tests/traces/oauth1-authorizer/setup-oauth1-authorizer-interactive-data create mode 100644 gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-refresh-authorization-authorized create mode 100644 gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-refresh-authorization-unauthorized create mode 100644 gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async create mode 100644 gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async-bad-credentials create mode 100644 gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async-cancellation create mode 100644 gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync create mode 100644 gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync-bad-credentials create mode 100644 gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync-cancellation create mode 100644 gdata/tests/traces/oauth2-authorizer/setup-oauth2-authorizer-data-authenticated create mode 100644 gdata/tests/traces/picasaweb/authentication create mode 100644 gdata/tests/traces/picasaweb/authentication-async create mode 100644 gdata/tests/traces/picasaweb/authentication-async-cancellation create mode 100644 gdata/tests/traces/picasaweb/comment-delete create mode 100644 gdata/tests/traces/picasaweb/comment-insert create mode 100644 gdata/tests/traces/picasaweb/comment-query create mode 100644 gdata/tests/traces/picasaweb/comment-query-async-progress-closure create mode 100644 gdata/tests/traces/picasaweb/comment_delete-async create mode 100644 gdata/tests/traces/picasaweb/comment_delete-async-cancellation create mode 100644 gdata/tests/traces/picasaweb/comment_insert-async create mode 100644 gdata/tests/traces/picasaweb/comment_insert-async-cancellation create mode 100644 gdata/tests/traces/picasaweb/comment_query-async create mode 100644 gdata/tests/traces/picasaweb/comment_query-async-cancellation create mode 100644 gdata/tests/traces/picasaweb/download-photo create mode 100644 gdata/tests/traces/picasaweb/download-thumbnails create mode 100644 gdata/tests/traces/picasaweb/global-authentication create mode 100644 gdata/tests/traces/picasaweb/insert-album create mode 100644 gdata/tests/traces/picasaweb/insert_album-async create mode 100644 gdata/tests/traces/picasaweb/insert_album-async-cancellation create mode 100644 gdata/tests/traces/picasaweb/query-all-albums create mode 100644 gdata/tests/traces/picasaweb/query-all-albums-async-progress-closure create mode 100644 gdata/tests/traces/picasaweb/query-all-albums-with-limits create mode 100644 gdata/tests/traces/picasaweb/query-files create mode 100644 gdata/tests/traces/picasaweb/query-files-async-progress-closure create mode 100644 gdata/tests/traces/picasaweb/query-files-single create mode 100644 gdata/tests/traces/picasaweb/query-user create mode 100644 gdata/tests/traces/picasaweb/query_all_albums-async create mode 100644 gdata/tests/traces/picasaweb/query_all_albums-async-cancellation create mode 100644 gdata/tests/traces/picasaweb/query_files-async create mode 100644 gdata/tests/traces/picasaweb/query_files-async-cancellation create mode 100644 gdata/tests/traces/picasaweb/query_user-async create mode 100644 gdata/tests/traces/picasaweb/query_user-async-cancellation create mode 100644 gdata/tests/traces/picasaweb/query_user_by_username-async create mode 100644 gdata/tests/traces/picasaweb/query_user_by_username-async-cancellation create mode 100644 gdata/tests/traces/picasaweb/setup-query-all-albums create mode 100644 gdata/tests/traces/picasaweb/setup-query-comments create mode 100644 gdata/tests/traces/picasaweb/setup-query-files create mode 100644 gdata/tests/traces/picasaweb/setup-upload create mode 100644 gdata/tests/traces/picasaweb/teardown-insert-album create mode 100644 gdata/tests/traces/picasaweb/teardown-insert-comment create mode 100644 gdata/tests/traces/picasaweb/teardown-query-all-albums create mode 100644 gdata/tests/traces/picasaweb/teardown-query-comments create mode 100644 gdata/tests/traces/picasaweb/teardown-query-files create mode 100644 gdata/tests/traces/picasaweb/teardown-upload create mode 100644 gdata/tests/traces/picasaweb/upload-default-album create mode 100644 gdata/tests/traces/picasaweb/upload_default_album-async create mode 100644 gdata/tests/traces/picasaweb/upload_default_album-async-cancellation create mode 100644 gdata/tests/traces/tasks/authentication create mode 100644 gdata/tests/traces/tasks/global-authentication create mode 100644 gdata/tests/traces/tasks/setup-delete-task create mode 100644 gdata/tests/traces/tasks/setup-delete-tasklist create mode 100644 gdata/tests/traces/tasks/setup-insert-task create mode 100644 gdata/tests/traces/tasks/setup-list-task create mode 100644 gdata/tests/traces/tasks/setup-list-tasklist create mode 100644 gdata/tests/traces/tasks/setup-update-task create mode 100644 gdata/tests/traces/tasks/setup-update-tasklist create mode 100644 gdata/tests/traces/tasks/task-delete create mode 100644 gdata/tests/traces/tasks/task-insert create mode 100644 gdata/tests/traces/tasks/task-list create mode 100644 gdata/tests/traces/tasks/task-update create mode 100644 gdata/tests/traces/tasks/tasklist-delete create mode 100644 gdata/tests/traces/tasks/tasklist-insert create mode 100644 gdata/tests/traces/tasks/tasklist-insert-unauthorised create mode 100644 gdata/tests/traces/tasks/tasklist-list create mode 100644 gdata/tests/traces/tasks/tasklist-update create mode 100644 gdata/tests/traces/tasks/teardown-delete-task create mode 100644 gdata/tests/traces/tasks/teardown-insert-task create mode 100644 gdata/tests/traces/tasks/teardown-insert-tasklist create mode 100644 gdata/tests/traces/tasks/teardown-list-task create mode 100644 gdata/tests/traces/tasks/teardown-list-tasklist create mode 100644 gdata/tests/traces/tasks/teardown-update-task create mode 100644 gdata/tests/traces/tasks/teardown-update-tasklist create mode 100644 gdata/tests/traces/youtube/authentication create mode 100644 gdata/tests/traces/youtube/authentication-async create mode 100644 gdata/tests/traces/youtube/authentication-async-cancellation create mode 100644 gdata/tests/traces/youtube/batch create mode 100644 gdata/tests/traces/youtube/batch-async create mode 100644 gdata/tests/traces/youtube/batch-async-cancellation create mode 100644 gdata/tests/traces/youtube/categories create mode 100644 gdata/tests/traces/youtube/categories-async create mode 100644 gdata/tests/traces/youtube/categories-async-cancellation create mode 100644 gdata/tests/traces/youtube/comment-delete create mode 100644 gdata/tests/traces/youtube/comment-insert create mode 100644 gdata/tests/traces/youtube/comment-query create mode 100644 gdata/tests/traces/youtube/comment-query-async-progress-closure create mode 100644 gdata/tests/traces/youtube/comment_delete-async create mode 100644 gdata/tests/traces/youtube/comment_delete-async-cancellation create mode 100644 gdata/tests/traces/youtube/comment_insert-async create mode 100644 gdata/tests/traces/youtube/comment_insert-async-cancellation create mode 100644 gdata/tests/traces/youtube/comment_query-async create mode 100644 gdata/tests/traces/youtube/comment_query-async-cancellation create mode 100644 gdata/tests/traces/youtube/global-authentication create mode 100644 gdata/tests/traces/youtube/query-related create mode 100644 gdata/tests/traces/youtube/query-related-async-progress-closure create mode 100644 gdata/tests/traces/youtube/query-single create mode 100644 gdata/tests/traces/youtube/query-standard-feed create mode 100644 gdata/tests/traces/youtube/query-standard-feed-async-progress-closure create mode 100644 gdata/tests/traces/youtube/query-standard-feed-with-query create mode 100644 gdata/tests/traces/youtube/query-standard-feeds create mode 100644 gdata/tests/traces/youtube/query_related-async create mode 100644 gdata/tests/traces/youtube/query_related-async-cancellation create mode 100644 gdata/tests/traces/youtube/query_single-async create mode 100644 gdata/tests/traces/youtube/query_single-async-cancellation create mode 100644 gdata/tests/traces/youtube/query_standard_feed-async create mode 100644 gdata/tests/traces/youtube/query_standard_feed-async-cancellation create mode 100644 gdata/tests/traces/youtube/setup-batch create mode 100644 gdata/tests/traces/youtube/setup-comment create mode 100644 gdata/tests/traces/youtube/setup-insert-comment create mode 100644 gdata/tests/traces/youtube/teardown-insert-comment create mode 100644 gdata/tests/traces/youtube/teardown-upload create mode 100644 gdata/tests/traces/youtube/upload-async create mode 100644 gdata/tests/traces/youtube/upload-async-cancellation create mode 100644 gdata/tests/traces/youtube/upload-simple create mode 100644 gdata/tests/youtube.c create mode 100644 glib-tap.mk create mode 100644 gtk-doc.make create mode 100644 libgdata.doap create mode 100644 libgdata.pc.in create mode 100644 m4/ax_append_compile_flags.m4 create mode 100644 m4/ax_append_flag.m4 create mode 100644 m4/ax_append_link_flags.m4 create mode 100644 m4/ax_check_compile_flag.m4 create mode 100644 m4/ax_check_link_flag.m4 create mode 100644 m4/ax_code_coverage.m4 create mode 100644 m4/ax_compiler_flags.m4 create mode 100644 m4/ax_compiler_flags_cflags.m4 create mode 100644 m4/ax_compiler_flags_cxxflags.m4 create mode 100644 m4/ax_compiler_flags_gir.m4 create mode 100644 m4/ax_compiler_flags_ldflags.m4 create mode 100644 m4/ax_generate_changelog.m4 create mode 100644 m4/ax_is_release.m4 create mode 100644 m4/ax_require_defined.m4 create mode 100644 m4/gtk-doc.m4 create mode 100644 m4/intltool.m4 create mode 100644 m4/introspection.m4 create mode 100644 m4/libtool.m4 create mode 100644 m4/ltoptions.m4 create mode 100644 m4/ltsugar.m4 create mode 100644 m4/ltversion.m4 create mode 100644 m4/lt~obsolete.m4 create mode 100644 m4/nls.m4 create mode 100644 m4/pkg.m4 create mode 100644 m4/vapigen.m4 create mode 100644 po/LINGUAS create mode 100644 po/Makefile.in.in create mode 100644 po/POTFILES.in create mode 100644 po/ar.po create mode 100644 po/as.po create mode 100644 po/be.po create mode 100644 po/bg.po create mode 100644 po/bn_IN.po create mode 100644 po/bs.po create mode 100644 po/ca.po create mode 100644 po/ca@valencia.po create mode 100644 po/cs.po create mode 100644 po/da.po create mode 100644 po/de.po create mode 100644 po/el.po create mode 100644 po/en_GB.po create mode 100644 po/eo.po create mode 100644 po/es.po create mode 100644 po/et.po create mode 100644 po/eu.po create mode 100644 po/fi.po create mode 100644 po/fr.po create mode 100644 po/fur.po create mode 100644 po/gl.po create mode 100644 po/gu.po create mode 100644 po/he.po create mode 100644 po/hi.po create mode 100644 po/hu.po create mode 100644 po/id.po create mode 100644 po/it.po create mode 100644 po/ja.po create mode 100644 po/kn.po create mode 100644 po/ko.po create mode 100644 po/lt.po create mode 100644 po/lv.po create mode 100644 po/ml.po create mode 100644 po/mr.po create mode 100644 po/nb.po create mode 100644 po/nl.po create mode 100644 po/oc.po create mode 100644 po/or.po create mode 100644 po/pa.po create mode 100644 po/pl.po create mode 100644 po/pt.po create mode 100644 po/pt_BR.po create mode 100644 po/ro.po create mode 100644 po/ru.po create mode 100644 po/sk.po create mode 100644 po/sl.po create mode 100644 po/sr.po create mode 100644 po/sr@latin.po create mode 100644 po/sv.po create mode 100644 po/ta.po create mode 100644 po/te.po create mode 100644 po/tg.po create mode 100644 po/th.po create mode 100644 po/tr.po create mode 100644 po/ug.po create mode 100644 po/uk.po create mode 100644 po/vi.po create mode 100644 po/zh_CN.po create mode 100644 po/zh_HK.po create mode 100644 po/zh_TW.po create mode 100755 tap-driver.sh create mode 100755 tap-test diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..426a183 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Philip Withnall diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..5ab7695 --- /dev/null +++ b/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..973d047 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,26798 @@ +commit f153e3c77e7699769fb8c1bde1a7bf01586261ae +Author: Philip Withnall +Date: Wed Aug 23 00:22:31 2017 +0100 + + docs: Fix gtk-doc parsing of a function in GDataCalendarService + + I don’t think it likes the mixture of attributes after the argument + list. Changing the line wrapping seems to fix it. + + Signed-off-by: Philip Withnall + +M gdata/services/calendar/gdata-calendar-service.h + +commit 620daaeb2cbf34ae4fd0470422668cf28eab3e88 +Author: Philip Withnall +Date: Wed Aug 23 00:09:26 2017 +0100 + + docs: Add GDataDocumentsMetadata to the documentation index + + Also relabel the ‘Documents API’ to ‘Documents/Drive API’ + to make it a + bit clearer that it now covers Google Drive. + + Signed-off-by: Philip Withnall + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt + +commit d83e899da86565ce397c96f4b3e54e6b2f714ccf +Author: Philip Withnall +Date: Tue Aug 22 22:51:25 2017 +0100 + + core: Drop an unused variable + + Signed-off-by: Philip Withnall + +M gdata/gdata-oauth1-authorizer.c + +commit a36efd9357bb8d6f44749ae47f190e4f5ff8b7a5 +Author: Debarshi Ray +Date: Wed Aug 9 18:27:25 2017 +0200 + + documents: Silence a CRITICAL when querying a feed of entries + + Querying a feed of Drive entries using Drive v2 leads to: + CRITICAL **: _gdata_query_set_next_uri: assertion + 'self->priv->pagination_type == GDATA_QUERY_PAGINATION_URIS' + failed + + When the support for pagination using page tokens was landed in + commit 38b934a9ef9dab89, the code in GDataDocumentsService::parse_feed + that added the next and previous URIs from the feed to the GDataQuery + was generalized and moved to GDataService::parse_feed, and + GDataDocumentsQuery was set to use pagination tokens. + + The intention was to use pagination tokens for GDataDocuments* using + only the generic parsing code in the base classes. + + However, the code in GDataDocumentsFeed::parse_json that added the + GDataLinks for the next URI to the feed wasn't removed. This tricks + GDataService::parse_feed into using pagination URIs with the + corresponding query. + + This reverts commit fa3e219eff1d4617463a86deb14cb3b1f5fb9a19. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-feed.c + +commit a627e0e4c586696ead2556eaea36797de2cc25b6 +Author: Debarshi Ray +Date: Tue Sep 27 20:23:13 2016 +0200 + + tests: Fix the set up for /documents/folders/remove_from_folder + + In Drive v2, we can only remove an entry from a folder if it had + multiple parents to start with. If there was only a single parent, + then + the request is just ignored. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit e793a0e4ab04dc930d25b4704a2dc03249743fc8 +Author: Philip Withnall +Date: Wed Aug 9 15:41:05 2017 +0100 + + picasaweb: Port from GSimpleAsyncResult to GTask + + These are the last instances of GSimpleAsyncResult. Die! + + Signed-off-by: Philip Withnall + +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit fa9ad32bb72e9586d36ba5fec5a94a35a5df7e2c +Author: Philip Withnall +Date: Wed Aug 9 15:40:47 2017 +0100 + + picasaweb: Add g_autoptr() support for all PicasaWeb classes + + Signed-off-by: Philip Withnall + +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-comment.h +M gdata/services/picasaweb/gdata-picasaweb-feed.h +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/picasaweb/gdata-picasaweb-query.h +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/services/picasaweb/gdata-picasaweb-user.h + +commit 65ca44ccdfcc19011131fa98ed820a69f57b3286 +Author: Philip Withnall +Date: Wed Aug 9 15:17:37 2017 +0100 + + youtube: Port from GSimpleAsyncResult to GTask + + Signed-off-by: Philip Withnall + +M gdata/services/youtube/gdata-youtube-service.c + +commit 453ae0319471312a2d17cb9be1c197971c20dc44 +Author: Philip Withnall +Date: Wed Aug 9 15:17:18 2017 +0100 + + app: Add g_autoptr() support to all the gdata/app classes + + Signed-off-by: Philip Withnall + +M gdata/app/gdata-app-categories.h + +commit e264589f13695d55955dbe8ddb8a2743bde034d8 +Author: Philip Withnall +Date: Wed Aug 9 14:56:59 2017 +0100 + + documents: Port from GSimpleAsyncResult to GTask + + Port GDataDocumentsService. + + Signed-off-by: Philip Withnall + +M gdata/services/documents/gdata-documents-service.c + +commit 3ce9cebcbdb52faf5faaaafcb40340ff9dee1585 +Author: Philip Withnall +Date: Wed Aug 9 14:56:29 2017 +0100 + + documents: Add g_autoptr() support for all Drive classes + + Signed-off-by: Philip Withnall + +M gdata/services/documents/gdata-documents-access-rule.h +M gdata/services/documents/gdata-documents-document.h +M gdata/services/documents/gdata-documents-drawing.h +M gdata/services/documents/gdata-documents-entry.h +M gdata/services/documents/gdata-documents-feed.h +M gdata/services/documents/gdata-documents-folder.h +M gdata/services/documents/gdata-documents-metadata.h +M gdata/services/documents/gdata-documents-pdf.h +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-query.h +M gdata/services/documents/gdata-documents-service.h +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.h +M gdata/services/documents/gdata-documents-upload-query.h + +commit f027dbc3204c4f6b2683f88f9ba88a996c698eb3 +Author: Philip Withnall +Date: Wed Aug 9 14:15:23 2017 +0100 + + general: Port from GSimpleAsyncResult to GTask + + Port various service classes. + + Signed-off-by: Philip Withnall + +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/tasks/gdata-tasks-service.c + +commit 2ea00a131ba6e5c67fc8c615906957f6a93773bd +Author: Debarshi Ray +Date: Tue Sep 27 20:20:15 2016 +0200 + + Port gdata_documents_service_remove_entry_from_folder to Drive v2 + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-service.c + +commit d71082cd83f4d2754279f6feb9f16955c495db5c +Author: Debarshi Ray +Date: Fri Sep 30 11:33:08 2016 +0200 + + documents: Split out the code to get an ID from a GDataLink + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-utils.c +M gdata/services/documents/gdata-documents-utils.h + +commit 990055474e32efb4d5be71781c8feec67191e0a4 +Author: Philip Withnall +Date: Wed Aug 9 10:21:10 2017 +0100 + + gdata: Port from GSimpleAsyncResult to GTask + + Finish porting the OAuth 1 code, port the OAuth 2 code and also + GDataCommentable. + + Signed-off-by: Philip Withnall + +M gdata/gdata-commentable.c +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-oauth2-authorizer.c + +commit b53d927d3e7a6a8072d9642c9a6173140f2857a1 +Author: Philip Withnall +Date: Tue Aug 8 21:31:19 2017 +0100 + + gdata: Port from GSimpleAsyncResult to GTask + + Some of the OAuth 1 code. + + Signed-off-by: Philip Withnall + +M gdata/gdata-oauth1-authorizer.c + +commit b4518b3514425fb78b673e09d0dcb934f1e82b3b +Author: Philip Withnall +Date: Tue Aug 8 21:31:04 2017 +0100 + + tests: Port from GSimpleAsyncResult to GTask + + Signed-off-by: Philip Withnall + +M gdata/tests/authorization.c + +commit cbf5a496e29e6aae93d368fa0cdd63426cced614 +Author: Philip Withnall +Date: Tue Aug 8 21:10:01 2017 +0100 + + gdata: Port various core APIs to GTask from GSimpleAsyncResult + + GSimpleAsyncResult has been deprecated for quite a long time, + and we’re + way overdue on porting to GTask. Start doing that for some of the core + classes. Still a number of instances of it left, though. + + Signed-off-by: Philip Withnall + +M gdata/gdata-access-handler.c +M gdata/gdata-authorizer.c +M gdata/gdata-batch-operation.c +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-service.c + +commit eb78a668687e74958331c39e6c1eba62d11d0f22 +Author: Philip Withnall +Date: Tue Aug 8 21:09:03 2017 +0100 + + gdata: Add some g_autoptr() declarations for core classes + + Coverage is by no means complete, but this adds the necessary + public API + to start using GDataService, GDataFeed and GDataEntry with + g_autoptr(). + + Signed-off-by: Philip Withnall + +M gdata/gdata-entry.h +M gdata/gdata-feed.h +M gdata/gdata-service.h + +commit f048a49995879cd60d740b18e1e93145870fb06e +Author: Philip Withnall +Date: Tue Aug 8 21:08:36 2017 +0100 + + build: Bump GLib dependency to 2.44 + + This is needed for upcoming changes which use g_autoptr() and GTask. + + Signed-off-by: Philip Withnall + +M README +M configure.ac + +commit ece8e887560ef794dba594cefb4c097cd057142c +Author: Philip Withnall +Date: Tue Aug 8 21:06:50 2017 +0100 + + tests: Fix incorrect string terminator comparison + + Spotted by gcc. + + Signed-off-by: Philip Withnall + +M gdata/tests/common.c + +commit 3128c70d3e055a08796f869e9cdb1fabbf135852 +Author: Michael Terry +Date: Mon Aug 7 22:27:13 2017 -0400 + + Add GDataDocumentsMetadata for quota information + + https://bugzilla.gnome.org/show_bug.cgi?id=785885 + +M Makefile.am +M docs/reference/gdata-sections.txt +M gdata/gdata-core.symbols +M gdata/gdata.h +A gdata/services/documents/gdata-documents-metadata.c +A gdata/services/documents/gdata-documents-metadata.h +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h + +commit 47512d19d2b6c637ae19e2d7529908616ddf64f6 +Author: Philip Withnall +Date: Tue Aug 8 09:23:17 2017 +0100 + + docs: Fix some outdated documentation links in the Drive API docs + + It’s all still a complete mess though. + + Signed-off-by: Philip Withnall + +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-drawing.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-pdf.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c + +commit 109d5df8e5a7033e082bfb2aec8763c20788139e +Author: Emmanuele Bassi +Date: Mon Jul 17 17:13:37 2017 +0100 + + build: Add enumeration files to BUILT_SOURCES + + These files are generated, but since dependencies are a by-product of + compilation, Automake won't be able to generate the dependencies + before + the files that include the headers are built. + + For more information: + + https://www.gnu.org/software/automake/manual/html_node/Sources.html + +M Makefile.am + +commit a2bd6b66f2f36ed71bfeea5489c31d021ddf5a3b +Author: Jeremy Bicha +Date: Fri Jul 7 18:58:58 2017 -0400 + + Fix header in Spanish translation + +M po/es.po + +commit 9925d4bba8e58d3cfa85ad6216484eaa2cc72de5 +Author: Karl-Philipp Richter +Date: Fri Jun 30 20:35:19 2017 +0200 + + build: Add initial .travis.yml + + Reviewed-by: Philip Withnall + + https://github.com/GNOME/libgdata/pull/1 + +A .travis.yml + +commit 868359d3803e87dea2a0ce0531ca25a42af3f9b9 +Author: Ondrej Holy +Date: Wed May 24 15:37:50 2017 +0200 + + Fix invalid URIs when q and q_internal properties are set + + get_query_uri produces invalid URIs for cases when q and q_internal + properties are set, because any separator isn't added between them. + Consequently, the queries end up with errors. Let's add " and + " between + them to fix this issue. + + https://bugzilla.gnome.org/show_bug.cgi?id=783046 + +M gdata/gdata-query.c + +commit 82e6760060a240ed0b001f43f66923e53040c9dd +Author: Philip Withnall +Date: Thu Apr 20 12:37:08 2017 +0100 + + build: Increment version to 0.17.9 + + Signed-off-by: Philip Withnall + +M configure.ac + +commit 19f9f9420146bc51c7dc6dba2102c7d94bae149a +Author: Philip Withnall +Date: Thu Apr 20 12:34:34 2017 +0100 + + Release version 0.17.8 + + Signed-off-by: Philip Withnall + +M NEWS +M configure.ac + +commit d10155034b0fa2e43e2889e55157798ce073f807 +Author: Philip Withnall +Date: Thu Apr 20 11:50:09 2017 +0100 + + tasks: Re-add ISO 8601 formatting workaround for Tasks service + + This partially reverts commit 684f95e8845be4f9efc434ea6456bee99b2303ac + for the Tasks service only, since it is the only service which + currently + requires a formatting workaround for ISO 8601 date timezones. + + https://bugzilla.gnome.org/show_bug.cgi?id=780067 + + Signed-off-by: Philip Withnall + +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/services/tasks/gdata-tasks-query.c +M gdata/services/tasks/gdata-tasks-task.c +M gdata/services/tasks/gdata-tasks-tasklist.c +M gdata/tests/tasks.c + +commit 61659ca68638dbccf3f1dbba8927f053b301de40 +Author: Yuras Shumovich +Date: Tue Apr 18 09:34:32 2017 +0000 + + Update Belarusian translation + +M po/be.po + +commit 3ae207e406fa98ac2f65eb83d43bf1e1e4e54477 +Author: Cédric Valmary +Date: Wed Apr 12 07:58:23 2017 +0000 + + Update Occitan translation + +M po/oc.po + +commit d93f654cce34aff9eff257eabe28636b608018c0 +Author: Tom Tryfonidis +Date: Fri Apr 7 10:37:34 2017 +0000 + + Update Greek translation + +M po/el.po + +commit b87141e748b108cd9e56a70635a6ade097d54ab5 +Author: Emmanuele Bassi +Date: Sat Mar 25 15:27:33 2017 +0000 + + Use the correct type for gtk_show_uri_for_window() + +M demos/scrapbook/scrapbook.c + +commit b1115818eb0aa8d8f171df06c7a2e9a6fbac073c +Author: Emmanuele Bassi +Date: Sat Mar 25 15:16:48 2017 +0000 + + demos: Use non-deprecated API + + Otherwise the build will fail with the default -Werror settings. + +M demos/scrapbook/scrapbook.c + +commit d6abf285fd387f6bb74fe2f281c539323aa7fe76 +Author: Yuri Myasoedov +Date: Sat Mar 18 10:50:17 2017 +0400 + + Updated Russian translation + +M po/ru.po + +commit 25225e375ec64a0e4b822c4db8bace07deea78d4 +Author: Philip Withnall +Date: Wed Mar 15 12:14:53 2017 +0000 + + build: Bump libsoup dependency for streams test to 2.55.90 + + Previously the streams test depended on new API added in libsoup + 2.47.3. + It still depends on that API, but it’s become apparent that there + was a + bug in libsoup which rendered soup_server_set_ssl_cert_file() useless + until libsoup 2.55.90. + + Bump the dependency (for the test code only) to 2.55.90. + + Thanks to Mart Raudsepp for their help in debugging. + + Signed-off-by: Philip Withnall + + https://bugzilla.gnome.org/show_bug.cgi?id=780081 + +M configure.ac +M gdata/tests/streams.c + +commit 192bcf3ec7752aaf03f19a1f801a9d66cf306a69 +Author: Philip Withnall +Date: Wed Mar 15 11:14:06 2017 +0000 + + build: Bump minimum GLib dependency to 2.38.0 + + Since the 0.17.7 release, we’ve actually depended on API from GLib + 2.38.0 (G_TEST_DIST), so this will just cause earlier build failure + than + before. + + This means we can drop some backwards compatibility code for + older GLib + releases. + + Spotted by Mart Raudsepp in + https://bugzilla.gnome.org/show_bug.cgi?id=780081#c1. + + Signed-off-by: Philip Withnall + +M README +M configure.ac +M demos/scrapbook/scrapbook.c +M gdata/tests/common.c + +commit 684f95e8845be4f9efc434ea6456bee99b2303ac +Author: Philip Withnall +Date: Tue Mar 14 23:34:55 2017 +0000 + + Revert "core: Re-add ISO 8601 formatting workaround for dates" + + This reverts commit bfbd4f5ca493f17fe2300e54092a4ec27f65ea08. + + Google have fixed their servers and now reject the workaround + timestamp + format. + + Unfortunately, because nothing is ever easy, this breaks Google Tasks. + Obviously something else is wrong there. + + https://bugzilla.gnome.org/show_bug.cgi?id=780067 + +M gdata/gdata-parser.c +M gdata/tests/calendar.c +M gdata/tests/general.c +M gdata/tests/tasks.c + +commit a4626e29b91101d6b8b984ec2bea5370f04be2fb +Author: Jiri Grönroos +Date: Sat Mar 11 16:46:16 2017 +0000 + + Update Finnish translation + +M po/fi.po + +commit 0ad0d713eb5812b9529791ff01d69859d06da2ab +Author: Fran Dieguez +Date: Sat Mar 11 03:08:38 2017 +0000 + + Update Galician translation + +M po/gl.po + +commit 68ba2c0b7b5c6325365f7f809448974c108e8e16 +Author: Alan Mortensen +Date: Mon Mar 6 12:47:35 2017 +0100 + + Updated Danish translation + +M po/da.po + +commit 2e1bd073426b42a7e207314f1cef1402509ce12a +Author: Jan Alexander Steffens (heftig) +Date: Mon Mar 6 06:28:32 2017 +0100 + + tests: Fix setting properties on i686 + + Without the cast, an integer literal will have to wrong size for a + 64-bit integer parameter. + + https://bugzilla.gnome.org/show_bug.cgi?id=779641 + +M gdata/tests/general.c + +commit 23b228110a122b2f0e8752ac2291b995d80347a5 +Author: Philip Withnall +Date: Sun Mar 5 21:14:03 2017 +0000 + + build: Increment version to 0.17.8 + +M configure.ac + +commit 209aa98488bbc08e54b41faad8b65426ac62ae32 +Author: Philip Withnall +Date: Sun Mar 5 21:12:29 2017 +0000 + + Release version 0.17.7 + +M NEWS +M configure.ac +M docs/reference/gdata-docs.xml +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-utils.c + +commit 0d8ed048c0ed7d3546232526cc60b8daaded4a00 +Author: Philip Withnall +Date: Sun Mar 5 20:19:25 2017 +0000 + + build: Distclean default.profraw files + + They’re generated by Clang in the build directory when building + with code + coverage enabled. After a distclean they are no longer relevant + (and are + breaking distcheck). + +M Makefile.am +M gdata/tests/Makefile.am + +commit 0d5e38fad7cbb138aa0d08367a6ea9f004c9a960 +Author: Philip Withnall +Date: Sun Mar 5 19:37:45 2017 +0000 + + core: Drop Freebase support from GDataGoaAuthorizer + + It’s unclear whether the authorisation domain will be accepted in + future, and there’s no point in authorising for it anyway, since the + service has been shut down. + +M gdata/gdata-goa-authorizer.c + +commit 5d094237e387c2062c264d36121e18ba263da113 +Author: Philip Withnall +Date: Sun Mar 5 18:41:08 2017 +0000 + + freebase: Deprecate everything as service was shut down + + Google shut down the Freebase service in August 2016, permanently; all + the APIs now return errors from the server side. + + Deprecate all of our Freebase API, drop the freebase-cli demo, + and drop + the unit tests. + + See: https://developers.google.com/freebase/. + +M Makefile.am +D demos/freebase/freebase-cli.c +M gdata/services/freebase/gdata-freebase-query.c +M gdata/services/freebase/gdata-freebase-query.h +M gdata/services/freebase/gdata-freebase-result.c +M gdata/services/freebase/gdata-freebase-result.h +M gdata/services/freebase/gdata-freebase-search-query.c +M gdata/services/freebase/gdata-freebase-search-query.h +M gdata/services/freebase/gdata-freebase-search-result.c +M gdata/services/freebase/gdata-freebase-search-result.h +M gdata/services/freebase/gdata-freebase-service.c +M gdata/services/freebase/gdata-freebase-service.h +M gdata/services/freebase/gdata-freebase-topic-query.c +M gdata/services/freebase/gdata-freebase-topic-query.h +M gdata/services/freebase/gdata-freebase-topic-result.c +M gdata/services/freebase/gdata-freebase-topic-result.h +M gdata/tests/Makefile.am +D gdata/tests/freebase.c +D gdata/tests/traces/freebase/search +D gdata/tests/traces/freebase/search-complex +D gdata/tests/traces/freebase/topic + +commit 6b37a4c94033d8ead6bce4f60566cf8fe20af591 +Author: Philip Withnall +Date: Sun Mar 5 18:05:09 2017 +0000 + + tests: Disable PicasaWeb tests since API is now read-only + + The tests rely on being able to create new test albums to put content + in. They would need to be rewritten completely to work with the new + read-only API. I cannot be bothered. + + https://developers.google.com/picasa-web/docs/3.0/releasenotes#picasa-is-retiring-february-12-2016 + +M gdata/tests/Makefile.am + +commit 3b2e08d68dcab8ea401f4d42bde86a50b50fbe62 +Author: Philip Withnall +Date: Sun Mar 5 18:02:34 2017 +0000 + + tests: Port the PicasaWeb tests to OAuth 2 authentication + + ClientLogin is no longer supported. + +M gdata/tests/picasaweb.c +M gdata/tests/traces/picasaweb/authentication +M gdata/tests/traces/picasaweb/global-authentication + +commit 27fe14b5217aebf49e8e559adb6ab2ec147bb5d2 +Author: Philip Withnall +Date: Sun Mar 5 16:30:13 2017 +0000 + + tests: Update Google Tasks logs from running the tests online + + No significant changes. + +M gdata/tests/traces/tasks/authentication +M gdata/tests/traces/tasks/global-authentication +M gdata/tests/traces/tasks/setup-delete-task +M gdata/tests/traces/tasks/setup-delete-tasklist +M gdata/tests/traces/tasks/setup-insert-task +M gdata/tests/traces/tasks/setup-list-task +M gdata/tests/traces/tasks/setup-list-tasklist +M gdata/tests/traces/tasks/setup-update-task +M gdata/tests/traces/tasks/setup-update-tasklist +M gdata/tests/traces/tasks/task-delete +M gdata/tests/traces/tasks/task-insert +M gdata/tests/traces/tasks/task-list +M gdata/tests/traces/tasks/task-update +M gdata/tests/traces/tasks/tasklist-delete +M gdata/tests/traces/tasks/tasklist-insert +M gdata/tests/traces/tasks/tasklist-insert-unauthorised +M gdata/tests/traces/tasks/tasklist-list +M gdata/tests/traces/tasks/tasklist-update +M gdata/tests/traces/tasks/teardown-delete-task +M gdata/tests/traces/tasks/teardown-insert-task +M gdata/tests/traces/tasks/teardown-insert-tasklist +M gdata/tests/traces/tasks/teardown-list-task +M gdata/tests/traces/tasks/teardown-list-tasklist +M gdata/tests/traces/tasks/teardown-update-task +M gdata/tests/traces/tasks/teardown-update-tasklist + +commit bfbd4f5ca493f17fe2300e54092a4ec27f65ea08 +Author: Philip Withnall +Date: Sun Mar 5 16:12:08 2017 +0000 + + core: Re-add ISO 8601 formatting workaround for dates + + This reverts commit 732017e4e5235e28c578cc3367fa0c4548b65495. + + The problem has re-appeared with the Google Tasks API: timestamps once + more have to be defined with microseconds included. + + See https://bugzilla.gnome.org/show_bug.cgi?id=737799. + +M gdata/gdata-parser.c +M gdata/tests/calendar.c +M gdata/tests/general.c +M gdata/tests/tasks.c + +commit bd82f79dc283a3fd99157d2904828d8e92d09c5f +Author: Philip Withnall +Date: Fri Feb 3 16:43:22 2017 +0000 + + calendar: Update query parameters to v3 of the API + + Somehow the URI parameters in GDataCalendarQuery did not get updated + with the rest of the code to use the v3 API, meaning that all + non-default query options have been broken since May 2015. + + Update them to the v3 parameters, which maintains almost the same + functionality as before. The following properties are no longer + supported in any form on the server, and have been deprecated: + + • GDataCalendarQuery:recurrence-expansion-start + • GDataCalendarQuery:recurrence-expansion-end + • GDataCalendarQuery:sort-order + +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/tests/calendar.c + +commit e013e1342544998b4528f938007d20e40d264b7d +Author: Philip Withnall +Date: Sat Mar 4 01:15:51 2017 +0000 + + tests: Add a test for calendar event attendees + +M gdata/tests/calendar.c + +commit 225aae7e1292580ca761d3b401f0e2aa155c7c70 +Author: Kukuh Syafaat +Date: Sun Mar 5 10:31:14 2017 +0000 + + Update Indonesian translation + +M po/id.po + +commit a8d11cae4db5acda35557ec430e123017cbb0ba4 +Author: Changwoo Ryu +Date: Sat Mar 4 03:46:25 2017 +0000 + + Update Korean translation + +M po/ko.po + +commit 5b9b435e5b4d6c9f1cb1bf3aaab5f8442410842c +Author: Chao-Hsiung Liao +Date: Tue Feb 28 06:41:13 2017 +0000 + + Update Chinese (Taiwan) translation + +M po/zh_TW.po + +commit fd1451a33f32bfc208e799e0f81139b790e315d3 +Author: Philip Withnall +Date: Mon Feb 6 10:02:46 2017 +0100 + + demos: Add a demo of Google Tasks + + This is a simple read-only demo of the Tasks service, similar to the + Calendar demo. + + https://bugzilla.gnome.org/show_bug.cgi?id=775813 + +M Makefile.am +A demos/tasks/tasks-cli.c + +commit a6b98081e45670d1b39e80afe9b1aa34fc536b2a +Author: Philip Withnall +Date: Mon Feb 6 10:04:17 2017 +0100 + + tasks: Fix pagination in Google Tasks API + + The pageToken URI parameter was never being appended to queries, + so they + could never retrieve more than the first page of results. + + https://bugzilla.gnome.org/show_bug.cgi?id=775813 + +M gdata/services/tasks/gdata-tasks-query.c +M gdata/tests/tasks.c + +commit 38b934a9ef9dab89692d7253dcb332f4ce46f8f0 +Author: Philip Withnall +Date: Thu Dec 8 14:51:00 2016 +0000 + + core: Support pagination using page tokens from JSON + + Based on a patch by Milan Crha . + + This reworks how pagination is implemented so that multiple pagination + mechanisms are supported explicitly, making the code a lot clearer. A + lot of the new services use pageToken parameters, which we did not + previously support — so this fixes support for pagination in + the Google + Tasks service, for example. + + This also means that we can drop the hacky pagination support from + GDataDocumentsService. + + https://bugzilla.gnome.org/show_bug.cgi?id=775813 + +M docs/reference/gdata-sections.txt +M gdata/gdata-core.symbols +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-private.h +M gdata/gdata-query.c +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/freebase/gdata-freebase-query.c +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/tasks/gdata-tasks-query.c +M gdata/services/youtube/gdata-youtube-query.c + +commit d9c1e590ac368354c0bf5225d22d3006bf1789da +Author: Claude Paroz +Date: Sun Feb 19 22:46:15 2017 +0100 + + Updated French translation + +M po/fr.po + +commit 6b57477d15341a146bd10b109fad8db30094d7c9 +Author: Inaki Larranaga Murgoitio +Date: Sat Feb 18 20:42:56 2017 +0100 + + Update Basque language + +M po/eu.po + +commit 11e7b3ac7fa4788aab6ce594a3dd2b125841298a +Author: Ask Hjorth Larsen +Date: Thu Feb 16 14:31:14 2017 +0100 + + Updated Danish translation + +M po/da.po + +commit c0ce3fb33569f4af08a3bfd32a825893f3f05818 +Author: Philip Withnall +Date: Fri Feb 3 16:36:04 2017 +0000 + + demos: Return a useful exit code from the docs-list demo + +M demos/docs-list/docs-list.c + +commit 399d8d40af5546f0eff6416d3573934a251ce233 +Author: Philip Withnall +Date: Fri Feb 3 16:33:55 2017 +0000 + + demos: Add event pagination support to calendar-cli demo + + Otherwise it will only show the first few entries from a calendar. + +M demos/calendar/calendar-cli.c + +commit e1f91be003d2e3a297181b86ae098d492907e2a5 +Author: Philip Withnall +Date: Fri Feb 3 16:46:43 2017 +0000 + + calendar: Remove an unused variable + +M gdata/services/calendar/gdata-calendar-event.c + +commit 5203ce837930ce3618d74c7b4e8e8fc449ff8fec +Author: Debarshi Ray +Date: Tue Jan 31 17:25:06 2017 +0100 + + tests: Assert the content-type of various GDataParsable types + + This is a good way to exercise the newly added + gdata_parsable_get_content_type API. + + https://bugzilla.gnome.org/show_bug.cgi?id=777980 + +M gdata/tests/general.c + +commit cdb623cac98509ce22d916ae9974fa6c3b21b7e6 +Author: Debarshi Ray +Date: Mon Feb 6 15:42:49 2017 +0100 + + app: Specify the correct content type + + GDataAPPCategories supports only JSON ever since the YouTube API was + ported to v3. + + https://bugzilla.gnome.org/show_bug.cgi?id=777980 + +M gdata/app/gdata-app-categories.c + +commit 79df1550f06454268751eb8e8de940208029d507 +Author: Qizhi Zhou +Date: Mon Feb 6 14:58:46 2017 +0800 + + Update zh_CN translation + +M po/zh_CN.po + +commit c658bb404b435fb054a86dbd5a060184d5fd6ba5 +Author: Philip Withnall +Date: Sat Jan 28 01:00:01 2017 +0000 + + calendar: Fix parsing of organizers without e-mail addresses + + It turns out the e-mail address for an organizer is optional. + + https://developers.google.com/google-apps/calendar/v3/reference/events#organizer.email + + Add a test. + +M gdata/services/calendar/gdata-calendar-event.c +M gdata/tests/calendar.c + +commit b44646093db8f41de952c9b740529cb849c73122 +Author: Debarshi Ray +Date: Tue Jan 31 13:33:41 2017 +0100 + + core: Add a public wrapper for GDataParsable:get_content_type + + https://bugzilla.gnome.org/show_bug.cgi?id=777980 + +M docs/reference/gdata-sections.txt +M gdata/gdata-core.symbols +M gdata/gdata-parsable.c +M gdata/gdata-parsable.h + +commit b262909695437f02ecda557b701bec3a397aa70b +Author: Piotr Drąg +Date: Sat Jan 28 01:32:37 2017 +0100 + + Fix translator comments + + They need to be exactly one line above a string to show up in + .po files. + +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-commentable.c + +commit 2c4b9f8a7d767474e02bf65d38fa422bb5c83669 +Author: Philip Withnall +Date: Thu Jan 26 00:42:29 2017 +0000 + + demos: Call setlocale() in docs-list demo + + Ensure that our output is encoded correctly for the console, so + that the + UTF-8 characters appear correctly. + +M demos/docs-list/docs-list.c + +commit 2ad79db3a3e9c315152b3470a6cb2fba644d7ac8 +Author: Philip Withnall +Date: Wed Jan 25 00:34:13 2017 +0000 + + tests: Fix use of an unsigned variable as signed + + This code was supposed to be using a signed variable for the + comparison, + but accidentally ended up using a signed one (and the wrong abs() + function). Fix that. + + Spotted by Clang. + +M gdata/tests/picasaweb.c + +commit a28e91c0687b12fa05f16847106493143ad53125 +Author: Philip Withnall +Date: Wed Jan 25 00:33:19 2017 +0000 + + demos: Fix a shadowed variable + + `timezone` is already declared by the system’s time.h. Rename our + variable to `time_zone` to avoid shadowing it. + + Spotted by Clang. + +M demos/calendar/calendar-cli.c + +commit bf0da775d998d06fac1fd108250e6f7c55dd7c4e +Author: Philip Withnall +Date: Tue Jan 24 23:14:28 2017 +0000 + + docs: Replace ‘**/’ gtk-doc comment endings with ‘*/’ + + ‘*/’ is more standard, so this is basically a housekeeping + improvement + in coding style. + +M gdata/app/gdata-app-categories.c +M gdata/app/gdata-app-categories.h +M gdata/atom/gdata-author.c +M gdata/atom/gdata-author.h +M gdata/atom/gdata-category.c +M gdata/atom/gdata-category.h +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-generator.h +M gdata/atom/gdata-link.c +M gdata/atom/gdata-link.h +M gdata/exif/gdata-exif-tags.c +M gdata/exif/gdata-exif-tags.h +M gdata/gcontact/gdata-gcontact-calendar.c +M gdata/gcontact/gdata-gcontact-calendar.h +M gdata/gcontact/gdata-gcontact-event.c +M gdata/gcontact/gdata-gcontact-event.h +M gdata/gcontact/gdata-gcontact-external-id.c +M gdata/gcontact/gdata-gcontact-external-id.h +M gdata/gcontact/gdata-gcontact-jot.c +M gdata/gcontact/gdata-gcontact-jot.h +M gdata/gcontact/gdata-gcontact-language.c +M gdata/gcontact/gdata-gcontact-language.h +M gdata/gcontact/gdata-gcontact-relation.c +M gdata/gcontact/gdata-gcontact-relation.h +M gdata/gcontact/gdata-gcontact-website.c +M gdata/gcontact/gdata-gcontact-website.h +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-im-address.h +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-name.h +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-phone-number.h +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-postal-address.h +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-when.h +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-where.h +M gdata/gd/gdata-gd-who.c +M gdata/gd/gdata-gd-who.h +M gdata/gdata-access-handler.c +M gdata/gdata-access-handler.h +M gdata/gdata-access-rule.c +M gdata/gdata-access-rule.h +M gdata/gdata-batch-feed.h +M gdata/gdata-batch-operation.c +M gdata/gdata-batch-operation.h +M gdata/gdata-batchable.c +M gdata/gdata-batchable.h +M gdata/gdata-buffer.c +M gdata/gdata-buffer.h +M gdata/gdata-comparable.c +M gdata/gdata-comparable.h +M gdata/gdata-download-stream.c +M gdata/gdata-download-stream.h +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-parsable.c +M gdata/gdata-parsable.h +M gdata/gdata-private.h +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata-types.c +M gdata/gdata-types.h +M gdata/gdata-upload-stream.c +M gdata/gdata-upload-stream.h +M gdata/georss/gdata-georss-where.c +M gdata/georss/gdata-georss-where.h +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-category.h +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-content.h +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-credit.h +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-group.h +M gdata/media/gdata-media-thumbnail.c +M gdata/media/gdata-media-thumbnail.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/calendar/gdata-calendar-feed.h +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-group.c +M gdata/services/contacts/gdata-contacts-group.h +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-document.h +M gdata/services/documents/gdata-documents-drawing.c +M gdata/services/documents/gdata-documents-drawing.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-entry.h +M gdata/services/documents/gdata-documents-feed.c +M gdata/services/documents/gdata-documents-feed.h +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-folder.h +M gdata/services/documents/gdata-documents-pdf.c +M gdata/services/documents/gdata-documents-pdf.h +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-query.h +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.c +M gdata/services/documents/gdata-documents-text.h +M gdata/services/freebase/gdata-freebase-query.c +M gdata/services/freebase/gdata-freebase-result.c +M gdata/services/freebase/gdata-freebase-search-query.c +M gdata/services/freebase/gdata-freebase-search-result.c +M gdata/services/freebase/gdata-freebase-service.c +M gdata/services/freebase/gdata-freebase-service.h +M gdata/services/freebase/gdata-freebase-topic-query.c +M gdata/services/freebase/gdata-freebase-topic-result.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-feed.c +M gdata/services/picasaweb/gdata-picasaweb-feed.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-query.h +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/picasaweb/gdata-picasaweb-user.h +M gdata/services/youtube/gdata-youtube-category.c +M gdata/services/youtube/gdata-youtube-category.h +M gdata/services/youtube/gdata-youtube-content.c +M gdata/services/youtube/gdata-youtube-content.h +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-credit.h +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-query.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-state.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit 42a0b64716ac12da97f2de8582c4ee88c8fad1a9 +Author: Philip Withnall +Date: Fri Dec 19 17:18:52 2014 +0000 + + docs: Use gtk-doc entity functionality to drop version.xml + + gtk-doc can now generate an entities file to do this for us. + + This bumps our gtk-doc dependency to 1.25, which was released in March + 2016. + +M configure.ac +M docs/reference/Makefile.am +M docs/reference/gdata-docs.xml +D docs/reference/version.xml.in + +commit 74c429d0da0f8b218cf578d46df791532aa1e1c6 +Author: Philip Withnall +Date: Sun Jan 8 23:04:40 2017 +0000 + + core: Improve GDataAccessRule validation + +M gdata/gdata-access-rule.c + +commit c2610d1c15cbccd72529e25482045e7545e3b576 +Author: Philip Withnall +Date: Sun Jan 8 22:59:23 2017 +0000 + + core: Clarify handling of empty strings in some core APIs + +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c + +commit bdcf8763a9c7d2983d29413a67417d82038c82db +Author: Марко М. Костић +Date: Fri Nov 18 08:28:02 2016 +0100 + + Updated Serbian translation + +M po/sr.po +M po/sr@latin.po + +commit b383c5f2065e84f2806b3d53702a7af189404866 +Author: Matej Urbančič +Date: Wed Nov 16 17:48:41 2016 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit 16fc166d3b1f048231fa4c504d4d0fb1725ddfa0 +Author: Philip Chimento +Date: Wed Nov 9 22:36:52 2016 -0800 + + build: Pass goa-1.0 dependency to VAPI build rule + + This would otherwise fail due to not being able to find the symbols + for + Goa. + + https://bugzilla.gnome.org/show_bug.cgi?id=774179 + +M Makefile.am + +commit 3f05da0d0a2a8e57f07d39c4c6002091fa2bf118 +Author: Rūdolfs Mazurs +Date: Wed Nov 9 19:28:16 2016 +0200 + + Update Latvian translation + +M po/lv.po + +commit 4206ca0ed34b6bf87e4f2b4764b83dbcfe502be2 +Author: Daniel Mustieles +Date: Mon Nov 7 15:57:41 2016 +0000 + + Update Spanish translation + +M po/es.po + +commit 1b1b06343611c4665b0369b9bf1a64e8fc1e289c +Author: David Newgas +Date: Sun Oct 16 15:38:52 2016 -0700 + + documents: add file-size property + + This property applies to all non-doc/sheet/slide/form documents. It is + similar but distinct from the quota-used property, which is not set if + the file's size isn't counting against the current user's quota. + + https://bugzilla.gnome.org/show_bug.cgi?id=773057 + +M docs/reference/gdata-sections.txt +M gdata/gdata-core.symbols +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-entry.h + +commit 9a8ddfc6910eb8ac754eb4006531d78b89ae44b8 +Author: Gábor Kelemen +Date: Wed Oct 19 03:19:00 2016 +0000 + + Update Hungarian translation + +M po/hu.po + +commit 2db4f59e5288c1b65e88ba3efa1fe8b80b8d9a6b +Author: Fabio Tomat +Date: Mon Oct 17 13:44:23 2016 +0000 + + Update Friulian translation + +M po/fur.po + +commit 77c2a281bdbe035cbf42a9d53697da710dc34c58 +Author: Kjartan Maraas +Date: Sun Oct 16 17:59:04 2016 +0200 + + Updated Norwegian bokmål translation from Kjartan Maraas. + +M po/nb.po + +commit fe31b2d0ef467b2f31aa3b0d791a95b76f926f63 +Author: Marek Černocký +Date: Sun Oct 16 13:40:11 2016 +0200 + + Updated Czech translation + +M po/cs.po + +commit 495f6b9e86cacf09f3a6d1ed4902ec94bbaa3319 +Author: Aurimas Černius +Date: Sat Oct 15 21:51:43 2016 +0300 + + Updated Lithuanian translation + +M po/lt.po + +commit 854dbe74d6d1e4389e3de8e88e6f5d5a328fe5bf +Author: Gianvito Cavasoli +Date: Fri Oct 14 12:01:24 2016 +0000 + + Update Italian translation + +M po/it.po + +commit 63418c3fc72d4b791461c828560561d705fcb5a2 +Author: Tiago Santos +Date: Thu Oct 13 15:50:31 2016 +0000 + + Update Portuguese translation + +M po/pt.po + +commit b6ecdb9a8bb81f80ebdeda922cdd2bbb67cf1d46 +Author: Jiri Grönroos +Date: Thu Oct 13 13:58:07 2016 +0000 + + Update Finnish translation + +M po/fi.po + +commit d923d2cca1ccf5553a0c360e6ea9ce735569adbf +Author: Mario Blättermann +Date: Thu Oct 13 09:19:33 2016 +0000 + + Update German translation + +M po/de.po + +commit d634151a1d54c335083c329aa89196655b54dc3f +Author: Dušan Kazik +Date: Wed Oct 12 17:59:58 2016 +0000 + + Update Slovak translation + +M po/sk.po + +commit ca383f73b4ec08f343f447e5b7668e003420b6c5 +Author: Fabio Tomat +Date: Wed Oct 12 13:45:33 2016 +0000 + + Update Friulian translation + +M po/fur.po + +commit 3cd3cb60bdf2112d2ca7b709e1f1b67872ede304 +Author: Rafael Fontenelle +Date: Wed Oct 12 08:43:17 2016 +0000 + + Update Brazilian Portuguese translation + +M po/pt_BR.po + +commit c3665ed28bb36ff731b4fc6b29e2f9d35f2470ce +Author: Anders Jonsson +Date: Tue Oct 11 16:49:23 2016 +0000 + + Update Swedish translation + +M po/sv.po + +commit 787b94c8b25e5a0b430d9f04c70b70c9fa6d8116 +Author: Piotr Drąg +Date: Tue Oct 11 17:52:50 2016 +0200 + + Update Polish translation + +M po/pl.po + +commit 51d108683cdfa8fe5bb232228cfe6e7c335de160 +Author: Piotr Drąg +Date: Tue Oct 11 15:31:53 2016 +0200 + + Use Unicode in translatable strings + + See https://developer.gnome.org/hig/stable/typography.html + + https://bugzilla.gnome.org/show_bug.cgi?id=772756 + +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-parser.c +M gdata/gdata-service.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/freebase/gdata-freebase-service.c + +commit 82f1c4e60bf462f89a33b1efe3d3e74ba024e85a +Author: Debarshi Ray +Date: Fri Sep 23 17:15:49 2016 +0200 + + tests: GDATA_LINK_PARENT links don't have a title in Drive v2 + + ... so there is nothing to compare with. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit d0cd48510141dd8195348720996d6bdc82bd1f12 +Author: Debarshi Ray +Date: Fri Sep 23 16:08:01 2016 +0200 + + tests: Make folder creation work with Drive v2 + + See a9c8516b4380a213cd92d83a11f9793414588319 for the rationale. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit 85c99df27bda67f27eb4c177f27825670c534924 +Author: Debarshi Ray +Date: Wed Sep 21 19:19:20 2016 +0200 + + documents: Set the content type for GDataDocumentsDocument sub-classes + + In Drive v2, every GDataDocumentsDocument sub-class is tied to a + specific content type. Except PDFs, these are the Drive-specific + application/vnd.google-apps.* types. This is unlike the older + Documents v3 API, where you could create a GDataDocumentsDocument to + represent a random ODF on the hard disk, and the server would + interpret + it as a GDataDocumentsText instance. + + Therefore, we should ensure that instances of these sub-classes have + the corresponding content type attached to them. Otherwise, they will + be identified as application/octet-stream and exportLinks will be + missing. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-drawing.c +M gdata/services/documents/gdata-documents-pdf.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c + +commit 16e601b7c832cbc1e945a7bd9fda61ee2e80299d +Author: Debarshi Ray +Date: Wed Sep 21 17:33:42 2016 +0200 + + documents: Retain the content type when adding an entry to a folder + + Otherwise, it will be identified as application/octet-stream and + exportLinks will be missing. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-service.c + +commit a9a2c4be51ecb4c665a349401097ff88636557bc +Author: Debarshi Ray +Date: Wed Sep 21 17:27:18 2016 +0200 + + documents: Split out the code to add a content type to an entry + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-utils.c +M gdata/services/documents/gdata-documents-utils.h + +commit 6a4e30e686e43d4f3ceaf58d15f551701e4baee0 +Author: Debarshi Ray +Date: Fri Jan 15 18:55:52 2016 +0100 + + documents: Drop unnecessary instance variable + + ... because a local method-level variable is enough. + + Fall out from d93279623e34c7b275ae3f989b54c6f3a30d5658 + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c + +commit 8240a4ddc9e8187987ae62361d854261b898037f +Author: Philip Withnall +Date: Tue Sep 20 17:05:28 2016 -0700 + + docs: Expand privacy discussion in the libgdata documentation + + Mention HTTP versus HTTPS, and the need to encrypt files on disk + if you + are handling the user’s data (which you are with Google Drive). + +M docs/reference/gdata-overview.xml + +commit 106937d394fe3b8edbfb506273ae429d7ded2c2c +Author: Philip Withnall +Date: Tue Sep 20 17:04:33 2016 -0700 + + core: Assert that all downloads, uploads and queries are HTTPS + + All callers should be using HTTPS already — for peace of mind, + let’s + assert that’s the case. + +M gdata/gdata-download-stream.c +M gdata/gdata-service.c +M gdata/gdata-upload-stream.c +M gdata/tests/general.c +M gdata/tests/streams.c + +commit ebcd878b3f333b48c701765aae2ca7ec6cbf7d5e +Author: Philip Withnall +Date: Tue Sep 20 16:02:18 2016 -0700 + + gdata: Fix license header for OAuth2 authorizer files + + They were mistakenly using a GPLv3+ header, whereas libgdata is + licensed + as LGPLv2.1+. The intention was not to provide the OAuth2 authorizer + under a different license; the header was incorrect. + + As I am the only author of those files, this change should be + uncontroversial. + +M gdata/gdata-oauth2-authorizer.c +M gdata/gdata-oauth2-authorizer.h + +commit 4d887f68c62287839b1a8e85eff231cecbb5a7fb +Author: Philip Withnall +Date: Tue Sep 20 09:57:17 2016 -0700 + + build: Switch to xz tarballs + +M configure.ac + +commit cb20cb2742588ed9aa4284b44b1b980256263393 +Author: Philip Withnall +Date: Tue Sep 20 09:57:01 2016 -0700 + + build: Increment version to 0.17.7 + +M configure.ac + +commit 17aeee7598a896603d7037066c7ac90b1ef87cd9 +Author: Philip Withnall +Date: Tue Sep 20 09:53:30 2016 -0700 + + Release version 0.17.6 + +M NEWS +M configure.ac + +commit 53b5d511261bc505040c5e0a232dec45c10d0075 +Author: David King +Date: Sun Sep 18 10:53:25 2016 +0200 + + Update British English translation + +M po/en_GB.po + +commit f44532b70b4bd05a9d3f676eb612fe97e2d5ba5b +Author: Piotr Drąg +Date: Fri Sep 9 04:21:28 2016 +0200 + + Updated Polish translation + +M po/pl.po + +commit 2590c92fe25dd76f5a949de860327331291f60c3 +Author: Akom Chotiphantawanon +Date: Fri Aug 26 11:35:08 2016 +0700 + + Updated Thai translation + +M po/th.po + +commit 4b29a94a71317ffa9df282fef7f7be126687343a +Author: Ondrej Holy +Date: Mon Aug 22 12:02:44 2016 +0200 + + tests: Add one more test for GDataBuffer + + This test reproduces bug 769727. + + https://bugzilla.gnome.org/show_bug.cgi?id=769727 + +M gdata/tests/buffer.c + +commit 76e12748bd0e519caeeefd6e1ac7ce8086e63059 +Author: Ondrej Holy +Date: Thu Aug 11 08:58:00 2016 +0200 + + core: Fix crashes on zero-length files + + reached_eof is set too early and thus it may not be propagated + properly + in some cases, which may cause abortion when reading zero-length + files. + + https://bugzilla.gnome.org/show_bug.cgi?id=769727 + +M gdata/gdata-buffer.c + +commit 309b74cc2ca741888e3352888844a2d8cfdf08b8 +Author: Piotr Drąg +Date: Mon Aug 22 21:38:19 2016 +0200 + + Updated Polish translation + +M po/pl.po + +commit f63af42f8ce177dd62ac5c49f6e0219005faaf72 +Author: Philip Withnall +Date: Sun Aug 14 14:43:33 2016 +0200 + + tests: Add some basic tests for GDataBuffer + +M gdata/tests/Makefile.am +A gdata/tests/buffer.c + +commit 5b0e3b0a4567a483813d397dab6779bf4577d92f +Author: Yosef Or Boczko +Date: Tue Aug 9 21:17:59 2016 +0300 + + Updated Hebrew translation + +M po/he.po + +commit 7d9cec6bab94a7de67fcaf72987df4349296191a +Author: Philip Withnall +Date: Wed Aug 3 00:56:10 2016 +0100 + + tests: Use correct invalid TLD rather than localhost + + RFC 6761 specifies an entire top-level domain which is guaranteed to + never resolve with a DNS query: invalid. Use that instead of + localhost, + to eliminate the chance that the domain name we thought should never + resolve, actually resolves. + + https://tools.ietf.org/html/rfc6761#section-6.4 + + This might fix bug #768282. + + https://bugzilla.gnome.org/show_bug.cgi?id=768282 + +M gdata/tests/general.c + +commit efb3f3fd3b5a7656b5d878943d1c3304262a6340 +Author: Piotr Drąg +Date: Sun Jul 24 03:08:52 2016 +0200 + + Add Language headers to po files + + Future versions of gettext will fail if this header is missing. + +M po/as.po +M po/bn_IN.po +M po/ca@valencia.po +M po/es.po +M po/fi.po +M po/gu.po +M po/id.po +M po/sr@latin.po +M po/ug.po +M po/zh_HK.po + +commit 7dbcef59f841a91cd1f5fd74b7a4d1d66d6ddc53 +Author: Philip Withnall +Date: Tue Jul 12 13:41:09 2016 +0100 + + tests: Drop performance target from 1ms to 2ms per parse operation + + The Alpha architecture only manages just above 1ms per parse + operation. + 2ms isn’t such a bad figure, so let’s use that rather than + doing any + optimisation, which would be too much like hard work. + + https://bugzilla.gnome.org/show_bug.cgi?id=768363 + +M gdata/tests/perf.c + +commit 11b72839bf4b54140b14a563fd84dc6ae392d146 +Author: Philip Withnall +Date: Tue Jul 12 13:37:45 2016 +0100 + + build: Use AX_GENERATE_CHANGELOG to generate the changelog + + This should fix building the ChangeLog when srcdir ≠ builddir. + + https://bugzilla.gnome.org/show_bug.cgi?id=768278 + +A ChangeLog +M Makefile.am +M configure.ac + +commit 82ada9ae16df0a848eac741b2240df970e31c90e +Author: Philip Withnall +Date: Wed Jun 29 23:58:31 2016 +0100 + + build: Increment version to 0.17.6 + +M configure.ac + +commit f3b4e05523e8894a7a00c03fed7b7fdb6ceefcad +Author: Philip Withnall +Date: Wed Jun 29 23:12:07 2016 +0100 + + Release version 0.17.5 + +M NEWS +M configure.ac + +commit b66c7933a9774260c63dd9a5cef87997eebc4e09 +Author: Debarshi Ray +Date: Fri Jun 17 13:02:50 2016 +0200 + + goa-authorizer: Mention support for OAuth 2.0 + + https://bugzilla.gnome.org/show_bug.cgi?id=767785 + +M gdata/gdata-goa-authorizer.c + +commit f352682abd5897029f36435d1563ebc8fa7c1f43 +Author: Debarshi Ray +Date: Fri Jun 17 12:53:24 2016 +0200 + + picasaweb: Clarify how to handle authentication failures during upload + + https://bugzilla.gnome.org/show_bug.cgi?id=767784 + +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit a9183885cc58a19f5858bfe57c48aea0f5975ecc +Author: Andika Triwidada +Date: Wed Jun 8 03:26:04 2016 +0000 + + Updated Indonesian translation + +M po/id.po + +commit d1eedf53251dc5bebd2cf1145dba24f626437135 +Author: Cédric Valmary +Date: Mon May 30 19:39:50 2016 +0000 + + Updated Occitan translation + +M po/oc.po + +commit 354af3e5850823119085ad57543f5674857f6cc2 +Author: Cédric Valmary +Date: Mon May 9 20:55:25 2016 +0000 + + Updated Occitan translation + +M po/oc.po + +commit d4e99b98eb409d0ce8b33bf9ad0becc991c7aee1 +Author: GNOME Translation Robot +Date: Wed Apr 27 19:32:56 2016 +0000 + + Updated Portuguese translation + +M po/pt.po + +commit 835f0b2fdff2c2ca3e5e20da007bb147bd94f904 +Author: Jeff Bai +Date: Tue Apr 26 17:39:01 2016 +0800 + + Update zh_CN translation + +M po/zh_CN.po + +commit 30258a944725ce073b760fe47ef7c140629d528e +Author: Fabio Tomat +Date: Wed Mar 23 16:30:34 2016 +0000 + + Updated Friulian translation + +M po/fur.po + +commit e49b4c5fb166445a0ff123c061ff2d10f532f3e8 +Author: Fabio Tomat +Date: Wed Mar 23 16:00:16 2016 +0000 + + Added Friulian translation + +M po/LINGUAS +A po/fur.po + +commit 9caf89c9c3cf1c0cb2f3e9fbe8e06a9ff4d1ea7b +Author: Ask Hjorth Larsen +Date: Sun Mar 20 23:16:30 2016 +0100 + + Updated Danish translation + +M po/da.po + +commit 8d59f8a1fd422e6a9a7086fcb869c0fb4539fd71 +Author: Inaki Larranaga Murgoitio +Date: Sun Mar 20 20:20:53 2016 +0100 + + Updated Basque language + +M po/eu.po + +commit 9e981d4fec9e295e832b8e5eab9b2a5ac60109bd +Author: Milo Casagrande +Date: Thu Mar 17 20:36:06 2016 +0000 + + Updated Italian translation + +M po/it.po + +commit faa7d335a81feab6059382135776b31844713a7f +Author: Ask Hjorth Larsen +Date: Tue Mar 15 21:21:13 2016 +0000 + + Updated Danish translation + +M po/da.po + +commit 3db4d0a65655f0aa59860022c7c7a36efed8df18 +Author: Changwoo Ryu +Date: Sat Mar 12 20:16:13 2016 +0000 + + Updated Korean translation + +M po/ko.po + +commit 83cbb258425dfb07156d32a4a5d30302c67b1986 +Author: Tom Tryfonidis +Date: Fri Mar 11 19:52:43 2016 +0000 + + Updated Greek translation + +M po/el.po + +commit 62e8f8bec461fb14de5f11e55f31a08f7e696f96 +Author: Stas Solovey +Date: Tue Mar 8 18:09:33 2016 +0000 + + Updated Russian translation + +M po/ru.po + +commit 736a38c027ac76bc49339bac60b8b22f855849ef +Author: Philip Withnall +Date: Fri Mar 4 01:37:17 2016 +0000 + + build: Update autogen.sh from GNOME recommendation + + https://wiki.gnome.org/Projects/GnomeCommon/Migration#autogen.sh + + This fixes a srcdir ≠ builddir issue. + +M autogen.sh + +commit 78c91df64913585d38a1f2701fb0c33a918e8e2d +Author: Aurimas Černius +Date: Wed Mar 2 20:26:19 2016 +0200 + + Updated Lithuanian translation + +M po/lt.po + +commit 079e05d92ead9f175d7c073af6ae8e1df34011cb +Author: Dušan Kazik +Date: Tue Mar 1 19:38:37 2016 +0000 + + Updated Slovak translation + +M po/sk.po + +commit 7532f7a07b26cde37cd40b711646eb061a5fa363 +Author: Cédric Valmary +Date: Mon Feb 29 19:38:54 2016 +0000 + + Updated Occitan translation + +M po/oc.po + +commit 92dc273d8e04e8935e753ec89603b5a7859bbbb7 +Author: Philip Withnall +Date: Thu Feb 25 00:45:26 2016 +0000 + + youtube: Fix a minor memory leak + + Spotted using LSan. + +M gdata/services/youtube/gdata-youtube-category.c + +commit 96b0aad27da224445fbe0413106d1a83f25b74d2 +Author: Philip Withnall +Date: Thu Feb 25 00:19:42 2016 +0000 + + core: Fix some minor memory leaks + + Spotted with ASan using: + CFLAGS=-fsanitize=address jhbuild make -ac + jhbuild shell + cd gdata/tests && make check + +M gdata/gcontact/gdata-gcontact-website.c +M gdata/services/calendar/gdata-calendar-event.c + +commit 8e5314403555361ef68e2aa92a5132fd0eb6c320 +Author: Fran Dieguez +Date: Tue Feb 23 20:03:43 2016 +0100 + + Updated Galician translations + +M po/gl.po + +commit 2482e06f251c10b4261ee97003b1dd832c63323d +Author: Мирослав Николић +Date: Fri Feb 19 21:39:54 2016 +0100 + + Updated Serbian translation + +M po/sr.po +M po/sr@latin.po + +commit f4415af9374de8777121ee3f517d6c6aa43f7b45 +Author: Anders Jonsson +Date: Fri Feb 19 19:43:18 2016 +0000 + + Updated Swedish translation + +M po/sv.po + +commit 7bf538eba294522758b07953423894a9fc4010f7 +Author: Chao-Hsiung Liao +Date: Sat Feb 13 07:01:10 2016 +0000 + + Updated Chinese (Taiwan) translation + +M po/zh_TW.po + +commit d054d046a8184de1cf8bf3cae95c6567dc3c6109 +Author: Rafael Fontenelle +Date: Wed Feb 10 17:28:35 2016 +0000 + + Updated Brazilian Portuguese translation + +M po/pt_BR.po + +commit 79f557a1bd252d27760d71cc36c4be159a69f514 +Author: Rūdolfs Mazurs +Date: Sat Feb 6 20:39:05 2016 +0200 + + Update Latvian translation + +M po/lv.po + +commit c8688bea4137ad4687e83c80e040afcbfb84e823 +Author: Matej Urbančič +Date: Tue Feb 2 17:54:45 2016 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit 3b2e0815fb2334e31ebb933c793e0943864edc9e +Author: Matej Urbančič +Date: Tue Feb 2 17:54:36 2016 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit 9683a49e115b56b7a07e7dd787cdd5d3e6934c57 +Author: Alexandre Franke +Date: Tue Feb 2 16:30:44 2016 +0000 + + Updated French translation + +M po/fr.po + +commit 1a0dc610be2f7bd8ad9da08f3213ebe6c8a91091 +Author: Marek Černocký +Date: Sun Jan 31 22:45:13 2016 +0100 + + Udated Czech translation + +M po/cs.po + +commit 3077483f154193068b668578cb3ea2c8ccc4e082 +Author: Daniel Mustieles +Date: Sun Jan 31 22:31:08 2016 +0100 + + Updated Spanish translation + +M po/es.po + +commit 44c4957a64148ff424080dd53aa545fe8b641d34 +Author: Balázs Meskó +Date: Mon Jan 25 00:34:02 2016 +0000 + + Updated Hungarian translation + +M po/hu.po + +commit 9ff682d7f8f442c261800dc06b86e99cffe466d9 +Author: Trần Ngọc Quân +Date: Tue Jan 19 08:25:26 2016 +0700 + + Updated Vietnamese translation + + Signed-off-by: Trần Ngọc Quân + +M po/vi.po + +commit a75c674850cd81d7df83e796b2cf863d7fd59585 +Author: Mario Blättermann +Date: Mon Jan 18 20:49:30 2016 +0100 + + Updated German translation + +M po/de.po + +commit a25d7feff47ec8a86ef9657890295b5a4ddb8f6b +Author: Piotr Drąg +Date: Mon Jan 18 16:36:57 2016 +0100 + + Updated Polish translation + +M po/pl.po + +commit dc9d85d323a740216e4525d82f1f43239a310f04 +Author: Philip Withnall +Date: Sun Dec 20 19:19:02 2015 +0000 + + documents: Fix error handling for unknown formats for document + downloads + + https://bugzilla.gnome.org/show_bug.cgi?id=759180 + +M gdata/services/documents/gdata-documents-document.c + +commit 6386c6188f2a934c00ea645e098aaf89e3987a78 +Author: Debarshi Ray +Date: Fri Jan 15 18:48:33 2016 +0100 + + documents: Handle cases where export format is same as the original + + ... by falling back to gdata_entry_get_content_uri. + + https://bugzilla.gnome.org/show_bug.cgi?id=759180 + +M gdata/services/documents/gdata-documents-document.c + +commit e1036b08a1fecc9cafadb8d788c837cc2bd1f865 +Author: Debarshi Ray +Date: Fri Jan 15 18:44:21 2016 +0100 + + documents: Split out the code to get the content type of an entry + + We will need this in gdata_documents_document_get_download_uri. + + https://bugzilla.gnome.org/show_bug.cgi?id=759180 + +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-utils.c +M gdata/services/documents/gdata-documents-utils.h + +commit 840b7d78ceac8d96a764c2741582204718bfba2f +Author: Debarshi Ray +Date: Fri Jan 15 19:03:10 2016 +0100 + + tests: Ensure that the test data for downloads is created with + Drive v2 + + Same issue as folder creation. See + a9c8516b4380a213cd92d83a11f9793414588319 for the rationale. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit 9adc3c2009499fb16f495dfc9445ed1bdce65d7c +Author: Debarshi Ray +Date: Fri Jan 15 17:46:11 2016 +0100 + + documents: Update URL to Drive v2 API documentation + + The previous URL was getting redirected to a web page documenting SDKs + for various platforms instead of the JSON protocol that we need. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c + +commit 33e9dff6d676d51413ae940f69f67c5fd22c8502 +Author: Kjartan Maraas +Date: Sun Jan 10 19:45:12 2016 +0100 + + Updated Norwegian bokmål translation. + +M po/nb.po + +commit aae900db1f2ae6497684e6d556f2dbab1a83bd21 +Author: Akom Chotiphantawanon +Date: Mon Jan 4 12:09:37 2016 +0700 + + Updated Thai translation. + +M po/th.po + +commit c58105f2275df397529ae5bb5d28132a3331559f +Author: Andika Triwidada +Date: Sat Jan 2 13:50:36 2016 +0000 + + Updated Indonesian translation + +M po/id.po + +commit db6979c3ffcc638f2f005c3b0e8f91ce1c7f1bbd +Author: Enrico Nicoletto +Date: Thu Dec 31 17:46:26 2015 +0000 + + Updated Brazilian Portuguese translation + +M po/pt_BR.po + +commit 806c015dd124dfc61ddbcad10f815b3c2ddcb577 +Author: Matej Urbančič +Date: Sun Dec 13 20:13:18 2015 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit 4ec8e11722fe47964d4fe212a5f0bb6124e8291f +Author: Matej Urbančič +Date: Sun Dec 13 18:38:06 2015 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit 5e6d6efc75594e768f68dc83745a94ddafb28028 +Author: Philip Withnall +Date: Sun Dec 13 15:26:06 2015 +0000 + + build: Increment version to 0.17.5 + +M configure.ac + +commit 62e90862b1d341d8683551dc2d1cc53c78681bf0 +Author: Philip Withnall +Date: Sun Dec 13 15:24:20 2015 +0000 + + Release version 0.17.4 + +M NEWS +M configure.ac + +commit c5223bffa57915f4c9f86580804dcfc7ebe31e2d +Author: Debarshi Ray +Date: Fri Nov 20 17:40:18 2015 +0100 + + tests: Make metadata-only uploads work with Drive v2 + + Same issue as folder creation. See + a9c8516b4380a213cd92d83a11f9793414588319 for the rationale. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit 51a5fbadee4e86fe6e0a30164bee76a71595cbbd +Author: Debarshi Ray +Date: Fri Nov 20 16:14:01 2015 +0100 + + tests: Align + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit 0a92ea82c69d95bef5c3f6664883e551ffb6e792 +Author: Alberto Mardegan +Date: Mon Nov 23 17:16:13 2015 +0200 + + documents: update title search to Drive v2 + + The title must be passed as part of the "q" parameter. + + https://bugzilla.gnome.org/show_bug.cgi?id=758524 + +M gdata/services/documents/gdata-documents-query.c + +commit 3e98fb3a62278dbe4c7905f6e7398b51b7cb4624 +Author: Balázs Meskó +Date: Sun Nov 29 14:03:57 2015 +0000 + + Updated Hungarian translation + +M po/hu.po + +commit c930f9c4a78c60ae44dc77928f1fa3ff815fa723 +Author: Wolfgang Stöggl +Date: Sat Nov 28 06:12:23 2015 +0000 + + Updated German translation + +M po/de.po + +commit a984f1137a77d7bfb5d39c7a4038597780e6490e +Author: Dušan Kazik +Date: Wed Nov 25 09:37:35 2015 +0000 + + Updated Slovak translation + +M po/sk.po + +commit 30a716bb8471282373c9eaad5d3e4d4b164c9724 +Author: Marek Černocký +Date: Tue Nov 24 16:15:17 2015 +0100 + + Updated Czech translation + +M po/cs.po + +commit 0c17acf334fff5b8a93748e6a09a8c43b2cc900c +Author: Debarshi Ray +Date: Fri Nov 20 16:57:26 2015 +0100 + + tests: Make folder creation work with Drive v2 + + See a9c8516b4380a213cd92d83a11f9793414588319 for the rationale. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit cd2c2fcbae24c2442bdf9f62eea9599043d31765 +Author: Debarshi Ray +Date: Fri Nov 20 17:41:34 2015 +0100 + + documents: Fix a typo in the documentation comment + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-service.c + +commit 8dfca1eb25d80c14d970d4448f4cef89f64839ef +Author: Debarshi Ray +Date: Fri Nov 20 16:00:33 2015 +0100 + + tests: Set the right expectations when deleting using Drive v2 + + Once an entry is deleted, it is gone for good and + gdata_service_query_single_entry won't be able find it + anymore. Instead + it will return NULL and throw GDATA_SERVICE_ERROR_NOT_FOUND. + + We might have to revisit it when we add support for trashing. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit 95f36ea5b0d4a0899aead28d48a45d8cb8fe749d +Author: Daniel Mustieles +Date: Mon Nov 23 19:04:41 2015 +0100 + + Updated Spanish translation + +M po/es.po + +commit b87f4099bffa492fb23c8f11698e1ec1252636fc +Author: Pedro Albuquerque +Date: Sat Nov 21 09:09:32 2015 +0000 + + Updated Portuguese translation + +M po/pt.po + +commit b1f7ecb2f3ec520e2fd991c87d072f3b69cd615f +Author: Aurimas Černius +Date: Fri Nov 20 20:47:39 2015 +0200 + + Updated Lithuanian translation + +M po/lt.po + +commit b38fd2189ccb044b782cc7f210e9901c63c202a3 +Author: Piotr Drąg +Date: Fri Nov 20 18:04:42 2015 +0100 + + Updated Polish translation + +M po/pl.po + +commit 7b1a804f324e154554a586cc477dbdc5ddb3a76a +Author: Debarshi Ray +Date: Fri Nov 20 12:37:17 2015 +0100 + + tests: Remove outdated async authentication tests from Documents + + These were using the unsupported ClientLogin API. The OAuth2 + authoriser + has its own async authorisation tests, so porting the existing + Documents tests would gain us nothing. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit e1b9c254300d07723b55bd830ab595aff714706a +Author: Debarshi Ray +Date: Fri Sep 4 15:12:04 2015 +0200 + + documents: Port gdata_documents_service_copy_document to Drive v2 + + Now it is a wrapper around + gdata_documents_service_add_entry_to_folder, + so the document can even be an arbitrary file. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-service.c + +commit 63637ad4cb68a3883c2689a510e590ec7a48640e +Author: Philip Withnall +Date: Wed Nov 18 00:15:13 2015 +0000 + + tests: Fix duplicate test path in oauth1-authorizer tests + + https://bugzilla.gnome.org/show_bug.cgi?id=758119 + +M gdata/tests/oauth1-authorizer.c + +commit ed52192fcd3cde2c0d7f0ab0d9e300fcdbc373a8 +Author: Inaki Larranaga Murgoitio +Date: Wed Oct 14 13:44:59 2015 +0200 + + Updated Basque language + +M po/eu.po + +commit 49f5998cf5234483552ffb0af8deb9c952ba8103 +Author: Philip Withnall +Date: Wed Oct 7 13:36:53 2015 +0100 + + calendar: Remove incorrect (allow-none) annotations + + gint64s can’t be allow-none. Spotted by Zeeshan Ali. This fixes + building + against the latest versions of gobject-introspection, which are + stricter + about warning about this kind of thing. + +M gdata/services/calendar/gdata-calendar-query.c + +commit fe8d0dd41823770c4283e7dbcc4b7ca1ad0d6eb9 +Author: Emmanuele Bassi +Date: Sun Oct 4 14:08:49 2015 +0100 + + build: Fix builddir != srcdir failure + + The split symbol files are in the srcdir path, not in the builddir + one. + +M Makefile.am + +commit 0bb2901aa5d944e7e588a4fd9f57d3be96354dc5 +Author: Philip Withnall +Date: Sun Oct 4 13:35:38 2015 +0100 + + build: Split GOA symbols out into a separate symbols file + + On some systems (Mac OS X) it is an error to include symbols in the + symbols file which are not exported from the library. This can + happen if + building with --disable-goa (or --disable-gnome). + + Fix this by generating the symbols file dynamically. + + https://bugzilla.gnome.org/show_bug.cgi?id=754821 + +M HACKING +M Makefile.am +R099 gdata/gdata.symbols gdata/gdata-core.symbols +A gdata/gdata-goa.symbols + +commit 5090ecd40d21c221ee8fa26d392c2e4ddecdd773 +Author: Philip Withnall +Date: Sun Oct 4 12:07:54 2015 +0100 + + contacts: Remove redundant copypasta + + This is left over from manually expanding one of the parser functions + inline here. + + Coverity CID: 131018 + +M gdata/services/contacts/gdata-contacts-contact.c + +commit 210878ba073be6bfffd3c9a6265164fbaf118f94 +Author: Debarshi Ray +Date: Fri Oct 2 12:41:34 2015 +0200 + + core: GDataDownloadStream:content-length should consider Content-Range + + https://bugzilla.gnome.org/show_bug.cgi?id=755976 + +M gdata/gdata-download-stream.c + +commit 79995b6789c89dc9bbe8514428045e8a151c78f6 +Author: Debarshi Ray +Date: Fri Oct 2 16:00:06 2015 +0200 + + core: Don't duplicate the received chunks in GDataDownloadStream + + We were accumulating SoupMessage::got-chunk connections whenever the + network thread was restarted. This meant that we were pushing the same + chunks of data multiple times into the GDataBuffer. + + https://bugzilla.gnome.org/show_bug.cgi?id=755976 + +M gdata/gdata-download-stream.c + +commit 805133bd6f306a720524b2bcbdab14ccac0800ad +Author: Philip Withnall +Date: Mon Sep 28 15:52:49 2015 +0100 + + gdata: Tweak documentation for GDataParserError + + It covers JSON as well as XML. + +M gdata/gdata-parsable.h + +commit 8025de2a5e3271b3527520f37246687a2e981c40 +Author: Милош Поповић +Date: Wed Sep 23 08:42:20 2015 +0000 + + Updated Serbian Latin translation + +M po/sr@latin.po + +commit 7e339f58211736a7988b45decdb9674ed97badd8 +Author: Марко Костић +Date: Wed Sep 23 08:40:52 2015 +0000 + + Updated Serbian translation + +M po/sr.po + +commit c4722b979e370150bf027542c1a1e782e4126a69 +Author: Enrico Nicoletto +Date: Sun Sep 20 15:01:39 2015 +0000 + + Updated Brazilian Portuguese translation + +M po/pt_BR.po + +commit 2eb4c160911e04a4575b041aed7c61297bb2a01f +Author: Ask Hjorth Larsen +Date: Sat Sep 19 16:25:41 2015 +0000 + + Updated Danish translation + +M po/da.po + +commit 3d27ae3cf461f2a42117c3284293a84bb1e31c46 +Author: Rūdolfs Mazurs +Date: Fri Sep 18 23:03:41 2015 +0300 + + Updated Latvian translation + +M po/lv.po + +commit 05826dc6ad21471519410be591d2ada9c386e950 +Author: Muhammet Kara +Date: Thu Sep 17 18:20:24 2015 +0000 + + Updated Turkish translation + +M po/tr.po + +commit ef86c11ec85b3151151365d448ddcadb854769c8 +Author: Stas Solovey +Date: Thu Sep 17 11:10:31 2015 +0000 + + Updated Russian translation + +M po/ru.po + +commit bd6f22933cd95cc14ea7e4659394b2164f10534b +Author: Philip Withnall +Date: Mon Sep 14 18:28:41 2015 +0100 + + build: Increment version to 0.17.4 + +M configure.ac + +commit 2840ab1ddfc4d0616424f0c23626f240a7923c3a +Author: Philip Withnall +Date: Mon Sep 14 18:27:31 2015 +0100 + + Release version 0.17.3 + +M NEWS +M configure.ac + +commit c192f1f3e4ea17ee8a6572ee1ac89a6be8176a59 +Author: Philip Withnall +Date: Thu Sep 10 16:56:25 2015 +0100 + + core: Remove undefined symbols from gdata.symbols + + These two symbols are not defined anywhere. + + https://bugzilla.gnome.org/show_bug.cgi?id=754821 + +M gdata/gdata.symbols + +commit add73ea9b249079061538cb9d502866a2be24e7d +Author: Matej Urbančič +Date: Tue Sep 8 23:27:21 2015 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit b8722cf38ba7f8fc60e3518e1e84dabcdc1bb640 +Author: Changwoo Ryu +Date: Wed Sep 9 01:26:45 2015 +0900 + + Updated Korean translation + +M po/ko.po + +commit 093b9fbc3cd2f9a18dc1ff2584bfe42b43679275 +Author: Debarshi Ray +Date: Fri Sep 4 13:55:03 2015 +0200 + + tests: Remove redundant if-else branches + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/tasks.c +M gdata/tests/youtube.c + +commit 0c413dcc2c1a67504f9b039547e1733360414b69 +Author: Debarshi Ray +Date: Fri Sep 4 13:59:01 2015 +0200 + + tests: Don't leak the authorizer + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit 977e18d79e6cd238fcb2ac782967aef4f3890ef7 +Author: Debarshi Ray +Date: Fri Sep 4 11:13:14 2015 +0200 + + core: Ignore overflows, but not alphamerics when parsing int64 + from XML + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-parser.c + +commit 840eea2f26fb8de25d8bc0b9a1e4ca57f50fd660 +Author: Debarshi Ray +Date: Wed Sep 2 18:55:09 2015 +0200 + + documents: Parse quotaBytesUsed as GDataDocumentsEntry:quota-used + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c + +commit 2e090dfa6ecd529b49a2fcb92fe8d9e0c062a91b +Author: Claudio Arseni +Date: Thu Sep 3 08:40:26 2015 +0000 + + Updated Italian translation + +M po/it.po + +commit b2aad10863be1c52fd452ec01e3ff05228e69964 +Author: Aurimas Černius +Date: Wed Sep 2 21:07:10 2015 +0300 + + Updated Lithuanian translation + +M po/lt.po + +commit 972665011d9e0b975ee2acaa4818d2bad2000101 +Author: Paul Seyfert +Date: Wed Sep 2 10:45:59 2015 +0000 + + Updated German translation + +M po/de.po + +commit a10865c79aa2d9c696749459790dfcfcf3f4cb60 +Author: Tom Tryfonidis +Date: Fri Aug 28 18:53:10 2015 +0000 + + Updated Greek translation + +M po/el.po + +commit eaa1ea4343bea77adad4905fe00885396ad1b72e +Author: Piotr Drąg +Date: Wed Aug 26 19:45:52 2015 +0200 + + Updated Polish translation + +M po/pl.po + +commit 7e6249c6a7079d9c757ef35a2266b6647883ff43 +Author: Chao-Hsiung Liao +Date: Tue Aug 25 22:58:59 2015 +0000 + + Updated Chinese (Taiwan) translation + +M po/zh_TW.po + +commit 45e5559a2bcb14dd00c11b922ea7cda9ad83b683 +Author: Fran Dieguez +Date: Tue Aug 25 16:02:59 2015 +0200 + + Updated Galician translations + +M po/gl.po + +commit 5c3441dfc3599a0d990c91e3b15a888ea77e563f +Author: Philip Withnall +Date: Tue Aug 18 08:54:34 2015 +0100 + + tests: Remove disabled memory test + + GLib has removed the memory allocation vtable for good, so this + test can + never be made to work. + + See: https://bugzilla.gnome.org/show_bug.cgi?id=701694 + +M gdata/tests/Makefile.am +D gdata/tests/memory.c + +commit e9a8ed15c780c19bef6ce430356ad3393e25941f +Author: Alexandre Franke +Date: Sat Aug 15 11:47:47 2015 +0000 + + Updated French translation + +M po/fr.po + +commit 73796dd4037681fe5668a5712ecf4dbdc98463f9 +Author: Dušan Kazik +Date: Sat Aug 15 09:46:49 2015 +0000 + + Updated Slovak translation + +M po/sk.po + +commit cc9e91f5ce41b0135ed61125026c5358e528e044 +Author: Anders Jonsson +Date: Fri Aug 14 14:13:52 2015 +0000 + + Updated Swedish translation + +M po/sv.po + +commit bd64219281c792db47e93d8a739b88f97550eff7 +Author: Kjartan Maraas +Date: Tue Aug 11 19:27:14 2015 +0200 + + Updated Norwegian bokmål translation. + +M po/nb.po + +commit 2268ad2bfa79e5a9c1f3b2dd1fb24f82c44abe53 +Author: Andika Triwidada +Date: Fri Aug 7 08:09:03 2015 +0000 + + Updated Indonesian translation + +M po/id.po + +commit 403ad46c3cb6a54b44c1dd494a6187ff969fc93d +Author: Akom Chotiphantawanon +Date: Tue Jul 28 16:03:58 2015 +0700 + + Updated Thai translation + +M po/th.po + +commit 560b195e5bc3fb372e6850bc6dce23a9515f3d19 +Author: Marek Černocký +Date: Sat Jul 25 13:17:38 2015 +0200 + + Updated Czech translation + +M po/cs.po + +commit 8e80be66795c7b7be7e2451c1102ed032812afd8 +Author: Balázs Úr +Date: Fri Jul 17 14:27:54 2015 +0000 + + Updated Hungarian translation + +M po/hu.po + +commit 7798d7d982dd1b62bb78bbfad89163db5fa6f235 +Author: Pedro Albuquerque +Date: Wed Jul 15 09:32:15 2015 +0000 + + Updated Portuguese translation + +M po/pt.po + +commit 5c0ed84aa4edbcad8268e8c14edad5d69b5a193f +Author: Daniel Mustieles +Date: Tue Jul 14 16:28:39 2015 +0200 + + Updated Spanish translation + +M po/es.po + +commit 99d8a4ce16113d3bcdc256e67dc593f2a2c04f04 +Author: Piotr Drąg +Date: Mon Jul 13 19:19:39 2015 +0200 + + Updated Polish translation + +M po/pl.po + +commit a9c8516b4380a213cd92d83a11f9793414588319 +Author: Debarshi Ray +Date: Tue Jun 16 18:53:13 2015 +0200 + + documents: Support creating folders and copying files using Drive v2 + + It is no longer possible to create a new folder using + gdata_service_insert_entry(). One must now use + gdata_documents_service_add_entry_to_folder for creating folders and + copying existing files. + + This is essentially a soft API break, but it’s unavoidable. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-service.c + +commit 7f05d8b6a70327c7efd2afabea0b8db3af6c71a1 +Author: Daniel Mustieles +Date: Mon Jul 13 10:52:53 2015 +0200 + + Updated Spanish translation + +M po/es.po + +commit ca77a729bca37bebac38f6675aab63d897ea428d +Author: Philip Withnall +Date: Fri Jul 10 13:54:17 2015 +0100 + + build: Increment version to 0.17.3 + +M configure.ac + +commit dd6bbd2f0dacc22f0bb888000195d49d0501c016 +Author: Philip Withnall +Date: Fri Jul 10 13:52:29 2015 +0100 + + Release version 0.17.2 + +M NEWS +M configure.ac +M docs/reference/gdata-docs.xml +M gdata/gdata-access-handler.h +M gdata/gdata-batchable.h +M gdata/gdata-entry.c +M gdata/gdata-oauth2-authorizer.c +M gdata/gdata-parser.c +M gdata/services/calendar/gdata-calendar-access-rule.c +M gdata/services/calendar/gdata-calendar-access-rule.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/documents/gdata-documents-access-rule.c +M gdata/services/documents/gdata-documents-access-rule.h +M gdata/services/documents/gdata-documents-utils.c +M gdata/services/youtube/gdata-youtube-comment.c + +commit 6056e5fdcfe8d08fcf158633cca8633162d022b9 +Author: Philip Withnall +Date: Fri Jul 10 13:42:07 2015 +0100 + + build: Add freebase test traces to dist_test_data + + Otherwise installed-tests fails on the freebase tests. + +M gdata/tests/Makefile.am + +commit b63fc7063d6b62c9f4f7ba745c94060546bb06c8 +Author: Philip Withnall +Date: Fri Jul 10 12:49:35 2015 +0100 + + tests: Mark some unused functions as unused + + After porting all of the YouTube tests, the Contacts and PicasaWeb + tests + need a bit more love to get them working. Because time is short, just + mark these ones as __attribute__((unused)), or comment them out, and I + will come back to them later. FIXMEs added. + + https://bugzilla.gnome.org/show_bug.cgi?id=750914 + +M gdata/tests/contacts.c +M gdata/tests/picasaweb.c + +commit 942b85f82461d3b70c9fcaa95ba389f1ff3beba0 +Author: Philip Withnall +Date: Fri Jul 10 12:43:15 2015 +0100 + + tests: Delete client-login-authorizer tests + + The ClientLogin authorizer is completely deprecated now, and all + requests to it return an error requesting the user to log in online. + + The libgdata code will no longer be maintained, and it is not possible + to test it sensibly any more. + +M gdata/tests/Makefile.am +D gdata/tests/client-login-authorizer.c +D +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async +D +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-cancellation +D +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-multiple-domains +D +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync +D +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-bad-password +D +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-cancellation +D +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-multiple-domains +D +gdata/tests/traces/client-login-authorizer/setup-client-login-authorizer-data-authenticated + +commit 4f598da08f9db641e2710c80d0604e7251c62cf7 +Author: Philip Withnall +Date: Fri Jul 10 12:21:56 2015 +0100 + + tests: Fix some compiler warnings in the YouTube tests + +M gdata/tests/youtube.c + +commit c5ced0ac8d6736b3214ebe27f3207e06e46722f5 +Author: Philip Withnall +Date: Fri Jul 10 12:20:45 2015 +0100 + + tests: Remove outdated async authentication tests from YouTube + + These were using the unsupported ClientLogin API. The OAuth2 + authoriser + has its own async authorisation tests, so porting the existing YouTube + tests would gain us nothing. + +M gdata/tests/youtube.c + +commit 00ec26d6c1e0c29ea09c89df3d3667e329bc6008 +Author: Philip Withnall +Date: Fri Jul 10 12:20:13 2015 +0100 + + youtube: Fix a potential NULL object dereference + +M gdata/services/youtube/gdata-youtube-video.c + +commit bcdf3c9f4dc59774f733c1cdcb7ca30d465bc1b9 +Author: Philip Withnall +Date: Fri Jul 10 12:19:59 2015 +0100 + + tests: Port and re-enable YouTube upload tests + +M gdata/tests/traces/youtube/teardown-upload +M gdata/tests/traces/youtube/upload-async +M gdata/tests/traces/youtube/upload-async-cancellation +M gdata/tests/traces/youtube/upload-simple +M gdata/tests/youtube.c + +commit 383af36165d0454de695f1b8cce6feccb3432353 +Author: Philip Withnall +Date: Fri Jul 10 12:18:33 2015 +0100 + + youtube: Re-enable video uploads using the v3 API + + This required a way of deleting videos once we’re done with them, + plus a + tweak to the upload parts parameter. + +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/youtube.c + +commit ebee2ee23960c532a4e24046b517afcfe5fee2cf +Author: Philip Withnall +Date: Fri Jul 10 11:43:03 2015 +0100 + + tests: Port and re-enable online YouTube comment tests + +M gdata/tests/traces/youtube/comment-insert +M gdata/tests/traces/youtube/comment-query +M gdata/tests/traces/youtube/comment-query-async-progress-closure +M gdata/tests/traces/youtube/comment_insert-async +M gdata/tests/traces/youtube/comment_insert-async-cancellation +M gdata/tests/traces/youtube/comment_query-async +M gdata/tests/traces/youtube/comment_query-async-cancellation +M gdata/tests/traces/youtube/setup-comment +M gdata/tests/youtube.c + +commit 3ff3df2a5c290eebd0479b8b65f9e197af17e492 +Author: Philip Withnall +Date: Fri Jul 10 10:35:43 2015 +0100 + + tests: Port and re-enable offline YouTube comment tests + +M gdata/tests/youtube.c + +commit 62714bce9ca0b7c8c292fdf916f658bbe7b6f35e +Author: Philip Withnall +Date: Fri Jul 10 10:34:47 2015 +0100 + + youtube: Remove a small amount of dead code + + Set but unused variables. + +M gdata/services/youtube/gdata-youtube-video.c + +commit 687c2768c3585da9c2e5878c9377f7f9a7f08a19 +Author: Philip Withnall +Date: Fri Jul 10 10:38:11 2015 +0100 + + youtube: Port YouTube comments to the v3 API + + This should make YouTube comments work again. They have been ported to + JSON from XML, and the GDataCommentable implementations updated to use + the correct comment URIs. + +M gdata/services/youtube/gdata-youtube-comment.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c + +commit b37f185f7a24ec0ff87e4acadeb90ab2fd556382 +Author: Philip Withnall +Date: Fri Jul 10 10:32:56 2015 +0100 + + core: Add a new internal method for setting GDataEntry:etag + + This will be useful for YouTube comments, coming up shortly. + +M gdata/gdata-entry.c +M gdata/gdata-private.h + +commit b5262ecca7237c414dcd6dc59ae0ba244c628242 +Author: Philip Withnall +Date: Fri Jul 10 10:31:07 2015 +0100 + + tests: Remove an unused YouTube test + + From way back in 2009. Time flies! + +M gdata/tests/youtube.c + +commit 3ca4fbcc88dbf26a1edda79fbad9e819a11ae82d +Author: Philip Withnall +Date: Wed Jul 8 15:31:53 2015 +0100 + + youtube: Simplify video ratings handling code + + This simplifies the code and fixes a problem where if both + region_restriction_allowed and region_restriction_blocked were not + spcified, the GDataYouTubeVideo would behave as if restricted for all + regions, which is most likely not the intention. + +M gdata/services/youtube/gdata-youtube-video.c + +commit d7a3fcefedca016c785541bedbef36e239970c01 +Author: Philip Withnall +Date: Wed Jul 8 15:30:07 2015 +0100 + + tests: Port and re-enable YouTube video rating tests + + A lot of the media:group parsing stuff has gone, and was not tested + properly to begin with, so that test can be dropped. Similarly, the + error handling test can be dropped because the JSON parser code is + deliberately a lot more tolerant now that arbitrary ratings boards are + supported. + +M gdata/tests/youtube.c + +commit 8ecba5f3241e19e797a39fdc269e064a077515fd +Author: Philip Withnall +Date: Wed Jul 8 09:48:31 2015 +0100 + + tests: Port and re-enable YouTube category tests + + Unfortunately the YouTube category list is no longer localised to the + region passed in to the query — the category names are now always in + English. So the only way we can detect differences caused by changing + region is to look at how many categories are returned. + +M gdata/tests/traces/youtube/categories +M gdata/tests/traces/youtube/categories-async +M gdata/tests/traces/youtube/categories-async-cancellation +M gdata/tests/youtube.c + +commit 6d66dcb54b4919a3a0f7cb1600c218e0199bfa1f +Author: Philip Withnall +Date: Wed Jul 8 09:46:15 2015 +0100 + + app: Fix parsing of YouTube categories + + The GDataAPPCategories parser used to take in the GType of the + GDataCategory subclass to construct when parsing its category list; in + the port to JSON, it was accidentally changed to always construct + GDataCategory instances. This broke the YouTube code, which was hoping + to see GDataYouTubeCategory instances be constructed. + +M gdata/app/gdata-app-categories.c + +commit 34d139a4d7b036c4bb65cb66c594ff4957e8a056 +Author: Philip Withnall +Date: Wed Jul 8 08:45:53 2015 +0100 + + docs: Add gdata-documents-utils.h to IGNORE_HFILES + + It’s a private header and shouldn’t be in the documentation. + +M docs/reference/Makefile.am + +commit 2aa0d42f2fea61005a1c1c159fc8e7c4c8604c04 +Author: Philip Withnall +Date: Wed Jul 8 00:29:03 2015 +0100 + + tests: Port and re-enable several YouTube parsing tests + +M gdata/tests/youtube.c + +commit 3177f27b6fc5637463a4400c27789ebcfa5ed441 +Author: Philip Withnall +Date: Wed Jul 8 00:28:00 2015 +0100 + + youtube: Fix parsing videos which have no recordingDate + + If they have a recordingDetails section, but no recordingDate, the + parser was crashing. + +M gdata/services/youtube/gdata-youtube-video.c + +commit bda4a259f6f246f5813659cb1aa2617623a700eb +Author: Pedro Albuquerque +Date: Mon Jul 6 09:58:48 2015 +0000 + + Updated Portuguese translation + +M po/pt.po + +commit 755d96754ad1a4f2e32b832c4726288d255851a4 +Author: Piotr Drąg +Date: Sun Jul 5 20:24:35 2015 +0200 + + Updated Polish translation + +M po/pl.po + +commit f23574101c9c423598566771cd69c78beb90f422 +Author: Piotr Drąg +Date: Sun Jul 5 20:22:19 2015 +0200 + + Updated POTFILES.in + +M po/POTFILES.in + +commit 3663353499edf0a11cfcf5c82b3c83c2cf53e1c5 +Author: Philip Withnall +Date: Sun Jul 5 14:06:58 2015 +0100 + + tests: Port and re-enable the YouTube batch API tests + + Now testing that GDataYouTubeService no longer claims to support batch + operations, rather than testing that they work. + + https://developers.google.com/youtube/v3/guides/implementation/deprecated#Batch_Processing + + https://bugzilla.gnome.org/show_bug.cgi?id=750914 + +M gdata/tests/traces/youtube/batch +M gdata/tests/traces/youtube/batch-async +M gdata/tests/traces/youtube/setup-batch +M gdata/tests/youtube.c + +commit 2b1823af2ee212bc4079f42dd432b89089ae6f47 +Author: Philip Withnall +Date: Sun Jul 5 14:04:14 2015 +0100 + + youtube: Mark GDataBatchable as unsupported by YouTube any more + + It is no longer supported in version 3 of the API, so implement + the new + GDataBatchable.is_supported API and return FALSE for everything, + meaning + that all batchable operations on GDataYouTubeService will now + fail with + GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION. + +M gdata/services/youtube/gdata-youtube-service.c + +commit 322328769d8347d2d0621d6eccd0f029390654c1 +Author: Philip Withnall +Date: Sun Jul 5 14:02:47 2015 +0100 + + core: Add GDataBatchable.is_supported virtual method + + This new API is intended to be used by GDataYouTubeService to allow it + to indicate which batch operations it supports (since this has changed + since v3 of the API — now batch operations are no longer supported). + +M gdata/gdata-batch-operation.c +M gdata/gdata-batchable.h + +commit 33a76e0c55bc012ec1ed3fda62ea13075bdc437e +Author: Philip Withnall +Date: Sun Jul 5 14:00:12 2015 +0100 + + tests: Port and re-enable the YouTube query URI tests + + https://bugzilla.gnome.org/show_bug.cgi?id=750914 + +M gdata/tests/youtube.c + +commit 718513ef649b7af7d15e76432eef72180012c08b +Author: Philip Withnall +Date: Sun Jul 5 12:49:44 2015 +0100 + + tests: Fix query parameter comparisons involving dates in YouTube + tests + + The only way to implement some of the standard feeds in the YouTube + service is now to query filtering against the current date, + which means + that a custom message comparison function has to be installed into the + uhttpmock code to ignore that query parameter when replacing HTTP + traces. + + Use some new convenience API in libuhttpmock to achieve this. + + Dependency changes: + • libuhttpmock ≥ 0.5.0 + + https://bugzilla.gnome.org/show_bug.cgi?id=750914 + +M configure.ac +M gdata/tests/traces/youtube/query-standard-feed +M +gdata/tests/traces/youtube/query-standard-feed-async-progress-closure +M gdata/tests/traces/youtube/query-standard-feed-with-query +M gdata/tests/traces/youtube/query-standard-feeds +M gdata/tests/traces/youtube/query_standard_feed-async +M gdata/tests/traces/youtube/query_standard_feed-async-cancellation +M gdata/tests/youtube.c + +commit b53780890f548b8fbbc4cf30d1aafd1b61cc4b8d +Author: Philip Withnall +Date: Sun Jul 5 14:05:41 2015 +0100 + + youtube: Reduce assumed accuracy of time query parameters + + There is no point in sending microsecond datestamps to the + server. This + also makes the API more testable, since the unit tests no longer + need to + guess the date stamp with microsecond accuracy. (They are still + open to + second-accuracy race conditions, though.) + +M gdata/services/youtube/gdata-youtube-query.c + +commit c9f3f74b87a8bbceac442cc62de7db485ed718c4 +Author: Philip Withnall +Date: Sat Jul 4 11:17:34 2015 +0100 + + tests: Port and re-enable a few more YoUTube unit tests + +M gdata/tests/traces/youtube/query-related +M gdata/tests/traces/youtube/query-related-async-progress-closure +M gdata/tests/traces/youtube/query-single +M gdata/tests/traces/youtube/query-standard-feeds +M gdata/tests/traces/youtube/query_related-async +M gdata/tests/traces/youtube/query_related-async-cancellation +M gdata/tests/traces/youtube/query_single-async +M gdata/tests/traces/youtube/query_single-async-cancellation +M gdata/tests/youtube.c + +commit de1dab37b889abe568981436042c21ea816fd1d6 +Author: Philip Withnall +Date: Sat Jul 4 11:16:42 2015 +0100 + + core: Add a missing NULL terminator to parsed JSON string arrays + + This fixes a crash on finalisation of GDataYouTubeVideo if it has + keywords set. + +M gdata/gdata-parser.c + +commit 778fcb4b8681ad5a614ffe2db45c0a1850b4e2ce +Author: Philip Withnall +Date: Thu Jul 2 08:17:53 2015 +0100 + + docs: Fix multiply-defined index IDs + + The api-index-full.xml and api-index-deprecated.xml files already + define + those two IDs, so we can’t define them again in gdata-docs.xml. Use + role + instead, whatever that is. + +M docs/reference/gdata-docs.xml + +commit a9e28e1be944743c6da71f0c6230f45b81fae44f +Author: Pedro Albuquerque +Date: Wed Jul 1 22:01:12 2015 +0000 + + Updated Portuguese translation + +M po/pt.po + +commit e76c6257448c826a249f8315cb20a5cd5dd06090 +Author: Debarshi Ray +Date: Wed Jul 1 15:26:34 2015 +0200 + + goa-authorizer: Add domains for documents if "files" is on + + The new gvfs backend will enable nautilus and the gtk+ file chooser to + interact with Google Drive. This means that GOA accounts in Google + will get a "files" switch, which we should check when deciding whether + to enable the documents service. + + https://bugzilla.gnome.org/show_bug.cgi?id=751782 + +M gdata/gdata-goa-authorizer.c + +commit 47b4df3a1eaf9dae4c18ffd3f779604a81c62282 +Author: Debarshi Ray +Date: Tue Jun 30 15:02:52 2015 +0200 + + documents: Add support for updating content using Drive v2 + + There is a bug in the Drive web UI where the preview doesn't get + updated with the new content, but if you download or go through the + revisions then things are as they should be. I could reliably + reproduce + it with plain/text content. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-service.c + +commit 015de8f078a6b1352c61393008e9dbc8570f03c4 +Author: Philip Withnall +Date: Wed Jun 24 23:49:58 2015 +0100 + + tests: Add a test for location presence in default YouTube video JSON + + This is a unit test for the fix in commit + 5ca05e195f7cecd63d6616aeef8410df8eee978c. + +M gdata/tests/youtube.c + +commit 033b6c8e718c6698f0e4c808e919b3b60202368e +Author: Debarshi Ray +Date: Tue Jun 16 18:22:13 2015 +0200 + + documents: Split out the code to add a parent folder's link to + an entry + + We will need this for creating folders and copying files. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-service.c + +commit 656207baff1e288c0c7d6020555316a53b9faa1c +Author: Debarshi Ray +Date: Tue Jun 16 15:06:51 2015 +0200 + + documents: Set mimeType in JSON + + A Drive v2 folder is a file with the MIME type + application/vnd.google-apps.folder (and with no extension). Therefore, + setting the MIME type is crucial for creating new folders. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-folder.c + +commit 9fc2d52a30e7325957624d75bbbf939cc4e0d978 +Author: Debarshi Ray +Date: Mon Jun 15 15:56:53 2015 +0200 + + documents: Support uploads to a specific location using Drive v2 + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-utils.h + +commit ed09ec21c25e0ed1c596d2982e3b6e3e0e9636fd +Author: Debarshi Ray +Date: Fri Jun 12 17:21:08 2015 +0200 + + core: Use constructed instead of constructor + + The constructed vfunc is the idiomatic place to access construct + properties, which is what we are doing in this case. The constructor + is more intrusive and is usually used for implementing things like + singletons. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-upload-stream.c + +commit b80f8883dd7c15a62ae9756f34c8f3155d557a32 +Author: Philip Withnall +Date: Sun Jun 14 15:51:48 2015 +0100 + + core: Add GDataOAuth2Authorizer:refresh-token API + + Add new API to allow the refresh token from an OAuth 2 authorizer + to be + stored by an application and restored into a new GDataOAuth2Authorizer + instance (a cold start). This adds the following new API: + • GDataOAuth2Authorizer:refresh-token + • gdata_oauth2_authorizer_dup_refresh_token() + • gdata_oauth2_authorizer_set_refresh_token() + + It does not add any new tests. + + https://bugzilla.gnome.org/show_bug.cgi?id=750746 + +M docs/reference/gdata-sections.txt +M gdata/gdata-oauth2-authorizer.c +M gdata/gdata-oauth2-authorizer.h +M gdata/gdata.symbols + +commit 0080aee2b88cd5ff24624c8c41d998e0bd5e9356 +Author: Debarshi Ray +Date: Fri Jun 12 17:10:50 2015 +0200 + + tests: Use GDataDocumentsAccessRule for documents ACLs + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/tests/documents.c + +commit f38a3f3e2b04d34838d4931fddad5a7d5492be76 +Author: Debarshi Ray +Date: Fri Jun 12 13:27:04 2015 +0200 + + documents: Add support for uploads using Drive v2 + + This is enough to upload a file to the root folder, but you can't + select a specific location. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-service.c + +commit 49f3b9d86f6f21bc2414fd18cebbedfa551c29a3 +Author: Debarshi Ray +Date: Fri Jun 12 16:04:44 2015 +0200 + + documents: Split out the code to map a content type to a GType + + We will need this in gdata_documents_service_finish_upload. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M Makefile.am +M gdata/services/documents/gdata-documents-feed.c +A gdata/services/documents/gdata-documents-utils.c +A gdata/services/documents/gdata-documents-utils.h + +commit fd46c2cbe130db4f7158762d5f88923c39c77382 +Author: Debarshi Ray +Date: Wed Jun 10 19:30:39 2015 +0200 + + documents: Support searching for readers using Drive v2 queries + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-query.c + +commit 19e91a0bfae358caf04b1522cc01ce64347caef7 +Author: Debarshi Ray +Date: Wed Jun 10 13:52:39 2015 +0200 + + core: Read-only properties are not going to be set via the public API + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-access-rule.c + +commit 360db0c60127c7bbd4dd26f2ab83b21a138f68ce +Author: Debarshi Ray +Date: Fri Jun 5 13:05:05 2015 +0200 + + calendar: Fix a path in the GDataCalendarAccessRule documentation + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/calendar/gdata-calendar-access-rule.c + +commit e2ab462d63e81a32dcca842bccfdd753bd5dd55f +Author: Debarshi Ray +Date: Fri Jun 5 11:54:41 2015 +0200 + + documents: Add support for editing ACLs using Drive v2 + + A new sub-class was introduced to set JSON as the content-type for + Drive v2. It was a good opportunity to move the Drive-specific JSON + parsing code from the base class. + + New API added: + • GDataDocumentsAccessRule + + This new class must be used in place of GDataAccessRule for any + interactions with the Drive API. This is essentially a soft API break, + but it’s unavoidable. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-access-rule.c +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/documents/gdata-documents-access-rule.c +A gdata/services/documents/gdata-documents-access-rule.h +M gdata/services/documents/gdata-documents-entry.c +M po/POTFILES.in + +commit f2459b4beb654cd6a789b594bb3c4e79de7aae2e +Author: Debarshi Ray +Date: Wed Jun 10 14:15:58 2015 +0200 + + core: Expose _gdata_access_rule_set_key() internally + + This will be used by GDataDocumentsAccessRule when parsing the JSON. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-access-rule.c +M gdata/gdata-private.h + +commit 10802aec3d4207e6c5520ec677649b9d57ee2838 +Author: Debarshi Ray +Date: Thu Jun 4 15:03:39 2015 +0200 + + core: Fix the GDataAccessRule example + + We need to pass the a GDataAuthorizationDomain to + gdata_service_insert_entry, and we should not unref the GDataLink + returned by gdata_entry_look_up_link. + + https://bugzilla.gnome.org/show_bug.cgi?id=750395 + +M gdata/gdata-access-rule.c + +commit 1dd92748d8bdb5bb538c6701db4857e18e842ff8 +Author: Ting-Wei Lan +Date: Tue Jun 9 16:00:09 2015 +0800 + + build: Fix -Werror build for clang + + This fixes implicit enumeration type conversion. + + https://bugzilla.gnome.org/show_bug.cgi?id=750480 + +M gdata/gdata-batch-feed.c + +commit c4f9bdedcdad0c392c1b2e854179213fa0e0c52b +Author: Debarshi Ray +Date: Wed Jun 3 14:04:29 2015 +0200 + + tests: Silence -Wunsafe-loop-optimizations + + We can end up with an infinite loop if end_num is G_MAXUINT. Let's use + ‘<’ instead of ‘<=’ to avoid this. + + https://bugzilla.gnome.org/show_bug.cgi?id=750335 + +M gdata/tests/streams.c + +commit c601fc4c4e9ba4fa071c3d1ff3bac7cf28f10747 +Author: Debarshi Ray +Date: Wed Jun 3 15:41:16 2015 +0200 + + tests: Use GDataCalendarAccessRule for calendar ACLs + + Fall out from 68ed77fbafaa1403e924ae9f9a06ebc8d159fcaa + + https://bugzilla.gnome.org/show_bug.cgi?id=750335 + +M gdata/tests/calendar.c + +commit d5447497569ad720096828705de48bffe860bf9a +Author: Debarshi Ray +Date: Wed Jun 3 14:07:47 2015 +0200 + + demos: Silence -Wmaybe-uninitialized + + Fall out from 0e42b9d0e64aaf9f4d04eeab29d860a68209ff61 + + https://bugzilla.gnome.org/show_bug.cgi?id=750335 + +M demos/calendar/calendar-cli.c + +commit 68ed77fbafaa1403e924ae9f9a06ebc8d159fcaa +Author: Philip Withnall +Date: Thu May 14 13:42:55 2015 +0100 + + calendar: Re-enable support for ACLs with version 3 of the API + + This was non-trivial. New API added: + • GDataCalendarAccessRule + + Due to how this new class overrides GDataAccessRule, it must be + used in + place of GDataAccessRule for any interactions with the Calendar API. + This is essentially a soft API break for anyone who uses + calendars. It’s + unavoidable. + + https://bugzilla.gnome.org/show_bug.cgi?id=664353 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/calendar/gdata-calendar-access-rule.c +A gdata/services/calendar/gdata-calendar-access-rule.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/tests/calendar.c +M gdata/tests/traces/calendar/access-rule-delete +M gdata/tests/traces/calendar/access-rule-get +M gdata/tests/traces/calendar/access-rule-insert +M gdata/tests/traces/calendar/access-rule-update +M gdata/tests/traces/calendar/global-authentication +M gdata/tests/traces/calendar/setup-temp-calendar +M gdata/tests/traces/calendar/setup-temp-calendar-acls +M gdata/tests/traces/calendar/teardown-temp-calendar +M gdata/tests/traces/calendar/teardown-temp-calendar-acls + +commit 76562aeb1a3ed10ce35c2c746dc10de9efffc347 +Author: Philip Withnall +Date: Wed May 27 21:52:38 2015 +0100 + + build: Remove local copy of ax_code_coverage.m4 + + Since we now depend on other macros from autoconf-archive, remove the + local copy of this one. When building from git, autoconf-archive will + need to be available. When building from a tarball, the macros + will have + been copied into the tarball during dist, so autoconf-archive is + unnecessary. When building from git via JHBuild, m4-common (a wrapper + for autoconf-archive) is used automatically. + +M Makefile.am +D m4/ax_code_coverage.m4 + +commit c55e32182522377c2af195fcee50e185b8a7246d +Author: Philip Withnall +Date: Wed May 27 21:51:38 2015 +0100 + + build: Use AX_COMPILER_FLAGS + + Switch from GNOME_COMPILE_WARNINGS to AX_COMPILER_FLAGS. This + integrates + better with CI systems, allows easy disabling of -Werror, and + integrates + with AX_IS_RELEASE to automatically disable errors when building + releases. + + https://wiki.gnome.org/Projects/GnomeCommon/Migration + +M Makefile.am +M configure.ac +M gdata/tests/Makefile.am +D m4/gnome-compiler-flags.m4 + +commit 6949c1d5ce1d5801bf21032a5be3ec4375997241 +Author: Philip Withnall +Date: Tue May 26 18:45:34 2015 +0100 + + build: Update autogen.sh to no longer hard-code the project name + + Use the recommended autogen.sh from + https://wiki.gnome.org/Projects/GnomeCommon/Migration + +M autogen.sh + +commit 6666a7ac6f24e788bca84ba9d1bda35dfd4d10d1 +Author: Philip Withnall +Date: Tue May 26 18:43:49 2015 +0100 + + build: Use AX_IS_RELEASE + + Check for the presence of a git repository to determine whether things + like compiler warnings should be fatal. The warnings themselves + will be + hooked up later. + + This adds an implicit dependency on autoconf-archive or GNOME’s + m4-common. These are pulled in by JHBuild, and the relevant macros are + automatically distributed in tarballs — so the dependencies only + need to + be explicitly installed if you are building from git without using + JHBuild. This is an unsupported use case. + + Note that AC_CONFIG_MACRO_DIR() has already been added to + configure.ac. + + https://wiki.gnome.org/Projects/GnomeCommon/Migration + +M configure.ac + +commit dac4f090da5f57dbd4de316e75fb2dbf5408102e +Author: Philip Withnall +Date: Tue May 26 18:42:55 2015 +0100 + + build: Update ACLOCAL_AMFLAGS to install third-party macros + + So that they are carried around in the distributed tarball, and there + are no dependencies on things like autoconf-archive. + + https://wiki.gnome.org/Projects/GnomeCommon/Migration + +M Makefile.am + +commit 7e5325f4d658536cc9ffccbf5832d420e3b31801 +Author: Akom Chotiphantawanon +Date: Sun May 24 17:52:12 2015 +0700 + + Updated Thai translation + +M po/th.po + +commit 982536bcc2d5042eff023aefe8d4bd5698f5cfb6 +Author: Cédric Valmary +Date: Fri May 22 21:17:21 2015 +0000 + + Added Occitan translation + +M po/LINGUAS +A po/oc.po + +commit 746739fab55dbc0493ea4a29d68cf545e3f151dc +Author: Philip Withnall +Date: Tue May 12 20:11:20 2015 +0100 + + core: Virtualise gdata_access_handler_get_rules() + + Add new API: + • GDataAccessHandlerIface.get_rules + as a virtual method backing gdata_access_handler_get_rules(). + + This does not break ABI as it uses one of the reserved slots in + GDataAccessHandlerIface. + + https://bugzilla.gnome.org/show_bug.cgi?id=664353 + +M gdata/gdata-access-handler.c +M gdata/gdata-access-handler.h + +commit 62163529e974304933208a73bca98fe9f6a4484b +Author: Philip Withnall +Date: Wed May 6 23:22:34 2015 +0100 + + tests: Update and re-enable the majority of Calendar unit tests + + The ACL tests remain disabled, pending porting the ACL implementation + to + v3 of the API. The batch tests have been removed completely, as + the API + no longer supports batch operations. + +M gdata/tests/Makefile.am +M gdata/tests/calendar.c +M gdata/tests/traces/calendar/authentication +D gdata/tests/traces/calendar/batch +D gdata/tests/traces/calendar/batch-async +D gdata/tests/traces/calendar/batch-async-cancellation +M gdata/tests/traces/calendar/event-insert +M gdata/tests/traces/calendar/event_insert-async +M gdata/tests/traces/calendar/event_insert-async-cancellation +M gdata/tests/traces/calendar/global-authentication +M gdata/tests/traces/calendar/query-all-calendars +M +gdata/tests/traces/calendar/query-all-calendars-async-progress-closure +M gdata/tests/traces/calendar/query-events +M gdata/tests/traces/calendar/query-events-async-progress-closure +M gdata/tests/traces/calendar/query-own-calendars +M +gdata/tests/traces/calendar/query-own-calendars-async-progress-closure +M gdata/tests/traces/calendar/query_all_calendars-async +M gdata/tests/traces/calendar/query_all_calendars-async-cancellation +M gdata/tests/traces/calendar/query_events-async +M gdata/tests/traces/calendar/query_events-async-cancellation +M gdata/tests/traces/calendar/query_own_calendars-async +M gdata/tests/traces/calendar/query_own_calendars-async-cancellation +D gdata/tests/traces/calendar/setup-batch-async +M gdata/tests/traces/calendar/setup-query-calendars +M gdata/tests/traces/calendar/setup-query-events +M gdata/tests/traces/calendar/setup-temp-calendar +D gdata/tests/traces/calendar/teardown-batch-async +M gdata/tests/traces/calendar/teardown-insert-event +M gdata/tests/traces/calendar/teardown-query-calendars +M gdata/tests/traces/calendar/teardown-query-events +M gdata/tests/traces/calendar/teardown-temp-calendar + +commit e24d9c4ceb2638d85e09fcdc6b9f39fc4c1579da +Author: Philip Withnall +Date: Wed May 6 23:24:51 2015 +0100 + + calendar: Set the self link for each GDataCalendarEvent + + Previously, this was partially solved in GDataCalendarService by + constructing the link after each query or insertion. However, + this could + not work well for async operations. Instead, it appears to be possible + to build the self link from within GDataCalendarEvent, as the calendar + ID is apparently available as the organiser’s e-mail address. + +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-service.c + +commit df0fef97fe680062870a01b7d06472eba25c3fb7 +Author: Philip Withnall +Date: Wed May 6 23:23:55 2015 +0100 + + core: Disable the warning about mismatched kinds + + As explained in the comment in the commit, kind mismatches are a lot + more common (legitimately), and a lot less avoidable, in the new JSON + APIs. Give in and stop warning about them. + +M gdata/gdata-entry.c + +commit 047e41692df42599268aabb2ec91c4b7b10e5b8b +Author: Philip Withnall +Date: Wed May 6 08:24:31 2015 +0100 + + tests: Update perf test to use GTest + + It now asserts that the performance is above some lower bound, and can + output in TAP format correctly. + +M gdata/tests/perf.c + +commit d301544d823bdeabc2e9d424b3481cbdac311187 +Author: Philip Withnall +Date: Wed May 6 00:44:52 2015 +0100 + + build: Update git.mk from upstream + +M git.mk + +commit 802fad787566223913bd03e39c60b7b6c1baa9f7 +Author: Philip Withnall +Date: Wed May 6 00:22:47 2015 +0100 + + tests: Port to use installed-tests + + Port the unit tests to follow the installed-tests standard, installing + the test binaries and generated .test metadata files. + + This removes the existing --enable-tests configure option, + replacing it + with the standard: + • --enable-always-build-tests + • --enable-installed-tests + options. --enable-always-build-tests is a direct replacement for + --enable-tests, controlling whether tests are built at compile + time, or + only when run under `make check`. --enable-installed-tests controls + whether tests will be installed on the system. + + If the tests are installed, use + gnome-desktop-testing-runner libgdata + to run them all. + + https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests + +M Makefile.am +M configure.ac +M gdata/tests/Makefile.am +M gdata/tests/common.c +A glib-tap.mk +A tap-driver.sh +A tap-test + +commit 10f67845a07c75bf92f1128d949edae75d645ec7 +Author: Philip Withnall +Date: Wed May 6 00:21:17 2015 +0100 + + tests: Use g_test_build_filename() to load test data files + + Rather than TEST_FILE_DIR, which is completely non-relocatable and + a bit + of a hack. + + This is one step towards supporting installed-tests. + + https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests + +M gdata/tests/Makefile.am +M gdata/tests/calendar.c +M gdata/tests/client-login-authorizer.c +M gdata/tests/common.c +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/freebase.c +M gdata/tests/oauth1-authorizer.c +M gdata/tests/oauth2-authorizer.c +M gdata/tests/picasaweb.c +M gdata/tests/tasks.c +M gdata/tests/youtube.c +D gtester.mk + +commit 0e42b9d0e64aaf9f4d04eeab29d860a68209ff61 +Author: Philip Withnall +Date: Mon May 4 00:11:34 2015 +0100 + + demos: Add calendar-cli demo + + This is a simple demo to allow querying calendars and events from the + command line, and inserting simple new events into a calendar. + +M Makefile.am +A demos/calendar/calendar-cli.c + +commit 83d215b9d2bb7e7b1547986c23277b370fce215f +Author: Philip Withnall +Date: Mon May 4 00:08:50 2015 +0100 + + calendar: Port to the Calendar API version 3 + + Deprecated API: + • GDataCalendarFeed:timezone, gdata_calendar_feed_get_timezone() + • GDataCalendarFeed:times-cleaned, + gdata_calendar_feed_get_times_cleaned() + • GDataBatchable implementation in GDataCalendarService + • gdata_calendar_service_insert_event(), + gdata_calendar_service_insert_event_async() + • GDataCalendarCalendar:times-cleaned, + gdata_calendar_calendar_get_times_cleaned() + • GDataCalendarCalendar:edited, + gdata_calendar_calendar_get_edited() + + API changes: + • GDataBatchable implementation in GDataCalendarService will + now always + fail + • ACLs are temporarily not supported; support for them will + be re-added + in future when they have been ported to the new API + • Add gdata_calendar_service_insert_calendar_event(), + gdata_calendar_service_insert_calendar_event_async() + + This includes a partial update of the unit tests, but most of + them have + been disabled pending updates. + + https://bugzilla.gnome.org/show_bug.cgi?id=664353 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/calendar/gdata-calendar-feed.h +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/tests/calendar.c + +commit 69d181787f4ed92690130d50858dc856c462585a +Author: Philip Withnall +Date: Sun May 3 23:51:59 2015 +0100 + + demos: Fix usage documentation in youtube-cli + + It was outdated. + +M demos/youtube/youtube-cli.c + +commit 03e5b84ec166d67e1f32a51dc6727a75fe826198 +Author: Philip Withnall +Date: Sun May 3 23:49:00 2015 +0100 + + core: Update reference link in GDataAccessRule documentation + + Haven’t yet checked if the implementation still matches the + documentation. + +M gdata/gdata-access-rule.c + +commit f5f4d75bc63fb57bf344ff1018731e12d695772e +Author: Philip Withnall +Date: Sun May 3 23:48:35 2015 +0100 + + docs: Remove a dead link from the HACKING file + + https://bugzilla.gnome.org/show_bug.cgi?id=664353 + +M HACKING + +commit f73d69de95bb934a34b20644de5e84854d046284 +Author: Philip Withnall +Date: Sun May 3 23:34:32 2015 +0100 + + core: Clarify that GDataFeed:total-results may be zero for unknown + + The v3 Calendar API doesn’t report the total number of results for + calendar lists, even though it supports pagination. Clarify the + documentation about this. + + https://bugzilla.gnome.org/show_bug.cgi?id=664353 + +M gdata/gdata-feed.c + +commit d7f93942811ba761cfb16430744a40e89a5bf5b6 +Author: Philip Withnall +Date: Sun May 3 16:21:30 2015 +0100 + + core: Add an internal parser for hexadecimal colours in JSON members + + This will be used for v3 of the Calendar API. + + https://bugzilla.gnome.org/show_bug.cgi?id=664353 + +M gdata/gdata-parser.c +M gdata/gdata-parser.h + +commit e98aabd114aa5d86d41b0da50c720fda58cd3b1e +Author: Philip Withnall +Date: Sun May 3 12:09:22 2015 +0100 + + documents: Assert that parsing a known JSON string member succeeds + + gdata_parser_string_from_json_member() should return TRUE iff + it matched + the given member (even if parsing fails). Since the member name comes + from a loop over the existing members, this should always succeed. + + Spotted by Coverity. + + CID: #109873 + +M gdata/services/documents/gdata-documents-document.c + +commit f6f4e3e5eb75d1f17eb1fa9cc8aa3c9b31bb38f1 +Author: Philip Withnall +Date: Sun May 3 12:07:59 2015 +0100 + + youtube: Add a missing strv NULL dereference check + + Spotted by Coverity. + + CID: #109874 + +M gdata/services/youtube/gdata-youtube-video.c + +commit f2d18cbcc9e33d4e3a92abde8cdad428c031dd7e +Author: Philip Withnall +Date: Thu Apr 30 21:31:01 2015 +0100 + + tests: Partially port and re-enable the YouTube test suite + + Re-enable a couple of the tests. There’s still a long way to + go before + they’re all re-enabled though. + +M gdata/tests/Makefile.am +M gdata/tests/traces/youtube/authentication +M gdata/tests/traces/youtube/global-authentication +M gdata/tests/youtube.c + +commit e49a9d92120da3a77817c77577859be53c7cd081 +Author: Philip Withnall +Date: Thu Apr 30 21:32:55 2015 +0100 + + youtube: Remove processingDetails part from single video query URI + + We can only query the processingDetails if we are the video owner, + which + basically means we can only (reliably) do it in the upload code, after + uploading the video. Attempting to retrieve the processingDetails for + any other video (we don’t own) results in an access denied error + response from the server. + +M gdata/services/youtube/gdata-youtube-video.c + +commit f21f169ea15fd30cd74b32a0100d6ae96300c53e +Author: Philip Withnall +Date: Thu Apr 30 21:32:20 2015 +0100 + + youtube: Fix freeing static strings in GDataYouTubeVideo + + The access control keys are all allocated, not static. This fixes a + crash when parsing some videos. + +M gdata/services/youtube/gdata-youtube-video.c + +commit 0f9ff5f12cf65c9a779f87f1e15ffb62c565c295 +Author: Philip Withnall +Date: Thu Apr 30 21:31:39 2015 +0100 + + youtube: Add property setters in GDataYouTubeState + + So that it can actually be constructed from + gdata_youtube_video_get_state(). + +M gdata/services/youtube/gdata-youtube-state.c + +commit 55494a86848d6ba164a72c8c57adf8360a3ed26d +Author: Philip Withnall +Date: Thu Apr 30 20:29:22 2015 +0100 + + tests: Re-enable Freebase tests + + They seem to pass now; don’t know what changed to cause them to stop + failing. + +M gdata/tests/Makefile.am + +commit c7445fc6f30befbf19dfbf60b81053259aae9804 +Author: Philip Withnall +Date: Thu Apr 30 20:22:08 2015 +0100 + + tests: Re-enable the general /app/categories after porting to + YouTube v3 + + Port the test to use the new JSON-style GDataAPPCategories (which is + completely non-standards-compliant, but hey) and re-enable it. + +M gdata/tests/general.c + +commit fa663d6504ceecb7cf9202f0de178b0915694e66 +Author: Philip Withnall +Date: Thu Apr 30 20:11:44 2015 +0100 + + tests: Update and re-enable the streams test + + It needed to be updated to check YouTube JSON, rather than XML. No + other + changes. + +M gdata/tests/Makefile.am +M gdata/tests/streams.c + +commit 7d58b5d78d1a69cf7a6d7957d31382b91f2ee6ae +Author: Philip Withnall +Date: Thu Apr 30 20:11:18 2015 +0100 + + youtube: Fix an error return value type + +M gdata/services/youtube/gdata-youtube-video.c + +commit 5ca05e195f7cecd63d6616aeef8410df8eee978c +Author: Philip Withnall +Date: Thu Apr 30 20:10:10 2015 +0100 + + youtube: Allow location to be unset in GDataYouTubeVideo + + Previously, whether the location was set was controlled by another + property, but that’s gone now. Relax the bounds on the latitude and + longitude properties, and treat all out-of-bounds values as an unset + location. + + This fixes the problem of a new GDataYouTubeVideo saying its + location is + (0.0, 0.0) (which is a valid location). + +M gdata/services/youtube/gdata-youtube-video.c + +commit 2fe7f6305063b6c300cac15e3abff738d41dba0c +Author: Philip Withnall +Date: Thu Apr 30 19:38:15 2015 +0100 + + media: Fix a strict aliasing problem with a cast + + Fixes a compiler warning. Potentially unbreaks libgdata on + architectures + which care about pointer alignment. (I’m looking at you, ARM.) + +M gdata/media/gdata-media-thumbnail.c + +commit 320bd70b5d285c9f3a336de94e1e771dffbfaea9 +Author: Debarshi Ray +Date: Mon Apr 27 18:23:57 2015 +0200 + + core: Set description in JSON + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-entry.c + +commit 6e0b3d1f14e0c290670fd595ace3bf48dd26e714 +Author: Debarshi Ray +Date: Fri Apr 24 17:01:42 2015 +0200 + + documents: Add support for Drive v2 query properties + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-query.c + +commit a246f3bf5f22fcde438e916764a5bca61c9f1a90 +Author: Debarshi Ray +Date: Fri Apr 24 11:31:16 2015 +0200 + + core: Add internal helper API for adding query strings + + In the Drive v2 API, certain GDataDocumentsQuery properties like + show-deleted and show-folders no longer have their own parameters, but + have to be specified as a search clause in the query string. This will + be used internally by child classes of GDataQuery to add search + clauses + that represent service-specific query properties. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-private.h +M gdata/gdata-query.c + +commit fa3e219eff1d4617463a86deb14cb3b1f5fb9a19 +Author: Debarshi Ray +Date: Fri Apr 24 11:35:22 2015 +0200 + + documents: Add support for paging through Drive v2 file lists + + The server does not offer a ‘previous’ URI. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-feed.c + +commit a7a92287d7fd592d8fb2ae466ab91b869c2c7a19 +Author: Debarshi Ray +Date: Thu Apr 23 14:37:12 2015 +0200 + + core: Expose _gdata_feed_add_link() internally + + This will be used by GDataDocumentsFeed to add a link for nextLink. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-feed.c +M gdata/gdata-private.h + +commit cb60cd24c2baea7c8b068114411b776db55b6bb5 +Author: Debarshi Ray +Date: Thu Apr 23 14:25:18 2015 +0200 + + core: Parse selfLink from JSON for GDataFeed + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-feed.c + +commit f05a94d4ddbad9b9f1dff58c8a6a68505f49cd35 +Author: Philip Withnall +Date: Fri Apr 24 03:50:45 2015 +0100 + + build: Increment version to 0.17.2 + +M configure.ac + +commit a032226ce2312753e4fa50a77c401cdd4ff82a3d +Author: Philip Withnall +Date: Fri Apr 24 03:49:26 2015 +0100 + + Release version 0.17.1 + +M NEWS +M configure.ac + +commit 83fa58ffd75b08463bf9d1be2a80fff8be098837 +Author: Philip Withnall +Date: Fri Apr 24 03:19:07 2015 +0100 + + Release version 0.17.0 + +M NEWS +M docs/reference/gdata-docs.xml +M gdata/atom/gdata-category.h +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-oauth2-authorizer.c +M gdata/gdata-oauth2-authorizer.h +M gdata/gdata-parser.c +M gdata/gdata-service.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/youtube/gdata-youtube-content.c +M gdata/services/youtube/gdata-youtube-content.h +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-credit.h +M gdata/services/youtube/gdata-youtube-feed.c +M gdata/services/youtube/gdata-youtube-feed.h +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-query.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit f6340dafe5b5ac872d48aeb3b4cb42f594d3cee4 +Author: Philip Withnall +Date: Fri Apr 24 02:35:28 2015 +0100 + + tests: Temporarily disable a few tests which have not been updated + + Disable the Drive and YouTube unit tests, as they have not been + updated + from master to match the new JSON APIs (vs the old XML ones). + +M gdata/tests/Makefile.am +M gdata/tests/general.c +M gdata/tests/picasaweb.c + +commit 8b448859ffb635b1de66bcf5fe51bf4d95c2c419 +Author: Philip Withnall +Date: Fri Apr 24 01:38:18 2015 +0100 + + docs: Add missing Freebase symbol to sections.txt + +M docs/reference/gdata-sections.txt + +commit c3f35353ec030d7e54aa496d9c0d5ca6af6ec401 +Author: Philip Withnall +Date: Fri Apr 24 01:35:37 2015 +0100 + + youtube: Remove some G_GNUC_DEPRECATED to un-break gtk-doc + + gtk-doc apparently cannot parse G_GNUC_DEPRECATED applied after struct + typedefs, so remove them. + +M gdata/services/youtube/gdata-youtube-content.h +M gdata/services/youtube/gdata-youtube-credit.h +M gdata/services/youtube/gdata-youtube-query.h + +commit 92c9c1b488a5da38a100ddc19b3544e702bd3cd8 +Author: Philip Withnall +Date: Fri Apr 24 01:15:41 2015 +0100 + + documents: Use standard ‘Deprecated’ syntax in gtk-doc comments + + Standardise with the rest of libgdata, and the gtk-doc manual. + +M gdata/services/documents/gdata-documents-entry.c + +commit d6e64a18cc28b6d8feb62d739d8b3d1eedf392d4 +Author: Philip Withnall +Date: Fri Apr 24 01:14:29 2015 +0100 + + core: Use standard ‘Deprecated’ syntax in gtk-doc comments + + Standardise with the rest of libgdata, and the gtk-doc manual. + +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-service.c + +commit 598cac2f34b5265d541131942fc75467ddbdaeef +Author: Piotr Drąg +Date: Thu Apr 23 23:09:38 2015 +0200 + + Updated POTFILES.in + +M po/POTFILES.in + +commit 6be3965c97cc3af1ea783166dd7c700129abe67a +Author: Debarshi Ray +Date: Thu Apr 23 13:22:03 2015 +0200 + + documents: Parse lastViewedByMeDate as GDataDocumentsEntry:last-viewed + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c + +commit 232c559afd9da9c21733ae77b6bdc357d63673a8 +Author: Debarshi Ray +Date: Thu Apr 16 20:10:05 2015 +0200 + + documents: Support thumbnails and downloads using Drive v2 + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-document.c + +commit d93279623e34c7b275ae3f989b54c6f3a30d5658 +Author: Debarshi Ray +Date: Tue Mar 31 16:04:33 2015 +0200 + + documents: Add support for parsing Drive v2 files + + We don't override GDataEntry:id any more. It is now identical to + GDataDocumentsEntry:document-id. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c + +commit 3bb5feaaf360fd946b5bd89a3a1345309a4d8d77 +Author: Debarshi Ray +Date: Mon Mar 30 18:39:47 2015 +0200 + + documents: Add support for parsing Drive v2 file lists + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-feed.c + +commit 72c1ae9fa445aca7cc24573e4d381cf66d17c704 +Author: Debarshi Ray +Date: Thu Apr 23 13:06:09 2015 +0200 + + documents: Deprecate GDataDocumentsEntry:edited + + The Drive v2 API does not have the concept of ‘significant + changes’, so + GDataDocumentsEntry:edited is now identical to GDataEntry:updated. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-entry.h +M gdata/tests/documents.c + +commit 4d2dce3539a40a93b0db3a6aad62aa04c005276f +Author: Debarshi Ray +Date: Fri Apr 17 12:51:53 2015 +0200 + + documents: Use Drive v2 scopes + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-service.c + +commit 54da3958675d2b8cdd0cedf19e5a5b5ffc7c6d92 +Author: Debarshi Ray +Date: Thu Apr 16 18:48:16 2015 +0200 + + documents: Point the entry URI at the Drive v2 API + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c + +commit ac384ef8538871ee7e52fbfcb4e989c0a04a8aae +Author: Debarshi Ray +Date: Mon Mar 30 20:03:20 2015 +0200 + + documents: Point the request uri at the Drive v2 API + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-service.c + +commit 9c996d5789107fdfc56a3cfff8264a978ac95123 +Author: Philip Withnall +Date: Wed Apr 22 00:46:58 2015 +0100 + + app: Remove unused XML parsing code from GDataAPPCategories + + No longer needed after porting the YouTube API to v3, which uses JSON. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/app/gdata-app-categories.c + +commit 727c13a632fbc6a9fd60d9b66921e12b618b55f5 +Author: Philip Withnall +Date: Sun Apr 19 20:43:17 2015 +0100 + + youtube: Port to the YouTube API version 3 + + Deprecated API: + • GDataYouTubeQuery:format, gdata_youtube_query_get_format(), + gdata_youtube_query_set_format() + • GDataYouTubeQuery:has-location + • GDataYouTubeQuery:language, gdata_youtube_query_get_language(), + gdata_youtube_query_set_language() + • GDataYouTubeQuery:sort-order, + gdata_youtube_query_get_sort_order(), + gdata_youtube_query_set_sort_order() + • GDataYouTubeQuery:uploader, gdata_youtube_query_get_uploader(), + gdata_youtube_query_set_uploader() + • GDataYouTubeSortOrder + • GDataYouTubeUploader + • GDataYouTubeContent + • GDataYouTubeFormat + • GDataYouTubeVideo:video-id, gdata_youtube_video_get_video_id() + • gdata_youtube_video_look_up_content() + (use gdata_youtube_video_get_player_uri() instead) + • GDATA_YOUTUBE_RATING_TYPE_SIMPLE + • GDataYouTubeCredit, GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER + • GDataYouTubeVideo:credit, gdata_youtube_video_get_credit() + • GDataYouTubeVideo:is-draft, gdata_youtube_video_is_draft(), + gdata_youtube_video_set_is_draft() + • GDATA_YOUTUBE_*_FEED except GDATA_YOUTUBE_MOST_POPULAR_FEED (all + others have been deprecated online and will transparently + return the + most popular videos from the past 24 hours) + + API changes: + • GDataYouTubeQuery:restriction no longer accepts IP addresses + • All GDataCommentable functionality on GDataYouTubeVideo is + disabled + at runtime until the v3 YouTube API for comments is finished online + • Not all properties of a GDataYouTubeVideo may be retrieved + when doing + searches, retrieving related videos, or listing standard feeds + — to + guarantee getting all properties, use + gdata_service_query_single_entry() for the video in question; + common + properties such as title, description, player URI and thumbnails + will always be retrieved + + Internally, the GDataYouTubeControl and GDataYouTubeGroup APIs + have been + removed, but they were never visible publicly, so this is not an API + break. + + Due to the transition from v2 to v3 of the YouTube API, your + client’s + developer key may stop working. Refresh it here: + https://developers.google.com/youtube/registering_an_application + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M Makefile.am +M docs/reference/Makefile.am +M gdata/services/youtube/gdata-youtube-content.c +M gdata/services/youtube/gdata-youtube-content.h +D gdata/services/youtube/gdata-youtube-control.c +D gdata/services/youtube/gdata-youtube-control.h +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-credit.h +D gdata/services/youtube/gdata-youtube-group.c +D gdata/services/youtube/gdata-youtube-group.h +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-query.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/youtube.c + +commit 4cf196ef256c2869a35bfdd086e2fdf0ee1da64e +Author: Philip Withnall +Date: Sun Apr 19 18:24:22 2015 +0100 + + youtube: Add a GDataYouTubeFeed helper class for parsing feeds + + This parses YouTube-specific properties of the feed — specifically, + the + total-results and items-per-page, which were previously handled in a + service-agnostic manner by GDataFeed, but YouTube doesn’t conform to + that. + + This adds the following new API: + • GDataYouTubeFeed + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/youtube/gdata-youtube-feed.c +A gdata/services/youtube/gdata-youtube-feed.h +M gdata/services/youtube/gdata-youtube-service.c + +commit 53ae5fcdd66378e1d3d4fd64588f71a49bda7694 +Author: Debarshi Ray +Date: Fri Apr 17 15:14:08 2015 +0200 + + documents: Deprecate document-id + + GDataDocumentsEntry:document-id was actually already deprecated (in + the gtk-doc comment); it just wasn’t marked with G_PARAM_DEPRECATED. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/services/documents/gdata-documents-entry.c + +commit 5fd7761658607ac97f752d9bee98be6c3de09499 +Author: Philip Withnall +Date: Sun Apr 19 20:33:28 2015 +0100 + + tests: Allow use of deprecated API in unit tests + + We need to test that the behaviour of deprecated API doesn’t change + across the versions of libgdata, which requires it to be accessible in + the headers, and hence LIBGDATA_DISABLE_DEPRECATED cannot be defined. + + All deprecated API is marked with G_GNUC_DEPRECATED anyway, and the + tests can explicitly disable this with + G_GNUC_BEGIN_IGNORE_DEPRECATIONS. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/tests/Makefile.am + +commit 750bb7ffe6395d85d930948eaf93c0f323f3ef8d +Author: Philip Withnall +Date: Sun Apr 19 18:39:20 2015 +0100 + + core: Add new JSON internal parser helper methods + + New internal API: + • gdata_parser_int_from_json_member() + • gdata_parser_strv_from_json_member() + + These will be useful in upcoming changes to port to v3 of the YouTube + API. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/gdata-parser.c +M gdata/gdata-parser.h + +commit d8a40c6e4172ba26f57e65041667b5266f88fed1 +Author: Philip Withnall +Date: Sun Apr 19 18:34:16 2015 +0100 + + core: Add JSON support to GDataUploadStream + + Add support for JSON to the non-resumable and resumable code paths, so + that GDataEntrys which specify application/json as their content type + have JSON generated and uploaded, rather than XML. + + This will be useful for the upcoming port to v3 of the YouTube API. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/gdata-upload-stream.c + +commit de74263ff38a9d3e9672b833e5883393b3a9854c +Author: Philip Withnall +Date: Sun Apr 19 18:29:29 2015 +0100 + + media: Add JSON support to GDataMediaThumbnail + + This will be used in the upcoming port to v3 of the YouTube API. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/media/gdata-media-thumbnail.c + +commit 9dc3981167a70c404a236aeb368dc441e9f9714c +Author: Philip Withnall +Date: Sun Apr 19 18:23:16 2015 +0100 + + core: Add internal API for setting GDataFeed:total-results + + This will be useful in adding GDataYouTubeFeed, shortly. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/gdata-feed.c +M gdata/gdata-private.h + +commit f89b123bf15dc1f4eee107b6a65a2a6bd1273253 +Author: Philip Withnall +Date: Sun Apr 19 18:02:03 2015 +0100 + + app: Add support for JSON to GDataAPPCategories + + This allows downloading the YouTube category list with v3 of the + YouTube + API. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/app/gdata-app-categories.c + +commit b354ff4c392c6adf65ccb5340dfb17c0dbab8363 +Author: Philip Withnall +Date: Sun Apr 19 18:36:16 2015 +0100 + + core: Expose gdata_parser_error_from_json_error() internally + + Expose this as an internal helper function, which will be useful in + upcoming commits. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/gdata-parser.c +M gdata/gdata-parser.h + +commit 7fc7b3ad68ddca2c838651734b0c8a1d32da8449 +Author: Philip Withnall +Date: Sun Apr 19 20:44:14 2015 +0100 + + youtube: Fix default values of GDataYouTubeQuery location properties + + The latitude and longitude properties previously had 0.0 as their + default value, which is a valid location. They should instead have + G_MAXDOUBLE as their default, which is not a valid location — + and hence + doesn’t affect query results before the properties are set + explicitly. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/services/youtube/gdata-youtube-query.c + +commit 7887424aed686642fa1ed61dff1409fb89eab7e1 +Author: Philip Withnall +Date: Sun Apr 19 17:59:18 2015 +0100 + + demos: Expand youtube-cli functionality + + Add support for all of the major features which our YouTube service + currently supports: querying single videos, related videos, standard + feeds, categories, and uploading videos. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M demos/youtube/youtube-cli.c + +commit f35706c5057d948e468f93c57ffba4f415124c2b +Author: Piotr Drąg +Date: Fri Apr 17 19:47:40 2015 +0200 + + Updated POTFILES.in + +M po/POTFILES.in + +commit 87389a294276de50db8e71eb35cd663b7266970d +Author: Debarshi Ray +Date: Thu Apr 16 18:51:57 2015 +0200 + + core: Get the content type from the response instead of hard coding it + + There are places where we need to hard code the content type used by + a specific service API. eg., when we want to upload and need to know + whether to send JSON or XML. However, in this case, we have the + response from the server and we can find the content type from that. + We are already doing it in a few other places, so let's do it + here too. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-service.c + +commit c8b45de97cd6c975659a4fbb477c065bb64002a4 +Author: Debarshi Ray +Date: Thu Apr 16 15:14:22 2015 +0200 + + core: Add support for JSON to GDataAccessRule + + The ‘edited’ property is left unused. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-access-rule.c + +commit 565bb3a7ffd945f4ee39ca4091be100f505a74ac +Author: Debarshi Ray +Date: Thu Apr 16 13:23:15 2015 +0200 + + core: Add support for JSON to GDataAccessHandler + + This includes initial code for detection of the Content Type of + received messages, and parsing JSON or XML depending on that. + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-access-handler.c + +commit d82abd75899683bfb5e9f677e8ca640fefe85efa +Author: Debarshi Ray +Date: Thu Apr 2 18:05:37 2015 +0200 + + core: Parse description from JSON + + https://bugzilla.gnome.org/show_bug.cgi?id=684920 + +M gdata/gdata-entry.c + +commit b0d0c9dd7cecd2c43e559215b14a082999d5a917 +Author: Philip Withnall +Date: Thu Apr 16 00:47:14 2015 +0100 + + core: Add internal helper API for setting GDataEntry:id + + This will be used in the upcoming ports of various services to JSON. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/gdata-entry.c +M gdata/gdata-private.h + +commit c975b7b55a7c32f5d4146b1b799ad4c6456c7b17 +Author: Philip Withnall +Date: Thu Apr 16 00:46:32 2015 +0100 + + core: Add internal helper API for setting GDataEntry:published + + This will be used in the upcoming ports of services to JSON. + + https://bugzilla.gnome.org/show_bug.cgi?id=687597 + +M gdata/gdata-entry.c +M gdata/gdata-private.h + +commit d6ddcbfe28f236f3f6a17fd980f03b2306135ec8 +Author: Philip Withnall +Date: Tue Apr 14 00:50:19 2015 +0100 + + demos: Add youtube-cli demo + + This is a simple demo to search for YouTube videos on the command + line. + +M Makefile.am +A demos/youtube/youtube-cli.c + +commit c8c56eec911d58e167d3772dbc10f4e4242c10c0 +Author: Philip Withnall +Date: Mon Apr 13 23:57:55 2015 +0100 + + core: Correctly track JSON reader state when cloning nodes + + It is not safe to call json_reader_get_member_name() after recursing + the + parser state, so we have to copy the list of member names before + iterating. + +M gdata/gdata-parsable.c + +commit 94e5b8355ee3eda717c1a5e8d391478dd99a851a +Author: Philip Withnall +Date: Mon Apr 13 23:55:59 2015 +0100 + + core: Handle malformed OAuth2 grant response bodies + + It’s possible for the server to return an empty error response, + which we + must handle gracefully. + +M gdata/gdata-oauth2-authorizer.c + +commit 220b4671bc4a8f503b4fdbebb06c01dd6c016b80 +Author: Philip Withnall +Date: Mon Apr 13 23:54:16 2015 +0100 + + core: Fix JSON parser state on hitting an error + + Close the entry element on error, otherwise the JsonParser stays + in its + error state. + +M gdata/gdata-feed.c +M gdata/gdata-parsable.c + +commit 4496726447dd431004ccf872c45db6538df62fc2 +Author: Carlos Garnacho +Date: Tue Jan 6 18:35:38 2015 +0100 + + goa-authorizer: Set Authorization header as "Bearer ..." + + Starting with "OAuth..." seems a CnP/leftover from OAuth1 support. RFC + 6750 only observes the "Bearer" keyword though. This also seems + consistent + with GDataOAuth2Authorizer. + + https://bugzilla.gnome.org/show_bug.cgi?id=742473 + +M gdata/gdata-goa-authorizer.c + +commit aab9947e41a1084ead6b8c82082a855656dd3e00 +Author: Carlos Garnacho +Date: Tue Jan 6 18:34:36 2015 +0100 + + goa-authorizer: Add freebase domain + + This is necessary for authorizers to correctly authorize freebase + queries. + + https://bugzilla.gnome.org/show_bug.cgi?id=742473 + +M gdata/gdata-goa-authorizer.c + +commit 5b34fea33d00695c993e637bc1c4f823a32133f1 +Author: Carlos Garnacho +Date: Tue Jan 6 18:33:29 2015 +0100 + + freebase: Fix authorization domain + + Set up as per + https://developers.google.com/freebase/v1/how-tos/authorizing#AboutAuthorization. + + https://bugzilla.gnome.org/show_bug.cgi?id=742473 + +M gdata/services/freebase/gdata-freebase-service.c + +commit 847f568fa01803cd386b1f096597b7cdd9aa9397 +Author: Debarshi Ray +Date: Thu Apr 2 15:05:46 2015 +0200 + + atom: Add macros for shared and viewed + + Having pre-defined and documented macros demystifies these strange + URL-like strings for the application developer. + + This adds the following new API: + • GDATA_CATEGORY_SCHEMA_LABELS_SHARED + • GDATA_CATEGORY_SCHEMA_LABELS_VIEWED + +M docs/reference/gdata-sections.txt +M gdata/atom/gdata-category.h + +commit 42a826fb41b3a7d41ece055b37eeca44ccaedab1 +Author: Alexander Shopov +Date: Sat Apr 11 14:03:58 2015 +0300 + + Updated Bulgarian translation + +M po/bg.po + +commit 2ae605eb932c288e539e695ac9bd817d4c57757c +Author: Mattias Põldaru +Date: Wed Apr 8 20:28:32 2015 +0300 + + [l10n] Updated Estonian translation + +M po/et.po + +commit eeff9f9117a9a6cd79dfb8236b506896af60d815 +Author: Samir Ribic +Date: Fri Mar 13 21:01:58 2015 +0000 + + Added Bosnian translation + +M po/LINGUAS +A po/bs.po + +commit 044a2a93c97efa426e14a5317eeeccb97efae3a0 +Author: Carlos Garnacho +Date: Tue Jan 6 18:31:29 2015 +0100 + + tests: Indirectly test API keys + + Set a fake one on the service, so it can be checked when comparing + with + traces. + + https://bugzilla.gnome.org/show_bug.cgi?id=742472 + +M gdata/tests/freebase.c +M gdata/tests/traces/freebase/search +M gdata/tests/traces/freebase/search-complex +M gdata/tests/traces/freebase/topic + +commit 540e624309b030af0e33ff1e43e278f9abcf4087 +Author: Carlos Garnacho +Date: Tue Jan 6 18:26:21 2015 +0100 + + freebase: Pass API key as a GET variable + + This needs including on every freebase request if a developer key + is set + by the caller. + + https://bugzilla.gnome.org/show_bug.cgi?id=742472 + +M gdata/services/freebase/gdata-freebase-service.c + +commit 29ed453ec5328ac757313763b5ca9d3580d3c664 +Author: Мирослав Николић +Date: Wed Mar 4 20:44:46 2015 +0100 + + Updated Serbian translation + +M po/sr.po +M po/sr@latin.po + +commit 73031a3e21cd8c82f1465ba9e26c3c57781c67dd +Author: Dušan Kazik +Date: Sat Feb 28 16:19:07 2015 +0000 + + Updated Slovak translation + +M po/sk.po + +commit 15f0272672b7f75071a0b83df6779ba974b1a6c1 +Author: Philip Withnall +Date: Fri Feb 6 13:58:28 2015 +0000 + + demos: Remove use of deprecated GTK+ API + + Put the widgets in the content area — they belong there anyway. + +M demos/scrapbook/scrapbook.c + +commit 8400bc61775511ed7b4fbdeb4922f13824b2b65a +Author: Carlos Garnacho +Date: Sun Oct 5 18:38:24 2014 +0200 + + tests: Add tests for Freebase search API + + https://bugzilla.gnome.org/show_bug.cgi?id=737541 + +M gdata/tests/freebase.c +A gdata/tests/traces/freebase/search +A gdata/tests/traces/freebase/search-complex + +commit 021370e3bf24ffdbf22e7d168a7487d51c519d93 +Author: Carlos Garnacho +Date: Sun Sep 28 19:18:04 2014 +0200 + + freebase: Fix locale-dependent issues in geolocated queries + + Latitude/longitude are really expected with a '.' decimal point by the + service, breaking on locales that would use anything different. Use + g_ascii_formatd which always uses the '.' decimal point. + + https://bugzilla.gnome.org/show_bug.cgi?id=737541 + +M gdata/services/freebase/gdata-freebase-search-query.c + +commit 43dd1889c41286b0bce6dd3f1ff86716f9f79775 +Author: Carlos Garnacho +Date: Sun Sep 28 18:25:09 2014 +0200 + + freebase: Fix typo in search query + + The string array matches the GDataFreebaseSearchFilterType, using the + FilterNodeType was unintended, and TYPE_CONTAINER happened to match + GDATA_FREEBASE_SEARCH_FILTER_ALL. + + https://bugzilla.gnome.org/show_bug.cgi?id=737541 + +M gdata/services/freebase/gdata-freebase-search-query.c + +commit 0e3915c67150dfdbc17305ec39cbebb244e3f31c +Author: Carlos Garnacho +Date: Sun Sep 28 18:37:26 2014 +0200 + + freebase: Create async topic replies with the correct GType + + The async version was wrongly using the parent type, so the returned + object + wasn't a GDataFreebaseTopicResult at all. + + https://bugzilla.gnome.org/show_bug.cgi?id=737540 + +M gdata/services/freebase/gdata-freebase-service.c + +commit 2a939fd913db3ade85e7f71850bbd009690273d4 +Author: Carlos Garnacho +Date: Sun Oct 5 19:26:59 2014 +0200 + + freebase: Add GType for GDataFreebaseSearchResultItem + + Making it a boxed type makes it friendly to bindings, as there's + some more embedded knowledge about how to deal with this type + memory-wise. + + https://bugzilla.gnome.org/show_bug.cgi?id=737936 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/freebase/gdata-freebase-search-result.c +M gdata/services/freebase/gdata-freebase-search-result.h + +commit 5c598dce8f092395c04d3b097669231c01cc0dc9 +Author: Carlos Garnacho +Date: Sun Oct 5 17:59:04 2014 +0200 + + tests: Add tests for freebase topic API + + https://bugzilla.gnome.org/show_bug.cgi?id=737539 + +M gdata/tests/Makefile.am +A gdata/tests/freebase.c +A gdata/tests/traces/freebase/topic + +commit 460c79a61b727e21246b463c930d020aa1d482ec +Author: Carlos Garnacho +Date: Sun Sep 28 18:34:30 2014 +0200 + + freebase: Fix thinko when creating compound GDataFreebaseTopicObjects + + The check was actually inverted, receiving a newly created object is + obviously the expected condition. This made the parsing of compound + objects a lot more shallower than the received data. + + https://bugzilla.gnome.org/show_bug.cgi?id=737539 + +M gdata/services/freebase/gdata-freebase-topic-result.c + +commit c28a745ad8cbd4e22dccee1c2921e062f39b09db +Author: Carlos Garnacho +Date: Sun Sep 28 18:29:40 2014 +0200 + + freebase: reader_fill_object_gvalue() is only meant for "object" types + + Compound types are only meant to be handled through + reader_fill_compound_gvalue(), which will iterate through its + "property" + array. Otherwise, compound elements with an ID (which is not + mandatory, + but ok for these to have) would be created as shallow objects instead + of containers of further objects/values. + + https://bugzilla.gnome.org/show_bug.cgi?id=737539 + +M gdata/services/freebase/gdata-freebase-topic-result.c + +commit d848eb308c84d8bd2139618bad5197d83fd81fae +Author: Debarshi Ray +Date: Fri Dec 12 23:57:08 2014 +0000 + + demos: Add a docs-list demo + + Adapted from a bug report reproducer program by Debarshi Ray, + this lists + all the documents in the user’s Google Documents account, + getting the + account information from GOA. + + https://bugzilla.gnome.org/show_bug.cgi?id=741345 + +M Makefile.am +A demos/docs-list/docs-list.c + +commit 42fe3139568ded6cdeb4f69410a893448c2ba516 +Author: Philip Withnall +Date: Fri Dec 12 23:45:11 2014 +0000 + + build: Fix some whitespace in Makefile.am + +M Makefile.am + +commit f08951ebf95977ece665636a5cf423a7bc4252d2 +Author: Philip Withnall +Date: Fri Dec 12 23:20:50 2014 +0000 + + documents: Handle final page pagination in GDataDocumentsService + + The Google Documents servers always return a next page URI in a + GDataFeed unless on the final page of results, in which case no URI is + returned. Pass that information through to the GDataQuery so that + pagination works correctly for Google Documents. + + https://bugzilla.gnome.org/show_bug.cgi?id=741345 + +M gdata/services/documents/gdata-documents-service.c + +commit b449554962090aed5500a6fd10cd04a7bb27c6d7 +Author: Philip Withnall +Date: Fri Dec 12 23:18:05 2014 +0000 + + core: Explicitly support a final page in GDataQuery pagination + + The pagination model previously used by GDataQuery was to assume that + the server would return an empty GDataFeed once the final page was + passed by calling gdata_query_next_page(). + + Unfortunately, the Google Documents servers don’t do that — + instead, + they provide a next page URI in each GDataFeed, and don’t provide + one on + the final page. GDataQuery did not support this kind of explicit + knowledge about the current page being the final one. + + Add support for it with a delightful set of hacky internal functions. + Return a dummy empty feed from GDataService if passed a GDataQuery + which + is flagged as having reached the end of its pagination. + + https://bugzilla.gnome.org/show_bug.cgi?id=741345 + +M gdata/gdata-private.h +M gdata/gdata-query.c +M gdata/gdata-service.c + +commit 18edbc4e90f582bc67b08f6158c97666ebd8acaf +Author: Philip Withnall +Date: Fri Dec 12 23:15:45 2014 +0000 + + core: Allow the GDataFeed type to be passed to _gdata_feed_new() + + This will be used internally later to support constructing custom + empty + feeds for pagination purposes. + + https://bugzilla.gnome.org/show_bug.cgi?id=741345 + +M gdata/gdata-batch-operation.c +M gdata/gdata-feed.c +M gdata/gdata-private.h + +commit 1e5e69909cec7cc4d75c8ac2ae326b29795f01a8 +Author: Philip Withnall +Date: Fri Dec 12 19:45:40 2014 +0000 + + core: Virtualise feed parsing in GDataService + + Split the bulk of feed parsing out into a virtual method on + GDataService. This will allow subclasses of GDataService to implement + service-specific tweaks to feed parsing, which is required for + pagination handling with Google Documents. + + New API: + • GDataServiceClass.parse_feed + + This does not break ABI — it consumes one of the struct’s + expansion + slots. + + https://bugzilla.gnome.org/show_bug.cgi?id=741345 + +M gdata/gdata-service.c +M gdata/gdata-service.h + +commit 52e05dd978ff111ad154b01d0bb3f241b3600325 +Author: Philip Withnall +Date: Fri Dec 12 19:44:12 2014 +0000 + + core: Eliminate unnecessary is_async argument from parser functions + + Instead, use g_main_context_invoke(), which guarantees to call the + callback synchronously if the GMainContext is owned, and in an idle + callback otherwise. This is exactly what we want for implementing + callbacks which could come from this thread or a worker thread. + + https://bugzilla.gnome.org/show_bug.cgi?id=741345 + +M gdata/gdata-access-handler.c +M gdata/gdata-feed.c +M gdata/gdata-private.h +M gdata/gdata-service.c + +commit b74bc65d31e2d52eec4fb9ba2296b6ef64f40a72 +Author: Philip Withnall +Date: Fri Dec 12 19:36:05 2014 +0000 + + core: Use correct relation URI for next/previous feed links + + GDataLink enforces that all relations are proper URIs, prefixing + iana.org to those which aren’t — so we need to do the same + when calling + gdata_feed_look_up_link(). + + https://bugzilla.gnome.org/show_bug.cgi?id=741345 + +M gdata/gdata-service.c + +commit 1b5919570fb8b16c25ccc11204ab763f11d97003 +Author: Philip Withnall +Date: Fri Dec 12 17:31:29 2014 +0000 + + tests: Switch to non-interactive tests by default + + This fixes `make check` stalling forever on requesting user input. To + run the interactive tests, the programs now need to be run with + --interactive. + +M gdata/tests/common.c + +commit c87a112246e0bcbd5c3a8aa484a50c617d710dbf +Author: Philip Withnall +Date: Fri Dec 12 17:31:01 2014 +0000 + + tests: Eliminate ISO 8601 formatting workaround for dates + + Follow up to commit + 732017e4e5235e28c578cc3367fa0c4548b65495732017e4e5235e28c578cc3367fa0c4548b65495. + + https://bugzilla.gnome.org/show_bug.cgi?id=739956 + +M gdata/tests/calendar.c +M gdata/tests/general.c +M gdata/tests/tasks.c +M gdata/tests/youtube.c + +commit 9e854ae61e898083a1792b13b6359d375b8fa0ef +Author: Yaşar Şentürk +Date: Thu Dec 4 21:26:38 2014 +0000 + + Updated Turkish translation + +M po/tr.po + +commit 08f31ef1d7e92671dc13a3c8494f9e3ae20e9b90 +Author: Philip Withnall +Date: Sun Nov 9 22:16:03 2014 +0000 + + tests: Temporarily disable some Contacts test assertions + + Seems these elements broke on the server at some point. + + https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3662 + +M gdata/tests/contacts.c + +commit b706cf271ba634b721e51a814e950bcfd620c139 +Author: Philip Withnall +Date: Sun Nov 9 22:04:45 2014 +0000 + + tests: Update Contacts test traces for ISO 8601 date changes + + https://bugzilla.gnome.org/show_bug.cgi?id=737799 + +M gdata/tests/contacts.c +M gdata/tests/traces/contacts/authentication +M gdata/tests/traces/contacts/batch +M gdata/tests/traces/contacts/batch-async +M gdata/tests/traces/contacts/contact-insert +M gdata/tests/traces/contacts/contact-update +M gdata/tests/traces/contacts/global-authentication +M gdata/tests/traces/contacts/group-insert +M gdata/tests/traces/contacts/group_insert-async +M gdata/tests/traces/contacts/group_insert-async-cancellation +M gdata/tests/traces/contacts/photo-add +M gdata/tests/traces/contacts/photo-delete +M gdata/tests/traces/contacts/photo-get +M gdata/tests/traces/contacts/photo_add-async +M gdata/tests/traces/contacts/photo_add-async-cancellation +M gdata/tests/traces/contacts/photo_delete-async +M gdata/tests/traces/contacts/photo_get-async +M gdata/tests/traces/contacts/photo_get-async-cancellation +M gdata/tests/traces/contacts/query-all-contacts +M +gdata/tests/traces/contacts/query-all-contacts-async-progress-closure +M gdata/tests/traces/contacts/query-all-groups +M +gdata/tests/traces/contacts/query-all-groups-async-progress-closure +M gdata/tests/traces/contacts/query_all_contacts-async +M gdata/tests/traces/contacts/query_all_contacts-async-cancellation +M gdata/tests/traces/contacts/query_all_groups-async +M gdata/tests/traces/contacts/query_all_groups-async-cancellation +M gdata/tests/traces/contacts/setup-batch-async +M gdata/tests/traces/contacts/setup-query-all-contacts +M gdata/tests/traces/contacts/setup-query-all-groups +M gdata/tests/traces/contacts/setup-temp-contact +M gdata/tests/traces/contacts/setup-temp-contact-with-photo +M gdata/tests/traces/contacts/teardown-batch-async +M gdata/tests/traces/contacts/teardown-insert +M gdata/tests/traces/contacts/teardown-insert-group +M gdata/tests/traces/contacts/teardown-query-all-contacts +M gdata/tests/traces/contacts/teardown-query-all-groups +M gdata/tests/traces/contacts/teardown-temp-contact + +commit 127a6efb183fdffaab94a2b06cc22a1387b2dcbf +Author: Philip Withnall +Date: Sat Nov 8 23:34:32 2014 +0000 + + tests: Remove pointless async authorizer tests from contacts.c + + The authorisers are tested separately, and don’t need to be + re-tested in + each unit test suite. + +M gdata/tests/contacts.c + +commit 732017e4e5235e28c578cc3367fa0c4548b65495 +Author: Philip Withnall +Date: Sat Nov 8 23:33:28 2014 +0000 + + core: Eliminate ISO 8601 formatting workaround for dates + + Google have fixed the issue upstream, so the workaround is no longer + needed. Thanks Google! + + https://bugzilla.gnome.org/show_bug.cgi?id=737799 + https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3595 + +M gdata/gdata-parser.c + +commit 730dfd4f728ca33d5dee20216562a45b644ae952 +Author: Kalev Lember +Date: Thu Oct 30 11:31:36 2014 +0100 + + Add --disable-tests to skip the building of tests + + https://bugzilla.gnome.org/show_bug.cgi?id=739395 + +M Makefile.am +M configure.ac + +commit 30cf8a58e0f7f6520112c45b7d2877bdecbd6bc1 +Author: Philip Withnall +Date: Mon Nov 3 00:13:51 2014 +0000 + + core: Mark all API as stable and impose API and ABI stability + guarantees + + It’s time for libgdata to grow up and start guaranteeing some + stability + for its users. In this vein, it’s already been API stable for + around 3 + years (since 0.9.1) — it’s about time that was made explicit. + + http://upstream-tracker.org/versions/libgdata.html is quite + interesting. + +M HACKING +M README +M gdata/app/gdata-app-categories.c +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/exif/gdata-exif-tags.c +M gdata/gcontact/gdata-gcontact-calendar.c +M gdata/gcontact/gdata-gcontact-event.c +M gdata/gcontact/gdata-gcontact-external-id.c +M gdata/gcontact/gdata-gcontact-jot.c +M gdata/gcontact/gdata-gcontact-language.c +M gdata/gcontact/gdata-gcontact-relation.c +M gdata/gcontact/gdata-gcontact-website.c +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-feed-link.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/gdata-access-handler.c +M gdata/gdata-access-rule.c +M gdata/gdata-authorization-domain.c +M gdata/gdata-authorizer.c +M gdata/gdata-batch-feed.c +M gdata/gdata-batch-operation.c +M gdata/gdata-batchable.c +M gdata/gdata-buffer.c +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-comment.c +M gdata/gdata-commentable.c +M gdata/gdata-comparable.c +M gdata/gdata-download-stream.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-goa-authorizer.c +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-oauth2-authorizer.c +M gdata/gdata-parsable.c +M gdata/gdata-query.c +M gdata/gdata-service.c +M gdata/gdata-types.c +M gdata/gdata-upload-stream.c +M gdata/georss/gdata-georss-where.c +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-group.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-drawing.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-feed.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-pdf.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/services/documents/gdata-documents-upload-query.c +M gdata/services/freebase/gdata-freebase-query.c +M gdata/services/freebase/gdata-freebase-result.c +M gdata/services/freebase/gdata-freebase-search-query.c +M gdata/services/freebase/gdata-freebase-search-result.c +M gdata/services/freebase/gdata-freebase-service.c +M gdata/services/freebase/gdata-freebase-topic-query.c +M gdata/services/freebase/gdata-freebase-topic-result.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-comment.c +M gdata/services/picasaweb/gdata-picasaweb-feed.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/tasks/gdata-tasks-query.c +M gdata/services/tasks/gdata-tasks-service.c +M gdata/services/tasks/gdata-tasks-task.c +M gdata/services/tasks/gdata-tasks-tasklist.c +M gdata/services/youtube/gdata-youtube-category.c +M gdata/services/youtube/gdata-youtube-comment.c +M gdata/services/youtube/gdata-youtube-content.c +M gdata/services/youtube/gdata-youtube-control.c +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/gdata-dummy-authorizer.c + +commit 8a695555b68671a765f95603dd054046df3e8a5d +Author: Philip Withnall +Date: Mon Nov 3 00:02:00 2014 +0000 + + core: Add padding members to class structures + + This gives us flexibility for soft ABI breaks in future if needed, + after + we lock down the ABI entirely. + +M gdata/app/gdata-app-categories.h +M gdata/atom/gdata-author.h +M gdata/atom/gdata-category.h +M gdata/atom/gdata-generator.h +M gdata/atom/gdata-link.h +M gdata/exif/gdata-exif-tags.h +M gdata/gcontact/gdata-gcontact-calendar.h +M gdata/gcontact/gdata-gcontact-event.h +M gdata/gcontact/gdata-gcontact-external-id.h +M gdata/gcontact/gdata-gcontact-jot.h +M gdata/gcontact/gdata-gcontact-language.h +M gdata/gcontact/gdata-gcontact-relation.h +M gdata/gcontact/gdata-gcontact-website.h +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-feed-link.h +M gdata/gd/gdata-gd-im-address.h +M gdata/gd/gdata-gd-name.h +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-phone-number.h +M gdata/gd/gdata-gd-postal-address.h +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.h +M gdata/gd/gdata-gd-where.h +M gdata/gd/gdata-gd-who.h +M gdata/gdata-access-handler.h +M gdata/gdata-access-rule.h +M gdata/gdata-authorization-domain.h +M gdata/gdata-batch-feed.h +M gdata/gdata-batch-operation.h +M gdata/gdata-client-login-authorizer.h +M gdata/gdata-comment.h +M gdata/gdata-download-stream.h +M gdata/gdata-entry.h +M gdata/gdata-feed.h +M gdata/gdata-goa-authorizer.h +M gdata/gdata-oauth1-authorizer.h +M gdata/gdata-oauth2-authorizer.h +M gdata/gdata-parsable.h +M gdata/gdata-query.h +M gdata/gdata-service.h +M gdata/gdata-upload-stream.h +M gdata/georss/gdata-georss-where.h +M gdata/media/gdata-media-category.h +M gdata/media/gdata-media-content.h +M gdata/media/gdata-media-credit.h +M gdata/media/gdata-media-group.h +M gdata/media/gdata-media-thumbnail.h +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/calendar/gdata-calendar-feed.h +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-group.h +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/contacts/gdata-contacts-service.h +M gdata/services/documents/gdata-documents-document.h +M gdata/services/documents/gdata-documents-drawing.h +M gdata/services/documents/gdata-documents-entry.h +M gdata/services/documents/gdata-documents-feed.h +M gdata/services/documents/gdata-documents-folder.h +M gdata/services/documents/gdata-documents-pdf.h +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-query.h +M gdata/services/documents/gdata-documents-service.h +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.h +M gdata/services/documents/gdata-documents-upload-query.h +M gdata/services/freebase/gdata-freebase-query.h +M gdata/services/freebase/gdata-freebase-result.h +M gdata/services/freebase/gdata-freebase-search-query.h +M gdata/services/freebase/gdata-freebase-search-result.h +M gdata/services/freebase/gdata-freebase-service.h +M gdata/services/freebase/gdata-freebase-topic-query.h +M gdata/services/freebase/gdata-freebase-topic-result.h +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-comment.h +M gdata/services/picasaweb/gdata-picasaweb-feed.h +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/picasaweb/gdata-picasaweb-query.h +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/services/picasaweb/gdata-picasaweb-user.h +M gdata/services/tasks/gdata-tasks-query.h +M gdata/services/tasks/gdata-tasks-service.h +M gdata/services/tasks/gdata-tasks-task.h +M gdata/services/tasks/gdata-tasks-tasklist.h +M gdata/services/youtube/gdata-youtube-category.h +M gdata/services/youtube/gdata-youtube-comment.h +M gdata/services/youtube/gdata-youtube-content.h +M gdata/services/youtube/gdata-youtube-control.h +M gdata/services/youtube/gdata-youtube-credit.h +M gdata/services/youtube/gdata-youtube-group.h +M gdata/services/youtube/gdata-youtube-query.h +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-state.h +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/gdata-dummy-authorizer.h + +commit b947511b2027b89bd5104473ffd0c720e784c6b1 +Author: Philip Withnall +Date: Sat Nov 1 14:27:59 2014 +0000 + + tests: Remove unnecessary non-NULL test + + It was confusing Coverity. + + Coverity issue: #74584 + +M gdata/tests/common.c + +commit 7d7fc35aba9d825f2fa87d3d018e318e176fcb26 +Author: Philip Withnall +Date: Fri Oct 17 10:15:22 2014 +0100 + + docs: Fix a typo in the README + +M README + +commit 8d76c05951e2acb1cd440bc6f6bbb215b191b8fd +Author: Bernd Homuth +Date: Tue Sep 23 21:41:43 2014 +0000 + + Updated German translation + +M po/de.po + +commit 5d6f40293c1127a3879d32bd7eef4b518cb797e7 +Author: Philip Withnall +Date: Wed Sep 17 23:52:48 2014 +0100 + + tests: Add networked tests for the Google Tasks service + + This brings test coverage of the gdata/services/tasks/ directory up to + 84% of lines and 90% of functions, which is good enough. + + https://bugzilla.gnome.org/show_bug.cgi?id=657539 + +M gdata/tests/Makefile.am +M gdata/tests/tasks.c +M gdata/tests/traces/tasks/authentication +M gdata/tests/traces/tasks/global-authentication +A gdata/tests/traces/tasks/setup-delete-task +A gdata/tests/traces/tasks/setup-delete-tasklist +A gdata/tests/traces/tasks/setup-insert-task +A gdata/tests/traces/tasks/setup-list-task +A gdata/tests/traces/tasks/setup-list-tasklist +A gdata/tests/traces/tasks/setup-update-task +A gdata/tests/traces/tasks/setup-update-tasklist +A gdata/tests/traces/tasks/task-delete +A gdata/tests/traces/tasks/task-insert +A gdata/tests/traces/tasks/task-list +A gdata/tests/traces/tasks/task-update +A gdata/tests/traces/tasks/tasklist-delete +M gdata/tests/traces/tasks/tasklist-insert +A gdata/tests/traces/tasks/tasklist-insert-unauthorised +A gdata/tests/traces/tasks/tasklist-list +A gdata/tests/traces/tasks/tasklist-update +A gdata/tests/traces/tasks/teardown-delete-task +A gdata/tests/traces/tasks/teardown-insert-task +A gdata/tests/traces/tasks/teardown-insert-tasklist +A gdata/tests/traces/tasks/teardown-list-task +A gdata/tests/traces/tasks/teardown-list-tasklist +A gdata/tests/traces/tasks/teardown-update-task +A gdata/tests/traces/tasks/teardown-update-tasklist + +commit 730c2de9ba7d9cdd1903ffe3387e9bfe6508a53b +Author: Philip Withnall +Date: Sun Sep 21 17:30:36 2014 +0100 + + tasks: Add preconditions for tasklist IDs being set when inserting + tasks + + Can’t insert a task to a non-tasklist. + +M gdata/services/tasks/gdata-tasks-service.c + +commit 181a74e0110d42dfb0d88ec98d29a6287ceda85b +Author: Philip Withnall +Date: Sun Sep 21 17:30:06 2014 +0100 + + tasks: Handle an additional form of AUTHENTICATION_REQUIRED error + + Apparently there are two ‘reason’ codes which correspond to this. + +M gdata/services/tasks/gdata-tasks-service.c + +commit 14cc74587533428d6bf26cdbaa35601d16d721ee +Author: Philip Withnall +Date: Sun Sep 21 17:29:08 2014 +0100 + + core: Don’t unset refresh token on refreshing OAuth 2.0 + authorisation + + When refreshing an OAuth 2.0 authorisation, only a new access token is + returned by the server — the refresh token is left unchanged, + so a new + one is not returned. Do not use that as an excuse to forget the + existing + refresh token. + +M gdata/gdata-oauth2-authorizer.c + +commit fe5a38c0b1d507bae84e41fa5014e91632f0fc25 +Author: Philip Withnall +Date: Sun Sep 21 17:28:43 2014 +0100 + + core: Handle ‘etag’ and ‘kind’ members in JSON feeds + + Set the GDataFeed:etag property and ignore the kind. + +M gdata/gdata-feed.c + +commit 0012f8bdb7bbd006e3ef9ec47604289840135836 +Author: A S Alam +Date: Sun Sep 21 08:43:00 2014 -0500 + + update Punjabi Translation for 3.14 release + +M po/pa.po + +commit 11d59f1370e20ee6e634b7edae586f444a575323 +Author: Piotr Drąg +Date: Sun Sep 21 15:23:44 2014 +0200 + + Updated POTFILES.in + +M po/POTFILES.in + +commit 98302f56a7888a05b1a9102fccecff1bd9d07f14 +Author: Philip Withnall +Date: Sun Sep 21 14:02:52 2014 +0100 + + build: Increment version to 0.17.0 + +M configure.ac + +commit 805e6c94cf1792ca912ec1f280d355f06702840e +Author: Philip Withnall +Date: Sun Sep 21 13:49:18 2014 +0100 + + tests: Call setlocale() on startup + + So that the correct character encoding is set for all tests. + +M gdata/tests/common.c + +commit c54b759085dfeb5f59aea7d1ac620620958ac29e +Author: Philip Withnall +Date: Sun Jul 3 21:37:49 2011 +0100 + + core: Add a GDataOAuth2Authorizer for OAuth 2.0 support + + This adds a new GDataAuthorizer subclass to support OAuth 2.0 + authorisation, which is needed for the Google Tasks unit tests. + + This includes support for all Google OAuth 2.0 features (note that + Google’s implementation of OAuth 2.0 is not entirely standard, + so this + OAuth 2.0 authoriser cannot be used outside of Google’s + services). It + includes full unit tests too. + + New API: + • GDATA_OAUTH2_REDIRECT_URI_OOB + • GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO + • GDataOAuth2Authorizer + + https://bugzilla.gnome.org/show_bug.cgi?id=646285 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-authorizer.c +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-oauth1-authorizer.c +A gdata/gdata-oauth2-authorizer.c +A gdata/gdata-oauth2-authorizer.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/tests/Makefile.am +A gdata/tests/oauth2-authorizer.c +A +gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-refresh-authorization-authorized +A +gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-refresh-authorization-unauthorized +A +gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async +A +gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async-bad-credentials +A +gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async-cancellation +A +gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync +A +gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync-bad-credentials +A +gdata/tests/traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync-cancellation +A +gdata/tests/traces/oauth2-authorizer/setup-oauth2-authorizer-data-authenticated + +commit f5b3aafe80686894a1a7dc2c9fc9e12631ffd839 +Author: Iris Gou +Date: Sun Sep 21 10:04:48 2014 +0800 + + update zh_CN translation + +M po/zh_CN.po + +commit 17d8f81efd544f3d0de1f8a92e73be96153d3cd5 +Author: Iris Gou +Date: Sun Sep 21 10:04:05 2014 +0800 + + update zh_CN translation + +M po/zh_CN.po + +commit 148b1d01807a870cfdc56327e2231ea21c705d76 +Author: Ask H. Larsen +Date: Sat Sep 20 17:21:43 2014 +0200 + + Updated Danish translation + +M po/da.po + +commit 1caeb0edff9c4b03dfa98fb8579ffc77fb149678 +Author: Mattias Eriksson +Date: Thu Sep 18 20:12:34 2014 +0000 + + Updated Swedish translation + +M po/sv.po + +commit 5c3b3fdb930485a0f20b4467e7d88661e0e398dc +Author: Philip Withnall +Date: Thu Sep 18 01:03:25 2014 +0100 + + build: Increment version to 0.16.1 + +M configure.ac + +commit d400e22c0f717434b7d5e80c9007b887a5761b18 +Author: Philip Withnall +Date: Thu Sep 18 01:02:15 2014 +0100 + + Release version 0.16.0 + +M NEWS +M configure.ac +M docs/reference/gdata-docs.xml +M gdata/gdata-access-rule.c +M gdata/gdata-service.h +M gdata/services/tasks/gdata-tasks-task.h +M gdata/tests/gdata-dummy-authorizer.c +M gdata/tests/gdata-dummy-authorizer.h + +commit b085a95596537409df2510aab72cb033c50ae253 +Author: Philip Withnall +Date: Wed Sep 17 23:44:38 2014 +0100 + + tasks: Output the ‘hidden’ property in generated JSON + + It’s read-only, but that hasn’t stopped us outputting all + the other + read-only properties. This can be reverted if real life testing proves + it’s a problem. + +M gdata/services/tasks/gdata-tasks-task.c + +commit c1fdff59c73dfa0f1883d8f108d4923b6becf246 +Author: Philip Withnall +Date: Wed Sep 17 23:44:21 2014 +0100 + + tasks: Simplify some code + + This introduces no functional changes. + +M gdata/services/tasks/gdata-tasks-task.c + +commit a7346660e2b60f338fe225bc12ad1addbc19912c +Author: Philip Withnall +Date: Wed Sep 17 23:01:04 2014 +0100 + + core: Fix various minor mutex abuses + + GLib has recently got stricter about abusing mutexes, and now + no longer + allows: + • Clearing a locked mutex. + • Unlocking a non-locked mutex. + Both of which libgdata was doing, and now does no longer. + +M gdata/gdata-service.c +M gdata/gdata-upload-stream.c + +commit d5938f7c4c778ec42f1d0dd9af96dbb0065be1c7 +Author: Philip Withnall +Date: Wed Sep 17 22:59:06 2014 +0100 + + tests: Add support for the new SoupServer API + + This increments the maximum libsoup dependency to ≤ 2.47.3, but + does not + increment the minimum dependency. + +M configure.ac +M gdata/tests/streams.c + +commit 65745626ffc893a06d2d27c562effed4b683002b +Author: Philip Withnall +Date: Sun Aug 31 00:59:12 2014 +0100 + + tests: Add unit tests for the Google Tasks service + + These are non-interactive and non-network tests, since I don’t + currently + have time to get networked tests working for Google Tasks — + they require + OAuth 2 support to land first (bug #646285). + + By themselves, these non-network tests give 64% line coverage and 74% + function coverage of gdata/services/tasks/. + +M gdata/tests/Makefile.am +A gdata/tests/tasks.c +A gdata/tests/traces/tasks/authentication +A gdata/tests/traces/tasks/global-authentication +A gdata/tests/traces/tasks/tasklist-insert + +commit dfd4735d645bdf9d64718f7c72c68ad683bb96a3 +Author: Philip Withnall +Date: Sun Aug 31 01:02:56 2014 +0100 + + tasks: Add a custom error parser + + The errors returned by the Google Tasks API are a simple JSON format + which allows for multiple error messages to be included. It appears to + be undocumented anywhere, so has been reverse engineered from examples + returned by the server. + +M gdata/services/tasks/gdata-tasks-service.c + +commit ef593215455ad8d4766ff8aef61b230c58a3c3d3 +Author: Philip Withnall +Date: Sun Aug 31 01:01:57 2014 +0100 + + core: Add an error code in GDataServiceError for exceeding the + API quota + + This adds API: + • GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED + +M gdata/gdata-service.h + +commit 574b54eb1cf9748ea58323037d68d2c0497da1eb +Author: Philip Withnall +Date: Sun Aug 31 01:01:09 2014 +0100 + + docs: Remove unnecessary clean rules from documentation Makefile.am + + These are now correctly included in gtk-doc.make. + +M docs/reference/Makefile.am + +commit 31c69604484a0c1a0e9913c2db760c2f63b72883 +Author: Philip Withnall +Date: Sun Aug 31 00:13:59 2014 +0100 + + tests: Add a dummy GDataAuthorizer implementation + + This will come in useful when testing services which don’t support + ClientLogin authorisation, such as Google Tasks. Such services require + OAuth authorisation, which requires user interaction. That puts up + a big + barrier to running the unit tests frequently, and Google seem + to provide + no ‘playground’ API key which could be used to bypass this + requirement + for testing purposes. + + The idea is that traces are recorded for tests using an OAuth + authoriser (requiring user interaction), then the dummy authoriser is + substituted when the tests are run offline against the pre-recorded + traces. This will require custom message matching in uhttpmock + to ignore + the Authorization header, which will differ between the OAuth + and dummy + authorisers. + +M docs/reference/Makefile.am +M gdata/tests/Makefile.am +A gdata/tests/gdata-dummy-authorizer.c +A gdata/tests/gdata-dummy-authorizer.h + +commit 760ca0235f7b0e6413cd31cb371f5e3e83a8c490 +Author: Philip Withnall +Date: Sun Aug 31 00:10:07 2014 +0100 + + tasks: Improve documentation for GDataTasksTask properties + + Better document the format of datetime-typed properties — they + are the + number of seconds since the UNIX epoch. + +M gdata/services/tasks/gdata-tasks-task.c + +commit d10a15b0d5016d027bb7613218d64b81b2b5c724 +Author: Philip Withnall +Date: Sun Aug 31 00:09:38 2014 +0100 + + tasks: Fix a property definition on GDataTasksTask + + This one was certainly never tested. + +M gdata/services/tasks/gdata-tasks-task.c + +commit eaaaddb30e93e528c1acfd741e2f08c3d3e619d9 +Author: Philip Withnall +Date: Sun Aug 31 00:08:26 2014 +0100 + + tasks: Add missing kind_terms to GDataEntry subclasses + + This is necessary to ensure the ‘kind’ JSON property appears in + generated output. I’m not sure how the service could have functioned + without these missing, unless Google is validating tasks very + relaxedly. + +M gdata/services/tasks/gdata-tasks-task.c +M gdata/services/tasks/gdata-tasks-tasklist.c + +commit 674d85182bf2c855122c21a06b3977a399eeeb11 +Author: Philip Withnall +Date: Sun Aug 31 00:07:53 2014 +0100 + + tasks: Document missing features of GDataTasksTask + + Currently it doesn’t support links associated with a task. + +M gdata/services/tasks/gdata-tasks-task.c + +commit 7b34e0a1fe2bf717129b25ea418bcb5f590ecc36 +Author: Philip Withnall +Date: Sun Aug 31 00:07:16 2014 +0100 + + tasks: Invalid GDataTasksQuery:etag on property changes + + Since the ETag no longer represents the query. + +M gdata/services/tasks/gdata-tasks-query.c + +commit c83a01a0eb222999574e2344c702e1a36dc1cb5a +Author: Philip Withnall +Date: Sun Aug 31 00:06:02 2014 +0100 + + tasks: Deprecate the ‘q’ parameter of gdata_tasks_query_new() + + It was never a valid parameter, and we really should have caught this + before the API was finalised. Deprecate the parameter and document + that + it should only ever have NULL passed to it. Don’t use the parameter + internally. + + This is necessary because Google don’t support the ‘q’ + parameter for + Tasks queries — there is no way to search within task titles + or notes. + +M gdata/services/tasks/gdata-tasks-query.c + +commit 28a4fada8a3077ab5ea3062c1d59b48971a51283 +Author: Philip Withnall +Date: Sun Aug 31 00:05:47 2014 +0100 + + tasks: Remove unused members from GDataTasksQuery + +M gdata/services/tasks/gdata-tasks-query.c + +commit 4b96f5b68c0bc70bf7b0d76fc3c36ff9f9dbe5fd +Author: Philip Withnall +Date: Sun Aug 31 00:04:28 2014 +0100 + + tasks: Add helper constants for GDataTasksTask:status + + So the user doesn’t need to keep typing out the well-known + strings which + form the accepted values of GDataTasksTask:status. + + This adds new API: + • GDATA_TASKS_STATUS_NEEDS_ACTION + • GDATA_TASKS_STATUS_COMPLETED + +M docs/reference/gdata-sections.txt +M gdata/services/tasks/gdata-tasks-task.c +M gdata/services/tasks/gdata-tasks-task.h + +commit af3498df1429182b85bec3e5cbfaeae8acebfe35 +Author: Philip Withnall +Date: Sat Aug 30 23:30:11 2014 +0100 + + tests: Tighten error checking on UHM trace setup + + If the trace file didn’t exist, we weren’t catching the error, and + things were failing further down the line. + +M gdata/tests/common.c + +commit 5e9c4ff3adc83bb21ac7a7436dcb0637b3662342 +Author: Philip Withnall +Date: Sat Aug 30 23:29:18 2014 +0100 + + tests: Split OAuth helper function out of oauth1-authorizer tests + + Move it to the common test library, as it will be useful in future for + testing services which require OAuth authentication (such as Google + Tasks). + +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/oauth1-authorizer.c + +commit ff6c831378848cce5622cea8fb1236154e83f9d2 +Author: Philip Withnall +Date: Sat Aug 30 23:28:17 2014 +0100 + + tasks: Add a missing symbol to gdata.symbols + +M gdata/gdata.symbols + +commit e7cfb96f471f133d57a09dbba9c747db3be52f1a +Author: Philip Withnall +Date: Sat Aug 30 23:04:04 2014 +0100 + + build: Split common test code into a libtool convenience library + + Instead of compiling the common code files into each test binary. + +M gdata/tests/Makefile.am + +commit 240c44f484c3bd6b5d887f3628ecbb2e52fe1749 +Author: Philip Withnall +Date: Sat Aug 30 22:53:26 2014 +0100 + + build: Tidy up whitespace in tests Makefile.am + + It was offending my sensibilities, which have apparently moved + on since + I originally wrote that file. + +M gdata/tests/Makefile.am + +commit 6bf1f79e2032b406fde5fe14634ddc1908bd6f20 +Author: Matej Urbančič +Date: Sun Sep 14 21:22:46 2014 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit 192768e1a47b7e96cc7ce6c41e003e3aa88c6f38 +Author: Balázs Úr +Date: Thu Sep 11 15:56:45 2014 +0000 + + Updated Hungarian translation + +M po/hu.po + +commit 3ef0de48702176d58cc11be7014b383b98b47138 +Author: Yuri Myasoedov +Date: Sun Sep 7 19:17:12 2014 +0400 + + Updated Russian translation + +M po/ru.po + +commit c06c478f9468b117c69dfb84baab65b2d40986cb +Author: Rūdolfs Mazurs +Date: Sun Sep 7 17:59:35 2014 +0300 + + Updated Latvian translation + +M po/lv.po + +commit aa92cf8c2901cc3254cd7ceae7f9e5bfa1394303 +Author: Claudio Arseni +Date: Sun Sep 7 14:54:44 2014 +0000 + + Updated Italian translation + +M po/it.po + +commit 2ad6b1bc61271ea02481689eaab5ac6e35509d2c +Author: Kjartan Maraas +Date: Sat Sep 6 14:05:27 2014 +0200 + + Updated Norwegian bokmål translation. + +M po/nb.po + +commit f1e7dc4bf313c780bedbe6c86ba2237d529a6669 +Author: Changwoo Ryu +Date: Sat Sep 6 18:28:12 2014 +0900 + + Updated Korean translation + +M po/ko.po + +commit 1c3906cbf3345fd4019a6b40e3e6cb322d6fb6fa +Author: Andika Triwidada +Date: Thu Sep 4 04:31:41 2014 +0000 + + Updated Indonesian translation + +M po/id.po + +commit fe810dcec28d1735b2d471f390d1f00ea52611d7 +Author: Claude Paroz +Date: Tue Sep 2 22:55:16 2014 +0200 + + Updated French translation + +M po/fr.po + +commit bda850e5f996e265ff09b4455cc4ec561594e60d +Author: Sweta Kothari +Date: Tue Sep 2 15:18:36 2014 +0530 + + Updated gujarati translations + +M po/gu.po + +commit b450fb03cc05e66b6cd9404f17c41b3aefd7902b +Author: Chao-Hsiung Liao +Date: Sat Aug 30 18:42:39 2014 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit ea2a9f8f241a6f9baf42f799c7f969b040cdc88f +Author: Yosef Or Boczko +Date: Fri Aug 29 02:15:40 2014 +0300 + + Updated Hebrew translation + +M po/he.po + +commit 1cf06c454f6a525e5282c23f3a31bc8e0d80a4bc +Author: Philip Withnall +Date: Sun Aug 24 17:17:43 2014 +0100 + + build: Update git.mk from upstream + +M git.mk + +commit 6e89b033b33fcc8e8316e58f0ee28f3809ca9667 +Author: Philip Withnall +Date: Sun Aug 24 17:14:32 2014 +0100 + + core: Add gzip encoding support + + libsoup already transparently supported gzip encoding of data from the + server, using SoupContentDecoder, which is present by default in a + SoupSession. We were correctly sending the Accept-Encoding header, but + Google also require that the string ‘gzip’ be present in the + User-Agent + header to enable gzip support. + + Add a User-Agent header which supports this. + + https://bugzilla.gnome.org/show_bug.cgi?id=666623 + +M gdata/gdata-service.c + +commit c55465b20f4f3560198894a61b0613b1b72cf4de +Author: Philip Withnall +Date: Sun Aug 24 16:47:51 2014 +0100 + + tests: Remove debug log storage system + + automake's parallel-tests feature now automatically separates + and stores + logs, and only prints them out on test failure. This is exactly + what the + logging code in the tests was doing before, so the logging code + can now + be simplified. + + https://bugzilla.gnome.org/show_bug.cgi?id=703192 + +M gdata/tests/common.c +M gdata/tests/common.h + +commit 8442be8e40bbfa1b4e46e9bd2c9ed6d1bc6256d4 +Author: Philip Withnall +Date: Sun Aug 24 16:19:16 2014 +0100 + + build: Enable automake parallel-tests + + This should speed up the test runs somewhat, as well as improving log + output handling. + + https://bugzilla.gnome.org/show_bug.cgi?id=703192 + +M configure.ac +M gdata/tests/Makefile.am + +commit f817fdaff889764125c5f073be4fd433c5c33b14 +Author: Philip Withnall +Date: Sun Aug 24 16:05:42 2014 +0100 + + core: Add support for ACL entries with keys + + This adds support for elements, allowing for + authorisation keys in ACLs, e.g. for Google Documents. + + This adds the following API: + • GDataAccessRule:key + • gdata_access_rule_get_key() + and appropriate tests. + + https://bugzilla.gnome.org/show_bug.cgi?id=690628 + +M docs/reference/gdata-sections.txt +M gdata/gdata-access-rule.c +M gdata/gdata-access-rule.h +M gdata/gdata.symbols +M gdata/tests/general.c + +commit 3a2ac16abda66aa8af22181f72fe912a32981f4f +Author: Marek Černocký +Date: Fri Aug 22 07:50:33 2014 +0200 + + Updated Czech translation + +M po/cs.po + +commit 08bd2109c6c99975ca8c7900aace75d0a1df25c0 +Author: ngoswami +Date: Tue Aug 19 17:04:04 2014 +0000 + + Updated Assamese translation + +M po/as.po + +commit f0797bb178911134f5d26f795b75edc906117aa7 +Author: Philip Withnall +Date: Tue Aug 19 00:08:49 2014 +0100 + + contacts: Allow and ignore empty e-mail addresses + + Empty e-mail addresses () are apparently allowed + by convention in the XML. Previously, we treated the empty address + attribute as an error. Instead, we should ignore the entire element, + treating it as non-existent. + + https://bugzilla.gnome.org/show_bug.cgi?id=734863 + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/tests/contacts.c + +commit c8aae3ecc1440bb8b2aec1212f5ccee2d9d917b7 +Author: Carles Ferrando +Date: Sun Aug 17 13:34:07 2014 +0200 + + [l10n] Updated Catalan (Valencian) translation + +M po/ca@valencia.po + +commit 8c315a5323137646f42b35f539dfedd001eb66c5 +Author: Gil Forcada +Date: Sun Aug 17 13:34:04 2014 +0200 + + [l10n] Updated Catalan translation + +M po/ca.po + +commit 45459fba6f808340d7b509c51fadf32438e5c58a +Author: Philip Withnall +Date: Sat Aug 9 21:14:47 2014 +0100 + + core: Remove outdated gdata_parser_int64_to_json_iso8601() + + gdata_parser_int64_to_iso8601() now does exactly the same. + + https://bugzilla.gnome.org/show_bug.cgi?id=732809 + +M gdata/gdata-entry.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/services/freebase/gdata-freebase-search-query.c +M gdata/services/tasks/gdata-tasks-task.c + +commit 18c16bfc9e517d44bf84449e58cc5b10bde07f09 +Author: Philip Withnall +Date: Sat Aug 9 21:10:03 2014 +0100 + + core: Tweak generated ISO8601 dates to appease Google’s parsers + + Even though the protocol documentation claims to accept RFC3339 dates, + the servers have recently started rejecting dates formatted as + ‘2014-08-09T21:10:05Z’ which don’t include microseconds and + specify the + timezone non-numerically. + + Since the issue hasn’t been resolved at Google’s end, we need + to hack + the date formats generated by libgdata to appease the servers, + completely undermining the point of having a defined protocol and + RFC to + base the code on. Sigh. + + Change gdata_parser_int64_to_iso8601() to produce dates in the format + ‘YYYY-MM-DDTHH:MM:SS.000001+00:00’. This was previously used by + the JSON + output generator, so perhaps the server breakage was introduced when + Google started rolling out the JSON APIs. + + https://bugzilla.gnome.org/show_bug.cgi?id=732809 + +M gdata/gdata-parser.c +M gdata/tests/calendar.c +M gdata/tests/general.c +M gdata/tests/youtube.c + +commit 30546923f89ce2b95cb6f6e97bf59317e5f69fda +Author: Philip Withnall +Date: Sat Aug 9 18:42:01 2014 +0100 + + build: Increment version to 0.15.3 + +M configure.ac + +commit 08ebb3e5804b29e18a67872eb071fd50e7fcc4b3 +Author: Philip Withnall +Date: Sat Aug 9 18:41:03 2014 +0100 + + Release version 0.15.2 + +M NEWS +M configure.ac + +commit 64532922a8096bd4eed8c83242e8d87c30423c4f +Author: Philip Withnall +Date: Sat Aug 9 18:32:37 2014 +0100 + + docs: Add the 0.15.1 APIs to the documentation + +M docs/reference/gdata-docs.xml + +commit 7e7038ff82661563e27fe42c9a59949a4c43c407 +Author: Philip Withnall +Date: Sat Aug 9 18:23:01 2014 +0100 + + core: Fix API documentation ‘Since’ versions + +M gdata/atom/gdata-link.h + +commit 5caad77e43f26f88efaa85496581e20b2dcae215 +Author: Philip Withnall +Date: Sat Aug 9 18:22:43 2014 +0100 + + freebase: Fix API documentation ‘Since’ versions + +M gdata/services/freebase/gdata-freebase-query.c +M gdata/services/freebase/gdata-freebase-query.h +M gdata/services/freebase/gdata-freebase-result.c +M gdata/services/freebase/gdata-freebase-result.h +M gdata/services/freebase/gdata-freebase-search-query.c +M gdata/services/freebase/gdata-freebase-search-query.h +M gdata/services/freebase/gdata-freebase-search-result.c +M gdata/services/freebase/gdata-freebase-search-result.h +M gdata/services/freebase/gdata-freebase-service.c +M gdata/services/freebase/gdata-freebase-service.h +M gdata/services/freebase/gdata-freebase-topic-query.c +M gdata/services/freebase/gdata-freebase-topic-query.h +M gdata/services/freebase/gdata-freebase-topic-result.c +M gdata/services/freebase/gdata-freebase-topic-result.h + +commit 05ea0cd77b35ea8313b3e79a60c406f80c57425e +Author: Philip Withnall +Date: Sat Aug 9 18:12:51 2014 +0100 + + build: Remove outdated documentation checks + + These are now performed by gtk-doc. Yay! + +M docs/reference/Makefile.am + +commit 3809b38e6651ab6b533feea9cff0b95a0ccede95 +Author: Philip Withnall +Date: Sat Aug 9 17:51:42 2014 +0100 + + core: Fix a data corruption bug in GDataBuffer + + In some situations, the buffer was reading off the end of a chunk and + into undefined memory. Spotted by asan. + + e.g. Take a GDataBuffer with two chunks: + • Chunk 1, length 8192 + • Chunk 2, length 699 + and with head_read_offset = 8187 from a previous read. There are thus + 704 bytes unread in the buffer. + + If a read of 8192 bytes is performed, 5 bytes should come from chunk 1 + and the remaining 699 from chunk 2. length_remaining was being + (correctly) set to 704, but then the while loop was not being entered, + as 704 is not greater than or equal to 8192 (the length of chunk + 1). The + code was then falling into the G_LIKELY case below, and attempting to + read 704 bytes from offset 8187 of chunk 1 — overreading by + 699 bytes + off the end of the chunk, and never getting the 699 bytes from + chunk 2. + + This can be fixed by correctly taking the head_read_offset into + account + for the while condition. + +M gdata/gdata-buffer.c + +commit 3b0b4a0bacd38997980d3f0dd4aeaf82a44dc1a9 +Author: Philip Withnall +Date: Sat Aug 9 16:46:13 2014 +0100 + + l10n: Update British English translation + +M po/en_GB.po + +commit ae6134187af336a878d460817441a58b0a9b2365 +Author: Philip Withnall +Date: Sat Aug 9 16:39:10 2014 +0100 + + build: Add missing configure checks spotted by autoscan + + Thanks, autoscan! + +M configure.ac + +commit e16460a3992fc6cb2f44c3b7ff25cdc2ab4c10a9 +Author: Philip Withnall +Date: Sat Aug 9 16:33:12 2014 +0100 + + tests: Fix GDataAuthorizer:proxy-resolver property tests + + The ClientLogin and OAuth 1 authoriser tests were assuming that the + proxy-resolver property is initially NULL. Actually, the property is + only potentially initially NULL, as it comes from a SoupSession which + the tests have no control over. + +M gdata/tests/client-login-authorizer.c +M gdata/tests/oauth1-authorizer.c + +commit 7cc30298b050da7a02eb990b6ad2dc40b4f57dbc +Author: Philip Withnall +Date: Sat Aug 9 16:00:17 2014 +0100 + + core: Use g_ascii_strto[u]ll() instead of strto[u]l() + + The GLib functions are locale-independent. While there are few + situations where a locale-independent server-provided string would be + parsed differently by strtoul() in different user locales, it’s + best to + be safe (and consistent with our use of g_ascii_strtod(), which more + easily causes problems). + +M configure.ac +M gdata/atom/gdata-link.c +M gdata/exif/gdata-exif-tags.c +M gdata/gd/gdata-gd-feed-link.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gdata-batch-feed.c +M gdata/gdata-feed.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/youtube/gdata-youtube-content.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 79608af2618cd84abb415d867cfea7f648dc111e +Author: Inaki Larranaga Murgoitio +Date: Thu Aug 7 15:12:16 2014 +0200 + + Updated Basque language + +M po/eu.po + +commit 3a76e5ac02ab3f215ee553b656e18e172c8c9d3f +Author: Piotr Drąg +Date: Thu Jul 31 19:35:39 2014 +0200 + + doap: add + +M libgdata.doap + +commit 6ab8bb8ba8ea2b7c407bb96edf99b7b93cb437ac +Author: Olav Vitters +Date: Wed Jul 30 20:27:30 2014 +0200 + + doap category core + +M libgdata.doap + +commit dcf6d53c1d90b425d84ff39e67d76c7bcf48ab69 +Author: MarMav +Date: Wed Jul 16 10:56:19 2014 +0000 + + Updated Greek translation + +M po/el.po + +commit 268397c7a3a033829cc413ef7329ab06f4594de6 +Author: Saurav Agarwalla +Date: Tue Jul 8 16:18:51 2014 +0530 + + core: Refresh authoriser on receiving SOUP_STATUS_NOT_FOUND + + If the authorizer is not refreshed, PicasaWeb returns + SOUP_STATUS_NOT_FOUND when we try to access a resource. This shouldn't + be the case when the user is logged in. + + https://bugzilla.gnome.org/show_bug.cgi?id=732890 + +M gdata/gdata-service.c + +commit a0911084a0c198d75642856b3f1ecdd50f168921 +Author: Aurimas Černius +Date: Sat Jul 5 14:11:41 2014 +0300 + + Updated Lithuanian translation + +M po/lt.po + +commit 1b32bfd088ad07983a7277f8724be64972c4232d +Author: Fran Diéguez +Date: Tue Jul 1 18:19:41 2014 +0200 + + Updated Galician translations + +M po/gl.po + +commit a215afc2e70addc794f5d0bac7480f6f2ea39612 +Author: Anders Jonsson +Date: Sun Jun 22 20:57:22 2014 +0000 + + Updated Swedish translation + +M po/sv.po + +commit ce396c49f72c7fdfa7f41927a8dabf122bdfa2dc +Author: Philip Withnall +Date: Sun Jun 22 21:48:07 2014 +0100 + + build: Remove .travis.yml + + Having spent the best part of a day iterating (in a branch) to get the + script working, I have decided it is just not worth the time. + gnome-continuous is much more suited to libgdata, and is a lot + easier to + use. + + Remove the .travis.yml file so nobody is tempted to believe it is + supported or works. If they ever upgrade from Ubuntu 12.04 and improve + the iteration times for setting up .travis.yml, it might be worth + another try. + +D .travis.yml + +commit 3562468ff7148402904236f96af689672ad12e35 +Author: Colin Walters +Date: Sun Jun 22 16:37:34 2014 -0400 + + configure: Use stronger quoting for GLIB_MAX_ALLOWED + + Because the shell is trying to interpret '(', use single quotes + around the value. + + Fixes the build in Continuous. + +M configure.ac + +commit 3eae031819ca35e93fd682c0246b7ca57085abfe +Author: Philip Withnall +Date: Sun Jun 22 17:32:38 2014 +0100 + + freebase: Remove a redundant comparison with zero + + Unsigned values can never be less than zero. + +M gdata/services/freebase/gdata-freebase-search-query.c + +commit 77680e7f84a6cb39ed7719849a89a9a23ae1268e +Author: Philip Withnall +Date: Sun Jun 22 17:04:09 2014 +0100 + + build: Directly encode maximum GLib version + + If we use the GLIB_VERSION_2_38 macro, compilation will fail with + older + versions of GLib which do not have that macro defined. Use the + underlying G_ENCODE_VERSION() macro instead. + +M configure.ac + +commit 17364db93e6fc8095df9eea4bf127d8f66036fa1 +Author: Philip Withnall +Date: Sun Jun 22 11:32:14 2014 +0100 + + build: Eliminate dependency on gnome-common + + Remove our usage of gnome-autogen.sh by inlining it and deleting + irrelevant stuff. This removes libgdata’s dependency on + gnome-common, + which will make it a little easier to build. + +M autogen.sh + +commit 41e371c2bcf55fc8bb8604ab817b366bea5f653c +Author: Philip Withnall +Date: Sun Jun 22 11:31:08 2014 +0100 + + build: Copy GNOME_COMPILE_WARNINGS in tree + + The master plan is for GNOME_COMPILE_WARNINGS to be upstreamed to + autoconf-archive, and then removed from gnome-common. That hasn’t + happened yet, but in the mean time we can reduce our dependency on + gnome-common by copying it in tree. + + See: https://bugzilla.gnome.org/show_bug.cgi?id=729407 + +M Makefile.am +A m4/gnome-compiler-flags.m4 + +commit 23f837d55b1b6f9e26b4a3999258fa89b85ec942 +Author: Philip Withnall +Date: Sun Jun 22 11:28:42 2014 +0100 + + build: Switch from GNOME_CODE_COVERAGE to AX_CODE_COVERAGE + + AX_CODE_COVERAGE comes from the autoconf-archive, and is an upstreamed + version of the original GNOME_CODE_COVERAGE macro. + + https://savannah.gnu.org/patch/?8451 + + By switching to it, we reduce our dependency on gnome-common. The + master + plan is for gnome-common to simply cease to exist. + + See: https://bugzilla.gnome.org/show_bug.cgi?id=729405 + +M Makefile.am +M configure.ac +A m4/ax_code_coverage.m4 + +commit 4e4a41e842f27b7998d44d01344b15502e5f9fa3 +Author: Philip Withnall +Date: Sun Jun 22 11:27:26 2014 +0100 + + build: Remove unused macros from configure.ac + + Their functionality was either outdated + (GNOME_MAINTAINER_MODE_DEFINES), + or unused (GNOME_DEBUG_CHECK). + +M configure.ac + +commit c44a3dc39bdb45b48f8354adc940f586f86173c4 +Author: Philip Withnall +Date: Sun Jun 22 11:26:41 2014 +0100 + + build: Add minimum and maximum API version checks for dependencies + +M configure.ac + +commit 5d087e0e6783e42b9597a5a0fd2ae9d056425bb3 +Author: Philip Withnall +Date: Sat Jun 21 23:08:41 2014 +0100 + + build: Update .travis.yml + +M .travis.yml + +commit 867861c5fa0f776247e3b32c6fd1d6c6ccb17897 +Author: Philip Withnall +Date: Sat Jun 21 22:36:07 2014 +0100 + + build: Update .travis.yml + +M .travis.yml + +commit d8602c5a182de421a151c898ccc33e4db324af89 +Author: Philip Withnall +Date: Sat Jun 21 22:06:45 2014 +0100 + + build: Update .travis.yml + +M .travis.yml + +commit 710741d44558d90876941456043b7f49bb9a07f5 +Author: Philip Withnall +Date: Sat Jun 21 21:12:55 2014 +0100 + + build: Update .travis.yml + +M .travis.yml + +commit 5b7f5b2f3ea264c8f808ca0f5dc3475cb0c41935 +Author: Philip Withnall +Date: Sat Jun 21 20:34:15 2014 +0100 + + build: Update .travis.yml + +M .travis.yml + +commit bd4e1dba2b51e27c5f9eb482ac3c29e01565a761 +Author: Philip Withnall +Date: Sat Jun 21 20:29:13 2014 +0100 + + build: Update .travis.yml + +M .travis.yml + +commit 558a7e66be6c0e93bd28de0abec5d75a4241fc10 +Author: Philip Withnall +Date: Sat Jun 21 19:59:23 2014 +0100 + + build: Update .travis.yml + +M .travis.yml + +commit e69a57179c60345a6e591462afb75b1fc2577662 +Author: Philip Withnall +Date: Sat Jun 21 19:28:30 2014 +0100 + + build: Add a .travis.yml for Travis CI + + Let’s try this out as an experiment. + +A .travis.yml + +commit aaafd1119448e3e36e149e8a957e99f9a5ec14b6 +Author: Philip Withnall +Date: Fri Jun 20 10:36:49 2014 +0100 + + core: Handle SOUP_STATUS_NO_CONTENT in response to DELETE requests + + The Google Tasks API apparently returns HTTP status 204 in response + to a + successful DELETE request on a task entry, rather than the status 200 + which is returned by all the other services. + + Handle the two statuses as equivalent. + + https://bugzilla.gnome.org/show_bug.cgi?id=731946 + +M gdata/gdata-service.c + +commit 8e2b4040870844b3976b5f087a8f18107988b486 +Author: Philip Withnall +Date: Fri Jun 20 10:42:39 2014 +0100 + + core: Fix a small memory leak in a date parsing function + + https://bugzilla.gnome.org/show_bug.cgi?id=731949 + +M gdata/gdata-parser.c + +commit 98e8a16c9cdb4efcb3e2f98e44622469765accfb +Author: Philip Withnall +Date: Thu Jun 19 13:28:34 2014 +0100 + + picasaweb: Support protected in albums + + The documentation + https://developers.google.com/picasa-web/docs/2.0/reference?csw=1#Visibility + doesn’t have any mention of this, so let’s alias it to + GDATA_PICASAWEB_PRIVATE for the moment. + + It seems to be set on albums which are marked as visible only to the + owner. + +M gdata/services/picasaweb/gdata-picasaweb-album.c + +commit 109417f61d250f0482c3d9d93c0c7caff04d1059 +Author: Philip Withnall +Date: Thu Jun 19 09:37:07 2014 +0100 + + core: Refresh authoriser on receiving SOUP_STATUS_FORBIDDEN + + Previously the authoriser was only refreshed on receiving a + SOUP_STATUS_UNAUTHORIZED response from the server. This worked + fine for + Google Documents, but it seems that PicasaWeb returns FORBIDDEN + instead. + The authoriser was not being refreshed, and hence the user was seeing + access denied messages even though they were technically logged in. + + https://bugzilla.gnome.org/show_bug.cgi?id=731269 + +M gdata/gdata-service.c + +commit 2e9da05c8ec6b06556a64f5ea7d45246e5963108 +Author: Saurav Agarwalla +Date: Wed Jun 18 11:35:00 2014 +0000 + + core: Add PicasaWeb support to GDataGoaAuthorizer + + GOA has supported photos for a long time. Grab PicasaWeb + authentication if GOA has already got a token supporting it. + + This bumps the GOA dependency to 3.8. + + https://bugzilla.gnome.org/show_bug.cgi?id=731269 + +M README +M configure.ac +M gdata/gdata-goa-authorizer.c + +commit 3825d56f62f485d5262fdc2b8829aa41dad89851 +Author: Daniel Mustieles +Date: Thu Jun 12 17:54:43 2014 +0200 + + Updated Spanish translation + +M po/es.po + +commit aaca2fc5a749d58c86bf6c1da141b047f6ffb995 +Author: Enrico Nicoletto +Date: Tue Jun 3 13:02:14 2014 +0000 + + Updated Brazilian Portuguese translation + +M po/pt_BR.po + +commit e2ff7f4e8a70b540ac148281644ec5b8b4f8763b +Author: Philip Withnall +Date: Tue May 27 21:48:30 2014 +0100 + + build: Increment version to 0.15.2 + +M configure.ac + +commit 563ee06cc2d6d0eff1fa8e12cc7730492c83a604 +Author: Philip Withnall +Date: Tue May 27 21:47:12 2014 +0100 + + Release version 0.15.1 + +M NEWS +M configure.ac + +commit 7b10afdc58399a2107475be622cb4b65f97b11f1 +Author: Piotr Drąg +Date: Tue May 27 22:01:42 2014 +0200 + + Updated Polish translation + +M po/pl.po + +commit 16886071e9f16a2833b4599e5a68fbe370b8aa30 +Author: Carlos Garnacho +Date: Tue May 27 02:53:45 2014 +0200 + + freebase: Add missing volatile hint on refcount counter + + That is manipulated through atomic operators and should be marked + as such. + +M gdata/services/freebase/gdata-freebase-topic-result.c + +commit 59a8370f5b210cb4df96f5ef788239b7fd4493f6 +Author: Carlos Garnacho +Date: Mon Mar 17 02:48:30 2014 +0100 + + demos: Add freebase demo + + This is a simple command line app that puts some of the api to work. + + https://bugzilla.gnome.org/show_bug.cgi?id=726486 + +M Makefile.am +A demos/freebase/freebase-cli.c + +commit 901a0aec17339ebdcb3d726ef400470a7ca3e886 +Author: Carlos Garnacho +Date: Mon Mar 17 02:45:34 2014 +0100 + + freebase: Add helper function to retrieve images + + This helper function can be used together with the topic API, + if a returned element is an image, this function can be used to + retrieve a GInputStream to the image at a requested maximum size. + + https://bugzilla.gnome.org/show_bug.cgi?id=726486 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/freebase/gdata-freebase-service.c +M gdata/services/freebase/gdata-freebase-service.h +M po/POTFILES.in + +commit 413e3cd52df049909cf6ddea52be2fdc560d2890 +Author: Carlos Garnacho +Date: Mon Mar 17 02:41:12 2014 +0100 + + freebase: Add search API + + This API enables searching for search terms, returning amongst other + info the Freebase IDs usable on the topic API. + + https://bugzilla.gnome.org/show_bug.cgi?id=726486 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/freebase/gdata-freebase-search-query.c +A gdata/services/freebase/gdata-freebase-search-query.h +A gdata/services/freebase/gdata-freebase-search-result.c +A gdata/services/freebase/gdata-freebase-search-result.h +M gdata/services/freebase/gdata-freebase-service.c +M gdata/services/freebase/gdata-freebase-service.h + +commit f4635b25e2a5809f111f232c9f81d6b0a650dfcf +Author: Carlos Garnacho +Date: Mon Mar 17 02:34:31 2014 +0100 + + freebase: Add Topic query API + + With this API, structured data can be obtained about any Freebase + ID, including localized text and references to images. + + https://bugzilla.gnome.org/show_bug.cgi?id=726486 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/freebase/gdata-freebase-service.c +M gdata/services/freebase/gdata-freebase-service.h +A gdata/services/freebase/gdata-freebase-topic-query.c +A gdata/services/freebase/gdata-freebase-topic-query.h +A gdata/services/freebase/gdata-freebase-topic-result.c +A gdata/services/freebase/gdata-freebase-topic-result.h + +commit 7d919fd88d88fa39f6870588826469bdae811d1a +Author: Carlos Garnacho +Date: Mon Mar 17 02:05:17 2014 +0100 + + Add Freebase service + + This service is, according to the main site, a "A community-curated + database of well-known people, places, and things", it allows + searching + for and offering information about a wide range of topics, in a + well-structured and uniform manner. + + The most low-level API is the MQL query interface, that is a + JSON-based + language, queries consist of a data graph (according to their + data schema) + with blank places, that will be filled in in the reply. + + https://bugzilla.gnome.org/show_bug.cgi?id=726486 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/freebase/gdata-freebase-query.c +A gdata/services/freebase/gdata-freebase-query.h +A gdata/services/freebase/gdata-freebase-result.c +A gdata/services/freebase/gdata-freebase-result.h +A gdata/services/freebase/gdata-freebase-service.c +A gdata/services/freebase/gdata-freebase-service.h + +commit b03f422a2e87dda27f593c866a45c1f112b4f6a8 +Author: Philip Withnall +Date: Fri May 16 10:22:17 2014 +0100 + + core: Disconnect a cancellable in GDataDownloadStream + + Ensure to disconnect from the user-provided cancellable when + finalising + a GDataDownloadStream. + + Coverity issue: #59757 + +M gdata/gdata-download-stream.c + +commit 931a8fa0ca788496bb3c783328e27e1b8a7bc4c2 +Author: Philip Withnall +Date: Fri May 16 10:16:10 2014 +0100 + + tests: Add an extra assertion about pagination + + Coverity issue: #59763 + +M gdata/tests/general.c + +commit c1a064d48b0fe2fcc006894997b15b8e9e92deae +Author: Philip Withnall +Date: Fri May 16 10:00:36 2014 +0100 + + contacts: Remove a redundant xmlFree() call + + It was always called on NULL, and was confusing Coverity. + + Coverity issue: #59764 + +M gdata/services/contacts/gdata-contacts-contact.c + +commit 690276602cd61d28d3240d88609f226fdfd5f945 +Author: Philip Withnall +Date: Fri May 16 09:59:05 2014 +0100 + + tests: Fix copy–paste errors in the OAuth 1 tests + + Coverity issues: #59766, #59765 + +M gdata/tests/oauth1-authorizer.c + +commit 646baf7435fddd7b28a0fe8ab62e79f627f9d3e5 +Author: Philip Withnall +Date: Fri May 16 09:56:12 2014 +0100 + + tests: Tidy up cases in a switch statement + + Coverity issue: #59767 + +M gdata/tests/streams.c + +commit 7b73b3369b6a52f1164ed7b193ebec7395a77629 +Author: Carlos Garnacho +Date: Mon Mar 17 02:49:20 2014 +0100 + + gdata: Allow creating GDataEntries out of JSON content + + Some services like Freebase are hardly based on JSON, and still + GDataEntry seems the most sensible base for the different server + responses in those services over GDataFeed. + + A small spawn of https://bugzilla.gnome.org/show_bug.cgi?id=726486 + +M gdata/gdata-service.c + +commit 7a649bdf1cbb8c9c5417efe08e96acbbb43b0547 +Author: Piotr Drąg +Date: Sun Apr 6 17:58:55 2014 +0200 + + doap: update URLs + +M libgdata.doap + +commit 3a4b9c759fd5e39265f0d048d2f01367c2c6d957 +Author: Inaki Larranaga Murgoitio +Date: Mon Mar 31 12:29:04 2014 +0200 + + Updated Basque language + +M po/eu.po + +commit 6a7509cb9fb8b1f4e1070839940569534aeafca0 +Author: Ask H. Larsen +Date: Wed Mar 19 22:32:11 2014 +0100 + + Updated Danish translation + +M po/da.po + +commit 493a9e2ae7b3012055e8f5f74cd11eb0d5eaaa51 +Author: Tiagosdot +Date: Tue Mar 11 16:07:15 2014 +0000 + + Updated Portuguese translation + +M po/pt.po + +commit 7c2d184ffb1028730965513f487f4f839d206ccc +Author: Philip Withnall +Date: Mon Mar 10 22:31:23 2014 +0000 + + atom: Add a GDATA_LINK_PARENT define + + This is a link type which is included in the GData specification + (in the + RelaxNG schema), but is not documented anywhere. Good job, + Google. Best + for us to define it and allow clients to use it, than to ignore it. + + New API: + • GDATA_LINK_PARENT + + https://bugzilla.gnome.org/show_bug.cgi?id=725827 + +M docs/reference/gdata-sections.txt +M gdata/atom/gdata-link.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/tests/documents.c + +commit 52230912394a0518ca4ee4b60620f47f0713da44 +Author: Changwoo Ryu +Date: Sat Mar 8 02:49:20 2014 +0900 + + Updated Korean translation + +M po/ko.po + +commit 3272084400be98fd27bd16060052fd3c096c10dd +Author: Rūdolfs Mazurs +Date: Fri Mar 7 17:46:34 2014 +0200 + + Updated Latvian translation + +M po/lv.po + +commit f03acd33a05f310c779b361dd3a52e681fbae49b +Author: Claude Paroz +Date: Fri Mar 7 14:25:47 2014 +0100 + + Updated French translation + +M po/fr.po + +commit 1ea060993046662974f90a22cbf3094c142ee199 +Author: Philip Withnall +Date: Wed Mar 5 23:46:30 2014 +0000 + + core: Load extra attributes from ‘kind’ categories + + When a GDataEntry is created, it’s automatically given a ‘kind’ + category + element, as this is the way the GData protocol identifies the schema + which applies to a given . + + Previously, the ‘kind’ category from parsed XML would not + override the + automatically-added category. This meant that if the XML contained + extra + attributes, such as a label, they were effectively lost. + + Fix this by always preferring the ‘kind’ category from the + XML. Add a + test case, because test cases are cool. + + https://bugzilla.gnome.org/show_bug.cgi?id=707477 + +M gdata/gdata-entry.c +M gdata/tests/general.c + +commit 533602f87a98451d3c4f811e19d17a7b54b4924b +Author: Gil Forcada +Date: Fri Feb 21 23:13:41 2014 +0100 + + [l10n] Update Catalan translation + +M po/ca.po + +commit 08394972dfe77e4e44567334f699bc74d73f019b +Author: Kjartan Maraas +Date: Wed Feb 12 19:37:17 2014 +0100 + + Updated Norwegian bokmål translation + +M po/nb.po + +commit f31f992a1d2574f819ff1962a98a5b7904e593ef +Author: Chao-Hsiung Liao +Date: Sun Feb 2 20:41:36 2014 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit b3d4bcec22f19450040ee5d27824b0423f87b716 +Author: Yosef Or Boczko +Date: Sun Jan 26 05:45:39 2014 +0200 + + Updated Hebrew translation + + Signed-off-by: Yosef Or Boczko + +M po/he.po + +commit 886ab2bfa1d164a8cff647004b4cdd7ddfd90b66 +Author: Benjamin Steinwender +Date: Sat Jan 4 19:33:19 2014 +0100 + + Updated German translation + +M po/de.po + +commit 8f7ff70c0dc8221fe63ae124002bb058dfedb2ca +Author: Yuri Myasoedov +Date: Thu Dec 19 23:49:07 2013 +0400 + + Updated Russian translation + +M po/ru.po + +commit dadb541eba8439d0b2279b895a1152a5a0dd44e4 +Author: Philip Withnall +Date: Thu Dec 19 01:51:36 2013 +0000 + + build: Increment version to 0.15.1 + +M configure.ac + +commit f82031b21f0f05c69ecbbccbc6068d53cba9c6ab +Author: Philip Withnall +Date: Thu Dec 19 01:50:51 2013 +0000 + + Release version 0.15.0 + +M NEWS +M configure.ac +M docs/reference/gdata-docs.xml +M gdata/gdata-parsable.c +M gdata/gdata-parser.c +M gdata/services/tasks/gdata-tasks-query.c +M gdata/services/tasks/gdata-tasks-query.h +M gdata/services/tasks/gdata-tasks-service.c +M gdata/services/tasks/gdata-tasks-service.h +M gdata/services/tasks/gdata-tasks-task.c +M gdata/services/tasks/gdata-tasks-task.h +M gdata/services/tasks/gdata-tasks-tasklist.c +M gdata/services/tasks/gdata-tasks-tasklist.h + +commit 3a964792afd39be5d93e6dbfebd1550d74b4d8e7 +Author: Akom Chotiphantawanon +Date: Mon Dec 16 18:12:09 2013 +0700 + + Updated Thai translation + +M po/th.po + +commit a64a158f0f04fbf7bfa299bb3a86cf7bf518fca8 +Author: 甘 露 +Date: Sat Dec 7 15:08:08 2013 +0800 + + Update Chinese simplified translation + +M po/zh_CN.po + +commit 89d9deeb8be9496b00868c7f3359ceb13f1e80a2 +Author: Philip Withnall +Date: Mon Dec 2 11:50:41 2013 +0000 + + tasks: Add missing G_END_DECLS to fix C++ compilation + + This should fix C++ compilation for libgdata entirely. (Untested.) + + https://bugzilla.gnome.org/show_bug.cgi?id=719647 + +M gdata/services/tasks/gdata-tasks-service.h + +commit 5de5b9199b60de49a5be3d707580083c4147229d +Author: Aurimas Černius +Date: Sun Dec 1 17:35:18 2013 +0200 + + core: Fix gdata-goa-authorizer.h for C++ + + Add missing G_END_DECLS. + + https://bugzilla.gnome.org/show_bug.cgi?id=719647 + +M gdata/gdata-goa-authorizer.h + +commit ac59d7a6903bf9708d41999d46a6356fb87709c2 +Author: Philip Withnall +Date: Sun Nov 24 18:26:28 2013 +0000 + + docs: Update libgdata website + + Now: https://wiki.gnome.org/Projects/libgdata + +M HACKING +M README +M configure.ac +M libgdata.doap + +commit d663cbff8a733d0296e81dc84c3ae6a307cb9b58 +Author: Fabiano Fidêncio +Date: Mon Nov 18 09:38:45 2013 +0100 + + tests: Replace g_test_trap_fork() with g_test_trap_subprocess() + + For GLib versions newer than 2.38.0. This continues to work for older + versions, so the GLib dependency is not bumped. + + https://bugzilla.gnome.org/show_bug.cgi?id=712565 + +M gdata/tests/client-login-authorizer.c + +commit 60e1cf16c3986c052867e9b9bcc85e0b1a2b8bc8 +Author: Fabiano Fidêncio +Date: Mon Nov 18 09:29:03 2013 +0100 + + core: Fix 'soup_gnome_features_2_26_get_type' is deprecated warning + + GNOME 2.26 libsoup's feature was just the GNOME proxy resolver, + which is now provided as default GIO extension point. + + More informations can be seen in: + [0]: + https://git.gnome.org/browse/libsoup/commit/?id=4ded0924fd82e006f31a8e9089fd297fac15eef9 + [1]: https://bugzilla.gnome.org/show_bug.cgi?id=573685 + + https://bugzilla.gnome.org/show_bug.cgi?id=712565 + +M README +M configure.ac +M gdata/gdata-service.c + +commit ed79b05977fec7708177c5abfe9a4ee6dab2135b +Author: Philip Withnall +Date: Tue Nov 19 19:05:04 2013 +0000 + + tests: Fix strict aliasing problems with struct sockaddr + + Make it a union and GCC is happy again. + +M gdata/tests/streams.c + +commit 8306c87c00ace13633301ca95a9db2e4935ae7da +Author: Philip Withnall +Date: Tue Nov 19 19:04:49 2013 +0000 + + core: Fix strict-aliasing problems with authentication domains + + Dodgy casts are the worst. + +M gdata/gdata-private.h + +commit c431be36871f2a28acb7ec06c104c4ae8ad8de2c +Author: Ihar Hrachyshka +Date: Tue Nov 19 15:39:30 2013 +0300 + + Updated Belarusian translation. + +M po/be.po + +commit e419233bcf92526ad1ab9f819b53847554b5a2f7 +Author: Fabiano Fidêncio +Date: Mon Nov 18 09:04:13 2013 +0100 + + demos: Fix GtkStock deprecated functions + + https://bugzilla.gnome.org/show_bug.cgi?id=712565 + +M demos/scrapbook/scrapbook.c + +commit 52ebe1cb542b060c56c78b4a411283022cf2fb78 +Author: Fabiano Fidêncio +Date: Mon Nov 18 09:20:45 2013 +0100 + + core: Replace deprecated GStaticMutex with GMutex + + https://bugzilla.gnome.org/show_bug.cgi?id=712565 + +M gdata/gdata-goa-authorizer.c + +commit 24f58b85ac42635b80d1d01b1c777d059b9838c4 +Author: Fabiano Fidêncio +Date: Mon Nov 18 09:01:48 2013 +0100 + + tasks: Fix return values + + https://bugzilla.gnome.org/show_bug.cgi?id=712565 + +M gdata/services/tasks/gdata-tasks-service.c + +commit ba4df423348f6a9a5c6a9922a40470ad1f8f4acb +Author: Milo Casagrande +Date: Mon Nov 18 18:35:16 2013 +0100 + + [l10n] Updated Italian translation. + +M po/it.po + +commit 2a6f46af66d335fac525fd03fb23145fe8a83968 +Author: Efstathios Iosifidis +Date: Wed Nov 6 08:24:24 2013 +0200 + + Updated Greek translation + +M po/el.po + +commit 6440f40505b11a4cfcccc8670e1f41b75aafc7de +Author: Andika Triwidada +Date: Tue Nov 5 08:08:11 2013 +0700 + + Updated Indonesian translation + +M po/id.po + +commit 17a80e43e6b8ffc137e871f2561e2e5f6f80ac47 +Author: Мирослав Николић +Date: Sun Nov 3 09:16:26 2013 +0100 + + Updated Serbian translation + +M po/sr.po +M po/sr@latin.po + +commit d522aa8f57db8a5acf7fcdb4bb72b76d959d4298 +Author: Daniel Mustieles +Date: Thu Oct 31 18:23:32 2013 +0100 + + Updated Spanish translation + +M po/es.po + +commit 89baf69f79e9c405ae4f12c28dff49ac3ebb0b89 +Author: Gabor Kelemen +Date: Thu Oct 31 11:12:37 2013 +0100 + + Updated Hungarian translation + +M po/hu.po + +commit 345e88649d264e4b2fdce7f059bd82b998951385 +Author: Marek Černocký +Date: Wed Oct 30 07:33:47 2013 +0100 + + Updated Czech translation + +M po/cs.po + +commit 6eb49ad359663d6bde1b308d92bbab561ac56dcc +Author: Fran Diéguez +Date: Mon Oct 28 01:04:13 2013 +0100 + + Updated Galician translations + +M po/gl.po + +commit 88e22b33cabf5555f3865dd38598f145fbd89d8b +Author: Fabiano Fidêncio +Date: Sun Sep 15 22:00:11 2013 +0200 + + tests: Replace GDataMock for uhttpmock + + https://bugzilla.gnome.org/show_bug.cgi?id=709691 + +M configure.ac +M gdata/tests/Makefile.am +M gdata/tests/calendar.c +M gdata/tests/client-login-authorizer.c +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/contacts.c +M gdata/tests/documents.c +D gdata/tests/mock-resolver.c +D gdata/tests/mock-resolver.h +D gdata/tests/mock-server.c +D gdata/tests/mock-server.h +M gdata/tests/oauth1-authorizer.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit cea908c22fd9b94b4319c40985c0ce356f2e137f +Author: Aurimas Černius +Date: Sun Oct 27 18:20:24 2013 +0200 + + Updated Lithuanian translation + +M po/lt.po + +commit 7b4649b796d6ca78373033656944152f92f334e9 +Author: Matej Urbančič +Date: Sat Oct 26 22:38:30 2013 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit dcbc6f253db81e63ccd6571d375d66c915496402 +Author: Enrico Nicoletto +Date: Sat Oct 26 09:29:39 2013 -0200 + + Updated Brazilian Portuguese translation + +M po/pt_BR.po + +commit 8b451153f38524d4d2bf558d91fa254bbcf91ff0 +Author: Piotr Drąg +Date: Sat Oct 26 13:13:51 2013 +0200 + + Updated Polish translation + +M po/pl.po + +commit 76ea0e7dc549e4abfbab6caca87fa834245a3b88 +Author: Peteris Krisjanis +Date: Sat Oct 12 16:17:17 2013 +0300 + + core: Add helper function to work around Google RFC 3339 + incompatibility + + In Google Tasks API it isn't supported to provide date/time in + RFC 3339/ISO 8601 format without providing time in miliseconds. As + gdata_parser_int64_to_iso8601() returns a properly formatted string, + helper + function replaces last character 'Z' with '.000001+00:00' to fit + Google’s + supported format. + + https://bugzilla.gnome.org/show_bug.cgi?id=657539 + +M gdata/gdata-entry.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/services/tasks/gdata-tasks-task.c +M gdata/tests/general.c + +commit 1e32273ff60b20da66a5334b911b2346d2af017a +Author: Peteris Krisjanis +Date: Sat Oct 12 15:49:13 2013 +0300 + + tasks: Add Google Tasks service support + + Adds GDataTasks classes to libgdata: + • GDataTasksService + • GDataTasksQuery + • GDataTasksTasklist + • GDataTasksTask + + This includes full documentation, but no test cases. No new + dependencies + have been added to libgdata, as all the necessary ones were added + with the + core JSON work. + + https://bugzilla.gnome.org/show_bug.cgi?id=657539 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/tasks/gdata-tasks-query.c +A gdata/services/tasks/gdata-tasks-query.h +A gdata/services/tasks/gdata-tasks-service.c +A gdata/services/tasks/gdata-tasks-service.h +A gdata/services/tasks/gdata-tasks-task.c +A gdata/services/tasks/gdata-tasks-task.h +A gdata/services/tasks/gdata-tasks-tasklist.c +A gdata/services/tasks/gdata-tasks-tasklist.h +M po/POTFILES.in + +commit 3ed33acfa1012f1795907c864d0b3d9a81285140 +Author: Philip Withnall +Date: Sat Oct 12 09:28:10 2013 +0100 + + core: Add a GDataOAuth1Authorizer:proxy-resolver property + + Bound to SoupSession’s ‘proxy-resolver’ property. Based + on commit + 8f1923fcd9c4203f68ce6a0405526500a77783e5 by Matthew Barnes + . + + This deprecates the following API: + • GDataOAuth1Authorizer:proxy-uri + • gdata_oauth1_authorizer_[get|set]_proxy_uri() + and adds the following new API: + • GDataOAuth1Authorizer:proxy-resolver + • gdata_oauth1_authorizer_[get|set]_proxy_resolver() + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=709758 + +M docs/reference/gdata-sections.txt +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-oauth1-authorizer.h +M gdata/gdata.symbols +M gdata/tests/oauth1-authorizer.c + +commit 4647e0b5cd60cb5429c14e77733bb6e423d27472 +Author: Philip Withnall +Date: Sat Oct 12 09:25:42 2013 +0100 + + core: Add a GDataClientLoginAuthorizer:proxy-resolver property + + Bound to SoupSession’s ‘proxy-resolver’ property. Based + on commit + 8f1923fcd9c4203f68ce6a0405526500a77783e5 by Matthew Barnes + . + + This deprecates the following API: + • GDataClientLoginAuthorizer:proxy-uri + • gdata_client_login_authorizer_[get|set]_proxy_uri() + and adds the following new API: + • GDataClientLoginAuthorizer:proxy-resolver + • gdata_client_login_authorizer_[get|set]_proxy_resolver() + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=709758 + +M docs/reference/gdata-sections.txt +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-client-login-authorizer.h +M gdata/gdata.symbols +M gdata/tests/client-login-authorizer.c + +commit 11dff8022dcd045471610780fbb66e8d5e2a2ca4 +Author: Philip Withnall +Date: Sat Oct 12 09:23:19 2013 +0100 + + core: Add a missing G_GNUC_PURE attribute to + gdata_service_get_proxy_resolver() + +M gdata/gdata-service.h + +commit 79f248b17a4559a8d25d62481614c8fd779cd53d +Author: Carles Ferrando +Date: Sun Oct 13 23:58:04 2013 +0200 + + [l10n] Updated Catalan (Valencian) translation + +M po/ca@valencia.po + +commit 0ec07c944079b98b6e8520d41471dc40784e440c +Author: Philip Withnall +Date: Fri Oct 11 13:30:35 2013 +0100 + + build: Fix ChangeLog generation + +M Makefile.am + +commit 8f1923fcd9c4203f68ce6a0405526500a77783e5 +Author: Matthew Barnes +Date: Wed Oct 9 12:54:11 2013 -0400 + + core: Add a "proxy-resolver" property. + + Bound to SoupSession's "proxy-resolver" property. + + This also bumps the libsoup requirement to 2.42. + + This deprecates the following API: + • GDataService:proxy-uri + • gdata_service_[get|set]_proxy_uri() + and adds the following new API: + • GDataService:proxy-resolver + • gdata_service_[get|set]_proxy_resolver() + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=709758 + +M configure.ac +M docs/reference/gdata-sections.txt +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols + +commit da3aa429b5fba38b57aec40ecb37ab340cce90a5 +Author: Peteris Krisjanis +Date: Sat Sep 28 16:53:49 2013 +0300 + + core: Add get_content_type virtual function to GDataParsable + + Adding get_content_type virtual function to GDataParsable to allow + insert/update/delete_entry functions in GDataService to distinguish + between + JSON and XML based GDataParsables. GDataParsable subclass who + uses JSON + format data define their virtual function and return const gchar* + string + application/json. Otherwise GDataParsable own defined virtual + function will + return application/atom+xml. For insert/update_entry it allows + to choose + between two different calls to build xml or json message, and also + in return + parse returned data from online service correctly. For delete_entry it + allows to choose different link from links list, as for json it is + stored in + different place. + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=657539 + +M gdata/gdata-parsable.c +M gdata/gdata-parsable.h +M gdata/gdata-service.c + +commit fcc2d13dc25eba59d8fb52daaa9ede4e5604e0f2 +Author: Philip Withnall +Date: Wed Sep 4 09:04:30 2013 -0600 + + build: Add extra compiler warnings to the build + + This is dependent on recent changes in gnome-common + (bug #707475). + + The new compiler warnings can be disabled by setting + --enable-compile-warnings to anything other than ‘yes’ + or ‘maximum’ during configuration. + +M configure.ac + +commit 8fa173f7d34aa2094df28140cd3508a307de9fc0 +Author: Gil Forcada +Date: Fri Sep 27 22:52:03 2013 +0200 + + [l10n] Update Catalan translation + +M po/ca.po + +commit 4feb73f06eab3013c25b30f3416ceb7e383b2658 +Author: Chao-Hsiung Liao +Date: Tue Sep 24 19:19:52 2013 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit 0e9262808ac4c50a7f02488d451b89f9ea9d80db +Author: Yuri Myasoedov +Date: Tue Sep 24 12:46:07 2013 +0400 + + Updated Russian translation + +M po/ru.po + +commit 5ae506be1102449ce5a0d2d5e2678801cbac2902 +Author: victory +Date: Mon Sep 23 17:28:53 2013 +0900 + + l10n: Update Japanese translation + +M po/ja.po + +commit 899404f3e6f5fc010535225f3c01016d0438651d +Author: Alexandre Franke +Date: Fri Sep 20 18:08:38 2013 +0200 + + Update French translation + +M po/fr.po + +commit 757bb3ec5895e2f3dc3417239f18d5f865219928 +Author: António Lima +Date: Wed Sep 18 23:24:17 2013 +0100 + + Updated Portuguese translation + +M po/pt.po + +commit faf334a52730c644f7c2d3bc5848ef899c60b9f9 +Author: A S Alam +Date: Wed Sep 18 09:05:01 2013 -0500 + + Punjabi Translation updated by Aman + +M po/pa.po + +commit 14e0da3ab699771039524209e643d7892d7fc48c +Author: Ask H. Larsen +Date: Tue Sep 17 18:28:57 2013 +0200 + + Updated Danish translation + +M po/da.po + +commit bbe135623ebaa740d5131560f1e3515710ac436b +Author: Pavol Klačanský +Date: Sun Sep 15 16:04:23 2013 +0200 + + Updated slovak translation + +M po/sk.po + +commit 8a53a6b8b42a63ce5b0ae47912719c28fb0e40e7 +Author: Changwoo Ryu +Date: Sat Sep 14 21:39:29 2013 +0900 + + Updated Korean translation + +M po/ko.po + +commit 312ad349c0ed9b01a750a88384526966d7a346de +Author: Nilamdyuti Goswami +Date: Fri Sep 13 18:30:07 2013 +0530 + + Assamese translation updated + +M po/as.po + +commit 1838271831726a3bcc98e0415257f3e7f820636d +Author: Gabor Kelemen +Date: Fri Sep 13 11:57:14 2013 +0200 + + Updated Hungarian translation + +M po/hu.po + +commit 8f21945b95d4a8fdc9b81c1478d5eb3a34768a5a +Author: Ihar Hrachyshka +Date: Thu Sep 12 19:27:32 2013 +0300 + + Updated Belarusian translation. + +M po/be.po + +commit b9c6e2e41fea2cdc962aa53684fb8e79fda3cab8 +Author: Mattias Põldaru +Date: Thu Sep 12 19:10:12 2013 +0300 + + [l10n] Updated Estonian translation + +M po/et.po + +commit 1718f68c9ddbbc681c67e0251653bbd5ff106000 +Author: Rūdolfs Mazurs +Date: Thu Sep 12 15:00:08 2013 +0300 + + Updated Latvian translation + +M po/lv.po + +commit 3559f4234203f84e142ea42aa635a415a23c1b2d +Author: Mattias Põldaru +Date: Thu Sep 12 07:39:50 2013 +0300 + + [l10n] Updated Estonian translation + +M po/et.po + +commit 2afeb50257a5a564005c975d35624991cb06b3e3 +Author: Andika Triwidada +Date: Mon Sep 9 21:52:22 2013 +0700 + + Updated Indonesian translation + +M po/id.po + +commit fe3b28f14b08a2c76da9608f21d6faa0481a3113 +Author: Kjartan Maraas +Date: Sun Sep 8 19:46:42 2013 +0200 + + Updated Norwegian bokmål translation + +M po/nb.po + +commit aca6e3acd067b34b15e6096f237ef17c4a321726 +Author: Akom Chotiphantawanon +Date: Sun Sep 8 13:01:01 2013 +0700 + + Updated Thai translation. + +M po/th.po + +commit 75a9eeefcf1e22ac9e86eac59b0e275e3c27bab0 +Author: Christian Kirbach +Date: Sat Sep 7 21:36:59 2013 +0200 + + Updated German translation + +M po/de.po + +commit c6a8f98f9339fb571d1cdb4b94749863b7a1bddf +Author: Ville-Pekka Vainio +Date: Sat Sep 7 20:29:12 2013 +0300 + + Finnish translation update by Jiri Grönroos + +M po/fi.po + +commit fcf48d16abb2058bcc099d1595df6814905b98df +Author: Chao-Hsiung Liao +Date: Fri Sep 6 16:27:33 2013 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit cfcb9582a5c53ccfed5d51a6217bcbe426817e29 +Author: Мирослав Николић +Date: Thu Sep 5 21:52:52 2013 +0200 + + Updated Serbian translation + +M po/sr.po +M po/sr@latin.po + +commit 4edb61bcf5c4f3660d404645b81de826f060cfea +Author: Marek Černocký +Date: Wed Sep 4 18:11:23 2013 +0200 + + Updated Czech translation + +M po/cs.po + +commit 89b4e5b5c8a40ee8ab6173f6ba650516051ba9f5 +Author: Daniel Mustieles +Date: Mon Sep 2 18:12:13 2013 +0200 + + Updated Spanish translation + +M po/es.po + +commit 5dc004938baf9e02e78ae29a2b4a6ea96de8015b +Author: Aurimas Černius +Date: Sun Sep 1 21:13:46 2013 +0300 + + Updated Lithuanian translation + +M po/lt.po + +commit be3d0aed005e6dd6a1c704fd13c5bd2ae6702c67 +Author: Philip Withnall +Date: Sun Sep 1 11:34:52 2013 -0600 + + docs: Update overview page to mention JSON support + +M docs/reference/gdata-overview.xml + +commit 9d0bcd603273425f076b93b9fffeb00a6d946128 +Author: Philip Withnall +Date: Sat Aug 31 22:45:17 2013 -0600 + + tests: Add tests for comparison of GDataGD* objects + + Add a number of tests for comparison of GDataGD* objects. This + doesn’t + push test coverage up significantly, but allowed validation of the + sanity of + the different comparisons when writing the tests. + +M gdata/tests/general.c + +commit 089fff676d2a22a8506b16e341805fccca599d6b +Author: Philip Withnall +Date: Sat Aug 31 22:44:02 2013 -0600 + + gd: Fix comparison of GDataGDReminders with non-equal relative times + + Two GDataGDReminders would previously compare as equal if their + methods were + equal but their relative times were not. Now they only compare equal + if both + their methods and their relative (or absolute) times are equal. + + This includes a test case. + + Spotted by Miao Yu . + +M gdata/gd/gdata-gd-reminder.c +M gdata/tests/general.c + +commit 65921d849e7e5f4fc16e335821f4ed9422fe1614 +Author: Philip Withnall +Date: Sat Aug 31 22:42:33 2013 -0600 + + gd: Include URI in comparisons between GDataGDPhoneNumbers + + This means two numbers will compare equal if their URIs are + non-NULL and equal. This is a slight behaviour change, but I + don’t consider it to break API, since comparison behaviour isn’t + documented anywhere and nobody’s ever asked. + + This includes a test case. + +M gdata/gd/gdata-gd-phone-number.c +M gdata/tests/general.c + +commit 458b9c785ccda938b7796bf4e5f07cade7e2e288 +Author: Piotr Drąg +Date: Sat Aug 31 21:35:19 2013 +0200 + + Updated Polish translation + +M po/pl.po + +commit 9b5ad14977a5bb8da3abbce99cde6423697ea2de +Author: Dimitris Spingos +Date: Sat Aug 31 22:20:34 2013 +0300 + + Updated Greek translation + +M po/el.po + +commit 776183fdb26b7955b6a3012dbe7017f727e0525f +Author: Philip Withnall +Date: Fri Aug 30 23:40:23 2013 -0600 + + calendar: Document mutual exclusion between event times and + recurrences + + Turns out the server explicitly disallows setting individual times for + an event if it has a recurrence rule set (and vice-versa). It’s not + possible to add checks for this in libgdata without breaking API, so + rely on the server to fail to insert the offending GDataCalendarEvent + if it pleases. + + Spotted by Miao Yu . + +M gdata/services/calendar/gdata-calendar-event.c + +commit 8b2cef27aace1039f9c38a3fb1dad64afa5213c9 +Author: Philip Withnall +Date: Fri Aug 30 23:39:14 2013 -0600 + + calendar: Remove an unused variable from a private struct + +M gdata/services/calendar/gdata-calendar-event.c + +commit f48b26cba53c1b0f53c9f45c4c4c3a65a29002d7 +Author: Matej Urbančič +Date: Fri Aug 30 20:12:00 2013 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit 41de685c3f550e8c8d8b0ff5e1a3d93013d543df +Author: Enrico Nicoletto +Date: Fri Aug 30 11:00:17 2013 -0300 + + Updated Brazilian Portuguese translation + +M po/pt_BR.po + +commit d7925e7c987ef68a226f9531adac9216b2e7d570 +Author: Fran Diéguez +Date: Fri Aug 30 12:39:51 2013 +0200 + + Updated Galician translations + +M po/gl.po + +commit 39c30e114d692f83945f2bcad62b6dfdd28b96e1 +Author: Claudio Arseni +Date: Fri Aug 30 08:30:03 2013 +0200 + + [l10n] Updated Italian translation. + +M po/it.po + +commit 9771af32dac2a78f67b2ff76f9cea35677e8b99f +Author: Peteris Krisjanis +Date: Mon Jul 8 18:29:17 2013 +0300 + + core: Add support for JSON to GDataParsable, GDataEntry and GDataFeed + + This also includes initial code for detection of the Content-Type + of received + messages, and parsing JSON or XML depending on that. + + This breaks ABI (but not API), and adds a dependency on json-glib + ≥ 0.15. + + Complete unit tests are included. Further work is expected for + integrating + JSON support into GDataService, ready for use with the Tasks service. + + This work is originally by Pēteris Krišjānis , + with + additions by Philip Withnall . + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=657539 + +M Makefile.am +M README +M configure.ac +M docs/reference/gdata-sections.txt +M gdata/GData-0.0.metadata +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/gdata-parsable.h +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata.symbols +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/general.c + +commit ce7bc546da6176ac4bec698f27792fe834c4a45d +Author: Philip Withnall +Date: Thu Aug 29 23:03:53 2013 -0600 + + tests: Fix minor memory leaks in general test suite + +M gdata/tests/general.c + +commit 0532646f19eca4b8a9055986bf9522613252a8ba +Author: Philip Withnall +Date: Thu Aug 29 09:22:49 2013 -0600 + + build: Add ACLOCAL_FLAGS to ACLOCAL_AMFLAGS + + This fixes the build with recent changes to gnome-common. + + See: https://bugzilla.gnome.org/show_bug.cgi?id=706826 + +M Makefile.am + +commit 05ff0c611d313776fb133f877e6c18e6ed76280e +Author: Philip Withnall +Date: Wed Aug 28 23:36:05 2013 -0600 + + build: Increment version to 0.15.0 + +M configure.ac + +commit 2c9ba300498e8dfd28498389e202eefda41e4c16 +Author: Philip Withnall +Date: Wed Aug 28 23:32:42 2013 -0600 + + Release version 0.14.0 + +M NEWS +M configure.ac + +commit 6937287b6c3302397eb92e4e900195d238f00888 +Author: Philip Withnall +Date: Wed Aug 28 21:54:44 2013 -0600 + + picasaweb: Fix some integer overflow bugs on 32-bit machines + + Looks like nobody’s previously run the test suite on a 32-bit + machine… + +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/tests/picasaweb.c + +commit 035979496f91747839c219d27627c6393f36230c +Author: Philip Withnall +Date: Wed Aug 28 20:39:06 2013 -0600 + + docs: Ignore generated *-enums.h files + + A couple of them weren’t being excluded, and were generating noise + in gdata-sections.txt. + +M docs/reference/Makefile.am +M docs/reference/gdata-sections.txt + +commit 5af3a0722daf2711f05665a63508b8fd34b70df8 +Author: Philip Withnall +Date: Tue Aug 27 23:42:35 2013 -0600 + + gd: Fix documentation comment + +M gdata/gd/gdata-gd-when.c + +commit 2b14c68fc531fb6d940c4602d83e4a2236caa9b8 +Author: Alexandre Franke +Date: Thu Aug 22 12:30:34 2013 +0200 + + Update French translation + +M po/fr.po + +commit 633a115fecf00f2335297a25bf0136c07184c6c2 +Author: Claudio Arseni +Date: Sun Aug 18 14:32:17 2013 +0200 + + [l10n] Updated Italian translation. + +M po/it.po + +commit 4b0792ed71ad09645b809f1b122146744513010b +Author: Dimitris Spingos +Date: Sun Aug 18 09:50:18 2013 +0300 + + Updated Greek translation + +M po/el.po + +commit 3573b01c45561ddf0e904d9c62c3e104038e622b +Author: Matej Urbančič +Date: Sat Aug 17 08:58:54 2013 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit 785c4f14b62498f02ab0c227574d86a1deed4351 +Author: Chao-Hsiung Liao +Date: Fri Aug 16 10:14:44 2013 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit 4c233898f0e626abd265846571e684453f19c8fb +Author: Aurimas Černius +Date: Sun Aug 11 19:49:38 2013 +0300 + + Updated Lithuanian translation + +M po/lt.po + +commit fda5e0af1f4338ef3d378c9e2e2a00da4301ea8a +Author: Reinout van Schouwen +Date: Sun Aug 11 00:20:09 2013 +0200 + + Fixed some small errors in the Dutch translation. + +M po/nl.po + +commit 55b68f99f278b4e33ca8a6be9aa18c3468e40f3e +Author: Akom Chotiphantawanon +Date: Sat Aug 10 15:43:51 2013 +0700 + + Updated Thai translation. + +M po/th.po + +commit 3554f537bbb6c47da7fb11d9fcf83d75d81c8ce4 +Author: Kjartan Maraas +Date: Thu Aug 8 22:20:08 2013 +0200 + + Updated Norwegian bokmål translation + +M po/nb.po + +commit d56fe9fd495b1135e0030d3f166f05c7de9a7790 +Author: Daniel Mustieles +Date: Thu Aug 8 11:16:28 2013 +0200 + + Updated Spanish translation + +M po/es.po + +commit ef97bbadd915a23e2cc876f80da97ca377533334 +Author: Philip Withnall +Date: Mon Aug 5 16:34:36 2013 +0200 + + tests: Tidy up invocation of GDataResolver + +M gdata/tests/calendar.c +M gdata/tests/client-login-authorizer.c +M gdata/tests/common.c +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/mock-server.c +M gdata/tests/oauth1-authorizer.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 9670f962222b6c51ca051c2665d0a5b659ac6282 +Author: Gil Forcada +Date: Sat Aug 3 23:36:58 2013 +0200 + + [l10n] Update Catalan translation + +M po/ca.po + +commit 08dc67658d0be82e24a72fb8910a4822e6cc54ce +Author: Christian Kirbach +Date: Sat Aug 3 16:03:40 2013 +0200 + + Updated German translation + +M po/de.po + +commit 9d3994090d67cf6fa7bb7b679bf36dc68d996bdf +Author: Yaron Shahrabani +Date: Sat Aug 3 14:04:18 2013 +0300 + + Updated Hebrew translation. + +M po/he.po + +commit 1d70529fa7ade5e0b4daed464fcbcef6904c502d +Author: Rafael Ferreira +Date: Sat Aug 3 00:30:42 2013 -0300 + + Updated Brazilian Portuguese translation + +M po/pt_BR.po + +commit 1bbe2deeabfdfb1e0fe788ccd4bc4ca67f6f546e +Author: Marek Černocký +Date: Fri Aug 2 20:38:29 2013 +0200 + + Updated Czech translation + +M po/cs.po + +commit 95623628dd021f5dadcf99c0ae6d556d1942930b +Author: Philip Withnall +Date: Fri Aug 2 13:47:04 2013 +0200 + + build: Increment version to 0.13.5 + +M configure.ac + +commit bd4c40f4b9b1a0413d0f2184f1a2781c6abe8582 +Author: Philip Withnall +Date: Fri Aug 2 13:45:11 2013 +0200 + + Release version 0.13.4 + +M NEWS +M configure.ac + +commit 0858c4354b63a544d3a328e9ceb1d8266c233853 +Author: Philip Withnall +Date: Fri Aug 2 13:15:52 2013 +0200 + + tests: Fix sense of a sleep() enable guard + +M gdata/tests/picasaweb.c + +commit 08f78da9f648dee50612af958177cf35b4f08328 +Author: Philip Withnall +Date: Fri Aug 2 13:09:25 2013 +0200 + + build: Set tar-pax AM_INIT_AUTOMAKE option + + This is necessary to include long filenames in the tarball, which + is needed for the trace files. + +M configure.ac + +commit 8d925cdb5a9e9d2ab91484f52cc406d2728b0bf7 +Author: Philip Withnall +Date: Fri Aug 2 12:46:28 2013 +0200 + + tests: builddir ≠ fixes for the trace code + +M gdata/tests/calendar.c +M gdata/tests/client-login-authorizer.c +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/oauth1-authorizer.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 6266e4776de10bcfa633f9a7ee5af9adabc2b58c +Author: Philip Withnall +Date: Fri Aug 2 12:40:19 2013 +0200 + + build: Add missing certificate and trace files to EXTRA_DIST + +M gdata/tests/Makefile.am + +commit c57365d70568c866cfbc4a063e4e90aa28fecef2 +Author: Piotr Drąg +Date: Fri Aug 2 12:48:26 2013 +0200 + + Updated Polish translation + +M po/pl.po + +commit b4e46b4f9c59959bf63650f9eb1d7a5b6b01ffd1 +Author: Fran Diéguez +Date: Fri Aug 2 12:47:54 2013 +0200 + + Updated Galician translations + +M po/gl.po + +commit 4415f9a47cb334103b270faefc5bf04222edc16d +Author: Philip Withnall +Date: Thu Aug 1 13:31:27 2013 +0200 + + tests: Disable hacky sleep()s when running against a mock server + + This speeds up running the test suite by a significant number of + seconds. The sleep()s are only needed to wait for changes to + propagate between servers in Google’s data centres, and are + totally irrelevant to the mock server. + +M gdata/tests/documents.c + +commit c00a7d8d743487d2f4f9dd0e0f5ad05c0e08d584 +Author: Philip Withnall +Date: Wed Jul 31 09:19:46 2013 +0200 + + tests: Tidy up server creation in streams tests + + Also ensure it sets LIBGDATA_HTTPS_PORT correctly so that the + tests work with the recent trace file changes to the core. + +M gdata/tests/streams.c + +commit a04ac5150b25331fb7ca3ab51d3026740b9593cc +Author: Philip Withnall +Date: Tue Jul 30 13:27:49 2013 +0200 + + tests: Remove --no-internet option in favour of trace files + + All unit test suites now support running against committed trace + files, so the --no-internet option can now be removed. + +M gdata/tests/common.c +M gdata/tests/common.h + +commit 8567c768cc31cc2e14c64d098c15b358003c69ac +Author: Philip Withnall +Date: Tue Jul 30 13:17:38 2013 +0200 + + tests: Add trace file testing support to the Documents test suite + +M gdata/tests/documents.c +A gdata/tests/traces/documents/access-rule-insert +A gdata/tests/traces/documents/authentication +A gdata/tests/traces/documents/authentication-async +A gdata/tests/traces/documents/authentication-async-cancellation +A gdata/tests/traces/documents/batch +A gdata/tests/traces/documents/batch-async +A gdata/tests/traces/documents/batch-async-cancellation +A gdata/tests/traces/documents/copy-document +A gdata/tests/traces/documents/delete-document +A gdata/tests/traces/documents/delete-folder +A gdata/tests/traces/documents/download-document +A gdata/tests/traces/documents/folders-add-to-folder +A gdata/tests/traces/documents/folders-remove-from-folder +A gdata/tests/traces/documents/folders_add_to_folder-async +A +gdata/tests/traces/documents/folders_add_to_folder-async-cancellation +A gdata/tests/traces/documents/folders_remove_from_folder-async +A +gdata/tests/traces/documents/folders_remove_from_folder-async-cancellation +A +gdata/tests/traces/documents/folders_remove_from_folder-async-epilogue +A gdata/tests/traces/documents/global-authentication +A gdata/tests/traces/documents/query-all-documents +A +gdata/tests/traces/documents/query-all-documents-async-progress-closure +A gdata/tests/traces/documents/query-all-documents-with-folder +A gdata/tests/traces/documents/query_all_documents-async +A +gdata/tests/traces/documents/query_all_documents-async-cancellation +A gdata/tests/traces/documents/setup-batch-async +A gdata/tests/traces/documents/setup-folders-add-to-folder +A gdata/tests/traces/documents/setup-folders-remove-from-folder +A gdata/tests/traces/documents/setup-temp-document-spreadsheet +A gdata/tests/traces/documents/setup-temp-documents +A gdata/tests/traces/documents/setup-temp-folder +A +gdata/tests/traces/documents/setup-update-document_content-and-metadata-non-resumable +A +gdata/tests/traces/documents/setup-update-document_content-and-metadata-resumable +A +gdata/tests/traces/documents/setup-update-document_content-only-non-resumable +A +gdata/tests/traces/documents/setup-update-document_content-only-resumable +A +gdata/tests/traces/documents/setup-update-document_metadata-only-non-resumable +A +gdata/tests/traces/documents/setup-upload-document_content-and-metadata-in-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-odt-convert +A +gdata/tests/traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/setup-upload-document_content-and-metadata-root-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-odt-convert +A +gdata/tests/traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/setup-upload-document_content-only-in-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/setup-upload-document_content-only-in-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/setup-upload-document_content-only-in-folder-resumable-odt-convert +A +gdata/tests/traces/documents/setup-upload-document_content-only-in-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/setup-upload-document_content-only-root-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/setup-upload-document_content-only-root-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/setup-upload-document_content-only-root-folder-resumable-odt-convert +A +gdata/tests/traces/documents/setup-upload-document_content-only-root-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/setup-upload-document_metadata-only-in-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/setup-upload-document_metadata-only-root-folder-non-resumable-odt-convert +A gdata/tests/traces/documents/teardown-batch-async +A gdata/tests/traces/documents/teardown-copy-document +A gdata/tests/traces/documents/teardown-folders-add-to-folder +A gdata/tests/traces/documents/teardown-temp-document +A gdata/tests/traces/documents/teardown-temp-documents +A gdata/tests/traces/documents/teardown-temp-folder +A +gdata/tests/traces/documents/teardown-update-document_content-and-metadata-non-resumable +A +gdata/tests/traces/documents/teardown-update-document_content-and-metadata-resumable +A +gdata/tests/traces/documents/teardown-update-document_content-only-non-resumable +A +gdata/tests/traces/documents/teardown-update-document_content-only-resumable +A +gdata/tests/traces/documents/teardown-update-document_metadata-only-non-resumable +A +gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-in-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-odt-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-root-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-odt-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-only-in-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-only-in-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-only-in-folder-resumable-odt-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-only-in-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-only-root-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-only-root-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-only-root-folder-resumable-odt-convert +A +gdata/tests/traces/documents/teardown-upload-document_content-only-root-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/teardown-upload-document_metadata-only-in-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/teardown-upload-document_metadata-only-root-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/update_content-and-metadata-non-resumable +A gdata/tests/traces/documents/update_content-and-metadata-resumable +A gdata/tests/traces/documents/update_content-only-non-resumable +A gdata/tests/traces/documents/update_content-only-resumable +A gdata/tests/traces/documents/update_metadata-only-non-resumable +A +gdata/tests/traces/documents/upload_content-and-metadata-in-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/upload_content-and-metadata-in-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/upload_content-and-metadata-in-folder-resumable-odt-convert +A +gdata/tests/traces/documents/upload_content-and-metadata-in-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/upload_content-and-metadata-root-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/upload_content-and-metadata-root-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/upload_content-and-metadata-root-folder-resumable-odt-convert +A +gdata/tests/traces/documents/upload_content-and-metadata-root-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/upload_content-only-in-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/upload_content-only-in-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/upload_content-only-in-folder-resumable-odt-convert +A +gdata/tests/traces/documents/upload_content-only-in-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/upload_content-only-root-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/upload_content-only-root-folder-resumable-bin-no-convert +A +gdata/tests/traces/documents/upload_content-only-root-folder-resumable-odt-convert +A +gdata/tests/traces/documents/upload_content-only-root-folder-resumable-odt-no-convert +A +gdata/tests/traces/documents/upload_metadata-only-in-folder-non-resumable-odt-convert +A +gdata/tests/traces/documents/upload_metadata-only-root-folder-non-resumable-odt-convert + +commit 8348fc1310c48734820d10853bff3a5189342a5a +Author: Philip Withnall +Date: Mon Jul 29 18:16:48 2013 +0200 + + tests: Add trace file testing support to the OAuth 1 test suite + +M gdata/tests/oauth1-authorizer.c +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-interactive-data-bad-credentials +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-refresh-authorization +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-async +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-async-cancellation +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-sync +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-sync-cancellation +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async-bad-credentials +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async-cancellation +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync-bad-credentials +A +gdata/tests/traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync-cancellation +A +gdata/tests/traces/oauth1-authorizer/setup-oauth1-authorizer-data-authenticated +A +gdata/tests/traces/oauth1-authorizer/setup-oauth1-authorizer-interactive-data + +commit dfd9951b6dad3fb5524db5615ab64f28aeaf009b +Author: Philip Withnall +Date: Mon Jul 29 17:04:49 2013 +0200 + + tests: Add trace file testing support to the ClientLogin test suite + +M gdata/tests/client-login-authorizer.c +A +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async +A +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-cancellation +A +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-multiple-domains +A +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync +A +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-bad-password +A +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-cancellation +A +gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-multiple-domains +A +gdata/tests/traces/client-login-authorizer/setup-client-login-authorizer-data-authenticated + +commit 060319d9fbf707f29e88326f07ff7124d62c7c69 +Author: Philip Withnall +Date: Mon Jul 29 16:41:39 2013 +0200 + + tests: Add trace file testing support to the Calendar test suite + +M gdata/tests/calendar.c +A gdata/tests/traces/calendar/access-rule-delete +A gdata/tests/traces/calendar/access-rule-get +A gdata/tests/traces/calendar/access-rule-insert +A gdata/tests/traces/calendar/access-rule-update +A gdata/tests/traces/calendar/authentication +A gdata/tests/traces/calendar/authentication-async +A gdata/tests/traces/calendar/authentication-async-cancellation +A gdata/tests/traces/calendar/batch +A gdata/tests/traces/calendar/batch-async +A gdata/tests/traces/calendar/batch-async-cancellation +A gdata/tests/traces/calendar/event-insert +A gdata/tests/traces/calendar/event_insert-async +A gdata/tests/traces/calendar/event_insert-async-cancellation +A gdata/tests/traces/calendar/global-authentication +A gdata/tests/traces/calendar/query-all-calendars +A +gdata/tests/traces/calendar/query-all-calendars-async-progress-closure +A gdata/tests/traces/calendar/query-events +A gdata/tests/traces/calendar/query-events-async-progress-closure +A gdata/tests/traces/calendar/query-own-calendars +A +gdata/tests/traces/calendar/query-own-calendars-async-progress-closure +A gdata/tests/traces/calendar/query_all_calendars-async +A gdata/tests/traces/calendar/query_all_calendars-async-cancellation +A gdata/tests/traces/calendar/query_events-async +A gdata/tests/traces/calendar/query_events-async-cancellation +A gdata/tests/traces/calendar/query_own_calendars-async +A gdata/tests/traces/calendar/query_own_calendars-async-cancellation +A gdata/tests/traces/calendar/setup-batch-async +A gdata/tests/traces/calendar/setup-query-calendars +A gdata/tests/traces/calendar/setup-query-events +A gdata/tests/traces/calendar/setup-temp-calendar +A gdata/tests/traces/calendar/setup-temp-calendar-acls +A gdata/tests/traces/calendar/teardown-batch-async +A gdata/tests/traces/calendar/teardown-insert-event +A gdata/tests/traces/calendar/teardown-query-calendars +A gdata/tests/traces/calendar/teardown-query-events +A gdata/tests/traces/calendar/teardown-temp-calendar +A gdata/tests/traces/calendar/teardown-temp-calendar-acls + +commit 65938c94908f13898f18a09f85f1ed84242aeae3 +Author: Philip Withnall +Date: Sun Jul 28 14:21:35 2013 +0200 + + tests: Add trace file testing support to the PicasaWeb test suite + +M gdata/tests/picasaweb.c +A gdata/tests/traces/picasaweb/authentication +A gdata/tests/traces/picasaweb/authentication-async +A gdata/tests/traces/picasaweb/authentication-async-cancellation +A gdata/tests/traces/picasaweb/comment-delete +A gdata/tests/traces/picasaweb/comment-insert +A gdata/tests/traces/picasaweb/comment-query +A gdata/tests/traces/picasaweb/comment-query-async-progress-closure +A gdata/tests/traces/picasaweb/comment_delete-async +A gdata/tests/traces/picasaweb/comment_delete-async-cancellation +A gdata/tests/traces/picasaweb/comment_insert-async +A gdata/tests/traces/picasaweb/comment_insert-async-cancellation +A gdata/tests/traces/picasaweb/comment_query-async +A gdata/tests/traces/picasaweb/comment_query-async-cancellation +A gdata/tests/traces/picasaweb/download-photo +A gdata/tests/traces/picasaweb/download-thumbnails +A gdata/tests/traces/picasaweb/global-authentication +A gdata/tests/traces/picasaweb/insert-album +A gdata/tests/traces/picasaweb/insert_album-async +A gdata/tests/traces/picasaweb/insert_album-async-cancellation +A gdata/tests/traces/picasaweb/query-all-albums +A +gdata/tests/traces/picasaweb/query-all-albums-async-progress-closure +A gdata/tests/traces/picasaweb/query-all-albums-with-limits +A gdata/tests/traces/picasaweb/query-files +A gdata/tests/traces/picasaweb/query-files-async-progress-closure +A gdata/tests/traces/picasaweb/query-files-single +A gdata/tests/traces/picasaweb/query-user +A gdata/tests/traces/picasaweb/query_all_albums-async +A gdata/tests/traces/picasaweb/query_all_albums-async-cancellation +A gdata/tests/traces/picasaweb/query_files-async +A gdata/tests/traces/picasaweb/query_files-async-cancellation +A gdata/tests/traces/picasaweb/query_user-async +A gdata/tests/traces/picasaweb/query_user-async-cancellation +A gdata/tests/traces/picasaweb/query_user_by_username-async +A +gdata/tests/traces/picasaweb/query_user_by_username-async-cancellation +A gdata/tests/traces/picasaweb/setup-query-all-albums +A gdata/tests/traces/picasaweb/setup-query-comments +A gdata/tests/traces/picasaweb/setup-query-files +A gdata/tests/traces/picasaweb/setup-upload +A gdata/tests/traces/picasaweb/teardown-insert-album +A gdata/tests/traces/picasaweb/teardown-insert-comment +A gdata/tests/traces/picasaweb/teardown-query-all-albums +A gdata/tests/traces/picasaweb/teardown-query-comments +A gdata/tests/traces/picasaweb/teardown-query-files +A gdata/tests/traces/picasaweb/teardown-upload +A gdata/tests/traces/picasaweb/upload-default-album +A gdata/tests/traces/picasaweb/upload_default_album-async +A +gdata/tests/traces/picasaweb/upload_default_album-async-cancellation + +commit 8afe6edc8900691a9d018532963a08661b7f48ef +Author: Philip Withnall +Date: Mon Jul 8 21:25:00 2013 +0100 + + tests: Add trace file testing support to the Contacts test suite + +M gdata/tests/contacts.c +A gdata/tests/traces/contacts/authentication +A gdata/tests/traces/contacts/authentication-async +A gdata/tests/traces/contacts/authentication-async-cancellation +A gdata/tests/traces/contacts/batch +A gdata/tests/traces/contacts/batch-async +A gdata/tests/traces/contacts/batch-async-cancellation +A gdata/tests/traces/contacts/contact-insert +A gdata/tests/traces/contacts/contact-update +A gdata/tests/traces/contacts/global-authentication +A gdata/tests/traces/contacts/group-insert +A gdata/tests/traces/contacts/group_insert-async +A gdata/tests/traces/contacts/group_insert-async-cancellation +A gdata/tests/traces/contacts/photo-add +A gdata/tests/traces/contacts/photo-delete +A gdata/tests/traces/contacts/photo-get +A gdata/tests/traces/contacts/photo_add-async +A gdata/tests/traces/contacts/photo_add-async-cancellation +A gdata/tests/traces/contacts/photo_delete-async +A gdata/tests/traces/contacts/photo_delete-async-cancellation +A gdata/tests/traces/contacts/photo_get-async +A gdata/tests/traces/contacts/photo_get-async-cancellation +A gdata/tests/traces/contacts/query-all-contacts +A +gdata/tests/traces/contacts/query-all-contacts-async-progress-closure +A gdata/tests/traces/contacts/query-all-groups +A +gdata/tests/traces/contacts/query-all-groups-async-progress-closure +A gdata/tests/traces/contacts/query_all_contacts-async +A gdata/tests/traces/contacts/query_all_contacts-async-cancellation +A gdata/tests/traces/contacts/query_all_groups-async +A gdata/tests/traces/contacts/query_all_groups-async-cancellation +A gdata/tests/traces/contacts/setup-batch-async +A gdata/tests/traces/contacts/setup-query-all-contacts +A gdata/tests/traces/contacts/setup-query-all-groups +A gdata/tests/traces/contacts/setup-temp-contact +A gdata/tests/traces/contacts/setup-temp-contact-with-photo +A gdata/tests/traces/contacts/teardown-batch-async +A gdata/tests/traces/contacts/teardown-insert +A gdata/tests/traces/contacts/teardown-insert-group +A gdata/tests/traces/contacts/teardown-query-all-contacts +A gdata/tests/traces/contacts/teardown-query-all-groups +A gdata/tests/traces/contacts/teardown-temp-contact + +commit 0e6e38604c23959e510eb21385a803f61587443c +Author: Philip Withnall +Date: Thu Aug 1 09:16:08 2013 +0200 + + tests: Fix DS problems with the Google Document removal tests + +M gdata/tests/documents.c + +commit 4b194f40773605288d2e9e0aad3ae9d78b5a6dc8 +Author: Philip Withnall +Date: Wed Jul 31 10:20:01 2013 +0200 + + tests: Add trace file testing support to the YouTube test suite + +A gdata/tests/traces/youtube/authentication +A gdata/tests/traces/youtube/authentication-async +A gdata/tests/traces/youtube/authentication-async-cancellation +A gdata/tests/traces/youtube/batch +A gdata/tests/traces/youtube/batch-async +A gdata/tests/traces/youtube/batch-async-cancellation +A gdata/tests/traces/youtube/categories +A gdata/tests/traces/youtube/categories-async +A gdata/tests/traces/youtube/categories-async-cancellation +A gdata/tests/traces/youtube/comment-delete +A gdata/tests/traces/youtube/comment-insert +A gdata/tests/traces/youtube/comment-query +A gdata/tests/traces/youtube/comment-query-async-progress-closure +A gdata/tests/traces/youtube/comment_delete-async +A gdata/tests/traces/youtube/comment_delete-async-cancellation +A gdata/tests/traces/youtube/comment_insert-async +A gdata/tests/traces/youtube/comment_insert-async-cancellation +A gdata/tests/traces/youtube/comment_query-async +A gdata/tests/traces/youtube/comment_query-async-cancellation +A gdata/tests/traces/youtube/global-authentication +A gdata/tests/traces/youtube/query-related +A gdata/tests/traces/youtube/query-related-async-progress-closure +A gdata/tests/traces/youtube/query-single +A gdata/tests/traces/youtube/query-standard-feed +A +gdata/tests/traces/youtube/query-standard-feed-async-progress-closure +A gdata/tests/traces/youtube/query-standard-feed-with-query +A gdata/tests/traces/youtube/query-standard-feeds +A gdata/tests/traces/youtube/query_related-async +A gdata/tests/traces/youtube/query_related-async-cancellation +A gdata/tests/traces/youtube/query_single-async +A gdata/tests/traces/youtube/query_single-async-cancellation +A gdata/tests/traces/youtube/query_standard_feed-async +A gdata/tests/traces/youtube/query_standard_feed-async-cancellation +A gdata/tests/traces/youtube/setup-batch +A gdata/tests/traces/youtube/setup-comment +A gdata/tests/traces/youtube/setup-insert-comment +A gdata/tests/traces/youtube/teardown-insert-comment +A gdata/tests/traces/youtube/teardown-upload +A gdata/tests/traces/youtube/upload-async +A gdata/tests/traces/youtube/upload-async-cancellation +A gdata/tests/traces/youtube/upload-simple +M gdata/tests/youtube.c + +commit 026e350a3d83ec186da55849832e97328153d2f0 +Author: Philip Withnall +Date: Tue Jul 30 17:43:41 2013 +0200 + + tests: General support for mock server traces in async tests + +M gdata/tests/common.h + +commit d5850ea879b6780ffff06934241b246eb1192c84 +Author: Philip Withnall +Date: Wed Jul 31 10:19:38 2013 +0200 + + tests: Add mock server trace support + + This adds a GDataMockServer which online tests can be run against, + either to log a trace file of all HTTP messages during the test, + or to re-run the test against such a trace file on a local + (in-process) server. + + Tests are transparently redirected to the mock server by overriding + the default DNS resolver, which will resolve all URIs to a loopback + interface. + + This also ports GDataService from using SoupSessionSync to the new + SoupSession. SoupSession’s default HTTP timeout is 60s, whereas the + old value used by SoupSessionSync was 0s (i.e. no timeout). In order + to preserve defaults for GDataService:timeout, we need to explicitly + set the timeout to 0s. + +M docs/reference/Makefile.am +M gdata/gdata-service.c +M gdata/tests/Makefile.am +A gdata/tests/cert.pem +M gdata/tests/common.c +M gdata/tests/common.h +A gdata/tests/key.pem +A gdata/tests/mock-resolver.c +A gdata/tests/mock-resolver.h +A gdata/tests/mock-server.c +A gdata/tests/mock-server.h + +commit 2cdc8344b34c867f1f0b259413807b34c297508d +Author: Philip Withnall +Date: Wed Jul 31 11:18:00 2013 +0200 + + Revert "core: Write upload chunks in an idle handler to avoid stack + overflow" + + This reverts commit e795f559327b3f208d768a4461ca1829e0f44693. + + This fixes GDataUploadStream now that we use SoupSession rather than + SoupSessionSync. See the discussion in bug #703464 for more details; + we need + to append body chunks before returning from the wrote-body-data signal + handler in order to not stall the upload and hit an assertion. + + See: https://bugzilla.gnome.org/show_bug.cgi?id=703464 + +M gdata/gdata-upload-stream.c + +commit bf973f6f7e663dd3c18d965fdcad69775a734cbb +Author: Philip Withnall +Date: Fri Aug 2 11:59:01 2013 +0200 + + tests: Add a sleep() in the PicasaWeb tests to work around DS bugs + +M gdata/tests/picasaweb.c + +commit fc934a4172eaada28e35336f9bb549dc7a6e3f9d +Author: Philip Withnall +Date: Thu Aug 1 19:09:03 2013 +0200 + + docs: Add a missing xi:include to gdata-docs.xml + +M docs/reference/gdata-docs.xml + +commit c7e87354107329982b81efb6d6c35ac4e1b447b2 +Author: Philip Withnall +Date: Thu Aug 1 18:32:42 2013 +0200 + + tests: Temporarily disable the memory test + + It’s broken due to a problem in GLib. + + See: https://bugzilla.gnome.org/show_bug.cgi?id=705303 + +M gdata/tests/Makefile.am + +commit 9ebcbcd52ad02cf7de17d263c2d345d9431a41a5 +Author: Philip Withnall +Date: Thu Aug 1 17:58:16 2013 +0200 + + tests: Disable some invalid comparisons in the PicasaWeb tests + + Turns out that Google servers can arbitrarily change a few more values + than I thought, which the tests didn’t expect to change. + +M gdata/tests/picasaweb.c + +commit 2f9f5e68907d839fa2f8a029ef7ec49c4ac1d41d +Author: Philip Withnall +Date: Thu Aug 1 17:56:44 2013 +0200 + + tests: Various distributed system workarounds for the Contacts tests + + This also, sadly, includes disabling a few tests which I can’t + figure out + how to fix sanely at the moment. + +M gdata/tests/contacts.c + +commit 288391e657c890338bf49b00228171b84d8c90be +Author: Philip Withnall +Date: Thu Aug 1 17:52:54 2013 +0200 + + core: Fix race condition in upload thread instantiation + + The upload thread takes a reference on the GDataUploadStream, but the + stream could be finalised while the thread is still being created; + hence once the thread main function starts and calls g_object_ref(), + the GDataUploadStream has already been destroyed. + + Move the g_object_ref() call to before the thread instantiation to + fix this. + +M gdata/gdata-upload-stream.c + +commit c0e74d66779fbb1310e24950e514cf7e861958d7 +Author: Philip Withnall +Date: Thu Aug 1 09:13:41 2013 +0200 + + tests: Fix document title comparison + + Google changed the semantics of document titles again. + +M gdata/tests/documents.c + +commit a5c74e837946d72764b471d1ac75897bf2f2d406 +Author: Philip Withnall +Date: Thu Aug 1 09:09:25 2013 +0200 + + documents: Minor code tidy-up + +M gdata/services/documents/gdata-documents-service.c + +commit 8901c2953327037fec3591e38ff8698391c34a80 +Author: Philip Withnall +Date: Tue Jul 30 13:25:38 2013 +0200 + + tests: Fix kinds of uploaded documents used in the Documents test + suite + + I’m sure this worked before, so it looks like Google has tightened + up + input validation a bit. Not a bad thing. + +M gdata/tests/documents.c + +commit 6bc8c36fa23d6722dcc44724a8d2feb2c99ad8e0 +Author: Philip Withnall +Date: Mon Jul 8 11:56:53 2013 +0100 + + tests: Add more tests for GDataQuery + + This pushes its test coverage up to 92.3% of lines, and 94.6% + of functions. + +M gdata/tests/general.c + +commit 50d349ae3ee8447cdb88fe87cd84c09095ff37e3 +Author: Philip Withnall +Date: Mon Jul 8 15:33:11 2013 +0100 + + core: Refactor assertions slightly + + This tidies up the code a bit. No behavioural changes. + +M gdata/gdata-service.c + +commit 8803a876ade32dfc4428bdac8c48a722e1caa7ad +Author: Philip Withnall +Date: Sun Jul 7 17:48:10 2013 +0100 + + core: Allow HTTPS port to be overriden using the LIBGDATA_HTTPS_PORT + envvar + + This will be useful for unit testing, allowing network traffic to be + redirected to a local unit testing server. + +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-download-stream.c +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata-upload-stream.c + +commit a1d2ad38ff2dca93ab763fb50ed3c1f9c35848f8 +Author: Philip Withnall +Date: Wed Jul 31 09:08:42 2013 +0200 + + tests: Work around distributed system bugs in the Google Contacts + servers + + Looks like the servers have changed to use weak synchronisation of new + contacts, so querying for contacts immediately after adding them now + often won’t return the new ones, or will return them with outdated + IDs. + ‘Fix’ this by adding a mandatory sleep after creating the + contacts, and + before querying them for the first time. + +M gdata/tests/contacts.c + +commit 1971f8ed3b3cb76719490b956cfdcb44644d0a2d +Author: Philip Withnall +Date: Tue Jul 30 17:44:18 2013 +0200 + + tests: Fix a memory leak in the PicasaWeb unit tests + +M gdata/tests/picasaweb.c + +commit 36b38fdb700a3f652b6985540b3d69134a1ec9d0 +Author: Philip Withnall +Date: Tue Jul 30 14:19:55 2013 +0200 + + build: Update MAINTAINERCLEANFILES + +M Makefile.am + +commit a627ea8d98b5222fe6e9fc6319fe9272dad475a3 +Author: Philip Withnall +Date: Tue Jul 30 14:19:10 2013 +0200 + + build: Use AC_CONFIG_AUX_DIR + + This tidies away various autoconf/automake files so they don’t + pollute + the root directory. It also ties in with recent git.mk improvements so + these files are automatically included in .gitignore. + +M configure.ac + +commit 469ea1e1fab91df489399fe42ce760d6eb7d2b6e +Author: Philip Withnall +Date: Tue Jul 30 14:18:44 2013 +0200 + + build: Use AM_C[PP]FLAGS instead of INCLUDES + + Let’s live in the future. + +M docs/reference/Makefile.am +M gdata/tests/Makefile.am + +commit 199d3a06471ab035215a661602fc7dc3550fbf3f +Author: Philip Withnall +Date: Tue Jul 30 14:17:58 2013 +0200 + + build: Update git.mk from upstream + +M git.mk + +commit 8dd839408ae7f257c91a92b5ca4f470e9993e637 +Author: Philip Withnall +Date: Tue Jul 30 13:18:20 2013 +0200 + + documents: Fix default value of GDataDocumentsUploadQuery:convert + + Also add a test for it, because tests are good. + +M gdata/services/documents/gdata-documents-upload-query.c +M gdata/tests/documents.c + +commit 03be462791252e1b146e154eb93fac4841052f6a +Author: Philip Withnall +Date: Sun Jul 28 14:23:24 2013 +0200 + + core: Remove an unnecessary message unpausing + + See: https://bugzilla.gnome.org/show_bug.cgi?id=703461#c4 + +M gdata/gdata-upload-stream.c + +commit f19cf538819581d9c208ca965703b5fd59241e3a +Author: Philip Withnall +Date: Sun Jul 28 14:22:09 2013 +0200 + + tests: Update upload limit on PicasaWeb tests + + Looks like quotas have been increased from 1GiB to 15GiB! + +M gdata/tests/picasaweb.c + +commit 99e4064a8365fab4046918d9b565b8b7974a3ea6 +Author: Philip Withnall +Date: Mon Jul 8 15:34:24 2013 +0100 + + youtube: Add a CHANNEL_REQUIRED error code + + This is returned for operations which require the currently + authenticated + Google Account to have an associated YouTube channel, but it + doesn’t. + + This adds the following API: + • GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED + +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h + +commit 39a84292509ca3dbd99dd06d264b643da15caa47 +Author: Philip Withnall +Date: Mon Jul 8 11:57:51 2013 +0100 + + core: Fix backwards pagination in GDataQuery + + If using pre-specific next/previous URIs, the previous URI wasn’t + being + detected correctly due to a copy–paste error. + +M gdata/gdata-query.c + +commit 2900a5dec708cf59896255f625f732142ed3a5b3 +Author: Philip Withnall +Date: Wed Jul 3 19:46:58 2013 +0100 + + tests: Update test account password + +M gdata/tests/common.h + +commit e795f559327b3f208d768a4461ca1829e0f44693 +Author: Philip Withnall +Date: Wed Jul 3 19:38:07 2013 +0100 + + core: Write upload chunks in an idle handler to avoid stack overflow + + Otherwise the used stack size would be proportional to the number of + chunks uploaded by GDataUploadStream, and hence stack overflow could + potentially occur. + +M gdata/gdata-upload-stream.c + +commit c7b758c60dca3d213ee3629605ae493c221e57c6 +Author: Philip Withnall +Date: Wed Jul 3 19:39:03 2013 +0100 + + tests: Fix a YouTube test name + +M gdata/tests/youtube.c + +commit 041e0cd0bd2b45ad6f8ca600d91bf51906cd4524 +Author: Philip Withnall +Date: Tue Jul 2 13:12:45 2013 +0100 + + tests: Move stream creation out of setup and into test functions + + Resetting the stream (seeking back to the beginning and clearing + pending + operations) was too fragile, and resulted in spurious test failures. + +M gdata/tests/youtube.c + +commit 26532799c10145c31dc07d95c8f69b71c72d9539 +Author: Philip Withnall +Date: Tue Jul 2 13:02:17 2013 +0100 + + core: Fix error notification of cancelled messages + + If a message is cancelled during (e.g.) DNS resolution or SSL + handshaking, + libsoup will return SOUP_STATUS_SSL_FAILED (and friends) rather than + SOUP_STATUS_CANCELLED, which was causing occasional spurious + failures in + the test suite (due to the wrong error messages being set). Fix + this by + explicitly converting SOUP_STATUS_SSL_FAILED (etc.) to + SOUP_STATUS_CANCELLED if the cancellable is cancelled. + +M gdata/gdata-service.c + +commit 300c38f65e34d76649c39a050e7d5d792ffba68f +Author: Philip Withnall +Date: Tue Jul 2 12:59:28 2013 +0100 + + core: Fix idle callback priority for batch operation callbacks + + Occasionally, the callback for an async batch operation as a whole + was being + called before the callbacks for the individual operations in the + batch. This + was causing the YouTube tests to spuriously fail every so often. + + Fix this by setting the callback priority for operation callbacks + to be the + same as that of the entire batch. + +M gdata/gdata-batch-operation.c + +commit 13e3571490d41aaff4761df12f0d97d5b048a5d1 +Author: Peteris Krisjanis +Date: Sat Jun 29 21:34:21 2013 +0300 + + Replacing g_log_set_default_handler with g_log_set_handler + + Replacing g_log_set_default_handler with g_log_set_handler for all + message types except G_LOG_LEVEL_DEBUG, as setting default handler + means it catches messages from all other domains, t.i. from other + libraries and applications. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=703192 + +M gdata/gdata-service.c + +commit b116aade27c2a4b4229ba0b6cca4a425f9dfcb38 +Author: Peteris Krisjanis +Date: Fri Jun 21 18:55:51 2013 +0300 + + Added functions gdata_test_debug_output, gdata_test_debug_handler + and GSList message_list for collecting debug messages in memory and + printing out only when needed (including pretty printing XML). Closes + https://bugzilla.gnome.org/show_bug.cgi?id=627895 + +M gdata/tests/common.c +M gdata/tests/common.h + +commit 59aea63e87277fe7d320add954403105be3f0405 +Author: Peteris Krisjanis +Date: Fri Jun 21 18:35:45 2013 +0300 + + Change g_log_set_handler to g_log_set_default_handler so we could + set handler for debug log level in tests/common.c. + +M gdata/gdata-service.c + +commit 0d10848774715616700673c0d4e88a7140d1a0db +Author: Inaki Larranaga Murgoitio +Date: Wed Mar 20 11:13:41 2013 +0100 + + Updated Basque language + +M po/eu.po + +commit 2e53dfed8492d615a7f7d9c5cff5d1d773609e40 +Author: Victor Ibragimov +Date: Tue Mar 19 22:37:17 2013 +0100 + + [l10n] Added Tadjik translation + +M po/LINGUAS +A po/tg.po + +commit b72f1a20fd48b34e283977a780ab4b57c1955b48 +Author: Duarte Loreto +Date: Sun Mar 17 00:52:05 2013 +0000 + + Converted Portuguese translation to New Spelling (Novo AO) + +M po/pt.po + +commit 092d9fa1155e0badc53218b0c990d9769f2f5d94 +Author: Philip Withnall +Date: Tue Feb 26 00:09:41 2013 +0000 + + build: Increment version to 0.13.4 + +M configure.ac + +commit b88c044eee340d3abec819e793e33cea0bb9b480 +Author: Philip Withnall +Date: Tue Feb 26 00:08:36 2013 +0000 + + Release version 0.13.3 + +M NEWS +M configure.ac + +commit 9e99119d917b7af762b46b91b067a3ad55710aa5 +Author: Philip Withnall +Date: Tue Feb 26 00:04:59 2013 +0000 + + docs: Add a missing xi:include to gdata-docs.xml + +M docs/reference/gdata-docs.xml + +commit 56490d4db4cf8b7fdfa84aa0b583da908ec21a10 +Author: Philip Withnall +Date: Tue Feb 26 00:04:05 2013 +0000 + + build: Fix paths referencing introspection.m4 in Makefile.am + + This is a follow-up to commit + 1d58568969ce533bf92870b378937057e95fe0c2. + +M Makefile.am + +commit 1d58568969ce533bf92870b378937057e95fe0c2 +Author: Evan Nemerson +Date: Thu Feb 21 22:08:33 2013 -0800 + + build: Don’t require introspection.m4 to be installed system-wide + + Keep and use a local copy, since libgdata only has g-i as an optional + dependency. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=694415 + +M autogen.sh +R100 introspection.m4 m4/introspection.m4 + +commit ba0d4a06dcec5bf26e23effded0973df70569dc1 +Author: Colin Walters +Date: Sun Feb 24 04:30:44 2013 -0500 + + vala: Fix a typo in the build rule + +M Makefile.am + +commit 2186969875520d535704f61280f62145932b4948 +Author: Evan Nemerson +Date: Thu Feb 21 21:53:45 2013 -0800 + + build: Add Vala bindings + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=693865 + +M Makefile.am +M configure.ac +A gdata/GData-0.0.metadata +A m4/vapigen.m4 + +commit 0fd7b768d14350854db00ad393ddc33e05681e1a +Author: William Jon McCann +Date: Sat Feb 16 09:14:38 2013 -0500 + + Add support for PDF files + + https://bugzilla.gnome.org/show_bug.cgi?id=693958 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-feed.c +A gdata/services/documents/gdata-documents-pdf.c +A gdata/services/documents/gdata-documents-pdf.h +M gdata/services/documents/gdata-documents-service.c + +commit 1d38ac14d3e57ebf20431086bf45cac5bfbb3ca5 +Author: Evan Nemerson +Date: Thu Feb 14 18:38:05 2013 -0800 + + calendar: port some introspection fixes from Vala's metadata + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=693855 + +M gdata/services/contacts/gdata-contacts-contact.c + +commit 618be836a12a32bc0af661c54bfd76d30c992466 +Author: Ján Kyselica +Date: Wed Feb 6 18:15:29 2013 +0100 + + Updated slovak translation + +M po/sk.po + +commit dad8706c3ab4b0c36dd8956dd0abe50d5f5d1df8 +Author: Gheyret Kenji +Date: Sat Feb 2 12:39:21 2013 +0900 + + Updated Uyghur translation + + Signed-off-by: Gheyret Kenji + +M po/ug.po + +commit 2fa88858a96b7368e342dc60996be8327a387ebc +Author: Peter Mráz +Date: Thu Jan 31 22:24:14 2013 +0100 + + Added missing et to LINGUAS + +M po/LINGUAS + +commit e59b3db62c09b5872c2f0c19182228cc184d4aa5 +Author: Ján Kyselica +Date: Wed Jan 30 22:34:11 2013 +0100 + + Added slovak translation + +M po/LINGUAS +A po/sk.po + +commit 2d64f6a90a9055c51beaf10f1aa35d5c8b8ef7a4 +Author: Philip Withnall +Date: Tue Dec 25 09:44:03 2012 +0000 + + build: Update git.mk from upstream + + Upstream is now https://github.com/behdad/git.mk. + +M git.mk + +commit 88e381defb549aa499d7cc482dc7d2dfe5a93577 +Author: Philip Withnall +Date: Tue Dec 25 09:38:52 2012 +0000 + + core: Make ‘Unhandled XML’ messages be debug-only messages + + This stops them filling up people’s .xsession-errors files + unnecessarily. + There is little point to having them as normal GLib messages, since it + didn’t encourage many people to file bugs about unhandled XML + and missing + features. + + If anybody still needs this output, just enable debug output using + G_MESSAGES_DEBUG=all LIBGDATA_DEBUG=3. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=690656 + +M gdata/gdata-parsable.c +M gdata/georss/gdata-georss-where.c + +commit b4d828e002adf21a5ef671ec1b62bed2f48382af +Author: Nirbheek Chauhan +Date: Mon Dec 17 23:18:12 2012 +0530 + + build: Make gnome-online-accounts optional as well + + It already was optional under --enable-gnome; just split that out + into its own + configure option + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=690225 + +M Makefile.am +M configure.ac +M libgdata.pc.in + +commit 60230e288e465091380135ed2d2397cce7ae956c +Author: Alexandre Rostovtsev +Date: Sun Dec 16 00:34:18 2012 -0500 + + build: Do not add unused gnome dependencies to libgdata.pc + + https://bugzilla.gnome.org/show_bug.cgi?id=690281 + +M configure.ac + +commit 1d0ea81d59e03674dceeaa74c277dd4048ff1377 +Author: Philip Withnall +Date: Thu Nov 29 00:34:54 2012 +0000 + + build: Relicence several C/H files from GPLv3+ to LGPLv2.1+ + + The files were mistakenly created with the wrong licence — + libgdata should + be licenced entirely under the LGPLv2.1+. + + Most of the files had their copyright entirely owned by me, and I + consent to + relicensing. + + gdata-client-login-authorizer.c had two commits from other + contributors: + • 84060afb by Philip Chimento + • 935e69fe by Stef Walter + + Both people have agreed to relicence their contributions to + LGPLv2.1+ by + e-mail. + +M gdata/gdata-authorization-domain.c +M gdata/gdata-authorization-domain.h +M gdata/gdata-authorizer.c +M gdata/gdata-authorizer.h +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-client-login-authorizer.h +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-oauth1-authorizer.h +M gdata/services/documents/gdata-documents-upload-query.c +M gdata/services/documents/gdata-documents-upload-query.h + +commit cc229e19456c20ab884f501ce39027faa26c97dd +Author: Colin Walters +Date: Fri Nov 2 12:43:01 2012 -0400 + + GDataDownloadStream: Don't use private libsoup symbol + + libsoup changed to not export private symbols: + + http://git.gnome.org/browse/libsoup/commit/?id=2e1e6999f627bce6fb18e5d94e256da2ac5fef30 + + Patch-suggested-by: Dan Winship + +M gdata/gdata-download-stream.c + +commit 5e088ccdaace6d12331fc63b67b7bfd46808bbff +Author: Mattias Põldaru +Date: Tue Oct 30 15:31:10 2012 +0200 + + [l10n] Updated Estonian translation + +A po/et.po + +commit adf2dd3171017430defa8e68792903724d1f9389 +Author: Philip Withnall +Date: Sun Oct 21 11:59:47 2012 +0100 + + build: Only call g_type_init() for GLib ≤ 2.35.0 + + GLib master has just deprecated g_type_init() in favour of making it a + compiler-supported constructor function. + +M demos/scrapbook/scrapbook.c +M gdata/tests/common.c +M gdata/tests/memory.c +M gdata/tests/perf.c + +commit 811ccbefe1b711a29763700a2bbb5b54b06384d5 +Author: Philip Withnall +Date: Sun Oct 21 11:54:56 2012 +0100 + + core: Add support for OAuth 2.0 to the GOA authoriser + + This is based very heavily on work by Matthew Barnes + for + EDS’ EGDataGoaAuthorizer: + • + http://git.gnome.org/browse/evolution-data-server/commit/addressbook/backends/google/e-gdata-goa-authorizer.c?id=f23f88b2b5e4662730bada1797378fbddfe7ddfa + • + http://git.gnome.org/browse/evolution-data-server/commit/addressbook/backends/google/e-gdata-goa-authorizer.c?id=870bcc9eced87f74807cfeacb16f995a797eb277 + + As he mentions, this hasn’t been tested against GOA 3.7 yet, + so may well not + work. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=685289 + +M gdata/gdata-goa-authorizer.c + +commit 4e72579d1bbb302776a42551cbfb560ddd4258b3 +Author: Robert Ancell +Date: Fri Oct 5 09:15:51 2012 +1300 + + core: Split packages into public and private so the .pc file has + correct depenencies + + https://bugzilla.gnome.org/show_bug.cgi?id=685464 + +M configure.ac +M libgdata.pc.in + +commit 990f3498f31d646b072a39a937f9628fe45ec67a +Author: Philip Withnall +Date: Sun Sep 30 11:08:26 2012 +0100 + + build: Increment version to 0.13.3 + +M configure.ac + +commit 4e8ed9843b55037b01a59143b8876c23a1f7b089 +Author: Philip Withnall +Date: Sun Sep 30 11:06:39 2012 +0100 + + Release version 0.13.2 + +M NEWS +M configure.ac + +commit cddb3f1c41d46b311ff59a4725a4bd1322e19561 +Author: Philip Withnall +Date: Sun Sep 30 10:40:04 2012 +0100 + + youtube: Fix HTTP/HTTPS in a string comparison in a test + + Google have been fiddling with the URIs again, for the better. + +M gdata/tests/youtube.c + +commit ca75565d3f39122d4988e2ede960c9b7cd427ca0 +Author: Philip Withnall +Date: Thu Aug 16 08:02:06 2012 +0100 + + build: Use gnome-common code coverage macros to add gcov support + + This replaces libgdata’s existing home-grown solution with the + gnome-common + code coverage macros added in gnome-common 3.5.6/3.6.0. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=683209 + +M Makefile.am +M configure.ac + +commit 67c447858d0db26b99b2d0c45abea6f31a5da154 +Author: Philip Withnall +Date: Sun Sep 30 09:20:24 2012 +0100 + + core: Redact X-GData-Key headers + + They’re used by the YouTube service to pass the program’s + YouTube developer + key to the server. The developer key is semi-public, but it’s + probably safest + to redact it anyway. It isn’t vital information for debugging. + +M gdata/gdata-service.c + +commit 6def273642e29dfcabf49eaeece27292a40b7f6d +Author: Zeeshan Ali (Khattak) +Date: Mon Sep 24 17:29:23 2012 +0300 + + configure: Explicitly check for libxml2 + + This fixes build on jhbuild on Fedora 18. + +M configure.ac + +commit b8e4c09ec6aa00656600875ebda78d421fa89f29 +Author: Ani Peter +Date: Sun Sep 23 01:02:26 2012 +0530 + + Updated Malayalam file + +M po/ml.po + +commit 5d356c54fcf3f6febc1d15f601c2b4bb30003797 +Author: Carles Ferrando +Date: Sat Sep 22 13:33:47 2012 +0200 + + [l10n]Updated Catalan (Valencian) translation + +M po/ca@valencia.po + +commit 3f7bcea2169824843d5e0e8eb9a49615432ac597 +Author: Joan Duran +Date: Sat Sep 22 13:33:44 2012 +0200 + + [l10n] Updated Catalan translation + +M po/ca.po + +commit 0425292c0bc16962d353aeee8336d616a3728bba +Author: Mario Blättermann +Date: Thu Sep 20 13:13:47 2012 +0200 + + [l10n] Updated German translation + +M po/de.po + +commit 0e9f55d8204641ceb883eaf65b4750fda49959ac +Author: Krishnababu Krothapalli +Date: Thu Sep 20 16:18:19 2012 +0530 + + Updated Telugu Translations + +M po/te.po + +commit 57e40361ec39d4e33e326baf98649f34fc86aa74 +Author: Rajesh Ranjan +Date: Wed Sep 19 17:32:22 2012 +0530 + + hindi update + +M po/hi.po + +commit 3fe3c613d517464a81061cc0eaa0de41c670e7f9 +Author: Alexander Shopov +Date: Tue Sep 18 22:46:49 2012 +0300 + + Updated Bulgarian translation + +M po/bg.po + +commit c7201d2276dd6fffb32fe33dede478ed5579f3e6 +Author: Rafael Ferreira +Date: Mon Sep 17 15:45:23 2012 -0400 + + Updated Brazilian Portuguese translation, reviewed by Enrico Nicoletto + . + +M po/pt_BR.po + +commit a7569a94455edbb6f71f8cb3083d850c5fa9fca8 +Author: Ask H. Larsen +Date: Sun Sep 16 13:33:53 2012 +0200 + + Updated Danish translation + +M po/da.po + +commit 4354b07ca0b8f059ec7e6b6deb0d58816237e1c5 +Author: Daniel Mustieles +Date: Sun Sep 16 13:23:26 2012 +0200 + + Updated Spanish translation + +M po/es.po + +commit 09f87033b09d69fcbe691a9c6e5a6c86548008cf +Author: António Lima +Date: Fri Sep 14 11:01:57 2012 +0100 + + Updated Portuguese translation + +M po/pt.po + +commit 0a1a86e0ff2ba1520f6f61c90e6e0b0a75d27446 +Author: A S Alam +Date: Fri Sep 14 07:39:42 2012 +0530 + + update Punjabi Translation + +M po/pa.po + +commit 12964be84bf8c6cb17cb11382a0c50d3e5ee6cdb +Author: Alexandre Franke +Date: Thu Sep 13 12:55:10 2012 +0200 + + Update French translation + +M po/fr.po + +commit dcedf9e08b8969d78a44ad275114301100b03471 +Author: Tom Tryfonidis +Date: Thu Sep 13 02:40:38 2012 +0300 + + Updated Greek translation + +M po/el.po + +commit 9c1a2304fbe91332ca589469aa12382874281efb +Author: Milo Casagrande +Date: Mon Sep 10 21:26:05 2012 +0200 + + [l10n] Updated Italian translation. + +M po/it.po + +commit e32d6e6f7d7572765196622f107cb5eba987df9b +Author: Changwoo Ryu +Date: Sun Sep 9 05:32:19 2012 +0900 + + Updated Korean translation + +M po/ko.po + +commit 020eb480190abce16b1fb70759497b3be087c0b9 +Author: Marek Černocký +Date: Sat Sep 8 01:02:41 2012 +0200 + + Updated Czech translation + +M po/cs.po + +commit 00e02ac97806ef704c6deb433bc80f58b72341c9 +Author: Akom Chotiphantawanon +Date: Wed Sep 5 17:33:30 2012 +0700 + + Updated Thai translation. + +M po/th.po + +commit 5d77f83aea9d60563d08b399947071f77ab1c7ab +Author: Muhammet Kara +Date: Tue Sep 4 22:47:38 2012 +0300 + + [l10n]Updated Turkish translation + +M po/tr.po + +commit 634b52eff65fe2ceb68ac40cdf1bf66c8ba724db +Author: Piotr Drąg +Date: Tue Sep 4 18:32:11 2012 +0200 + + Updated Polish translation + +M po/pl.po + +commit b04dd4b897fd6f61cc26ede53d7e413b8603f2b4 +Author: Gabor Kelemen +Date: Mon Sep 3 16:27:51 2012 +0200 + + Updated Hungarian translation + +M po/hu.po + +commit 4de1c7a39c5d62b861db4d0f5d938b28bbbd7233 +Author: Yuri Kozlov +Date: Mon Sep 3 10:25:40 2012 +0400 + + Updated Russian translation + +M po/ru.po + +commit b9c73b6843631c5a413f38fd7858952ea469edf6 +Author: Rūdolfs Mazurs +Date: Sun Sep 2 20:49:04 2012 +0300 + + Updated Latvian translation + +M po/lv.po + +commit 1494cefb6ae944eba55b88d208369ce696b424eb +Author: Rūdolfs Mazurs +Date: Sun Sep 2 20:39:48 2012 +0300 + + Updated Latvian translation + +M po/lv.po + +commit 1f4806cfdfa0e62d9831798759f8de75bda58b68 +Author: Aurimas Černius +Date: Tue Aug 28 22:21:15 2012 +0300 + + Updated Lithuanian translation + +M po/lt.po + +commit adbb0ca9846897c9497a3276e50a18139d2efaf4 +Author: Philip Withnall +Date: Sat Aug 25 00:18:42 2012 +0100 + + core: Add a missing ‘G_BEGIN_DECLS’ to a header file + +M gdata/gdata-commentable.h + +commit 3c8bb54c96216ecfd684184260a516d47dc202bd +Author: Philip Withnall +Date: Fri Aug 24 18:51:37 2012 +0100 + + docs: Add an example of inserting an access rule into an ACL + + Hopefully this should make ACLs a little less opaque. + +M gdata/gdata-access-handler.c +M gdata/gdata-access-rule.c + +commit 953a4a5da421fa4a0833e849832ae71265fe903c +Author: Piotr Drąg +Date: Thu Aug 23 03:44:50 2012 +0200 + + Updated Polish translation + +M po/pl.po + +commit e7972d97e08f4769a6864758c76cd5d2b30aaded +Author: Nguyễn Thái Ngọc Duy +Date: Wed Aug 22 08:50:45 2012 +0700 + + Updated Vietnamese translation + +M po/vi.po + +commit 4138a69a48c8be3dfdcef57b1339b20ea4c581e2 +Author: Nguyễn Thái Ngọc Duy +Date: Wed Aug 22 08:49:49 2012 +0700 + + po/vi: imported from Damned Lies + +M po/vi.po + +commit be87eb3471b9ae4a9a25842652997be684c71af4 +Author: Philip Withnall +Date: Tue Aug 21 08:05:57 2012 +0100 + + youtube: Fix case of a string in the unit tests + + Looks like Google changed how they treat cases of usernames in URIs. + +M gdata/tests/youtube.c + +commit 7c1f8ffaf330827129c5b01f34377ba2ed5a0530 +Author: Philip Withnall +Date: Mon Aug 20 22:36:34 2012 +0100 + + core: Fix parsing of ‘default’ ACL rule scopes + + As found by Meg Ford, libgdata was expecting elements + to have + a ‘value’ property, when the documentation + (https://developers.google.com/google-apps/calendar/v2/reference#gacl_reference) + explicitly says they shouldn’t have one. Whoops. + + This fixes it and adds a test. Note that the code doesn’t check that + there _isn’t_ a ‘value’ property, because Google might go and + change it in + future. + +M gdata/gdata-access-rule.c +M gdata/tests/general.c + +commit 49f7f28fa1e6b9cbbaab02089a01bb6220853634 +Author: Fran Diéguez +Date: Fri Aug 17 23:23:02 2012 +0200 + + Updated Galician translations + +M po/gl.po + +commit eeb8d1ee714c5c20bfa1c787bdacdcff3d084d4a +Author: Philip Withnall +Date: Thu Aug 16 08:18:41 2012 +0100 + + docs: Expand documentation on logging and error handling + +M README +M docs/reference/gdata-running.xml + +commit 50bcf6439e3692a33e0cf7b4b036c83cf9397490 +Author: Javier Jardón +Date: Fri Aug 10 03:57:07 2012 +0900 + + Makefile.ac: remove reference to not used gnome-doc-utils file + +M Makefile.am + +commit a3dbae4a2a540cde2e1d661dcb3ae264e8cb8826 +Author: Nilamdyuti Goswami +Date: Wed Aug 8 14:23:12 2012 +0530 + + Assamese translation updated + +M po/as.po + +commit b013ee1618e833f9ddf10718bc6d65575b56892f +Author: Chao-Hsiung Liao +Date: Tue Aug 7 13:42:55 2012 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit aab60b1bc8f3bbe7e58cb3bfaacf109873d2501c +Author: Fran Diéguez +Date: Mon Jul 30 02:43:14 2012 +0200 + + Updated Galician translations + +M po/gl.po + +commit 219beb2bed7dfcd226c85ff85fba0238f4488b74 +Author: Philip Withnall +Date: Sat Jul 28 12:41:01 2012 +0200 + + build: Increment version to 0.13.2 + +M configure.ac + +commit fd8116576d8f9c33eadc45be0305f0291012419f +Author: Philip Withnall +Date: Sat Jul 28 12:03:36 2012 +0200 + + Release version 0.13.1 + +M NEWS +M configure.ac + +commit d2c038fe3f9a098ec8ee6eb4edb03d114e2daf64 +Author: Philip Withnall +Date: Sat Jul 28 12:20:32 2012 +0200 + + documents: Fix some documentation for thumbnail downloads + +M gdata/services/documents/gdata-documents-document.c + +commit d8a93286b0262b273eb926d19cf37032cdd44be6 +Author: Philip Withnall +Date: Sat Jul 28 12:06:16 2012 +0200 + + docs: Add a missing xi:include to gdata-docs.xml + +M docs/reference/gdata-docs.xml + +commit bb323065ac791f51efad24678b7316664ac052f3 +Author: Philip Withnall +Date: Sat Jul 28 11:50:50 2012 +0200 + + l10n: Update British English translation + +M po/en_GB.po + +commit ea8ea91b685c5521dde2178503fe06a4717492e6 +Author: Мирослав Николић +Date: Wed Jul 25 09:22:13 2012 +0200 + + Updated Serbian translation + +M po/sr.po +M po/sr@latin.po + +commit 02cef063ab4dc532b913e2e019fbd38a5ada0e92 +Author: Yaron Shahrabani +Date: Tue Jul 24 22:37:33 2012 +0300 + + Updated Hebrew translation. + +M po/he.po + +commit 7687d01259c41be11178e9c88203050e5db1a7ec +Author: Kjartan Maraas +Date: Mon Jul 23 11:47:31 2012 +0200 + + Updated Norwegian bokmål translation + +M po/nb.po + +commit 39b6ac0d4c79730bbaa62f36cd9aa343559b07ee +Author: Philip Withnall +Date: Sat Jul 21 11:07:45 2012 +0100 + + Bug 656970 — Add thumbnail support + + Add support for downloading thumbnails of Google Documents + documents. This + includes a test case, but it isn’t very useful because I can’t + find a single + document which has a thumbnail expressed in its metadata. Your + mileage may + vary. + + This also includes an example of how to download thumbnails, + but that’s + similarly (unfortunately) untestable. This leaves me with a sour + taste in + my mouth. + + New API: + • gdata_documents_document_get_download_uri() + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=656970 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-document.h +M gdata/tests/documents.c + +commit 23a3e2db4405900ac1e3e0ce637dc3434db1a55f +Author: Philip Withnall +Date: Sat Jul 21 11:06:40 2012 +0100 + + documents: Fix uploading documents for some of the tests + + Inserting metadata-only documents is currently broken on the + servers. Work + around it for the moment by using resumable upload. + +M gdata/tests/documents.c + +commit a6ee6ee1de1e290fcebb3f68e0707f88670657d8 +Author: Philip Withnall +Date: Sat Jul 21 09:33:27 2012 +0100 + + docs: Update dependency list in README + +M README + +commit 4c5eb11d7555ac8836cbe71d96a823566b1d0d02 +Author: Matej Urbančič +Date: Thu Jul 19 13:02:42 2012 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit d456a8f5c23df309b4bbbd570b3bdbdcea20c534 +Author: Matej Urbančič +Date: Thu Jul 19 10:11:58 2012 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit 926efff5e76ffb0fc25f0db9d5323029968cf579 +Author: Chao-Hsiung Liao +Date: Wed Jul 18 19:36:18 2012 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit 935e69fe86b51508cb22860a5db96aa1989c58ca +Author: Stef Walter +Date: Tue Jul 17 21:16:11 2012 +0100 + + core: Use gcr instead of libgnome-keyring for secure memory + + * libgnome-keyring will be deprecated in the future + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=679867 + +M README +M configure.ac +M docs/reference/gdata-overview.xml +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-service.c + +commit 56a39743779f63791e27886aaa3a9338602406f3 +Author: Philip Withnall +Date: Mon Jul 16 21:08:00 2012 +0100 + + Bug 656976 — Merge eds and GNOME Documents GOA authorisers + + Copy the GOA authoriser from EDS into libgdata, modifying it a bit + to add + support for non-Contacts services and remove use of the liboauth + HMAC function + in favour of GLib’s implementation. + + This is essentially the same code as used by GNOME + Documents. Originally + written by Matthew Barnes. He’s given permission for it to be + relicenced from + LGPL v2 or v3 to LGPL v2.1+. (See the bug report.) + + This adds the following API: + • GDataGoaAuthorizer + + This is currently untested; waiting to port EDS and GNOME Documents + to it + to test it. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=656976 + +M Makefile.am +M configure.ac +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +A gdata/gdata-goa-authorizer.c +A gdata/gdata-goa-authorizer.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/tests/Makefile.am +M libgdata.pc.in + +commit e483d930c86ba20d390051713f34bc9ed1da0289 +Author: Daniel Mustieles +Date: Mon Jul 16 16:45:45 2012 +0200 + + Updated Spanish translation + +M po/es.po + +commit 5f851c6f82a639ff7c25b28bf49cd42fb90223aa +Author: Andika Triwidada +Date: Sun Jul 15 20:00:10 2012 +0700 + + Updated Indonesian translation + +M po/id.po + +commit 6a4d7b156d833980f6bad286d6fd70d64a923bf2 +Author: Ihar Hrachyshka +Date: Sun Jul 15 14:36:03 2012 +0300 + + Updated Belarusian translation. + +M po/be.po + +commit 2bfde8ba318c991ec909c3f7d788c244b615d7b8 +Author: Philip Withnall +Date: Sun Jul 15 11:00:50 2012 +0100 + + Bug 607270 — Support copying documents + + Add support for copying uploaded Google Documents documents without + having + to re-upload them. + + New API: + • gdata_documents_service_copy_document() + • gdata_documents_service_copy_document_async() + • gdata_documents_service_copy_document_finish() + + This includes a test case, but I haven’t been able to run it + because Google’s + servers are still acting up re. metadata-only uploads. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=607270 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/tests/documents.c + +commit adc9b5b03e5f8ea121214a66888d9e7d06b5e2dd +Author: Chao-Hsiung Liao +Date: Sat Jul 14 14:16:00 2012 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit be230783f8a4105e1a128873b4666060f164e856 +Author: Philip Withnall +Date: Thu Jul 5 21:45:27 2012 +0100 + + contacts: Sleep for 3s after uploading a photo in the tests + + It now seems to fairly consistently take Google servers 3s to process + uploaded photos. Before this time has passed, a query for an + uploaded photo + (using the URI provided in the “upload successful” response) + will result in + an error. + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=679072 + +M gdata/tests/contacts.c + +commit 49ff505cb84341ecd0ae89f25a16cb8e01722311 +Author: Philip Withnall +Date: Thu Jul 5 21:40:07 2012 +0100 + + tests: Temporarily relax requirements on element + + See previous commit (faa7fe461032a3cb6b7a35fc6465bed53c695b70). + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=679072 + +M gdata/tests/general.c + +commit faa7fe461032a3cb6b7a35fc6465bed53c695b70 +Author: Philip Withnall +Date: Tue Jul 3 22:16:59 2012 +0100 + + youtube: Temporarily relax requirements on element + + The YouTube comments feed is not a valid Atom feed, as it’s recently + (somehow) + lost its element. So we temporarily relax our requirements + for feeds + to follow any kind of standards or even the Google-provided + documentation. + + Filed as: https://code.google.com/p/gdata-issues/issues/detail?id=2908 + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=679072 + +M gdata/gdata-feed.c + +commit b1de9375b8c652c89415c5cde43607ffb06edbc2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jul 3 21:53:35 2012 +0100 + + contacts: Use fuzzy time comparisons when testing contact insertions + + Yes, having a contact which was last edited before it was created + is a valid + thing. + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=679072 + +M gdata/tests/common.h +M gdata/tests/contacts.c + +commit 62bb1f674d866f04022a71a7516b52d9895b7444 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jul 3 00:02:49 2012 +0100 + + tests: Update test account password + +M gdata/tests/common.h + +commit c04163c0b53c8a9c0db4650cb345b18374ae8d15 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 2 23:48:05 2012 +0100 + + picasaweb: Relax some checks in the PicasaWeb test suite + + Don’t compare ETags and update dates exactly. This fixes some + failures caused + by Google’s use of relaxed consistency in the server implementation. + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=679072 + +M gdata/tests/picasaweb.c + +commit 93b1982b23fda320f2e0bd71e982849a8a970a20 +Author: Tom Tryfonidis <tomtryf@gmail.com> +Date: Mon Jul 2 16:42:54 2012 +0300 + + Updated Greek translation + +M po/el.po + +commit 5407aa327fc94cd25e2e05773cf7afbb7092c188 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jun 28 21:19:06 2012 +0100 + + calendar: Test with 2 calendars rather than 3 + + Google’s poor little servers don’t like 3 calendars being created + in quick + succession (although they definitely used to be OK with it), + resulting in + the calendar query tests failing. + + Reduce the number of test calendars used for such tests to 2, rather + than 3. + That should hopefully fix the problem, although I can’t test the + fix works + completely because I’ve run out of GData query quota for the day. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=679072 + +M gdata/tests/calendar.c + +commit 8c3e14a7504227bb1b59e193fc7da2e8518c1409 +Author: Alexander Shopov <ash@kambanaria.org> +Date: Wed Jun 27 06:50:20 2012 +0300 + + Updated Bulgarian translation + +M po/bg.po + +commit 09d594d6aad97c8a2f7d0d8b0beae159bc797f95 +Author: Cosimo Cecchi <cosimoc@gnome.org> +Date: Sat Jun 23 13:09:04 2012 -0400 + + documents: add support for Google Drawings + + Add a GDataDocumentsDocument subclass to handle drawing docs. + + https://bugzilla.gnome.org/show_bug.cgi?id=633548 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-document.c +A gdata/services/documents/gdata-documents-drawing.c +A gdata/services/documents/gdata-documents-drawing.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-feed.c +M gdata/services/documents/gdata-documents-service.c + +commit 4446403ee1323480e9b2eaa37ab30da8c43afba9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat May 19 22:45:41 2012 +0100 + + core: Silence a GIR warning + + Since gdata-version.h is included several times, the scanner was + getting + confused about seeing the SECTION comment multiple times. + +M gdata/gdata-version.h.in + +commit 28ec244a551e1cba09fdcb63cc5f38eba977633e +Author: Wouter Bolsterlee <wbolster@gnome.org> +Date: Tue May 15 22:08:08 2012 +0200 + + Updated Dutch translation + +M po/nl.po + +commit 72b2d5e3aafc8d3b835ffb96cfbccf5486916e65 +Author: Willem Heppe <heppew@yahoo.com> +Date: Tue May 15 21:09:38 2012 +0200 + + Initial Dutch translation + +M po/LINGUAS +A po/nl.po + +commit c6be6c32b45fee3b9e0fd8ddfdca35cc6bd0777f +Author: Γιώργος Στεφανάκης <george.stefanakis@gmail.com> +Date: Wed May 2 12:29:16 2012 +0300 + + Updated Greek translation + +M po/el.po + +commit b3267de2e3ab52f7e476eb57ca9a067a7f651858 +Author: Fran Diéguez <fran.dieguez@mabishu.com> +Date: Sun Apr 22 21:34:53 2012 +0200 + + Updated Galician translations + +M po/gl.po + +commit 3be0cfb05eb49b70d22f199ea1fbd7534f6cbc6e +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Sat Apr 21 13:08:01 2012 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit 20449020db4083ce9fdfa5b562dcfab199146a99 +Author: Kjartan Maraas <kmaraas@gnome.org> +Date: Wed Apr 18 09:29:04 2012 +0200 + + Updated Norwegian bokmål translation + +M po/nb.po + +commit 5496df57bbe92ead573ebc22310192a6ec13d89a +Author: Sasi Bhushan <sasi@swecha.net> +Date: Tue Apr 17 15:55:35 2012 +0530 + + Updated Telugu Translation + +M po/te.po + +commit df9886267101d38fe913ce37d5961b0a5487dda9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 12:31:53 2012 +0100 + + build: Increment version to 0.13.1 + +M configure.ac + +commit 703a7d2cd9ca10392acf9f6916b781dea8c857be +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 12:30:32 2012 +0100 + + Release version 0.13.0 + +M NEWS +M configure.ac +M docs/reference/gdata-docs.xml + +commit 66a9d2b4d9c6a45bb231549caabf0d1a1446ae5f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 12:14:43 2012 +0100 + + l10n: Update British English translation + +M po/en_GB.po + +commit dc298f4f5123ba62df56ae1e4ece08d6055eb2bb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 11:08:30 2012 +0100 + + documents: Add an XML parsing test for GDataDocumentsFolder + + This includes a test for GDataDocumentsEntry:quota-used. + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=588714 + +M gdata/tests/documents.c + +commit 3ee77832b4dcfdb83a5e653760eeece34d68c045 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 11:00:35 2012 +0100 + + Bug 588714 — <gd:quotaBytesUsed> handling in GDataDocumentsEntry + + Add support for <gd:quotaBytesUsed> to GDataDocumentsEntry. + + API additions: + • GDataDocumentsEntry:quota-used and + gdata_documents_entry_get_quota_used() + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=588714 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-entry.h + +commit 72464c86e970f205ae6bad765f65839cc9da46dd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 11:26:40 2012 +0100 + + core: Add gdata_parser_int64_from_element() to parse long numbers + + In comparison to the old version, this handles normal integers + rather than + dates. + + This also ports some uses of g_ascii_strtoll() in GDataPicasaWebUser + to the + new API. + +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/services/picasaweb/gdata-picasaweb-user.c + +commit 282d44478b67a7c86f92fb4fa416c47c1cdc101a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 11:13:40 2012 +0100 + + core: Rename gdata_parser_int64_from_element() + + So that a new int64 parsing method can be added. + +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-group.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/youtube/gdata-youtube-group.c + +commit c31f3d6e8955c37c1351644527917bd9cb082623 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 10:27:18 2012 +0100 + + documents: Fix support for downloading arbitrary documents + + This adds a new authorization domain necessary for downloading + arbitrary + files. I can’t test this at the moment, though, due to Google + breaking the + workaround we were using for uploading metadata-only documents. + (See: + http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3033) + + Thanks Google. Thoogle. + +M gdata/services/documents/gdata-documents-service.c +M gdata/tests/documents.c + +commit 8f084ed2f1d8f3256c12ad7184639d0dd2c68ccd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 09:52:40 2012 +0100 + + documents: Add GDATA_DOCUMENTS_TEXT_JPEG export format + + API additions: + • GDATA_DOCUMENTS_TEXT_JPEG + +M docs/reference/gdata-sections.txt +M gdata/services/documents/gdata-documents-text.h + +commit 5cbd5e7e61000f3170bb25dcdd8e316b1208e9c2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 09:50:29 2012 +0100 + + documents: Tidy up GDataDocumentsFeed a little + +M gdata/services/documents/gdata-documents-feed.c + +commit 4617666c239d268b5a90ac3e3dd5b24445e0c878 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 14 09:47:52 2012 +0100 + + documents: Add arbitrary file support to GDataDocumentsFeed + +M gdata/services/documents/gdata-documents-feed.c + +commit 8fd2cf3963d25eb97014ddb3f234c2bf8cad6261 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 13 13:14:54 2012 +0100 + + Bug 607616 — Permit the uploading of documents of any type + + Add support to GDataDocumentsUploadQuery for specifying that documents + shouldn’t be converted to common formats on being uploaded. This + permits + arbitrary files to be uploaded. + + This includes test cases. + + API additions: + • GDataDocumentsUploadQuery:convert, + gdata_documents_upload_query_get_convert and + gdata_documents_upload_query_set_convert + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=607616 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-upload-query.c +M gdata/services/documents/gdata-documents-upload-query.h +M gdata/tests/documents.c + +commit e1f77430461ea48917a87aa2050d4f91a9440c9f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 13 13:52:00 2012 +0100 + + tests: Move check_kind() from contacts tests to + gdata_test_compare_kind() + +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/contacts.c + +commit 1d0e74eeb0851d5be40b5d79d153682d52712180 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 13 13:20:00 2012 +0100 + + documents: Make GDataDocumentsDocument non-abstract + + It now represents arbitrary files, so that Google Documents can be + used as + a kind of remote filesystem. + + This shouldn’t be an API break. + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=656971 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-document.h + +commit c8eca065e5f3f11d0ec8c7aac497e19f7d07469e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 13 00:21:51 2012 +0100 + + documents: Split upload parameters out into GDataDocumentsUploadQuery + + This new object currently only specifies the destination folder for an + upload (replacing the folder argument to + gdata_documents_service_upload_document_resumable()), but will + in future + allow specifying things like the ‘convert’ and OCR parameters + for uploads. + + API additions: + • GDataDocumentsUploadQuery and its methods + + API breaks: + • gdata_documents_service_upload_document_resumable() + (Note that this API hasn’t yet been in a libgdata release, so + this isn’t + a real API break.) + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=656971 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +A gdata/services/documents/gdata-documents-upload-query.c +A gdata/services/documents/gdata-documents-upload-query.h +M gdata/tests/documents.c + +commit 5eea510bb492e62e76e515534f4f02be85caac81 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 13 00:09:38 2012 +0100 + + documents: Tidy up URI escaping a little + +M gdata/services/documents/gdata-documents-service.c + +commit 50e671a77fff86641a211ea1434b067d35e359db +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 13 00:04:09 2012 +0100 + + docs: Fix some documentation comment syntax + +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/picasaweb/gdata-picasaweb-album.c + +commit b5b93cee8fc3210ac96c40051b14695846ca2f9d +Author: Yaron Shahrabani <sh.yaron@gmail.com> +Date: Fri Apr 13 01:03:15 2012 +0300 + + Updated Hebrew translation. + +M po/he.po + +commit 37a2d6e5802bdadfc1c2f7190d9a75cdfae6f03f +Author: Carles Ferrando <carles.ferrando@gmail.com> +Date: Wed Apr 11 00:22:39 2012 +0200 + + [l10n]Updated Catalan (Valencian) translation + +M po/ca@valencia.po + +commit 98cd05d04c5ebb9c4e9355d989932b46b3ca5f22 +Author: Jordi Serratosa <jordis@softcatala.cat> +Date: Wed Apr 11 00:22:19 2012 +0200 + + [l10n] Fixes on Catalan translation + +M po/ca.po + +commit 820216f8a6acb6a3b5ecdcb7a2d076db86109509 +Author: Daniel Mustieles <daniel.mustieles@gmail.com> +Date: Sun Apr 8 13:25:48 2012 +0200 + + Updated Spanish translation + +M po/es.po + +commit 611ab8efbc5eaa9884e6217f19c15ae885323f74 +Author: Daniel Nylander <po@danielnylander.se> +Date: Mon Apr 2 18:45:17 2012 +0200 + + Updated Swedish translation + +M po/sv.po + +commit 96ab38cf45dcf07eb9b125106548a2343457be19 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 2 16:39:26 2012 +0100 + + build: Increment version to 0.13.0 + + This also fixes the ‘Since’ lines of documentation comments + which referred + to the (now non-existent) 0.11.2 release. This will actually be + the 0.13.0 + release. + +M configure.ac +M gdata/gdata-upload-stream.c +M gdata/gdata-upload-stream.h +M gdata/services/documents/gdata-documents-service.c + +commit 1f847d3e53e4c1a326f7920e1651e5a4573a990f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 2 15:18:21 2012 +0100 + + documents: Fix batch operation tests for v3 of the API + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=593537 + +M gdata/tests/documents.c + +commit c0358261b2c897c8daacab1be58d63a63b9f4394 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 2 15:17:42 2012 +0100 + + documents: Fix adding to/removing from folders with v3 of the API + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=593537 + +M gdata/services/documents/gdata-documents-service.c + +commit 6e8499dfbdb6029b7797ae31957b87f688a88482 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 2 15:12:35 2012 +0100 + + documents: Add support for resumable uploads and updates + + This adds support for resumable uploads and updates to the Documents + API. In + doing so, it was necessary to wade through a sea of bugs and + documentation + inadequacies in the GData protocol (thanks, Google). In the end, + it all seems + to work (ignoring the pile of hacks to handle differences between + non-resumable and resumable uploads’ handling of metadata; and + the bugs in + content-only uploads). + + It’s worth noting that this is only a basic implementation of + resumable + upload/update. It does not, for example, automatically retry chunks of + uploads which fail. That can come later. + + A new, expanded set of test cases for uploads/updates is included. + + New API: + • gdata_documents_service_upload_document_resumable() + • gdata_documents_service_update_document_resumable() + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=607272 + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=593537 + +M docs/reference/gdata-sections.txt +M gdata/gdata-upload-stream.c +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/tests/documents.c + +commit c472db8b6cd12c02d4182e4d2f36aa2ae8dcdac2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Oct 28 09:31:24 2011 +0100 + + documents: Add basic support for version 3 of the Google Documents API + + Support for v3 of the API will replace support for v2, given that + v3 is now + stable and v2 is no longer recommended. + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=593537 + +M gdata/services/documents/gdata-documents-service.c + +commit 3ff70e3824980996b8c0e3b0f1917144783945d0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Nov 6 23:27:43 2011 +0000 + + documents: Changes to IDs for v3 support + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=593537 + +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-service.c + +commit 6c4a2b36627a5ceec91d6979eca61ef27ee3ea1f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 2 15:06:41 2012 +0100 + + documents: Update links in the documentation + + Google have helpfully moved the GData documentation and not put + any redirects + in place, so we have to update all the links for v3 of the Documents + API. + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=593537 + +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.c +M gdata/services/documents/gdata-documents-text.h + +commit f91c994f0f6f5f96ea7765e75ecc1ce393f9b61b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 20 20:40:16 2011 +0000 + + core: Extend GDataUploadStream with support for resumable uploads + + This adds the following API: + • gdata_upload_stream_new_resumable() + • GDataUploadStream:content-length, + gdata_upload_stream_get_content_length() + + Helps: https://bugzilla.gnome.org/show_bug.cgi?id=607272 + +M docs/reference/gdata-sections.txt +M gdata/gdata-upload-stream.c +M gdata/gdata-upload-stream.h +M gdata/gdata.symbols +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/streams.c + +commit c755ad77704e7d1a7cac3bb7d4e4371c5da9a234 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Mar 31 17:20:59 2012 +0100 + + core: Bump GLib requirement to ≥ 2.31.0 + + This allows us to drop the conditional threading code and just + use GLib’s + new threading primitives. + +M configure.ac +M gdata/gdata-buffer.c +M gdata/gdata-buffer.h +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-download-stream.c +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-service.c +M gdata/gdata-upload-stream.c +M gdata/tests/common.c +M gdata/tests/memory.c +M gdata/tests/perf.c +M gdata/tests/streams.c + +commit f02b54681358d477141b8cbe3bcbfc80a3cb344d +Author: Praveen Arimbrathodiyil <pravi.a@gmail.com> +Date: Mon Mar 26 13:10:11 2012 +0530 + + Malayalam translation updated by Anish + +M po/ml.po + +commit 05e843480f5db0d79370163b7dc3bec653691a7c +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Fri Mar 23 22:31:20 2012 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit 29357c3cdb19c386f9177dce24fa9e556443c6fb +Author: Rajesh Ranjan <rranjan@redhat.com> +Date: Fri Mar 23 16:48:15 2012 +0530 + + hindi translation by Chandan Kumar + +M po/hi.po + +commit 4898f768bf0e88f7cec5dbdc32039697c0354a16 +Author: Sandeep Sheshrao Shedmake <sshedmak@redhat.com> +Date: Tue Mar 20 13:44:03 2012 +0530 + + Updated Marathi Translations + +M po/mr.po + +commit 940ac57432c52f332c33e29bb31b7eeb9618fb57 +Author: Abderrahim Kitouni <a.kitouni@gmail.com> +Date: Tue Mar 20 08:53:46 2012 +0100 + + Added Arabic translation + + Based on initial translation by Ibrahim "Diego". + +M po/LINGUAS +A po/ar.po + +commit be9c25f6892eeb530a01ef326fe2258b11828f27 +Author: Praveen Arimbrathodiyil <pravi.a@gmail.com> +Date: Thu Mar 15 14:29:00 2012 +0530 + + Malayalam translation by Anish + +M po/LINGUAS +A po/ml.po + +commit 81c5ea68058ca1039d3b881f98fc911d45d9a896 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 12 21:31:38 2012 +0000 + + build: Fix NEWS entry for 0.11.1 + + I accidentally copied-and-pasted the entry from 0.10.2 without + editing it + properly. + +M NEWS + +commit fed57ca8526011d9a81dca790bb61e8d305ff2ef +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 12 09:15:05 2012 +0000 + + build: Increment version to 0.11.2 + +M configure.ac + +commit 0613f655c8121129bd69a7f51ddd575748ca88db +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 12 09:14:40 2012 +0000 + + Release version 0.11.1 + +M NEWS + +commit 6799f2c525a584dc998821a6ce897e463dad7840 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 8 00:09:08 2012 +0000 + + core: Validate SSL certificates for all connections + + This prevents MitM attacks which use spoofed SSL certificates. + + Note that this bumps our libsoup requirement to 2.37.91. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=671535 + +M configure.ac +M gdata/gdata-service.c + +commit cfc23bfe8fae81485f424965ec4157993cf655e6 +Author: Daniel Korostil <ted.korostiled@gmail.com> +Date: Sat Mar 3 17:01:13 2012 +0200 + + Uploaded Ukranian + +M po/uk.po + +commit 49d2d96f00a7203fdf11b93357391358a9f0c8b8 +Author: Kasia Bondarava <kasia.bondarava@gmail.com> +Date: Mon Feb 27 13:59:05 2012 +0300 + + Added Belarusian translation. + +M po/LINGUAS +A po/be.po + +commit 2dda90f943b8a4419982d54342e14ffada908bd8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jan 21 10:20:44 2012 +0000 + + build: Remove some #defines from gdata.symbols + + They should never have been in there, and were breaking the build + on Solaris. + + Closes: https://bugzilla.gnome.org/show_bug.cgi?id=668365 + +M gdata/gdata.symbols + +commit b3d4d6b95645922d1f431b21c41127479b6e463d +Author: Praveen Illa <mail2ipn@gmail.com> +Date: Thu Jan 12 00:01:01 2012 +0530 + + Updated Telugu Translation + +M po/te.po + +commit dad027fdb55420341f1379b031f583c9c75ae189 +Author: Praveen Illa <mail2ipn@gmail.com> +Date: Wed Jan 11 23:58:43 2012 +0530 + + Added Telugu Translation + +M po/LINGUAS + +commit 44476df5362bc1fbc9c052d51330d2f18b04fe6d +Author: Praveen Illa <mail2ipn@gmail.com> +Date: Wed Jan 11 23:58:15 2012 +0530 + + Updated Telugu Translation + +A po/te.po + +commit 7e4274b5f31ab9b4af87c1b862f4f1229810688d +Author: Ryan Lortie <desrt@desrt.ca> +Date: Sat Jan 7 22:21:01 2012 -0500 + + fix introspection for srcdir != builddir builds + + https://bugzilla.gnome.org/show_bug.cgi?id=667577 + +M Makefile.am + +commit a0210434adb4e6ae65db3e1d3820359ca8e57193 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 20 23:36:21 2011 +0000 + + build: Increment version to 0.11.1 + +M configure.ac + +commit 9509d84b36f2e1910f68ba7d10dc2faf79d4f026 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 20 23:34:35 2011 +0000 + + Release version 0.11.0 + +M NEWS +M configure.ac +M docs/reference/gdata-docs.xml + +commit 8e6c8842b44429fbba8cc4bb445532b314b07885 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 20 22:59:48 2011 +0000 + + core: Atomically update auth_tokens in GDataClientLoginAuthorizer + + If a (synchronous or asynchronous) authentication operation fails + or is + cancelled part-way through, we could have successfully authenticated + against + some GDataAuthorizationDomains but not others. In this situation, + we now + only update the set of domains we're authenticated against if _all_ + domains + are successfully authenticated against. + + While this may seem like it wastes the valid auth. tokens, it makes + the API + more consistent and won't really impact real-world usage. In the + real world, + clients are going to want to be authenticated against all of the + domains + they're interested in, or none of them. They most likely won't + care about + partial success of an authentication operation. + +M gdata/gdata-client-login-authorizer.c + +commit fd7c94a176493e4d48f175d28bf9c6266b56da9c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 20 22:58:47 2011 +0000 + + tests: Set G_MESSAGES_DEBUG when running tests + + Recent versions of GLib will only display debug messages when the + appropriate logging domains are set in G_MESSAGES_DEBUG. + +M gdata/tests/common.c + +commit 488106059bd78c600313921c03927b711066725c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 20 21:55:31 2011 +0000 + + documents: Don't use a deprecated function in + GDataDocumentsSpreadsheet + + Use resource IDs instead of document IDs. + +M gdata/services/documents/gdata-documents-spreadsheet.c + +commit b7faf9bfa883fe32d6a73aae55e833e126dde62f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 20 21:53:23 2011 +0000 + + core: Don't use deprecated GLib threading API if we have a recent GLib + + If we have GLib ≥ 2.31.0, use the new threading/mutex/condition + variable API + to avoid deprecated function warnings. + + Note that this doesn't bump our GLib dependency from 2.30.0; if + a recent + enough GLib is not available, libgdata should still compile with + the old + threading API. + +M gdata/gdata-buffer.c +M gdata/gdata-buffer.h +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-download-stream.c +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-service.c +M gdata/gdata-upload-stream.c +M gdata/tests/common.c +M gdata/tests/memory.c +M gdata/tests/perf.c +M gdata/tests/streams.c + +commit bcced9de5f3fb427124848f61d06cd896a76aa88 +Author: Žygimantas Beručka <uid0@akl.lt> +Date: Tue Dec 6 17:36:56 2011 +0200 + + Updated Lithuanian translation + +M po/lt.po + +commit 1c5540bbf98f2b51d23a632dd72a4b2c606d08a7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Oct 27 08:54:03 2011 +0100 + + contacts: Add support for the “file as” property + + Add support for “file as” strings on contacts, specifying their + sort order + if they have non-Western-style names or names which are otherwise + incorrectly + sorted in the contact list. + + The following API has been added: + • GDataContactsContact:file-as + • gdata_contacts_contact_[get|set]_file_as() + + This includes basic test coverage of the new code. + + Helps: bgo#661033 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit 43934b019874eb6490f1df72d3d6dbb5fd034234 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Oct 27 08:52:36 2011 +0100 + + contacts: Slightly relax a test condition + + Instead of requiring that a contact's creation date be at or after + its last + edit date, require that the last edit date be within 5 seconds + after the + contact's creation date. + +M gdata/tests/contacts.c + +commit 95033d02d73a9d7b6e95d4e201c7f53c60b048af +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 23 11:24:40 2011 +0100 + + core: Use GHmac instead of HMAC from liboauth + + This moves us one step closer to dropping the liboauth dependency. + + This bumps our GLib dependency to 2.30.0. + +M configure.ac +M gdata/gdata-oauth1-authorizer.c + +commit 2c7d5579bb82658a2df04dd1e209d9d73d5195ee +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Oct 20 17:19:25 2011 +0100 + + Bug 662290 — Can't update contact that has no full name + + Treat the empty string as if it were NULL for + GDataGDName:full-name. Add a + test case which does so too. + + This should fix round-trips to Google for contacts which have no + full name + set. + + Closes: bgo#662290 + +M gdata/gd/gdata-gd-name.c +M gdata/tests/general.c + +commit ec55e6507cdf650a5e071e416fd95192da84a2a6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Oct 11 16:42:48 2011 +0100 + + docs: Add a section on privacy considerations to the documentation + + This covers the work on non-pageable memory for sensitive details, + plus the + work to redact sensitive details from log output. + + Closes: bgo#656783 + +M docs/reference/gdata-overview.xml + +commit a5a772a00526b0830c01254d0ba24305d46b1fa5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Oct 11 16:40:21 2011 +0100 + + core: Ensure passwords and auth. tokens are stored in non-pageable + memory + + If we're compiled with --enable-gnome, we now allocate passwords + and auth. + tokens in non-pageable memory where possible. Where not possible + (due to API + constraints imposed by ourselves or libsoup) we ensure that the + details are + zeroed out before being freed. + + This is all with the aim of never having passwords or auth. tokens + hit disk + or be leaked in other ways. + + It hasn't been formally reviewed or certified, and there are + probably cases + I've missed (which are bugs). + + This adds an optional dependency on libgnome-keyring when compiled + with + --enable-gnome. + + Helps: bgo#656783 + +M README +M configure.ac +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-private.h +M gdata/gdata-service.c + +commit 41129e8ac50e22dddbc5eaf26604e74785f81810 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 10 23:17:35 2011 +0100 + + Bug 656973 — Add an example of starring a document + + Add an example of starring a document to the GDataDocumentsService + documentation. + + This adds the following new API (for convenience of referring + to URIs): + • GDATA_CATEGORY_SCHEMA_LABELS + • GDATA_CATEGORY_SCHEMA_LABELS_STARRED + + Closes: bgo#656973 + +M docs/reference/gdata-sections.txt +M gdata/atom/gdata-category.h +M gdata/services/documents/gdata-documents-service.c + +commit 1e16460f0df6d67c55569c8b2a39293aa32e0f5e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 10 22:27:38 2011 +0100 + + Bug 659148 — Add search-term query example to documentation + + Closes: bgo#659148 + +M gdata/services/youtube/gdata-youtube-service.c + +commit 0360fd97b2af0ba24a9ef54ff9b5a941c293a21b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 10 22:07:39 2011 +0100 + + Bug 660174 — Deprecate SWF export of presentations + + SWF export has been deprecated in the protocol and will be disabled, + leading + to HTTP 400 errors. + + See: + http://googleappsdeveloper.blogspot.com/2011/09/deprecating-swf-exports-of.html + + Closes: bgo#660174 + +M gdata/services/documents/gdata-documents-presentation.h + +commit 7b4bf874d32e2db7832f722c68b89642ad9e1367 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 10 22:07:24 2011 +0100 + + youtube: Fix a typo in a documentation comment + +M gdata/services/youtube/gdata-youtube-query.h + +commit efb1e2b8ae8328c82d86ce9fb4c3c00f3ddc6846 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 10 21:57:58 2011 +0100 + + Bug 658865 — Add support for the license query parameter + + Add a GDataYouTubeQuery:license parameter, plus getter and setter, + and some + tests. + + Closes: bgo#658865 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-query.h +M gdata/tests/youtube.c + +commit fd2d8a5f14aece4b28b07d2bffeb766d77c972aa +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 10 09:38:19 2011 +0100 + + core: Filter sensitive details out of debug log output + + Add a new log level, GDATA_LOG_FULL_UNREDACTED = 4, and redact + usernames, + passwords and auth. tokens from all log levels below it. Thus, + taking a + debug log with LIBGDATA_DEBUG=3 will no longer inadvertently + reveal the + user's password. + + Helps: bgo#656783 + +M README +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/tests/common.c + +commit 6e1ced020c67c9711bb3af1a8a8669b34cfedf5a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 9 22:20:22 2011 +0100 + + Bug 656972 — Tidy up document IDs + + Tidy up the mess of IDs available for Google Docs + documents. Previously, + they could be identified by any one of their: entry ID, resource + ID and + document ID. Document IDs are now deprecated and replaced by + resource IDs; + and both are now considered as internal, and thus entry IDs should be + used everywhere by client code in preference. + + Added API: + • GDataDocumentsEntry:resource-id and getter + + Deprecated (but not removed) API: + • GDataDocumentsEntry:document-id and getter + + Closes: bgo#656972 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-entry.h +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/tests/documents.c + +commit d8904f6c5b0e830df10157906ebfe7c612a18468 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 9 22:02:54 2011 +0100 + + build: Add a LIBGDATA_DISABLE_DEPRECATED build flag + + This only affects installed header files, to make it easier for + clients to + ensure they're not using deprecated libgdata API. (If, for some + reason, + G_GNUC_DEPRECATED_FOR doesn't cut it for them.) + + It doesn't affect the compilation of libgdata. + +M HACKING +M Makefile.am +M README +M docs/reference/Makefile.am +M gdata/tests/Makefile.am + +commit c8ddd2eb7860aca9dc9764f99854bec79de8da1c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 9 22:01:03 2011 +0100 + + demos: Port scrapbook demo to GtkGrid from GtkTable + + This fixes compilation against GTK+ with deprecations disabled. This + also + requires enforcing a minimum version of GTK+ of 2.91.2, which should + be fine. + +M configure.ac +M demos/scrapbook/scrapbook.c +M demos/scrapbook/scrapbook.h + +commit d94fd8402a0e9dbadb2b161e3ff90530ed5cc5b3 +Author: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> +Date: Sun Oct 2 11:59:57 2011 +1100 + + Added Vietnamese translation + +M po/LINGUAS +A po/vi.po + +commit e1ab283e0a347bea06398953f9ad6eeba4e891c5 +Author: Holger Berndt <hb@gnome.org> +Date: Sun Sep 25 02:24:03 2011 +0200 + + Add version check preprocessor macros + + https://bugzilla.gnome.org/show_bug.cgi?id=660038 + +M Makefile.am +M configure.ac +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +A gdata/gdata-version.h.in +M gdata/gdata.h + +commit ae0a5b82645767367616ce21999bafe7722f4530 +Author: YunQiang Su <yqsu@src.gnome.org> +Date: Wed Sep 28 00:47:03 2011 +0800 + + update zh_CN translation + +M po/zh_CN.po + +commit cc5dff24c3bc15822a337438760fbd17c39407cb +Author: Tommi Vainikainen <thv@iki.fi> +Date: Fri Sep 23 10:44:06 2011 +0300 + + Updated Finnish translation + +M po/fi.po + +commit 4725e9de3c95ae4043f49d437c5ea94c9698ef56 +Author: Manoj Kumar Giri <mgiri@dhcp193-76.pnq.redhat.com> +Date: Fri Sep 23 11:03:30 2011 +0530 + + Updated Oriya Translation + +M po/or.po + +commit 785b8168baa37a2be3e2be89cc752be983e0e10a +Author: Nilamdyuti Goswami <ngoswami@redhat.com> +Date: Thu Sep 22 12:07:38 2011 +0200 + + Update Assamese translation + +M po/as.po + +commit 5481c5e0e02fbc9927c30d8226dfb4915515dd33 +Author: Inaki Larranaga Murgoitio <dooteo@zundan.com> +Date: Wed Sep 21 17:24:21 2011 +0200 + + Updated Basque language + +M po/eu.po + +commit be3c7cbcba4072ca537b7264a63c3eb56f003e60 +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Wed Sep 21 02:34:43 2011 +0200 + + Updated Hungarian translation + +M po/hu.po + +commit 69f533b6feb74712d65365d2f63568f0f729e43e +Author: Aputsiaq Janussen <aj@isit.gl> +Date: Sat Sep 17 18:16:40 2011 +0200 + + Updated Danish translation + +M po/da.po + +commit d5c3473e3879f67e89ee00de4f08ebf58b74426d +Author: Jiro Matsuzawa <jmatsuzawa@src.gnome.org> +Date: Sat Sep 17 11:36:20 2011 +0900 + + Updated Japanese translation + +M po/ja.po + +commit 558e39c4d1f6631a9db7095112378f7debc462af +Author: Мирослав Николић <miroslavnikolic@rocketmail.com> +Date: Sat Sep 17 00:06:09 2011 +0200 + + Updated Serbian translation + +M po/sr.po +M po/sr@latin.po + +commit ad9d5a6fdf3444a0a2983da0cf8e3da5441d0b00 +Author: Claudio Arseni <claudio.arseni@ubuntu.com> +Date: Thu Sep 15 01:02:15 2011 +0200 + + l10n: Updated Italian translation + +M po/it.po + +commit b21572fce758f2d8d876bb22d9241f80c72af2c8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 14 23:12:20 2011 +0100 + + youtube: Fix a potential unref of a NULL pointer + +M gdata/services/youtube/gdata-youtube-service.c + +commit 644f49c4be1bbb6b7c9566260fc7d4fdaefc27d1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 14 23:12:01 2011 +0100 + + core: Fix a potential unref of a NULL pointer + +M gdata/gdata-service.c + +commit 009a587aaadfda39c48e35c3615fb2c756472250 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 14 19:19:38 2011 +0100 + + Bug 659016 — @rel not mandatory in website references + + Allow gContact:website elements to include a label attribute but + no rel + attribute. Includes new test cases. + + I've filed + http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=2769 + about the lack of clarity in Google's protocol specification + regarding this. + + Closes: bgo#659016 + +M gdata/gcontact/gdata-gcontact-website.c +M gdata/tests/general.c + +commit 9d6d6f4fc1f5bb22ea096142a86164052bfb7c34 +Author: I Felix <ifelix25@gmail.com> +Date: Tue Sep 13 15:30:35 2011 +0530 + + Updated Tamil Translations + +M po/ta.po + +commit 0eb3d613a2fcf7999aedf9b5395d89b20f9bde3d +Author: I Felix <ifelix25@gmail.com> +Date: Tue Sep 13 15:28:52 2011 +0530 + + Updated Tamil Translations + +A po/ta.po + +commit ca607576d05d26c8aef8e220cc07b82511a2847d +Author: I Felix <ifelix25@gmail.com> +Date: Tue Sep 13 15:28:49 2011 +0530 + + Updated linguas with ta + +M po/LINGUAS + +commit 99b9b9fe7166907eff88e69f525756b139743108 +Author: Changwoo Ryu <cwryu@debian.org> +Date: Tue Sep 13 08:34:47 2011 +0900 + + Updated Korean translation + +M po/ko.po + +commit b4dbe53836c8d6024438035c17d6925d12a68f20 +Author: Rudolfs Mazurs <rudolfs.mazurs@gmail.com> +Date: Sun Sep 11 20:02:23 2011 +0300 + + Updated Latvian translation. + +M po/lv.po + +commit 58042bd842c3458221e8cf530764c82d208ca943 +Author: A S Alam <aalam@users.sf.net> +Date: Sun Sep 11 16:43:35 2011 +0530 + + Updated Punjabi Translation + +M po/pa.po + +commit b30c75355c19e089b9352bac4291aa37de35df76 +Author: Piotr Drąg <piotrdrag@gmail.com> +Date: Thu Sep 8 20:50:08 2011 +0200 + + Updated Polish translation + +M po/pl.po + +commit 6e5605d613432871f754cdfa868b643715af28ee +Author: Flamarion Jorge <jorge.flamarion@gmail.com> +Date: Sun Sep 4 12:32:49 2011 -0400 + + Updated Brazilian Portuguese translation. + +M po/pt_BR.po + +commit c00264210d15ba310f87839ef152d6fbbbc9d07e +Author: António Lima <amrlima@gmail.com> +Date: Sat Sep 3 23:46:54 2011 +0100 + + Updated Portuguese translation + +M po/pt.po + +commit b73e9396c8d79e2c2dc84e16905ade1dc9b581ba +Author: Chao-Hsiung Liao <j_h_liau@yahoo.com.tw> +Date: Mon Aug 29 19:22:12 2011 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit d651e47d37d5c6f98359500f364817f7a9097354 +Author: Shankar Prasad <svenkate@redhat.com> +Date: Wed Aug 24 14:06:14 2011 +0530 + + Updated Kannada Translation + +M po/kn.po + +commit aba0befd93005eddf2f82e9b3afa72026171a880 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 19:08:40 2011 +0100 + + build: Increment version to 0.11.0 + +M configure.ac + +commit 5abf775c62e081ef0b11f4872aaa2afa8c6efb7d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 19:06:57 2011 +0100 + + Release version 0.10.0 + +M NEWS +M configure.ac +M docs/reference/gdata-docs.xml +M gdata/gd/gdata-gd-feed-link.c +M gdata/gd/gdata-gd-feed-link.h +M gdata/gdata-comment.c +M gdata/gdata-comment.h +M gdata/gdata-commentable.c +M gdata/gdata-commentable.h +M gdata/gdata-entry.c +M gdata/services/picasaweb/gdata-picasaweb-comment.c +M gdata/services/picasaweb/gdata-picasaweb-comment.h +M gdata/services/youtube/gdata-youtube-comment.c +M gdata/services/youtube/gdata-youtube-comment.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/common.h + +commit 9a5f9cf1efb555aa1b8ff845de5f0e41dcdf7a8f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 18:51:30 2011 +0100 + + l10n: Update British English translation + +M po/en_GB.po + +commit c67b9e9dac971d4e9ec23901f15d5fff39d85ad6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 18:48:27 2011 +0100 + + tests: Fix “unmatched quotes” warning from intltool-update + + Silly intltool. + +M gdata/tests/common.h + +commit a62cc92cab588ed89aeb771929f7a227e8518d74 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Aug 19 00:16:38 2011 +0100 + + Bug 633364 — Add cancellation tests + + Add a set of generic macros for writing async operation tests. The + macros + have inbuilt support for generating cancellation tests too, testing + cancellation before the operation has started and at several time + offsets + afterwards. + + This ports the Calendar, Contacts, Documents, PicasaWeb and YouTube + test + suites to use the new macros, and thus gain lots of tests for + cancellation. + + Closes: bgo#633364 + +M gdata/tests/calendar.c +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 9e5037f2dfdf75090cb97dd9cd06efa46d7036b2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 17:43:24 2011 +0100 + + youtube: Ensure comment modification URIs are HTTPS + + Videos apparently now (incorrectly) return HTTP URIs for their comment + query and modification URIs. We force them to be HTTPS so we + don't leak + auth. credentials. + +M gdata/services/youtube/gdata-youtube-video.c + +commit 68b5af5eabc0d3f81c9e7e69ce37bfba8c375c95 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 17:42:35 2011 +0100 + + contacts: Always set an ETag in gdata_contacts_contact_set_photo() + + If we don't have an ETag to hand, send ‘*’ as the ETag. The + server requires + that we send some kind of If-Match header. + +M gdata/services/contacts/gdata-contacts-contact.c + +commit 68b13c9ca480da464780f308e60cb5f4cfd8a60e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 17:41:29 2011 +0100 + + contacts: Set out parameters in error conditions + + The out parameters of gdata_contacts_contact_get_photo_finish() were + previously being left uninitialised if an error was returned, + which isn't + very friendly. They now return well-defined values, and the + documentation's + been updated appropriately. + +M gdata/services/contacts/gdata-contacts-contact.c + +commit fde18bd82a883d5955c19b12b40770c62ed40e89 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 17:40:06 2011 +0100 + + core: Ensure HTTPS URIs are used when deleting entries + + Apparently YouTube videos have started returning HTTP URIs for + their edit + links (which I'd consider as a bug on the server side), but we have + to work + around this and use HTTPS in order to avoid leaking auth. credentials. + +M gdata/gdata-service.c + +commit 0345885c14f2d5c1f80b6460be302adeb3e14103 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 17:39:06 2011 +0100 + + core: Catch SOUP_STATUS_IO_ERROR and treat it as cancellation + + When we cancel a request, it's (somehow) possible for libsoup + to return + SOUP_STATUS_IO_ERROR instead of the (desired) + SOUP_STATUS_CANCELLED. We now + catch SOUP_STATUS_IO_ERROR and, if the user requested cancellation, + treat it + like a normal cancellation status. + +M gdata/gdata-service.c + +commit db6ee229558fcd749fc2e6ea2b2fb26bfa46d082 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 17:38:20 2011 +0100 + + core: Fix a NULL pointer ref. inc. in GDataService + +M gdata/gdata-service.c + +commit 9e3042ef261a2972b2f882f9a71e5cf5a696f4fc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 20 17:37:26 2011 +0100 + + core: Only propagate the first auth. error in the ClientLogin + authorizer + +M gdata/gdata-client-login-authorizer.c + +commit 23e7043ef1c8f6fc2d803ecf2ea0ac5b7d4706f2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 18 22:47:21 2011 +0100 + + gd: Don't output empty department elements for gd:organization + + See: bgo#651451 + +M gdata/gd/gdata-gd-organization.c + +commit 2a0f3e3b4b1157c732f8c247be9003e56e47a700 +Author: Abduxukur Abdurixit <abdurixit@gmail.com> +Date: Fri Aug 19 19:58:38 2011 +0200 + + Added UG translation + +M po/ug.po + +commit d30a70b323a79754c2c07925b79ab971e3fd4989 +Author: Fran Dieguez <fran@openhost.es> +Date: Tue Aug 16 19:05:59 2011 +0200 + + Updated Galician translations + +M po/gl.po + +commit 611a34616426f89ccb4f9d5404fdee4887ff35d4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 15 22:16:21 2011 +0100 + + demos: Fix a potentially uninitialised variable in the scrapbook + +M demos/scrapbook/scrapbook.c + +commit 60330e8a42e80c4dd647c55a4b99c44d67cedfc0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 15 22:15:57 2011 +0100 + + core: Add missing symbols to symbols file + + Closes: bgo#656529 + +M gdata/gdata.symbols + +commit d61e0e93472a98fb3998016bc281ebefe69dded8 +Author: Andika Triwidada <andika@gmail.com> +Date: Fri Aug 12 15:55:58 2011 +0700 + + Updated Indonesian translation + +M po/id.po + +commit 57b5a19a44b76011a49f219b3eff9fcec6ad84af +Author: Kristjan SCHMIDT <kristjan.schmidt@googlemail.com> +Date: Fri Aug 12 10:35:00 2011 +0200 + + Updated Esperanto translation + +M po/eo.po + +commit d901816b2e888b03a5bfe656610740aa7a50a36f +Author: Alexander Shopov <ash@kambanaria.org> +Date: Thu Aug 11 07:25:25 2011 +0300 + + Updated Bulgarian translation + +M po/bg.po + +commit 592147a0d49cf7cd0cfaeb5810ee866e5f8b1d6d +Author: Akom Chotiphantawanon <knight2000@gmail.com> +Date: Wed Aug 10 16:32:23 2011 +0700 + + Updated Thai translation. + +M po/th.po + +commit a3ae21fded378881b5efe74140bc1a1e84e02cda +Author: Yuri Kozlov <yuray@komyakino.ru> +Date: Mon Aug 1 00:09:08 2011 +0400 + + Updated Russian translation + +M po/ru.po + +commit 6ddc77720eda2035eddc47d03cdf3aa4971ef3e0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 30 20:50:17 2011 +0100 + + demos: Remove some incorrect unrefs + + This doesn't fix the problem of the memory management for widgets + being a + little broken in the scrapbook, but at least it stops the warnings. + +M demos/scrapbook/scrapbook.c + +commit 2f95f26a8bceec9166ba0c8e7e933fda467d4912 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 30 20:44:30 2011 +0100 + + demos: Fix PicasaWeb searches in the scrapbook + +M demos/scrapbook/scrapbook.c + +commit e0049fce8be066bc1fc78e801791aebf6b025d1d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 30 20:35:43 2011 +0100 + + demos: Add licence headers and a documentation comment + +M demos/scrapbook/scrapbook.c +M demos/scrapbook/scrapbook.h + +commit 620c9f25e26b9036e4ea27e158828c4ed8a80768 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 30 20:33:01 2011 +0100 + + demos: Fix error handling for photo uploads in the scrapbook + +M demos/scrapbook/scrapbook.c + +commit 48bec40a81aa02d4ed261d07e0a472de127706ee +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 30 20:23:45 2011 +0100 + + demos: Use local variables wherever possible + + Move some variables out of malloc()ed structures which needn't + have been + there. + +M demos/scrapbook/scrapbook.c +M demos/scrapbook/scrapbook.h + +commit f37ee6a0e6b282a39c4a27a302a8f3d88264e844 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 30 19:45:12 2011 +0100 + + demos: Port the scrapbook to GDataAuthorizer + +M demos/scrapbook/scrapbook.c + +commit 7b57196184eb1cdc3670d6d1d463f66c212615a1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 30 19:38:28 2011 +0100 + + demos: Port the scrapbook to the GTK+ 3 GtkBox API + +M demos/scrapbook/scrapbook.c + +commit b58bdaebee63b4b9878fb27c7a4955da525ac3c7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 17:56:45 2011 +0000 + + demos: Fix type of a struct + +M demos/scrapbook/scrapbook.h + +commit 9d23c88ba819f3fdaae57e45d08e02600a31dfda +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 17:53:37 2011 +0000 + + demos: Remove trailing whitespace from lines + +M demos/scrapbook/scrapbook.c + +commit 517e093df245e0fe83750dde9611705c4579fda2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 17:50:20 2011 +0000 + + demos: Add a client ID to requests + +M demos/scrapbook/scrapbook.c +M demos/scrapbook/scrapbook.h + +commit 570e7e56d631d1acf9925d88222c2d7cccd31118 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 17:38:21 2011 +0000 + + demos: Fix assignments from invalid pointers + +M demos/scrapbook/scrapbook.c +M demos/scrapbook/scrapbook.h + +commit b0e383168ce8dad8d2be535a6f5e162703f195ab +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 17:34:00 2011 +0000 + + demos: Remove extraneous title property + +M demos/scrapbook/scrapbook.c +M demos/scrapbook/scrapbook.h + +commit fc15d815fdd463833f548ab02de2c755659526b7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 17:28:46 2011 +0000 + + demos: Fix window sizes + +M demos/scrapbook/scrapbook.c + +commit 108196a9e616fc5fb14f9d540d8840d69232b13c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 17:19:41 2011 +0000 + + demos: Tidy up some of the UI strings + +M demos/scrapbook/scrapbook.c + +commit 8e4acea7174bf2da721572a6566f9b03f3a46eb8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 17:13:46 2011 +0000 + + demos: Move services into the main application data struct + +M demos/scrapbook/scrapbook.c +M demos/scrapbook/scrapbook.h + +commit 319bf0680be7855aabe1e0e66cfc5b64cb943186 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 17:01:11 2011 +0000 + + demos: Ensure results of queries are freed correctly + +M demos/scrapbook/scrapbook.c + +commit 6cbd799733b10ad7b09f14d210c73e120e5bb244 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 16:57:38 2011 +0000 + + demos: Port to the 0.8 version of the PicasaWeb upload API + +M demos/scrapbook/scrapbook.c + +commit b306201216050e468aab40a73ccb760a28d9ba5a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 16:49:22 2011 +0000 + + demos: Port the scrapbook to the GTK+ 3 dialogue API + +M demos/scrapbook/scrapbook.c + +commit 1e2b47cd5dd536888ecc415eab34537c971b0e92 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 16:46:45 2011 +0000 + + demos: Port the scrapbook from GtkFileSelector to GtkFileChooser + +M demos/scrapbook/scrapbook.c + +commit 7e78ef6c37a46f7000d7d5c8cc1726e8fc0a3be8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 16:31:12 2011 +0000 + + demos: Rename the scrapbook files to be more consistent + +M Makefile.am +R099 demos/scrapbook/scrap.c demos/scrapbook/scrapbook.c +R100 demos/scrapbook/scrapdata.h demos/scrapbook/scrapbook.h + +commit a1606384f5f9db5b5a324539739818b6d0984b81 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 16 16:29:44 2011 +0000 + + docs: Add the “demos” commit message tag + +M HACKING + +commit f330d66a19e41f5af5ddd568e103fe9770271f51 +Author: Joe C <escozzia@gmail.com> +Date: Sun Jan 16 16:27:55 2011 +0000 + + demos: Add a “scrapbook” demo of PicasaWeb and YouTube services + + Helps: bgo#628069 + +M Makefile.am +M configure.ac +A demos/scrapbook/scrap.c +A demos/scrapbook/scrapdata.h + +commit 96d88904bc10e066ebcee75e5eac4cf18e23ad55 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 29 23:39:34 2011 +0100 + + Bug 647882 — Support rating schemes + + Add support for media rating schemes (such as the MPAA's certificates) + to + GDataYouTubeVideo (and GDataMediaGroup). This includes tests, and + adds the + following new API: + • gdata_youtube_video_get_media_rating() + • GDATA_YOUTUBE_RATING_TYPE_SIMPLE + • GDATA_YOUTUBE_RATING_TYPE_MPAA + • GDATA_YOUTUBE_RATING_TYPE_V_CHIP + + Closes: bgo#647882 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-group.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/youtube.c + +commit bba5887ad817439b01ffa80482405effd7be5bbf +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 29 22:21:34 2011 +0100 + + docs: Fix a typo in README + +M README + +commit 537dd49c9ec282c01011e49a11e2fad2b53aa2f9 +Author: Kjartan Maraas <kmaraas@gnome.org> +Date: Mon Jul 18 13:20:18 2011 +0200 + + Updated Norwegian bokmål translation + +M po/nb.po + +commit 49e31ec2e7ab9b9d6c019301f4b7321fcf90b686 +Author: Claude Paroz <claude@2xlibre.net> +Date: Sat Jul 16 17:47:18 2011 +0200 + + Updated French translation + +M po/fr.po + +commit 77d8200d4e5d40ac7d1de8b3f170adcae5695609 +Author: Aurimas Černius <aurisc4@gmail.com> +Date: Sat Jul 16 16:47:13 2011 +0300 + + Updated Lithuanian translation. + +M po/lt.po + +commit a6f62bd64ad1845d2baf57e11b7e292564399558 +Author: Carles Ferrando <carles.ferrando@gmail.com> +Date: Sat Jul 16 13:20:37 2011 +0200 + + [l10n]Updated Catalan (Valencian) translation + +M po/ca@valencia.po + +commit eeb83c9719f6e96e53848a15da4dafbf64a2b8d7 +Author: Gil Forcada <gforcada@gnome.org> +Date: Sat Jul 16 13:20:18 2011 +0200 + + [l10n]Updated Catalan translation + +M po/ca.po + +commit 6c46688c657f47f8b898b337888b4b67e333c12a +Author: Daniel Nylander <po@danielnylander.se> +Date: Fri Jul 15 13:05:06 2011 +0200 + + Updated Swedish translation + +M po/sv.po + +commit f1d9d0db2a51e023d4dec2554754b487bb4ba66e +Author: Yaron Shahrabani <sh.yaron@gmail.com> +Date: Fri Jul 15 11:10:27 2011 +0300 + + Updated Hebrew translation. + +M po/he.po + +commit 8e2c0232fa1e23695952c7bd207f81a8a351ce06 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Thu Jul 14 14:38:13 2011 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit bef70629d8e91d79866b907e5f1f02a71fea979f +Author: Mario Blättermann <mariobl@gnome.org> +Date: Wed Jul 13 20:04:50 2011 +0200 + + [l10n] Updated German translation + +M po/de.po + +commit 999365892e13949190a6a2a48f5e31aa4310b5ed +Author: Rudolfs Mazurs <rudolfs.mazurs@gmail.com> +Date: Wed Jul 13 00:24:03 2011 +0300 + + Updated Latvian translation. + +M po/lv.po + +commit 4c0768936d97345dd2b40d57964706aaa2eb7488 +Author: Marek Černocký <marek@manet.cz> +Date: Sun Jul 10 19:06:45 2011 +0200 + + Updated Czech translation + +M po/cs.po + +commit 8e7e826718a23b68acd423c15d29793ff354dc15 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Sun Jul 10 15:40:39 2011 +0200 + + Updated Spanish translation + +M po/es.po + +commit fb8d70c586466e9600766fdc2d49388203d5ab24 +Author: Piotr Drąg <piotrdrag@gmail.com> +Date: Sun Jul 10 13:51:36 2011 +0200 + + Updated POTFILES.in + +M po/POTFILES.in + +commit 633224349c8de8869381f2f86820513971d5b671 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 9 15:13:07 2011 +0100 + + documents: Remove extraneous debug output + + Whoops. + +M gdata/services/documents/gdata-documents-entry.c + +commit 8d97202d21f026046f8c316dccd7857f11eb0e90 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 9 15:12:24 2011 +0100 + + picasaweb: Implement GDataCommentable on GDataPicasaWebFile + + This adds support for comments to GDataPicasaWebFile, including + a GDataComment + subclass, GDataPicasaWebComment, and test cases. + + This adds the following API: + • GDataPicasaWebComment + + Helps: bgo#598752 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/picasaweb/gdata-picasaweb-comment.c +A gdata/services/picasaweb/gdata-picasaweb-comment.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/tests/picasaweb.c + +commit bbb3d20ee62a740ef98a4117003c0364e7b06b26 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 9 15:10:31 2011 +0100 + + youtube: Implement GDataCommentable on GDataYouTubeVideo + + This adds support for comments to GDataYouTubeVideo, including + a GDataComment + subclass, GDataYouTubeComment, and test cases. + + This adds the following API: + • GDataYouTubeComment + + Helps: bgo#598752 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/youtube/gdata-youtube-comment.c +A gdata/services/youtube/gdata-youtube-comment.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/youtube.c + +commit 4554cc0490460d2c9f62bced9287bdb721447f76 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 9 14:51:51 2011 +0100 + + core: Add gdata_entry_remove_link() to allow removing links from + entries + + This adds the following API: + • gdata_entry_remove_link() + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata.symbols +M gdata/tests/general.c + +commit 1e2b9a2805c40abc40ede2aed44c2fdcd38a7d9a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 9 13:05:43 2011 +0100 + + core: Fix uninitialised memory in GDataService query data structure + + This can cause problems when cancelling queries, sometimes. + +M gdata/gdata-service.c + +commit e6fe52a83786e87559ff4878bef0fc9ca451baa0 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Sat Jul 9 15:07:14 2011 +0100 + + Bug 598752 — Support comments + + This adds GDataCommentable, an interface to be implemented by + GDataEntry + subclasses which support comments being added to them; and + GDataComment, + an abstract base class for all types of comments to inherit from. + + This adds the following API: + • GDataCommentable + • GDataComment + + Closes: bgo#598752 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +A gdata/gdata-comment.c +A gdata/gdata-comment.h +A gdata/gdata-commentable.c +A gdata/gdata-commentable.h +M gdata/gdata.h +M gdata/gdata.symbols + +commit f19560899fe901549f7968124283ce1c008c1e07 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Wed Jul 6 00:19:40 2011 +0100 + + Bug 618587 — Implement GDataGDFeedLink + + Add a GDataGDFeedLink class to implement support for gd:feedLink + elements + as used in support for comment feeds. (See bgo#598752.) + + Closes: bgo#618587 + +M Makefile.am +M docs/reference/Makefile.am +A gdata/gd/gdata-gd-feed-link.c +A gdata/gd/gdata-gd-feed-link.h + +commit a3f06e4695fa3ef0fa0695381c6e330696a073da +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 4 22:00:08 2011 +0100 + + build: Increment version to 0.9.2 + +M configure.ac + +commit 9dc4508bcf8754e9f0c7d35c76ac56b85f6ae2c1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 4 21:58:55 2011 +0100 + + Release version 0.9.1 + +M NEWS +M configure.ac + +commit 757e8ec978bdd19001b510ef1f5a0ca4d33853f9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 4 21:55:29 2011 +0100 + + docs: Add new symbol list for 0.9.1 + +M docs/reference/gdata-docs.xml + +commit 7005e8e8b9eb5513ab0667613eec9edb3791f5dc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 4 21:25:18 2011 +0100 + + picasaweb: Minor documentation updates to GDataPicasaWebUser + +M gdata/services/picasaweb/gdata-picasaweb-user.c + +commit 227da3c082b12a9bab5a55a88b9d818e4f7b14fe +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 4 21:24:22 2011 +0100 + + Bug 653224 — Add gdata_picasaweb_service_get_user_async() + + Add an async. variant of gdata_picasaweb_service_get_user(). This + adds the + following API: + • gdata_picasaweb_service_get_user_async() + • gdata_picasaweb_service_get_user_finish() + + Closes: bgo#653224 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/picasaweb.c + +commit 9341f62a51ac05bcc218bee8f4d2de1159510d40 +Author: Fran Dieguez <fran@openhost.es> +Date: Mon Jul 4 10:22:04 2011 +0200 + + Updated Galician translations + +M po/gl.po + +commit c3c58a3e88166544ea67315cbd5a606cc06f8628 +Author: Tommi Vainikainen <thv@iki.fi> +Date: Mon Jul 4 11:11:38 2011 +0300 + + Updated Finnish translation + +M po/fi.po + +commit 0b000891a602776f50b4ae182ad153abc2c14406 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 13:07:04 2011 +0100 + + documents: Tidy up whitespace in the test suite + +M gdata/tests/documents.c + +commit 7df378d7e2b0d2d41c77092cc8f01da0acd43e4a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 13:04:03 2011 +0100 + + documents: Tidy up test names in the test suite + +M gdata/tests/documents.c + +commit f605431b9f04e51b268b5b2d68e36c289f589f08 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 12:49:11 2011 +0100 + + documents: Work around an ETag bug on the servers for the folder tests + +M gdata/tests/documents.c + +commit 8b66dab3d3be2bed53ffa47430122fbc40b251a1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 12:40:32 2011 +0100 + + documents: Fix the IDs used to refer to all documents + + As explained in a comment in the commit, it turns out that the + server returns + one of two different formats of ID for a document depending on how + it was + created. One of these is useful, the other one is not so useful, + especially + when it comes to deleting the document. + +M gdata/gdata-entry.c +M gdata/services/documents/gdata-documents-entry.c + +commit b641c41d9aa1bea9fe6bb6811a1be3dd19af460e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 12:39:13 2011 +0100 + + documents: Make the access rule tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/documents.c + +commit 82354155e9a96f6e234d8ff56e03d95209cbb870 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 11:26:23 2011 +0100 + + documents: Make the document update tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/documents.c + +commit 07d93c561c68c24544f8955ab28299287c6763e5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 11:05:44 2011 +0100 + + documents: Make the document download tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/documents.c + +commit bcce6351218460faff0fde865e4f2e3cb713fe33 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 10:53:46 2011 +0100 + + documents: Make the document query tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/documents.c + +commit 1df7e3aaf322e41e565adee300ccabbad247adf7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 09:48:00 2011 +0100 + + documents: Make the deletion tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/documents.c + +commit 90719b6d0492f41d90a00aa815aefec6b340257c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 09:21:28 2011 +0100 + + documents: Make the document upload tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/documents.c + +commit 239d6f785013500ef5bb7d58c4a4063857a9c444 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 3 08:48:27 2011 +0100 + + calendar: Remove some dead code from the tests + +M gdata/tests/calendar.c + +commit 11acc9979f50d577d501ddc7328739801964a83a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 19:26:24 2011 +0100 + + calendar: Expand the documentation for GDataCalendarCalendar:color + slightly + + It turns out that only a limited palette of colours is allowed. + +M gdata/services/calendar/gdata-calendar-calendar.c + +commit 7fde7a83bab6b7fc852d5f4696f5f64bc1b3276f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 19:20:48 2011 +0100 + + calendar: Tidy up whitespace in the test suite + +M gdata/tests/calendar.c + +commit 3d861e9d6aa2de5ce65fa117674ca23670a357e8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 19:15:15 2011 +0100 + + calendar: Tidy up test names in the test suite + +M gdata/tests/calendar.c + +commit 78d4dbde2c22c4bdfc2f6a5f0b624b0a0c775402 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 19:12:21 2011 +0100 + + calendar: Make the access rule tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/calendar.c + +commit fbfcd0adacaed515dff69c0904806ba0ed88b7f8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 18:53:18 2011 +0100 + + calendar: Split access rule XML tests out from the insertion test + + Helps: bgo#633359 + +M gdata/tests/calendar.c + +commit 137eb1f71e37c75234bdd01e8d430a718f088d98 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 18:43:24 2011 +0100 + + calendar: Make the event insertion tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/calendar.c + +commit 07cfc7ef7e620bdfa50d1a0f6912d3fb43807c45 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 18:37:25 2011 +0100 + + calendar: Split event XML tests out from the insertion test + + Helps: bgo#633359 + +M gdata/tests/calendar.c + +commit 8b90570cb61875d2614f12a2d1bb7f3427b7e739 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 18:31:42 2011 +0100 + + calendar: Make the event query tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/calendar.c + +commit a9001d5f2478611aedd3c6766789872cffc15f9a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 17:31:24 2011 +0100 + + calendar: Make the calendar query tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/calendar.c + +commit e1c7c4204df6bdb11252a2c380184b211e7f671d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 17:30:45 2011 +0100 + + calendar: Disable ETag support in GDataCalendarCalendar + + The servers don't support it, which makes doing operations like + deletion on + a calendar impossible. + +M gdata/services/calendar/gdata-calendar-calendar.c + +commit e569ea84dafd1095a3ef9c998b56ab9a88271a09 +Merge: b8fd328a 404a2bdb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 11:20:38 2011 +0100 + + Merge branch '633359-idempotent-tests' + +commit 404a2bdb164c25e31fadf84ff984b35bbf9575bb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 11:15:46 2011 +0100 + + contacts: Tidy up whitespace in the test suite + +M gdata/tests/contacts.c + +commit 99ea3880b81dd8a9a3a879b6151b2af5f975f5f1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 11:10:09 2011 +0100 + + contacts: Tidy up test names in the test suite + +M gdata/tests/contacts.c + +commit 8be206dfca19c6adf65a9e56fb73a3548b2bba8b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 10:56:24 2011 +0100 + + contacts: Make the group insertion tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/contacts.c + +commit a07196c17ac56ff834c4468c7bbdddd825e58567 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 10:50:56 2011 +0100 + + contacts: Split group property tests out from the insertion test + + Helps: bgo#633359 + +M gdata/tests/contacts.c + +commit 1a3edf058c068e5a9c2dba990cb776fc3204952b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 10:45:32 2011 +0100 + + contacts: Make the query all groups tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/contacts.c + +commit 45e9d03a72525e496794538413da037912cc13bc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 10:37:11 2011 +0100 + + contacts: Make the query all contacts tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/contacts.c + +commit b7943e20a4054ca168c6dd738f05652b3786ad93 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 10:26:02 2011 +0100 + + contacts: Make the contact update and photo tests individually + idempotent + + Helps: bgo#633359 + +M gdata/tests/contacts.c + +commit ea2a695ba86a1cc0a7564d2cb0021917049dfa23 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 10:24:56 2011 +0100 + + contacts: Ensure that contact entry URIs use HTTPS + +M gdata/services/contacts/gdata-contacts-contact.c + +commit aa2c27145caf908c12a6f48e20b1393d49805d06 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 09:46:57 2011 +0100 + + contacts: Make the contact insertion tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/contacts.c + +commit 8de5e418746fd5f6f1bb1737ebf5f033788cd606 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 2 09:41:21 2011 +0100 + + contacts: Split property tests out from the insertion test + + Helps: bgo#633359 + +M gdata/tests/contacts.c + +commit b8fd328ac68216dd7be7d38970510fa7107db346 +Author: Yaron Shahrabani <sh.yaron@gmail.com> +Date: Sat Jul 2 10:51:15 2011 +0300 + + Updated Hebrew translation. + +M po/he.po + +commit 52b59c1136b639bee7acefa6b64f9f30f1e1a8ee +Author: Carles Ferrando <carles.ferrando@gmail.com> +Date: Fri Jul 1 17:43:56 2011 +0200 + + [l10n]Updated Catalan (Valencian) translation + +M po/ca@valencia.po + +commit 4e58e8cb02f575869162930b826f5e8e8bad726d +Author: Gil Forcada <gforcada@gnome.org> +Date: Fri Jul 1 17:43:38 2011 +0200 + + [l10n]Updated Catalan translation + +M po/ca.po + +commit c72cf6fcb6950abc605b553b4f73f15d7b8bb5ff +Author: Aurimas Černius <aurisc4@gmail.com> +Date: Wed Jun 29 14:07:58 2011 +0300 + + Updated Lithuanian translation. + +M po/lt.po + +commit 53d9a0b00eb30f785cc226c2e5a7c9da6ac96942 +Author: Daniel Nylander <po@danielnylander.se> +Date: Wed Jun 29 10:44:47 2011 +0200 + + Updated Swedish translation + +M po/sv.po + +commit 900a93016b00087dadf956e339c2b6a9201ce74f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jun 29 09:07:14 2011 +0100 + + Bug 653530 — Bogus run-time warnings + + Remove usage of g_simple_async_result_report_error_in_idle() because + it fails + to set a source tag. Instead, we build an async result ourselves + with the + correct source tag. + + Closes: bgo#653530 + +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-service.c + +commit 5494aef7d705b9a4ad2d0da7db6dd6c0a43f9560 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jun 29 08:56:02 2011 +0100 + + Bug 653535 — Let GDataAuthorizer re-process request after refreshing + + After receiving a 401 status (unauthorised) from the server and + refreshing + the current GDataAuthorizer, re-process the message in question + with the + authoriser before re-sending it, so that it has updated credentials + set on + it. + + This involves a slight change in the semantics of + GDataAuthorizer->process_request, which now has to handle being called + multiple times on a given message. + + Closes: bgo#653535 + +M gdata/gdata-authorizer.h +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-oauth1-authorizer.c +M gdata/gdata-service.c + +commit baa8e41dd9079411e90c7ec3bd6381a24192bc06 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jun 28 00:06:26 2011 +0100 + + core: Ensure that synchronous progress callbacks aren't done in + idle callbacks + + Progress callbacks should only be made in idle callbacks if the + operation is + being performed asynchronously. If it's being performed synchronously, + we + should be able to guarantee that all progress callbacks have been + executed + by the time the synchronous operation function call returns. + +M gdata/gdata-access-handler.c +M gdata/gdata-feed.c +M gdata/gdata-private.h +M gdata/gdata-service.c + +commit a3b83737075015ea159c3e59dc2bb900197f09dd +Author: Muhammet Kara <muhammet.k@gmail.com> +Date: Sun Jun 26 03:49:12 2011 +0300 + + Updated Turkish translation file header + +M po/tr.po + +commit ee022d3c926cae2318fbf623c09a616cf98eb4ec +Author: Muhammet Kara <muhammet.k@gmail.com> +Date: Sun Jun 26 01:19:22 2011 +0300 + + Updated Turkish translation + +M po/tr.po + +commit 8d34fa9fd080b15d8e8e021c3406bbb60c59d1fd +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Fri Jun 24 22:25:17 2011 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit a07437a6d93f8f4b3949b602992e18127ec65a1f +Author: Мирослав Николић <miroslavnikolic@rocketmail.com> +Date: Fri Jun 24 22:26:43 2011 +0200 + + Updated Serbian translation + +M po/sr.po +M po/sr@latin.po + +commit 9214fc318f99fe14b1945bf12e7a4ddf683956ec +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jun 24 19:34:35 2011 +0100 + + picasaweb: Fix user tests to work when no photos have been uploaded + + Since all the PicasaWeb tests are now idempotent, we can run them + on an + empty PicasaWeb account with no quota used. + +M gdata/tests/picasaweb.c + +commit 61112ba7073ffd05d22847cdf0d76f20b20ca632 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jun 24 19:19:10 2011 +0100 + + picasaweb: Make the file download tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/picasaweb.c + +commit 608a3438a2418a8996f6e2db822b1bbb1552ec64 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jun 24 19:07:54 2011 +0100 + + picasaweb: Make the file query tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/picasaweb.c + +commit 51df7776ed3a15f48c911899890a353a3040ff6d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jun 24 19:07:23 2011 +0100 + + picasaweb: Split some more property checking tests out into + non-network tests + + Helps: bgo#633359 + +M gdata/tests/picasaweb.c + +commit 0efe64e8483604ab337852099d03e9a5fde01d6e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jun 24 19:05:30 2011 +0100 + + picasaweb: Add a comparison function for GDataPicasaWebFiles in + the tests + +M gdata/tests/picasaweb.c + +commit 3c3d1dcbe2572427dab75167fc8fd1ceeb9bb708 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jun 24 19:04:16 2011 +0100 + + picasaweb: Fix uploads to non-default albums + + They were previously broken due to not using the correct ID when + building + a URI. + +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit 0930a77528caa724032fdffbf85fa4479da21ced +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jun 23 17:20:47 2011 +0100 + + picasaweb: Split some property checking tests out into non-network + tests + + Helps: bgo#633359 + +M gdata/tests/picasaweb.c + +commit 5d90702da833533da36a954e83f6d9fdb5cc2f36 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jun 23 16:28:19 2011 +0100 + + picasaweb: Make the album insertion tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/picasaweb.c + +commit 0c75897a59a9d0d0616cf7627d313fffdf08d9be +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jun 23 16:00:44 2011 +0100 + + picasaweb: Ensure the rights of an album are correctly initialised + to private + + Previously, the default value of the “visibility” property + wasn't set + properly, and the GDataEntry:rights property (which is aliased with + GDataPicasaWebAlbum:visibility) wasn't set to private on + initialisation. + +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/tests/picasaweb.c + +commit 2d0322cdf83c22d969f1b8354eb91c5237039496 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jun 23 12:05:49 2011 +0100 + + picasaweb: Make the all album query tests individually idempotent + + Helps: bgo#633359 + +M gdata/tests/picasaweb.c + +commit c213644b44cafd9208a63988a753e450e31dad9e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jun 23 16:27:16 2011 +0100 + + picasaweb: Add a comparison function for GDataPicasaWebAlbums in + the tests + +M gdata/tests/picasaweb.c + +commit 02e5840a7561a02536b4b56de8517ef811fcc99b +Author: Mario Blättermann <mariobl@gnome.org> +Date: Thu Jun 23 22:21:47 2011 +0200 + + [l10n] Updated German translation + +M po/de.po + +commit f22eaa88a39a9c33d35d725c2b57a5972846f18b +Author: Andre Klapper <a9016009@gmx.de> +Date: Thu Jun 23 21:05:27 2011 +0200 + + Update Czech translation + +M po/cs.po + +commit 0a5554b5f37bd5d01233e3ef922a39f962ce4055 +Author: Daniel Mustieles <daniel.mustieles@gmail.com> +Date: Thu Jun 23 18:43:41 2011 +0200 + + Updated Spanish translation + +M po/es.po + +commit a7597f401019391724eb81d75ab0ee501f67b3df +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jun 21 13:35:45 2011 +0100 + + Bug 637664 — Fix GSeekable interface implementation in + GDataDownloadStream + + Add a few seeking test cases to test the new implementation of seek(). + g_input_stream_truncate() isn't supported by GDataDownloadStream, + since it's + an input stream, not an output stream. + + Closes: bgo#637664 + +M gdata/gdata-buffer.c +M gdata/gdata-download-stream.c +M gdata/tests/streams.c + +commit 28e4dbcd66bb085627cd35d70eb8bdb505fc1475 +Author: Yuri Kozlov <yuray@komyakino.ru> +Date: Wed Jun 22 20:14:09 2011 +0400 + + Updated Russian translation + +M po/ru.po + +commit 3b62d2d1f24e56ee8a60a99a371f830a54a7a958 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 20 21:34:38 2011 +0100 + + core: Keep GDataClientLoginAuthorizer alive while notifying property + changes + + It's possible for the GDataClientLoginAuthorizer to be finalised after + scheduling property notifications to happen in an idle function, + but before + the idle function is called. This would cause crashes, so we hold + a reference + to the authorizer while waiting for the idle function to be called. + +M gdata/gdata-client-login-authorizer.c + +commit 54fa219d3e55b476b6b843deec63d3889b960ef2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 20 21:09:01 2011 +0100 + + calendar: Add support for querying for deleted events + + Add support for the “showdeleted” query parameter, cf. the + Google Contacts + service. + + This adds the following API: + • GDataCalendarQuery:show-deleted + • gdata_calendar_query_show_deleted() + • gdata_calendar_query_set_show_deleted() + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/tests/calendar.c + +commit 4c6b5ea87204ca695e1d51ac65af9dbdbc9e1e59 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 20 20:56:14 2011 +0100 + + Bug 639405 — Add max-attendees query parameter + + This adds the following API: + • GDataCalendarQuery:max-attendees + • gdata_calendar_query_get_max_attendees() + • gdata_calendar_query_set_max_attendees() + + Closes: bgo#639405 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/tests/calendar.c + +commit fafa68352959512861bcbc8c9d3f0295a70e767c +Author: Philip Chimento <philip.chimento@gmail.com> +Date: Sat Jun 18 18:31:28 2011 +0100 + + introspection: Add GDestroyNotify to progress callbacks + + All query_async functions that take a progress callback should have a + GDestroyNotify parameter for freeing the progress callback data, since + there is no suitable (scope) annotation. + + This breaks API by changing the signatures for: + • gdata_access_handler_get_rules_async() + • gdata_service_query_async() + • gdata_calendar_service_query_all_calendars_async() + • gdata_calendar_service_query_own_calendars_async() + • gdata_calendar_service_query_events_async() + • gdata_contacts_service_query_contacts_async() + • gdata_contacts_service_query_groups_async() + • gdata_documents_service_query_documents_async() + • gdata_picasaweb_service_query_all_albums_async() + • gdata_picasaweb_service_query_files_async() + • gdata_youtube_service_query_standard_feed_async() + • gdata_youtube_service_query_videos_async() + • gdata_youtube_service_query_related_async() + + Closes: bgo#649728 + +M HACKING +M gdata/gdata-access-handler.c +M gdata/gdata-access-handler.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/tests/calendar.c +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 75ededc68bdc77d522156c3fbcb2b2e4cd93e102 +Author: Tommi Vainikainen <thv@iki.fi> +Date: Thu Jun 16 13:34:08 2011 +0300 + + Added Finnish translation + +M po/LINGUAS +A po/fi.po + +commit 85d2d82c72ac23cbaffc0badad53cc6d39213330 +Merge: 120acd84 ae8c91a9 +Author: Davide Italiano <davide.italiano@gmail.com> +Date: Sun Jun 12 21:15:10 2011 +0200 + + Merge branch 'master' of http://git.gnome.org/browse/libgdata + +commit 120acd849afd53cdb1d14536fa4c7de270a7b546 +Author: Davide Italiano <davide.italiano@gmail.com> +Date: Sun Jun 12 20:59:19 2011 +0200 + + Remove some warnings + +M Makefile.am +M configure.ac + +commit ae8c91a9246ea20599d34af11555cb734908a3bb +Author: Daniel Nylander <po@danielnylander.se> +Date: Sun Jun 12 20:24:58 2011 +0200 + + Updated Swedish translation + +M po/sv.po + +commit d1bc058418827aa459066d75a2aa766d44b69961 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jun 12 12:46:59 2011 +0100 + + build: Increment version to 0.9.1 + +M configure.ac + +commit 827305957733db51124d90873949f45f7ba7a45d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jun 12 12:45:49 2011 +0100 + + Release version 0.9.0 + +M NEWS +M configure.ac + +commit 025a6544787772ba2dcb86bf40c21e5abdf83762 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jun 12 12:38:59 2011 +0100 + + docs: Fix builddir ≠ srcdir documentation builds + +M docs/reference/Makefile.am + +commit 8f490d76e6586bc88f5af88f9764e829075adfe8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jun 11 16:51:42 2011 +0100 + + contacts: Remove gdata_contacts_contact_has_photo() + + It was deprecated, and since version 0.9.0 breaks API, what harm + can removing + it do? + + API changes: + • Remove gdata_contacts_contact_has_photo() and + GDataContactsContact:has-photo + (use gdata_contacts_contact_get_photo_etag() instead) + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h + +commit 1de4b2f017f1e743a84bc88bbd26851b860e61c1 +Author: Gil Forcada <gforcada@gnome.org> +Date: Sat Jun 11 20:36:58 2011 +0200 + + [l10n]Updated Catalan translation + +M po/ca.po + +commit 5af9a0151de5625736773083ed033c328c438188 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Fri Jun 10 20:10:18 2011 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit 05787c583f870dc65c5f9d85e30a6a59906fd128 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Fri Jun 10 11:21:29 2011 +0200 + + [l10n] Updated German translation + +M po/de.po + +commit 4a91a5cac302a0b8fc1d49fbe54cbc840b065663 +Author: Yaron Shahrabani <sh.yaron@gmail.com> +Date: Fri Jun 10 08:09:12 2011 +0300 + + Updated Hebrew translation. + +M po/he.po + +commit fa6c25b6af8734b8e1a20379b9dd98bf83145de9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jun 7 10:43:46 2011 +0100 + + docs: Fix some typos in gdata-sections.txt + + They were breaking the documentation for GDataOAuth1Authorizer. + +M docs/reference/gdata-sections.txt + +commit 84060afb583fc5c9642861eb9ccd82488000f906 +Author: P. F. Chimento <philip.chimento@gmail.com> +Date: Mon Jun 6 21:28:53 2011 +0200 + + introspection: Fix introspection for GCancellable parameters + + ...and progress callbacks in non-async functions + See bug #649728 + +M gdata/gdata-access-handler.c +M gdata/gdata-batch-operation.c +M gdata/gdata-buffer.c +M gdata/gdata-client-login-authorizer.c +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-service.c + +commit b525bbc905144ce13af8d618022b671e3a4bf27c +Author: Alexander Shopov <ash@kambanaria.org> +Date: Tue Jun 7 08:31:02 2011 +0300 + + Updated Bulgarian translation + +M po/bg.po + +commit f29c72c363cd49276eef55ae44b85fa0a1a15adf +Author: Marek Černocký <marek@manet.cz> +Date: Tue Jun 7 07:21:08 2011 +0200 + + Updated Czech translation + +M po/cs.po + +commit c5e4594ca21225f81719b1a8d9b8ade3367d72e1 +Author: Daniel Mustieles <daniel.mustieles@gmail.com> +Date: Mon Jun 6 22:34:29 2011 +0200 + + Updated Spanish translation + +M po/es.po + +commit 62b86bbb7bc645dd4696e036d35a0e6235b01f67 +Author: Daniel Mustieles <daniel.mustieles@gmail.com> +Date: Mon Jun 6 22:25:02 2011 +0200 + + Updated Spanish translation + +M po/es.po + +commit 48c7061cc904a578523f679c073c5ce3b78caf71 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Mon Jun 6 20:56:38 2011 +0200 + + Updated Spanish translation + +M po/es.po + +commit c1b3f37923f3f5c22b691f65672a570742372f96 +Author: Fran Diéguez <fran.dieguez@mabishu.com> +Date: Mon Jun 6 11:22:04 2011 +0200 + + Updated Galician translations + +M po/gl.po + +commit 47d20c21e8986cdbab21098428dd57bca203f6ad +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 29 22:38:39 2011 +0100 + + core: Add an OAuth 1.0 authoriser + + This adds a GDataAuthorizer implementation for OAuth 1.0, the current + favourite authentication/authorization protocol in Google-land. + + This includes full documentation and a test suite. + + This makes the following API changes: + • Add GDataOAuth1Authorizer and all its properties and methods. + + It also adds a dependency on liboauth ≥ 0.9.4. + + Helps: bgo#646285 + +M Makefile.am +M README +M configure.ac +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-authorizer.c +A gdata/gdata-oauth1-authorizer.c +A gdata/gdata-oauth1-authorizer.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/tests/Makefile.am +M gdata/tests/common.c +M gdata/tests/common.h +A gdata/tests/oauth1-authorizer.c +M po/POTFILES.in + +commit 65d3e0c373edcaf199b4d3dc3499b237bb620fc1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat May 28 14:56:48 2011 +0100 + + docs: Add new symbol list for 0.9.0 + +M docs/reference/gdata-docs.xml + +commit 2957118536be2c51c9e4c8c14b52c95db7717725 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu May 5 23:29:14 2011 +0100 + + core: Remove the old authentication API in favour of a new + GDataAuthorizer API + + This separates authentication and authorisation from the services + themselves, + allowing authorisation schemes to be plugged in as they pop into + and out of + fashion. + + This removes the old gdata_service_authenticate() methods, replacing + them with an equivalent GDataClientLoginAuthorizer. + + Full test cases are provided, covering everything except parsing + of error + responses from the server by GDataClientLoginAuthorizer. + + This makes the following API changes: + • Rename GDataAuthenticationError to + GDataClientLoginAuthorizerError + Rename GDATA_AUTHENTICATION_ERROR and + gdata_authentication_error_quark() + similarly. + • Remove gdata_service_authenticate() in favour of + using GDataClientLoginAuthorizer with GDataService::authorizer: + - Remove gdata_service_authenticate(), + gdata_service_authenticate_async() and + gdata_service_authenticate_finish(). + - Replace gdata_service_is_authenticated() by + gdata_service_is_authorized() with much the same functionality. + - Add GDataService::authorizer, gdata_service_get_authorizer(), + gdata_service_set_authorizer() and + gdata_service_get_authorization_domains(). + - Remove gdata_service_get_client_id() in favour of + GDataClientLoginAuthorizer::client-id. + - Remove gdata_service_get_username() in favour of + GDataClientLoginAuthorizer::username. + - Remove gdata_service_get_password() in favour of + GDataClientLoginAuthorizer::password. + - Remove GDataServiceClass->service_name in favour of + GDataAuthorizationDomain::service-name. + - Remove GDataServiceClass->authentication_uri and + GDataServiceClass->parse_authentication_response in favour of + different GDataAuthorizer implementations. + - Add GDataAuthorizer parameters to and remove client_id + parameters from: + gdata_calendar_service_new(), gdata_contacts_service_new(), + gdata_documents_service_new(), gdata_picasaweb_service_new() and + gdata_youtube_service_new(). + • Add GDataAuthorizationDomain. + - Add GDataServiceClass->get_authorization_domains and + gdata_service_get_authorization_domains(). + - Add auth. domain getters to various GDataService subclasses: + gdata_youtube_service_get_primary_authorization_domain(), + gdata_contacts_service_get_primary_authorization_domain(), + gdata_calendar_service_get_primary_authorization_domain(), + gdata_picasaweb_service_get_primary_authorization_domain(), + gdata_documents_service_get_primary_authorization_domain() and + gdata_documents_service_get_spreadsheet_authorization_domain(). + - Add auth. domain properties to various standalone request + objects: + GDataDownloadStream::authorization-domain with + gdata_download_stream_get_authorization_domain(), + GDataUploadStream::authorization-domain with + gdata_upload_stream_get_authorization_domain() and + GDataBatchOperation::authorization-domain with + gdata_batch_operation_get_authorization_domain(). + - Add GDataAccessHandlerIface->get_authorization_domain. This + doesn't + have to be implemented by existing GDataAccessHandlers, but it's + highly recommended. + - Add a GDataAuthorizationDomain parameter to + GDataServiceClass->append_query_headers, + gdata_service_query(), gdata_service_query_async(), + gdata_service_query_single_entry(), + gdata_service_query_single_entry_async(), + gdata_service_insert_entry(), + gdata_service_insert_entry_async(), + gdata_service_update_entry(), + gdata_service_update_entry_async(), + gdata_service_delete_entry(), + gdata_service_delete_entry_async(), + gdata_batchable_create_operation(), + gdata_download_stream_new() and gdata_upload_stream_new(). + • Add GDataAuthorizer as described above, implemented by + GDataClientLoginAuthorizer. + + Helps: bgo#646285 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-access-handler.c +M gdata/gdata-access-handler.h +A gdata/gdata-authorization-domain.c +A gdata/gdata-authorization-domain.h +A gdata/gdata-authorizer.c +A gdata/gdata-authorizer.h +M gdata/gdata-batch-operation.c +M gdata/gdata-batch-operation.h +M gdata/gdata-batchable.c +M gdata/gdata-batchable.h +A gdata/gdata-client-login-authorizer.c +A gdata/gdata-client-login-authorizer.h +M gdata/gdata-download-stream.c +M gdata/gdata-download-stream.h +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata-upload-stream.c +M gdata/gdata-upload-stream.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/Makefile.am +A gdata/tests/authorization.c +M gdata/tests/calendar.c +A gdata/tests/client-login-authorizer.c +M gdata/tests/common.h +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/general.c +M gdata/tests/memory.c +M gdata/tests/picasaweb.c +M gdata/tests/streams.c +M gdata/tests/youtube.c +M po/POTFILES.in + +commit d9add17fb43e405f5c72135cf71952e817f4f968 +Author: Carles Ferrando <carles.ferrando@gmail.com> +Date: Sun May 29 14:13:55 2011 +0200 + + [l10n]Updated Catalan (Valencian) translation + +M po/ca@valencia.po + +commit 2ef5875aad2d628578c2f6e4c9f01769594acbd1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon May 23 23:08:05 2011 +0100 + + core: Don't assume that messages can't be cancelled externally + + In _gdata_service_actually_send_message() we were previously + assuming that + we were the only code which could cancel an in-progress message's + request. + + This isn't true. + + soup_session_abort() can be called from anywhere else and will + explicitly + cancel all in-progress requests. This could happen if the GDataService + is + disposed of, which would cause the SoupSession to be disposed of, + which + causes it to abort all in-progress requests. Alternatively, it + could happen + if the GDataService's (and hence SoupSession's) proxy URI is changed. + + To fix this, we: + • now hold a reference to the session and message in + _gdata_service_actually_send_message() so that they're kept alive + throughout the request; and we + • no longer assume that a cancelled message was cancelled by us, + removing + the assertion which caused the crash in bgo#650835. + + Fixes: bgo#650835 + +M gdata/gdata-service.c + +commit 9615d1d9381724c9af87421289a19470d4e8d7e7 +Author: Abduxukur Abdurixit <abdurixit@gmail.com> +Date: Mon May 2 07:29:19 2011 +0200 + + Added UG translation + +M po/ug.po + +commit 8762d9f119962eb77808f2ab7357d20e881ba03c +Author: Akom Chotiphantawanon <knight2000@gmail.com> +Date: Tue Apr 26 00:13:13 2011 +0700 + + Added Thai translation. + +M po/LINGUAS +A po/th.po + +commit f5779abdbc00a2cd26b858c421f3ba1345334873 +Author: Kristjan SCHMIDT <kristjan.schmidt@googlemail.com> +Date: Thu Apr 21 20:32:32 2011 +0200 + + Add Esperanto translation + +M po/LINGUAS +A po/eo.po + +commit 9560c55e2163e15d4b486eaadd6f9f336fa7f816 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Apr 19 09:13:01 2011 +0100 + + Bug 648058 — Doesn't allow empty names for user defined fields + + Allow Google Contacts' user defined fields to have empty names. Test + cases + updated. Closes: bgo#648058 + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/tests/contacts.c + +commit 943a48eb048e3aae0cff9ecc24249757fef189e6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 15 18:08:33 2011 +0100 + + picasaweb: Don't check various image URIs exactly in the test suite + + They regularly change (every month or two), and it's a pain to have to + keep updating the test suite. + +M gdata/tests/picasaweb.c + +commit 23571a59e1d4b4dffc1079252f5a8bbe81c249c5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 15 17:54:29 2011 +0100 + + media: Handle media:rating elements which don't provide a country + attribute + + Includes a test case. + +M gdata/media/gdata-media-group.c +M gdata/tests/youtube.c + +commit 9d2e6d49ee144b05a7a46258f6d82ef92fcbe091 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 15 17:17:55 2011 +0100 + + build: Remove non-existent symbols from gdata.symbols + + The three symbols in question were removed by commit + 0db5aeece161142093343263652fa5c498e169f6. + + Spotted by openSUSE packagers. + +M gdata/gdata.symbols + +commit d49b550f5f9d58735160a8be927b96aa2aa4a6ac +Author: Manoj Kumar Giri <mgiri@redhat.com> +Date: Thu Apr 7 13:54:21 2011 +0530 + + Updated Oriya Translation + +M po/or.po + +commit 89ad55e7e6ec110d9b9d11619ed66b7025849aca +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 6 00:26:34 2011 +0100 + + docs: Add a “public” comment to GDataColor to stop gtk-doc dieing + on it + + Since it's a boxed enum type, its fields need to be marked public + to prevent + gtk-doc complaining about them. See bgo#642998. + + Closes: bgo#642983 + +M gdata/gdata-types.h + +commit cc2e6f077f22374534a7719056aa8a133dbf7bbc +Author: Chao-Hsiung Liao <j_h_liau@yahoo.com.tw> +Date: Tue Apr 5 06:50:56 2011 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit 2cc041b971500ba8b92451789e1a49d5fb9d4bca +Author: Jordi Serratosa <serratosa@gmail.com> +Date: Mon Apr 4 22:03:11 2011 +0200 + + [l10n]Fixes on Catalan translation + +M po/ca.po + +commit 5372160c3c14cfdf9e534d9e095ea319538dafad +Author: Amitakhya Phukan <amitakhya@svn.gnome.org> +Date: Mon Apr 4 12:12:40 2011 +0530 + + Updated Assamese translations + +A po/as.po + +commit 6faff1f461d166d6acf1f6bfea1085a076e84c16 +Author: Amitakhya Phukan <amitakhya@svn.gnome.org> +Date: Mon Apr 4 12:12:34 2011 +0530 + + Adding as to LINGUAS + +M po/LINGUAS + +commit 646404403ab2388a80014501f15568c60a174a3c +Author: Baris Cicek <baris@teamforce.name.tr> +Date: Mon Apr 4 08:35:39 2011 +0300 + + Added Turkish translation by Senol Korkmaz + +M po/LINGUAS +A po/tr.po + +commit 241875c4552c241dca7111408806f67e4b4928d5 +Author: Inaki Larranaga Murgoitio <dooteo@zundan.com> +Date: Sun Apr 3 13:00:19 2011 +0200 + + Updated Basque language + +M po/eu.po + +commit d7e551acf313bb436a526755944b0a9b776d01d6 +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Fri Apr 1 14:57:50 2011 +0200 + + Updated Hungarian translation + +M po/hu.po + +commit ac91c888e64281be6cac7175f0d081933791c1e5 +Author: Rajesh Ranjan <rranjan@redhat.com> +Date: Thu Mar 31 17:55:34 2011 +0530 + + hindi updated + +M po/hi.po + +commit 83995b727d4429f8eaf9a9fbea8758f6bcf48928 +Author: Shankar Prasad <svenkate@redhat.com> +Date: Thu Mar 31 16:58:48 2011 +0530 + + Updated LINGUAS file + +M po/LINGUAS + +commit 13f8cc6c9ec2fcd516eb67baa47a8b4e9eae070a +Author: Shankar Prasad <svenkate@redhat.com> +Date: Thu Mar 31 16:50:52 2011 +0530 + + Added kn.po and updated LINUGAS file + +A po/kn.po + +commit 320c8ca0e84e127f34e49177440fc1c72e1a057b +Author: Miroslav Nikolić <miroslavnikolic@rocketmail.com> +Date: Thu Mar 31 01:29:44 2011 +0200 + + Added Serbian translation + +M po/LINGUAS +A po/sr.po +A po/sr@latin.po + +commit e18b5b506549f2b8516547e9ba2ccae29c1a7bac +Author: Bruce Cowan <bruce@bcowan.me.uk> +Date: Wed Mar 30 15:09:21 2011 +0100 + + Updated British English translation + +M po/en_GB.po + +commit 1749913254d7201e739dd7bd1ab20a875b86629b +Author: António Lima <amrlima@gmail.com> +Date: Tue Mar 29 23:47:19 2011 +0100 + + Updated Portuguese translation + +M po/pt.po + +commit dad0a3f8db50e4b1801b8ecb49b65331239d42fa +Author: Kris Thomsen <lakristho@gmail.com> +Date: Mon Mar 28 23:33:27 2011 +0200 + + Updated Danish translation + +M po/da.po + +commit cdfbd577468c27690afa5edb7139de50b68f940f +Author: Piotr Drąg <piotrdrag@gmail.com> +Date: Mon Mar 28 20:19:19 2011 +0200 + + Updated Polish translation + +M po/pl.po + +commit e0b38d091e45fd4383a707d4ecfdfc3dfe3c1976 +Author: Rajesh Ranjan <rranjan@redhat.com> +Date: Mon Mar 28 16:31:19 2011 +0530 + + hindi added and translated and lingua upodated + +M po/LINGUAS +A po/hi.po + +commit 90ab328e5e27c5cf7f5deb52f62d0ca7bd5608e7 +Author: Rodrigo Padula de Oliveira <contato@rodrigopadula.com> +Date: Sun Mar 27 17:08:59 2011 -0400 + + Updated Brazilian Portuguese translation. Reviewed by Flamarion Jorge. + +M po/pt_BR.po + +commit b09bda7ebb8a464fdca4137e4777d9d9f77ab614 +Author: Abduxukur Abdurixit <abdurixit@gmail.com> +Date: Sun Mar 27 21:30:53 2011 +0200 + + Added UG translation + +M po/ug.po + +commit e1ca5480ff4d68e2b2135fef3ce73001f1301ece +Author: Bruno Brouard <annoa.b@gmail.com> +Date: Sun Mar 27 21:26:28 2011 +0200 + + Updated French translation + +M po/fr.po + +commit de00c3039c5e78a787d4246a9292eedf8f78b736 +Author: Rudolfs Mazurs <rudolfs.mazurs@gmail.com> +Date: Sat Mar 26 12:59:40 2011 +0200 + + Updated Latvian translation. + +M po/lv.po + +commit c04315f31997919711faee108127a3b5dbcb44fb +Author: Claudio Arseni <claudio.arseni@gmail.com> +Date: Sat Mar 26 10:57:33 2011 +0100 + + Updated Italian translation + +M po/it.po + +commit 2e4a51cf8d41cd4708cacd5ec71b6d5d27b98726 +Author: Yaron Shahrabani <sh.yaron@gmail.com> +Date: Sat Mar 26 11:44:53 2011 +0200 + + Added he to LINGUAS + +M po/LINGUAS + +commit 0834417aada000cee002f94006f2ee5999f26ef7 +Author: Yaron Shahrabani <sh.yaron@gmail.com> +Date: Sat Mar 26 11:43:37 2011 +0200 + + Updated Hebrew translation. + +A po/he.po + +commit 90459d70e4198d46897487597492784cf0ced922 +Author: Wolfgang Stöggl <c72578@yahoo.de> +Date: Sat Mar 26 07:38:58 2011 +0100 + + Updated German translation + +M po/de.po + +commit df8e86874ea2d8f1a919c079b6d2c4e807863ff8 +Author: Alexander Shopov <ash@kambanaria.org> +Date: Fri Mar 25 22:10:15 2011 +0200 + + Updated Bulgarian translation + +M po/bg.po + +commit bf91897cbb268aa0d38589181ddf93529028e884 +Author: Aron Xu <aronxu@gnome.org> +Date: Fri Mar 25 17:45:53 2011 +0000 + + Update Simplified Chinese translation. + +M po/zh_CN.po + +commit a4588c7d01e40481ad24bf4606c34a649dc798ee +Author: Joan Duran <jodufi@gmail.com> +Date: Thu Mar 24 23:25:26 2011 +0100 + + [l10n]Updated Catalan translation + +M po/ca.po + +commit a85aeb46493bd51f7c882c99fd4042d24e383420 +Author: Daniel Korostil <ted.korostiled@gmail.com> +Date: Wed Mar 23 22:47:07 2011 +0200 + + Uploaded Ukranian + +M po/uk.po + +commit 21567d84e9d8f4ff0a70c7d16176d0d90f70392a +Author: Yuri Myasoedov <omerta13@yandex.ru> +Date: Wed Mar 23 23:49:27 2011 +0300 + + Updated Russian translation + +M po/ru.po + +commit a738beb670c78bffedd4c10e153a7ba981e9be53 +Author: Daniel Nylander <po@danielnylander.se> +Date: Wed Mar 23 18:59:17 2011 +0100 + + Updated Swedish translation + +M po/sv.po + +commit b76c965d13de0d0854873ea45baee30d16bf78c1 +Author: Sandeep Shedmake <sshedmak@redhat.com> +Date: Wed Mar 23 19:28:28 2011 +0530 + + Added mr to LINGUAS + +M po/LINGUAS + +commit 29a4e18061e775ec4ac5bcba36ed055e099d7bcc +Author: Sandeep Shedmake <sshedmak@redhat.com> +Date: Wed Mar 23 19:26:31 2011 +0530 + + Added Marathi Translations + +A po/mr.po + +commit 1b4c78e396281b3248441425f6a569500de3c472 +Author: Marek Černocký <marek@manet.cz> +Date: Tue Mar 22 22:49:17 2011 +0100 + + Updated Czech translation + +M po/cs.po + +commit 977828c3f73004af75a3673412ffee0f6c14868d +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Tue Mar 22 22:05:13 2011 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit 7ab756b525cec089f14190b3d963253e34923ea9 +Author: Fran Diéguez <fran.dieguez@mabishu.com> +Date: Tue Mar 22 21:34:39 2011 +0100 + + Updated Galician translations + +M po/gl.po + +commit 4c78396942b69732e972e01302e1ad4b48bf0fc5 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Tue Mar 22 20:33:13 2011 +0100 + + Updated Spanish translation + +M po/es.po + +commit a23845177803a78b7b4d605c3e8e934924328fea +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 22 13:43:02 2011 +0000 + + Bug 639610 — Allow access to a contact's photo ETag + + Deprecate gdata_contacts_contact_has_photo() (and the corresponding + property) + in favour of a new gdata_contacts_contact_get_photo_etag() and + property + which work in exactly the same way, but return the photo's ETag + or NULL, + rather than TRUE or FALSE. + + Closes: bgo#639610 + +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit 605a4c64109c933e29eecb3e54062db781d7c5a0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 22 13:25:19 2011 +0000 + + tests: Remove use of assigned-but-not-used variables in the tests + +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/streams.c +M gdata/tests/youtube.c + +commit 810d9d81676f8eb3462cce590e467bb55fead259 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 22 13:20:44 2011 +0000 + + Bug 644946 — Support two-factor authentication + + Add support for notifying the user with a more specific error + message if + login failed due to them needing to enter an application-specific + password. + + This adds the following new error code: + • GDATA_AUTHENTICATION_ERROR_INVALID_SECOND_FACTOR + + Closes: bgo#644946 + +M gdata/gdata-service.c +M gdata/gdata-service.h + +commit bbd37f5f81ae16457c0569f208090114bed1a8c0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 22 13:08:58 2011 +0000 + + Bug 644940 — Use HTTPS only + + Use HTTPS for all communications with the server, removing the + LIBGDATA_FORCE_HTTP environment variable. Closes: bgo#644940 + +M README +M docs/reference/gdata-running.xml +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/tests/picasaweb.c + +commit 7c0db41e9f1532201230f5ed8f26a1aeff3d3817 +Author: Rudolfs Mazurs <rudolfs.mazurs@gmail.com> +Date: Sat Mar 19 21:50:39 2011 +0200 + + Added Latvian translation. + +M po/LINGUAS +A po/lv.po + +commit bb0bdafd89364d4e53b5396c1e5f190b4fbd4d7c +Author: ben <benbenhappy2008@gmail.com> +Date: Fri Mar 18 23:17:07 2011 +0800 + + Update Simplified Chinese translation. + +M po/zh_CN.po + +commit bdef0fd144d5ff881e4a14c0dde5057d3f22fc7d +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Tue Mar 15 15:19:57 2011 +0100 + + Updated Hungarian translation + +M po/hu.po + +commit 0fdda9016b828200f129a20a2f6a198ad4c255ea +Author: Lucian Adrian Grijincu <lucian.grijincu@gmail.com> +Date: Mon Mar 14 11:19:53 2011 +0100 + + Updated Romanian translation + +M po/ro.po + +commit 2b709d4c85548fe13b78cbdcd1265f23711cfdbf +Author: António Lima <amrlima@gmail.com> +Date: Sat Mar 12 19:50:29 2011 +0000 + + Updated Portuguese translation + +M po/pt.po + +commit a262734d8ed520996c1d332b91460f57ed72e586 +Author: Joan Duran <jodufi@gmail.com> +Date: Thu Mar 10 23:47:32 2011 +0100 + + [l10n] Updated Catalan translation + +M po/ca.po + +commit 092646351fa5d8399123f86b7a03a2f2e2caca76 +Author: Piotr Drąg <piotrdrag@gmail.com> +Date: Thu Mar 10 17:50:29 2011 +0100 + + Updated Polish translation + +M po/pl.po + +commit 9ac8bf38938b881c97401f8a6aab1a897cd21ef7 +Author: Yuri Myasoedov <omerta13@yandex.ru> +Date: Sun Mar 6 11:37:45 2011 +0300 + + Updated Russian translation + +M po/ru.po + +commit 594862238d57bd0f597053ae8745c26735213212 +Author: Manoj Kumar Giri <mgiri@redhat.com> +Date: Tue Mar 1 13:45:03 2011 +0530 + + Added Oriya (or) to LINGUAS + +M po/LINGUAS + +commit 1dd2f1ff98385ddee3ca1629b21936812c6fcde1 +Author: Manoj Kumar Giri <mgiri@redhat.com> +Date: Tue Mar 1 13:41:45 2011 +0530 + + Updated Oriya Translation + +A po/or.po + +commit c70756c6a679ae6ccb0fdd0354c6d07f5a0e20d5 +Author: Bruno Brouard <annoa.b@gmail.com> +Date: Sat Feb 26 10:29:42 2011 +0100 + + Updated French translation + +M po/fr.po + +commit e0c85b38234df674da9ce889b9697f6f97e35636 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Feb 22 19:50:57 2011 +0000 + + docs: Add the 0.8.0 API changes page to the documentation + + Helps: bgo#642983 + +M docs/reference/gdata-docs.xml + +commit 755235e5623a52b11cccc6908422535830013b73 +Author: Runa Bhattacharjee <runab@redhat.com> +Date: Thu Feb 17 17:37:48 2011 +0530 + + Added Bengali India to the list of languages + +M po/LINGUAS + +commit 212257a5ad3df0dfcf4c94f2556a0fa59e3c7689 +Author: Runa Bhattacharjee <runab@redhat.com> +Date: Thu Feb 17 17:37:34 2011 +0530 + + Added Bengali India Translation + +A po/bn_IN.po + +commit 8faeeeb1971b78cba5396306033c728211120b9b +Author: Daniel Korostil <ted.korostiled@gmail.com> +Date: Wed Feb 16 08:03:04 2011 +0200 + + Uploaded Ukranian + +M po/uk.po + +commit 99a85165ce3d35070778342cbe5d0f4f14c628f5 +Author: Ivaylo Valkov <ivaylo@e-valkov.org> +Date: Tue Feb 15 06:39:57 2011 +0200 + + Updated Bulgarian translation + +M po/LINGUAS +A po/bg.po + +commit 32a489b0c068b9f57d540a940298609fd931125c +Author: Changwoo Ryu <cwryu@debian.org> +Date: Sun Feb 13 04:22:08 2011 +0900 + + Add Korean translation + +M po/LINGUAS +A po/ko.po + +commit 6ef3a6cd4dbeebce93c6377e65a29bae5ec96fbc +Author: Sweta Kothari <swkothar@redhat.com> +Date: Tue Feb 8 14:14:30 2011 +0530 + + Updated Gujarati Translations & Added gu in LINGUAS + +M po/LINGUAS +A po/gu.po + +commit 8800f1eefba340767484b372ded403e95e2c6146 +Author: Gheyret Kenji <gheyret@hotmail.com> +Date: Fri Feb 4 23:21:33 2011 +0100 + + Added UG translation + +M po/LINGUAS + +commit 17376b2db91c965eabe1c5b164e6fb9dc0a68bfe +Author: Gheyret Kenji <gheyret@hotmail.com> +Date: Fri Feb 4 23:17:11 2011 +0100 + + Added UG translation + +A po/ug.po + +commit 63c01ba9b1ad776a71df8ce0a0788d57715fb0bd +Author: A S Alam <aalam@users.sf.net> +Date: Sat Jan 29 09:13:12 2011 +0530 + + update Punjabi Translation by A S Alam + +M po/pa.po + +commit 15a465d951d7aa14508962f193fcfd541c38817e +Author: A S Alam <aalam@users.sf.net> +Date: Sat Jan 29 08:13:25 2011 +0530 + + update Punjabi Translation by A S Alam + +M po/pa.po + +commit 8bed9a863def8812ae24dfce94ab488877de9212 +Author: Fran Diéguez <fran.dieguez@mabishu.com> +Date: Thu Jan 27 03:22:15 2011 +0100 + + QA of Galician translations + +M po/gl.po + +commit c26e694f530725766b00bf84e0af86a50c27f98c +Author: Kjartan Maraas <kmaraas@gnome.org> +Date: Wed Jan 26 15:31:12 2011 +0100 + + Updated Norwegian bokmål translation. + +M po/nb.po + +commit 78eb567d32a578cef8ae573fa5da4d61cd8bf8e2 +Author: Chao-Hsiung Liao <j_h_liau@yahoo.com.tw> +Date: Tue Jan 25 19:26:27 2011 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit 5fae259ab79bfa218fa1493923ab8b7bc051699f +Author: Kjartan Maraas <kmaraas@gnome.org> +Date: Sun Jan 23 11:49:33 2011 +0100 + + Updated Norwegian bokmål translation + +M po/nb.po + +commit 1951c53b54c9b44b342d4d589ba17223990f4686 +Author: Michael Kotsarinis <mk73628@gmail.com> +Date: Wed Jan 19 18:28:52 2011 +0200 + + Updated Greek translation + +M po/el.po + +commit ba6676dd0d6f56da993fc2a0d8e458a30e11da31 +Author: Fran Diéguez <fran.dieguez@mabishu.com> +Date: Wed Jan 19 15:40:45 2011 +0100 + + Updated Galician translations + +M po/gl.po + +commit e1a663ad280385f280ef6f32a336cc4f68e82bbe +Author: Andika Triwidada <andika@gmail.com> +Date: Mon Jan 17 12:25:29 2011 +0700 + + Updated Indonesian translation + +M po/id.po + +commit e5a49029aaf3accb7fa65d9f4975ba8bbb3862a2 +Author: George Stefanakis <george.stefanakis@gmail.com> +Date: Thu Jan 13 21:18:38 2011 +0200 + + Updated Greek translation + +M po/el.po + +commit 781e53a5d939e108f7ff57fd75f6409199321de4 +Author: Petr Kovar <pknbe@volny.cz> +Date: Mon Jan 3 21:52:50 2011 +0100 + + Update Czech translation by Marek Cernocky + + Reviewed by Petr Kovar. + +M po/cs.po + +commit fc90d4563c6209b5f4468c01c187de4e1ff8abd9 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Sat Jan 1 21:16:13 2011 +0100 + + [l10n] Updated German translation + +M po/de.po + +commit d33046b432da8a2580154dd91767710acbf28d59 +Author: Daniel Mustieles <daniel.mustieles@gmail.com> +Date: Sat Jan 1 14:47:02 2011 +0100 + + Updated Spanish translation + +M po/es.po + +commit 75be00208ccf233e551d22e4e5aa39480ebfae40 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Thu Dec 30 21:23:54 2010 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit e6cf0cd9c37c910aab4ae8efb72869cefcad4ac9 +Author: Daniel Nylander <po@danielnylander.se> +Date: Thu Dec 30 18:29:58 2010 +0100 + + Updated Swedish translation + +M po/sv.po + +commit 065bb38c3b107b2e3574496a8d6e848fd537d7a5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 17:00:03 2010 +0000 + + docs: Add a note about the even–odd/stable–unstable versioning + change + +M HACKING + +commit 9b42c97c5562c6937b4efcaedf5b82c99d6bd3f3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 16:50:29 2010 +0000 + + build: Increment version to 0.9.0 + +M configure.ac + +commit 430b36875815fcf2b888f952ac84ccc71979d893 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 16:48:14 2010 +0000 + + Release version 0.8.0 + +M NEWS +M configure.ac + +commit 775255d6e2263772c5ec49677e468617768e9bdf +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 15:36:35 2010 +0000 + + l10n: Update British English translation + +M po/en_GB.po + +commit 889232526478833a43aea49a1bda8342ffca41c6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 15:34:56 2010 +0000 + + l10n: Add missing files to POTFILES.in + +M po/POTFILES.in + +commit 3a045028895789efdf1248c10a483996426d6003 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 15:07:09 2010 +0000 + + core: Don't use a deallocated mutex for early-cancelled messages + + In the case that a message is cancelled before it's queued in + the session + (i.e. the cancellation callback is called immediately by + g_cancellable_connect()), ensure we don't free the mutex which + we later + attempt to lock. + +M gdata/gdata-service.c + +commit 4869dd85d3853184a42fe66ceded941dfbd148b3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 14:54:04 2010 +0000 + + core: Don't use deallocated memory + + When authenticating asynchronously, don't attempt to use the + username and + password from the asynchronous closure after it's been implicitly + deallocated + by changing the result value of the GSimpleAsyncResult. + + See: bgo#635736 + +M gdata/gdata-service.c + +commit 9cefc971f8facc88a8597242bc17ae38d22f04c5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 14:10:24 2010 +0000 + + calendar: Fix some typos in code examples + + Helps: bgo#579885 + +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-query.c + +commit c68d0d81945184ca7896360edf05b0aef2bbe899 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 13:55:31 2010 +0000 + + contacts: Add a code example for using batch operations + + Helps: bgo#579885 + +M gdata/services/contacts/gdata-contacts-service.c + +commit ceddaf96173fcb98f73a414cad2a10d28615f042 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 13:55:13 2010 +0000 + + documents: Fix a small documentation typo + + Helps: bgo#579885 + +M gdata/services/documents/gdata-documents-service.c + +commit 8d5f8f6fb67d32308327f4baf5e3b13bf15a8b2a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 13:52:12 2010 +0000 + + contacts: Add a code example for querying for groups + + Helps: bgo#579885 + +M gdata/services/contacts/gdata-contacts-service.c + +commit 6e275bc8e3b2c37976338f3753cbd6b5d7179cbc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 13:46:01 2010 +0000 + + contacts: Add a code example for adding a new group + + Helps: bgo#579885 + +M gdata/services/contacts/gdata-contacts-group.c + +commit edccc5d9b54f174fd15c477434423749137a0763 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 13:39:05 2010 +0000 + + contacts: Add a code example for updating a contact's details + + Helps: bgo#579885 + +M gdata/services/contacts/gdata-contacts-contact.c + +commit f15d8b4bf226e11278f6344c1bc55d865973a1c0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 13:28:31 2010 +0000 + + contacts: Add a code example for getting/setting a contact's photo + + Helps: bgo#579885 + +M gdata/services/contacts/gdata-contacts-contact.c + +commit f412792acb1b2787de7efb85d9fcd5df250e7c86 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 13:24:02 2010 +0000 + + contacts: Add a code example for querying for contacts + + Helps: bgo#579885 + +M gdata/services/contacts/gdata-contacts-query.c + +commit f73bdf5e7c96252685b95864d20ac24646b57b0b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 13:00:43 2010 +0000 + + documents: Add a code example for using batch operations + + Helps: bgo#579885 + +M gdata/services/documents/gdata-documents-service.c + +commit 07de9637c5ce8356dc314110e61162c2e947ac60 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 12:55:50 2010 +0000 + + documents: Add a code example for document ACLs + + Helps: bgo#579885 + +M gdata/services/documents/gdata-documents-document.c + +commit bde0a011f9b9e373a642f13b41b99ae84fc1c952 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 12:55:35 2010 +0000 + + calendar: Fix some typos in code examples + + Helps: bgo#579885 + +M gdata/services/calendar/gdata-calendar-service.c + +commit 6dbc1592506b406d8f47cc400459a5d78ff46dd5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 12:46:14 2010 +0000 + + documents: Add a code example for downloading a specific spreadsheet + sheet + + Helps: bgo#579885 + +M gdata/services/documents/gdata-documents-spreadsheet.c + +commit 6046970e4c38a87ab83e16e58ea7f0b2a04510bb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 12:34:32 2010 +0000 + + documents: Add a code example for querying for documents + + Helps: bgo#579885 + +M gdata/services/documents/gdata-documents-query.c + +commit e05dd7d6d8ee71ad6bdaec06cae91c2d4b19e748 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 12:24:47 2010 +0000 + + documents: Add a code example for moving an entry between folders + + Helps: bgo#579885 + +M gdata/services/documents/gdata-documents-entry.c + +commit 3151fefa7d4d3e03afed40fa2a71d48091ba84cc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 12:14:08 2010 +0000 + + documents: Add a code example for uploading documents + + Helps: bgo#579885 + +M gdata/services/documents/gdata-documents-service.c + +commit f886abad30b6928a1a38db3b10ba0942fbf0f621 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 12:13:42 2010 +0000 + + youtube: Fix a typo in a code example + + Helps: bgo#579885 + +M gdata/services/youtube/gdata-youtube-service.c + +commit e081c7144e407bf107c2bebf0bf2ae57313f2ea1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 12:06:42 2010 +0000 + + documents: Add a code example for adding a new folder + + Helps: bgo#579885 + +M gdata/services/documents/gdata-documents-folder.c + +commit 5720765671291315397d4f6c182f300548d4cbac +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 12:01:30 2010 +0000 + + documents: Add a code example for downloading a document + + Helps: bgo#579885 + +M gdata/services/documents/gdata-documents-document.c + +commit 1e0ff1cdc9e70676ad3d21f2174663680b4ce899 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 11:40:11 2010 +0000 + + youtube: Add a code example for querying standard video feeds + + Helps: bgo#579885 + +M gdata/services/youtube/gdata-youtube-service.c + +commit e6763ee4f5a7fc76d8011f24e756106fc21906a7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 11:34:00 2010 +0000 + + youtube: Add a code example for uploading videos + + Helps: bgo#579885 + +M gdata/services/youtube/gdata-youtube-service.c + +commit a246c29d8e4421663eb2448883f31ae3c61b51cb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 11:11:13 2010 +0000 + + calendar: Add a code example for using batch operations + + Helps: bgo#579885 + +M gdata/services/calendar/gdata-calendar-service.c + +commit 6864acd870b589622f9d7f482a86a448972cc57c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 10:41:20 2010 +0000 + + calendar: Add a code example for listing calendars + + Helps: bgo#579885 + +M gdata/services/calendar/gdata-calendar-calendar.c + +commit fd41f764f19a0daad8a351e128cd23a6434a879d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 10:41:04 2010 +0000 + + calendar: Add a code example for querying for events + + Helps: bgo#579885 + +M gdata/services/calendar/gdata-calendar-query.c + +commit ba0fe9776a9048b262abb64a94d5f7db4171fb13 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 10:22:52 2010 +0000 + + calendar: Add a code example for inserting events + + Helps: bgo#579885 + +M gdata/services/calendar/gdata-calendar-event.c + +commit 61927f8f0ad6c0e819fadf88637ae94d4fba0aef +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 10:04:51 2010 +0000 + + calendar: Add a code example for calendar ACLs + + Helps: bgo#579885 + +M gdata/services/calendar/gdata-calendar-service.c + +commit bb023759e90b3be386c100193560652d6e31efe3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 30 09:58:43 2010 +0000 + + core: Fix a minor typo in the documentation + +M gdata/gdata-upload-stream.c + +commit 841301ce2999bf54af8959843fc90ff65272f312 +Author: Daniel Nylander <po@danielnylander.se> +Date: Wed Dec 29 18:54:21 2010 +0100 + + Updated Swedish translation + +M po/sv.po + +commit e9d3eeb92226b2f179a1bc74e4595a64cb51f144 +Author: Kris Thomsen <lakristho@gmail.com> +Date: Wed Dec 29 11:59:54 2010 +0100 + + Updated Danish translation + +M po/da.po + +commit f2317ea32b594e0054673557c6ea3c2fec4d080b +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Sun Dec 26 00:32:12 2010 +0100 + + Updated Hungarian translation + +M po/hu.po + +commit 29f7b1582d5b7a4bed51ef2497bb0b04b644b052 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 21 17:48:50 2010 +0000 + + contacts: Don't return deleted groups in + gdata_contacts_contact_get_groups() + + Also take the opportunity to rewrite it to use GHashTableIter + instead of + a tiny little callback function. + +M gdata/services/contacts/gdata-contacts-contact.c + +commit bda2daa2a4741eb7ad7e59859c62c4df329656d7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 21 17:44:55 2010 +0000 + + contacts: Improve documentation for + gdata_contacts_contact_is_group_deleted() + +M gdata/services/contacts/gdata-contacts-contact.c + +commit c3129e7de1b02ea646c30051dad2c7b3938946c1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 21 17:44:37 2010 +0000 + + contacts: Add tests for group membership + +M gdata/tests/contacts.c + +commit 3dfd4dedf71fae3481477fb66e199f9d235402fd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 20 13:57:40 2010 +0000 + + docs: Remove some outdated TODO comments + +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit d3a1231d07669b05b791b15b370065effc35b20e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 20 13:51:36 2010 +0000 + + core: Expand documentation about cancellation of core query methods + +M gdata/gdata-service.c + +commit f5c20a31ae87a543a60024a1f3a62c15eef56b70 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 20 11:29:51 2010 +0000 + + core: Expand GDataUploadStream documentation + +M gdata/gdata-upload-stream.c + +commit 515868e62f6ed1096b55b7df30c9867a52f3154a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 20 11:06:54 2010 +0000 + + core: Expand GDataDownloadStream documentation + +M gdata/gdata-download-stream.c + +commit 7d28021fa21a3349f08940154f5370c0d385266b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 20 10:28:55 2010 +0000 + + core: Move sending of final boundary to gdata_upload_stream_close() + + It makes more sense for the final boundary to be sent to the + server when + the stream is closed, and makes the bookkeeping simpler. It also + means that + the boundary can't be sent multiple times, which was possible + before if + g_output_stream_write() was called multiple times after EOF. + +M gdata/gdata-upload-stream.c + +commit 475e64a25734af7366984e5a5cdb070e01996dd1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 20 10:12:04 2010 +0000 + + core: Don't signal completion of a download in a callback function + + If completion of a GDataDownloadStream download is signalled in + a callback + function, it's possible for the stream object to be unreffed and + finalised + while the network thread is still using the object (as it has + some cleanup + work to do after emitting the “finished” signal). + + This is fixed by moving signalling of finished_cond to the end of + the thread's + main function. + +M gdata/gdata-download-stream.c + +commit 063845eaabfdf0703914c3d59b63a7945250ce4d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 20 10:09:21 2010 +0000 + + core: Return G_IO_ERROR_CLOSED if stream close methods are called + again + + While g_[input|output]_stream_close() prevents the close method + implementation + from being called multiple times, other methods in GIO (such as + g_output_stream_splice()) call the close method implementation + directly, so + gdata_[upload|download]_stream_close() need to be safe to call + multiple + times. + +M gdata/gdata-download-stream.c +M gdata/gdata-upload-stream.c + +commit d968510805686fba3f0b6d1318db4402b10fbcbe +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 20 10:05:21 2010 +0000 + + core: Ensure that _gdata_service_actually_send_message() never + returns NONE + + If the message was cancelled before + _gdata_service_actually_send_message() + was called, it wasn't previously getting the correct status code + (SOUP_STATUS_CANCELLED) set. + +M gdata/gdata-service.c + +commit 756cdd54d364bea57a751eb8a543219847d84fdb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Dec 19 17:23:49 2010 +0000 + + core: Take offset into account multiple times in GDataBuffer + + If many small pops are requested of a GDataBuffer which has only + had large + pushes done on it, the head_read_offset should be used to return + the correct + data from increasing positions in the first chunk. Previously, + it wasn't. + +M gdata/gdata-buffer.c + +commit 2cb5ab13464357ad5ed76a1f32dde79f0cfdaeff +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Dec 19 17:22:51 2010 +0000 + + tests: Add test suite for GDataUploadStream and GDataDownloadStream + + Add a simple test suite (comprising two tests cases so far) for + the two + stream classes. More tests will be added in future. + +M gdata/tests/Makefile.am +A gdata/tests/streams.c + +commit 7b700f72366981c8fb97cfc929d28db1aee2a269 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 23:28:26 2010 +0000 + + core: Tidy up critical regions in GDataDownloadStream + + Tidy up the mutex locks and unlocks, and ensure that all variables + which + should be protected by a mutex, are. + +M gdata/gdata-download-stream.c + +commit f9b2d01bbc94a20091e466c9989b641cc654cd7d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 22:12:44 2010 +0000 + + core: Tidy up critical regions in GDataUploadStream + + Tidy up the mutex locks and unlocks, and ensure that all variables + which + should be protected by a mutex, are. + +M gdata/gdata-upload-stream.c + +commit 0c5cb2bee46d0646cba336dc44feb28301bd5e6d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 21:56:04 2010 +0000 + + core: Make behaviour of response values more consistent + + We now make more guarantees about the response values (response_status + and + response_error). Firstly, we guarantee that they won't be set + until the + network activity has finished. Secondly, we guarantee that they + won't be + returned by any GOutputStream methods other than + g_output_stream_close(). + Thirdly, we guarantee that they are immutable once set. + +M gdata/gdata-upload-stream.c + +commit ef2af1afd03788feed7e3ed52de84280e2eaeea1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 18:57:42 2010 +0000 + + core: Ensure that data from the EOF chunk is uploaded in + GDataUploadStream + +M gdata/gdata-upload-stream.c + +commit 484f237da97941f486b5fd4fac84f7baa6810f21 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 17:24:44 2010 +0000 + + core: Cancel gdata_download_stream_read() if the entire download + is cancelled + + Helps: bgo#637036 + +M gdata/gdata-download-stream.c + +commit b1b2f8399a2a03d7ccc11ff8b99fd0ad42411490 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 17:07:39 2010 +0000 + + core: Refactor return path in gdata_download_stream_read() + + Refactor it to contain a single return statement which asserts + a postcondition + derived from the documentation for g_input_stream_read(). + +M gdata/gdata-download-stream.c + +commit 8dca3d4cb09de2787d490f0b62246d2bd22360a7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 19:10:47 2010 +0000 + + core: Allow gdata_download_stream_close() to be cancelled + + Helps: bgo#637036 + +M gdata/gdata-download-stream.c + +commit 4d2061ee2f614f5ff923d2f49f9218a8db38ddfd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 12:46:07 2010 +0000 + + media: Add a cancellable parameter to gdata_media_thumbnail_download() + + Add a cancellable parameter to gdata_media_thumbnail_download() + to mirror + GDataDownloadStream:cancellable. The tests have been updated + accordingly. + + This breaks the following API: + • gdata_media_thumbnail_download() + + Helps: bgo#637036 + +M gdata/media/gdata-media-thumbnail.c +M gdata/media/gdata-media-thumbnail.h +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/tests/picasaweb.c + +commit 63e1cc0b4e8440f851549552da334fe0c58bdc47 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 12:43:07 2010 +0000 + + media: Add a cancellable parameter to gdata_media_content_download() + + Add a cancellable parameter to gdata_media_content_download() + to mirror + GDataDownloadStream:cancellable. The tests have been updated + accordingly. + + This breaks the following API: + • gdata_media_content_download() + + Helps: bgo#637036 + +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-content.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/tests/picasaweb.c + +commit 032a5bc08986f66735846ffec3d1daafcd62cd0f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 12:39:43 2010 +0000 + + documents: Add a cancellable parameter to + gdata_documents_document_download() + + Add a cancellable parameter to gdata_documents_document_download() + to mirror + GDataDownloadStream:cancellable. The tests have been updated + accordingly. + + This breaks the following API: + • gdata_documents_document_download() + + Helps: bgo#637036 + +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-document.h +M gdata/tests/documents.c + +commit 002d4d83e03f7bb30544d7690c83e4c44f5ae73f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 18 12:35:54 2010 +0000 + + core: Add a “cancellable” property to GDataDownloadStream + + Allow the code which creates the GDataDownloadStream to specify + a GCancellable + which will cancel the entire download operation (i.e. permanently + cancel all + I/O on the stream and all network activity). + + This breaks the following API: + • gdata_download_stream_new() + + The following API has been added: + • GDataDownloadStream:cancellable + • gdata_download_stream_get_cancellable() + + Helps: bgo#637036 + +M docs/reference/gdata-sections.txt +M gdata/gdata-download-stream.c +M gdata/gdata-download-stream.h +M gdata/gdata.symbols +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/documents/gdata-documents-document.c + +commit 26b8b853f3c24f47077b277a95ca1f49e37d7584 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 17 23:55:59 2010 +0000 + + core: Add support for g_output_stream_flush() to GDataUploadStream + + Now, calling g_output_stream_flush() on a GDataUploadStream will + block until + all outstanding bytes have been written to the network. + +M gdata/gdata-upload-stream.c + +commit e74adbd5a414cf075df5fdd868a3cfb628e7f1ac +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 17 21:49:06 2010 +0000 + + core: Fix cancellation of gdata_upload_stream_close() + + It shouldn't return a cancellation error for the entire stream — if + gdata_upload_stream_close() is cancelled, it merely means to return + from the + call without blocking on the stream actually being closed. + + Helps: bgo#637036 + +M gdata/gdata-upload-stream.c + +commit b7974ac2ed3293968cfb0c10c610a0afb0d2abc8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 17 23:30:28 2010 +0000 + + youtube: Add a cancellable parameter to the upload video method + + Add a cancellable parameter to gdata_youtube_service_upload_video() to + mirror GDataUploadStream:cancellable. The tests have been updated + accordingly. + + This breaks the following API: + • gdata_youtube_service_upload_video() + + Helps: bgo#637036 + +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/tests/youtube.c + +commit c512dd50e0c5c5561dae0ad333cf35e29ff5c1ae +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 17 23:28:30 2010 +0000 + + picasaweb: Add a cancellable parameter to the upload file method + + Add a cancellable parameter to gdata_picasaweb_service_upload_file() + to mirror + GDataUploadStream:cancellable. The tests have been updated + accordingly. + + This breaks the following API: + • gdata_picasaweb_service_upload_file() + + Helps: bgo#637036 + +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/picasaweb.c + +commit 2641a723031b13b129cbe9b8e864115f0024a398 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 17 23:26:53 2010 +0000 + + documents: Add a cancellable parameter to the upload/update methods + + Add a cancellable parameter to + gdata_documents_service_upload_document() + and gdata_documents_service_update_document() to mirror + GDataUploadStream:cancellable. The tests have been updated + accordingly. + + This breaks the following API: + • gdata_documents_service_upload_document() + • gdata_documents_service_update_document() + + Helps: bgo#637036 + +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/tests/documents.c + +commit 2338e007e768770627158f5298cc44bd6de80ed8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 17 23:13:53 2010 +0000 + + core: Add a “cancellable” property to GDataUploadStream + + Allow the code which creates the GDataUploadStream to specify + a GCancellable + which will cancel the entire upload operation (i.e. permanently + cancel all + I/O on the stream and all network activity). + + This breaks the following API: + • gdata_upload_stream_new() + + The following API has been added: + • GDataUploadStream:cancellable + • gdata_upload_stream_get_cancellable() + + Helps: bgo#637036 + +M docs/reference/gdata-sections.txt +M gdata/gdata-upload-stream.c +M gdata/gdata-upload-stream.h +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-service.c + +commit 89fbed575e1e22c3e68b9bbc1cc4cb93b9800e21 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 17 23:11:19 2010 +0000 + + core: Cancel gdata_upload_stream_write() if the entire upload is + cancelled + + Helps: bgo#637036 + +M gdata/gdata-upload-stream.c + +commit 4ca3dbe2b46fab8d578ca9d16ab06fe60be08c26 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 17 22:22:24 2010 +0000 + + core: Port GDataUploadStream to use the safe message cancellation + methods + + GDataUploadStream now uses _gdata_service_actually_send_message(), and + consequently message cancellation is properly an non-racily + supported by + holding a GCancellable in the GDataUploadStream's private data. + + Helps: bgo#637036 + +M gdata/gdata-upload-stream.c + +commit 8962b93e81f3095cd3c78f0bf2af81c2360311cf +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 23:37:54 2010 +0000 + + core: Fix synchronisation between threads in GDataUploadStream + + This upgrades GDataUploadStream to keep track of the number of + bytes in + various buffers, so that it can return more accurate numbers of + bytes written + in each gdata_upload_stream_write() operation, as well as support + cancellation + of a write without cancelling the entire upload. + + Helps: bgo#637036 + +M gdata/gdata-upload-stream.c + +commit 9170ed2d603397a12be1cbfafd6408b7c37de98a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 23:37:09 2010 +0000 + + core: Don't reach EOF in gdata_buffer_pop_data() unless it's the + last read + + Helps: bgo#637036 + +M gdata/gdata-buffer.c + +commit 97b1e0dccee1a70a53bd601721219ac1639ed450 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 22:31:12 2010 +0000 + + core: Rearrange the network thread callbacks in GDataUploadStream + + If we use wrote-body-data, we have access to the number of bytes + which were + written from the last chunk, which is important for keeping track + of the total + number of bytes written, coming up in the next commit. + + Helps: bgo#637036 + +M gdata/gdata-upload-stream.c + +commit 61f4f916bfb249c8ed6ff2dcfb5c71a47a6ee902 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 22:06:12 2010 +0000 + + core: Don't set the response error when cancelling + gdata_upload_stream_write() + + Helps: bgo#637036 + +M gdata/gdata-upload-stream.c + +commit 76ddf92f954288ff187b69328e37317829f24ce9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 19:22:09 2010 +0000 + + core: Prevent a race condition in joining GDataUploadStream's + network thread + + Helps: bgo#637036 + +M gdata/gdata-upload-stream.c + +commit 1d32533173641103283c2fc201821cd50e7f180d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 19:16:58 2010 +0000 + + core: Add some comments about the lifecycle of GDataDownloadStream + + Helps: bgo#637036 + +M gdata/gdata-download-stream.c + +commit 7dfcadbc0e34e378eff8890a269e91cc0dab298e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 18:27:34 2010 +0000 + + core: Port GDataDownloadStream to use the safe message cancellation + methods + + GDataDownloadStream now uses _gdata_service_actually_send_message(), + and + consequently message cancellation is properly an non-racily + supported by + holding a GCancellable in the GDataDownloadStream's private data. + + Helps: bgo#637036 + +M gdata/gdata-download-stream.c + +commit ffde18eaeeb03464ad183cc46c41ed10d03f57a9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 18:05:25 2010 +0000 + + core: Expose _gdata_service_actually_send_message() internally + + This will allow the GDataUploadStream and GDataDownloadStream + message-sending + code to be rebased on it to fix cancellation races. + + Helps: bgo#637036 + +M gdata/gdata-private.h +M gdata/gdata-service.c + +commit fbf02481e91a4bc0aea673dc1a971063426ec3fd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 17:59:12 2010 +0000 + + core: Prevent cancellation races being caused by other messages + being queued + + The SoupSession::request-queued signal is emitted for messages + other than + the one we're preventing message cancellation races for, so we need + to check + that it's been emitted for the message we're interested in. + + Helps: bgo#637036 + +M gdata/gdata-service.c + +commit 0edc7d221cf99bd701d4912e4ba1546797978544 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 17:50:06 2010 +0000 + + core: Handle GDataDownloadStreams which never have a network thread + started + + Helps: bgo#637036 + +M gdata/gdata-download-stream.c + +commit 3e9e1dbfa7b8a2853635aa3f0ea64421290490b5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 17:36:04 2010 +0000 + + core: Block gdata_download_stream_close() on completion of network + activity + + It wasn't previously waiting for the network activity to finish, + which it + should (if any has started). + + Helps: bgo#637036 + +M gdata/gdata-download-stream.c + +commit 458b9cc57e2a9a734a591a3fe4e0955b3decd401 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 16:41:44 2010 +0000 + + core: Remove redundant cancellation checks from the authentication + thread + + Helps: bgo#637036 + +M gdata/gdata-service.c + +commit cd457fa88f55e3306baef639a7e6a9d292836afb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 16:40:44 2010 +0000 + + core: Only notify for GDataService::authenticated if it's actually + changed + +M gdata/gdata-service.c + +commit 7111756f40c188479364830b1da819e3e8cf39f9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 16:31:11 2010 +0000 + + core: Fix cancellation handling for closing a GDataUploadStream + + Deadlocks could have occurred if the cancellable was in the process + of being + cancelled when g_cancellable_disconnect() was called (as it was + being called + with the same mutex locked that the cancellation callback attempts + to lock). + + Additionally, the suboptimal method of running the cancellation code + in an + idle callback to ensure that it wasn't run in the same thread as + gdata_upload_stream_close() can be removed, because the cancellation + handler + is now installed before gdata_upload_stream_close() locks the + response_mutex, + thus removing the possibility of deadlock if the cancellable has + already been + cancelled. + + Helps: bgo#637036 + +M gdata/gdata-upload-stream.c + +commit 80be38cfb29922a4b0846c1b5496ba3cd3f1f5f4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 16:07:10 2010 +0000 + + core: Fix cancellation handling for writing to a GDataUploadStream + + There was a minor locking issue with write_finished, and deadlocks + could have + occurred if the cancellable was in the process of being cancelled when + g_cancellable_disconnect() was called (as it was being called with + the same + mutex locked that the cancellation callback attempts to lock). + + Helps: bgo#637036 + +M gdata/gdata-upload-stream.c + +commit 321abcef328f35b2cd732fea7e3e2ccfd96ccf4d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 15:45:50 2010 +0000 + + core: Fix error handling for reading from a GDataDownloadStream + + Cancellation should only return an error if it couldn't read a + single byte. + All errors should be accompanied by a return value of -1, not 0. + +M gdata/gdata-download-stream.c + +commit 76e7ba27e5f275fdd886648b00e0d7ea0e2147b4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 15:25:45 2010 +0000 + + core: Fix liveness issues and cancellation problems in GDataBuffer + + There was a race condition with cancellation of a + gdata_buffer_pop_data() + operation where if the operation was cancelled before the first + g_cond_wait() + call, the thread would sit in the g_cond_wait() for ever, as the + GCond would + never be signalled in the cancellation handler, as it had already run. + + This commit fixes the problem by serialising access to the cancelled + flag, + ensuring that deadlock doesn't occur by setting up and tearing + down the + cancellation stuff without the buffer's mutex being held. + + Helps: bgo#637036 + +M gdata/gdata-buffer.c + +commit 6273d1c7161c892c42e76320fc87988fd58c02f8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 15:02:02 2010 +0000 + + core: Ensure all GDataUploadStream ops are finished before freeing + the message + + It was previously possible for the SoupMessage being used in an + ongoing + upload to be unreffed (by dispose()) and destroyed before the + ongoing network + operation finished, causing a crash. We now ensure that all network + operations + are finished at the start of dispose(), rather than at the start of + finalize(). + +M gdata/gdata-upload-stream.c + +commit 877c9b0b3ca169d0edd7280b256b0af658a6803a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 14:06:09 2010 +0000 + + core: Expand the cancellation docs on gdata_service_query() + +M docs/reference/gdata-overview.xml +M gdata/gdata-service.c + +commit 5d3f8c90da42719cd49bb1f3ef643a676e901f15 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Mon Dec 20 12:57:29 2010 +0100 + + [l10n] Updated German translation + +M po/de.po + +commit b1f7f3fd54a155889939c5bbcafe711e072406e9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 12:45:46 2010 +0000 + + docs: Add a diagram of cancellation in libgdata + +M docs/reference/Makefile.am +A docs/reference/cancellation.dia +A docs/reference/cancellation.png +M docs/reference/gdata-overview.xml + +commit ab094bab26aa754196d467a9c183f9598ed8d1f1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 12:41:36 2010 +0000 + + docs: Add missing file to EXTRA_DIST + +M docs/reference/Makefile.am + +commit 8baf76c36876bd46c4ebe3399bf52d1775078293 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 16 12:19:52 2010 +0000 + + Bug 594814 — Handle GeoRSS for YouTube videos + + Add support for getting and setting the latitude and longitude + for YouTube + videos. This adds the following new API: + • GDataYouTubeVideo:latitude + • GDataYouTubeVideo:longitude + • gdata_youtube_video_get_coordinates() + • gdata_youtube_video_set_coordinates() + + Closes: bgo#594814 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/youtube.c + +commit ba11882e88125857219145f6da72ae52d3d3d7c4 +Author: Marek Černocký <marek@manet.cz> +Date: Mon Dec 13 14:53:02 2010 +0100 + + Updated Czech translation + +M po/cs.po + +commit 464606f752f1b6832c45e348569dd241b43c66ed +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 23:13:50 2010 +0000 + + core: Minor documentation fix for some of the authentication + documentation + +M gdata/gdata-service.c + +commit 425fc2eb51acbc2ca4b98961a8903ef23dac0d8f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 23:13:23 2010 +0000 + + core: Add an example of async authentication to the documentation + + Helps: bgo#579885 + +M gdata/gdata-service.c + +commit 6f39903405ba8f12c3d1808c1fc36b51105ce8a1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 20:12:03 2010 +0000 + + tests: Fix comparison of attributes' namespaces in XML tree + comparisons + +M gdata/tests/common.c + +commit 7c73cdda649657245de554eb0711c04591ef9f9e +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Sat Dec 11 20:23:21 2010 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit ef956e38771209b1dc815e95382f006ceea04c57 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 18:27:30 2010 +0000 + + core: Remove _gdata_download_stream_find_destination() + + It was unused and private. + +M gdata/gdata-download-stream.c +M gdata/gdata-private.h + +commit 3a3e1704e0da0c3ddeff973f1beb5c3a69d2b464 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 18:24:09 2010 +0000 + + core: Fix handling early cancellation of batch operations + + If we left cancellation handling to the GSimpleAsyncResult, our + code to + propagate errors to all the operation's callbacks was not being + called if + the GCancellable was cancelled really early in running the operation + (e.g. + before calling gdata_batch_operation_run[_async]()). + + This commit fixes the problem by disabling GSimpleAsyncResult's + cancellation + handling feature for batch operations. + +M gdata/gdata-batch-operation.c + +commit 3fe595e302eaed8af46b7b3d58313548e4473584 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 18:20:46 2010 +0000 + + core: Fix a race condition in message cancellation handling + + Message cancellation is performed using soup_session_cancel_message(), + but + this has no effect until after the message is queued in the + SoupSession's + message queue. Consequently, with the naïve cancellation + implementation we + had before, there was a race condition which could occur if the + message was + cancelled before it was queued in the session (typically if the + cancellable + was cancelled before the message was even passed to the GDataService). + + We fix this by locking message cancellation while the message is + added to + the session's message queue, and separately handling cancellation + which + occurs before the message is passed to the GDataService. + +M gdata/gdata-service.c + +commit 9d04916081eea719b162cde3be0ee5b0da2eb99d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 16:32:36 2010 +0000 + + core: Consolidate message sending code in GDataService + + This reduces duplication of the repetitive code needed to send + messages in + the authentication and query code paths, and gives a central + location to + fix the race conditions in cancellation. + +M gdata/gdata-service.c + +commit 4ab7b69209455a95afbce8a4b479617696ab860f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 15:58:09 2010 +0000 + + youtube: Fix another leak in the test suite + +M gdata/tests/youtube.c + +commit bca50ab7f79f24fa5d4ba1269094e2e4daf811ab +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 15:44:55 2010 +0000 + + youtube: Fix batch tests + + Due to the fixes in GDataBatchOperation which ensure that callbacks + are + always called for every operation, the batch operation tests need + fixing. + +M gdata/tests/youtube.c + +commit 997fc9a3dda1d3d1e38e68b11cb3c5136d484e63 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 14:38:00 2010 +0000 + + tests: Convert all the tests to use the new XML tree comparison + function + + This fixes them to work correctly regardless of the GLib version. + +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/general.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit c32acde2c4d486fb1a01fed8f76e1442844ac190 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 11 11:53:55 2010 +0000 + + tests: Add an XML tree comparison function for the test suite + + Due to a recent change in GLib master which affects the ordering + of entries + in hash tables (g_str_hash()'s implementation has been changed), + many of the + XML comparisons in libgdata's test suite have been broken. A tidy + solution is + to introduce an XML-aware comparison function, rather than just + using a + simple string comparison. This commit does that. + + This commit only adds the comparison function; a further one will + port all + the test suites to use it. + +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/general.c + +commit be936bbdf8b4e4b45d15a7675655e3841a2168e1 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Sat Dec 11 18:18:42 2010 +0100 + + Updated Spanish translation + +M po/es.po + +commit 6fb9eb819b1122dca6128133484820ffcd5f421c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 20:01:46 2010 +0000 + + contacts: Add an async method for gdata_contacts_contact_set_photo() + + This includes new tests. + + The following API has been added: + • gdata_contacts_contact_set_photo_async() + • gdata_contacts_contact_set_photo_finish() + + Closes: bgo#633363 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit 2735092f558b98cfa58c71cdf167ba102b424ce2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 19:46:48 2010 +0000 + + contacts: Tighten the type of service in + gdata_contacts_contact_set_photo() + + We shouldn't support the use of a GDataService for one service + with methods + for a different service. + + This breaks the API of gdata_contacts_contact_set_photo() (again). + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit a456b9be8884b2bc9d39ffd09e54b2ce1d0b1ca5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 19:25:10 2010 +0000 + + contacts: Require the content type of new contact photos to be passed + + Google's servers technically require a precise content type for + image data + which is uploaded by gdata_contacts_contact_set_photo(), so it's + necessary + to add a content type argument to the method. + + This breaks the API of gdata_contacts_contact_set_photo(). + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit 03ffabc8a6a7cb0dedd91e61d9a1355b7d08f8bf +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 19:15:22 2010 +0000 + + contacts: Add an async method for gdata_contacts_contact_get_photo() + + This includes new tests. + + The following API has been added: + • gdata_contacts_contact_get_photo_async() + • gdata_contacts_contact_get_photo_finish() + + Helps: bgo#633363 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit fd5f10453b6456ad55d707327a24f14d3df57d95 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 18:41:22 2010 +0000 + + contacts: Use guint8 instead of gchar for image data + + When handling contacts' photos, we should use guint8 representations + rather + than gchar ones, as the data isn't textual, and for consistency with + GDataBuffer and friends. + + This changes the types of the following methods, which is an API + break on + weird platforms where sizeof(gchar) != sizeof(guint8): + • gdata_contacts_contact_get_photo() + • gdata_contacts_contact_set_photo() + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit f7a0cc289fc2fa82a5ae4d1af6adceb8ed7f5934 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 18:21:26 2010 +0000 + + calendar: Add an async method for + gdata_calendar_service_insert_event() + + This includes new tests. + + The following API has been added: + • gdata_calendar_service_insert_event_async() + + Helps: bgo#633363 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/tests/calendar.c + +commit 98cabcd58764cd535b3139a9594d3b0f0245bd1f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 18:08:48 2010 +0000 + + calendar: Add an async method for + gdata_calendar_service_query_events() + + This includes new tests. + + The following API has been added: + • gdata_calendar_service_query_events_async() + + Helps: bgo#633363 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/tests/calendar.c + +commit 6a728e3d24f446934bd36f7687d841540ada08f6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 17:51:41 2010 +0000 + + core: Fix attribute escaping for GDataFeed + + Helps: bgo#631033 + +M gdata/gdata-feed.c +M gdata/tests/general.c + +commit 56b33358f94c325dca0fee75a9028247ef5ad896 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 17:45:20 2010 +0000 + + core: Fix attribute escaping for GDataAccessRule + + Helps: bgo#631033 + +M gdata/gdata-access-rule.c +M gdata/tests/general.c + +commit 87d003808596109dbb7ab4bf6f946898a9a53c0e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 17:27:19 2010 +0000 + + core: Fix attribute escaping for GDataEntry + + Helps: bgo#631033 + +M gdata/gdata-entry.c +M gdata/tests/general.c + +commit 5a6637eb4ba66265a7f698d8bbae4a3f5b6a30a5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 17:13:33 2010 +0000 + + youtube: Switch to a stream-based upload API + + For similar reasons as the Documents service's switch to a + stream-based + upload and download API, it makes sense to switch the YouTube service + to a + stream-based upload API. This gives us more flexibility as to the + source of + uploaded data. + + The test suite has been updated appropriately. + + The following API has been changed: + • gdata_youtube_service_upload_video() + + The following API has been removed: + • gdata_youtube_service_upload_video_async() + • gdata_youtube_service_upload_video_finish() + + The following API has been added: + • gdata_youtube_service_finish_video_upload() + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/tests/youtube.c + +commit f3e240dda770f1816d4d4e533fc6f734e782eac0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 16:55:45 2010 +0000 + + youtube: Make the upload tests idempotent + + This helps towards the goal of making all tests idempotent, but + also means + that the tests will be a lot easier to adapt to a stream-based upload + mechanism which is landing shortly for the YouTube service. + + Helps: bgo#633359 + +M gdata/tests/youtube.c + +commit 70e9d50ae9007181e2938ff347118c93810ef1d1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 16:49:25 2010 +0000 + + youtube: Fix a crash in the error handling code if no GError is + passed in + +M gdata/services/youtube/gdata-youtube-service.c + +commit ea6df1cfd4f7f4d2ccad733e20f9ee05ad618b88 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 15:45:33 2010 +0000 + + media: Switch GDataMediaThumbnail to a stream-based download API + + Downloading to a file provided by its path was unnecessarily limiting, + forcing downloads to be made directly to disk instead of + (e.g.) another + network stream, and subjecting clients to libgdata's idea of + “Replace this + File?” logic. It's not much extra code for the clients to handle + this + themselves, and offers much greater flexibility. We also get async + support + for free, as creating the GDataDownloadStream is a cheap operation, + and it + already has async support. + + This updates the test suite appropriately. We now load thumbnails + in the + test suite directly into GdkPixbufs, which requires that we bump our + gdk-pixbuf requirement to 2.14. + + This is an API break which affects: + • gdata_media_thumbnail_download() + + Helps: bgo#633363 + +M configure.ac +M gdata/media/gdata-media-thumbnail.c +M gdata/media/gdata-media-thumbnail.h +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/tests/picasaweb.c + +commit 8c6c28dca3cbd84759f7933e8fc29aec0a5eb4ac +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 15:29:58 2010 +0000 + + media: Switch GDataMediaContent to a stream-based download API + + Downloading to a file provided by its path was unnecessarily limiting, + forcing downloads to be made directly to disk instead of + (e.g.) another + network stream, and subjecting clients to libgdata's idea of + “Replace this + File?” logic. It's not much extra code for the clients to handle + this + themselves, and offers much greater flexibility. We also get async + support + for free, as creating the GDataDownloadStream is a cheap operation, + and it + already has async support. + + This updates the test suite appropriately. + + This is an API break which affects: + • gdata_media_content_download() + + Helps: bgo#633363 + +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-content.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/tests/picasaweb.c + +commit bee6e510abd2cb63341028d30c59f0f2f374b2dd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 15:05:46 2010 +0000 + + picasaweb: Switch to a stream-based upload API + + For similar reasons as the Documents service's switch to a + stream-based + upload and download API, it makes sense to switch the PicasaWeb + service to a + stream-based upload API. This gives us more flexibility as to the + source of + uploaded data. + + The test suite has been updated appropriately. + + The following API has been changed: + • gdata_picasaweb_service_upload_file() + + The following API has been removed: + • gdata_picasaweb_service_upload_file_async() + • gdata_picasaweb_service_upload_file_finish() + + The following API has been added: + • gdata_picasaweb_service_finish_file_upload() + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/picasaweb.c + +commit ab3a9b5f5c69ad9d716d853ea00610915dda626c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 14:11:55 2010 +0000 + + picasaweb: Make the upload tests idempotent + + This helps towards the goal of making all tests idempotent, but + also means + that the tests will be a lot easier to adapt to a stream-based upload + mechanism which is landing shortly for the PicasaWeb service. + + Helps: bgo#633359 + +M gdata/tests/picasaweb.c + +commit 719230d79d877238fc8f13ff9640e24f01d54c24 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 13:04:00 2010 +0000 + + picasaweb: Rearrange and rename the upload tests + + This makes them more logical, in preparation for making them + idempotent. + +M gdata/tests/picasaweb.c + +commit ef81ce227917b36a29b57d88a66c2ed7d5adb4b2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 12:12:40 2010 +0000 + + picasaweb: Fix memory leaks in the picasaweb test suite + +M gdata/tests/picasaweb.c + +commit 1f33f87086c6005f2938985c98575ab3a9f0d142 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 12:12:17 2010 +0000 + + picasaweb: Fix a memory leak in GDataPicasaWebService + +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit 82ca3cb7a602184bafd87003fddce297f82aa2a1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 12:11:49 2010 +0000 + + core: Fix a memory leak in GDataMediaGroup + +M gdata/media/gdata-media-group.c + +commit 2c087dd6d3ab3be0ee81c811d9deb98ded181f0f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 11:54:43 2010 +0000 + + picasaweb: Update test URIs + + It appears that the test account on PicasaWeb has been moved to + a different + server, so we need to update a few URIs in the tests accordingly. + +M gdata/tests/picasaweb.c + +commit 4f8564081500373ef15e0d15c4f35f1e498bb53e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 11:44:22 2010 +0000 + + tests: Fix memory leaks in the general test suite + +M gdata/tests/general.c + +commit e1d394cde3a24b466b3c8d1bb5839b2766eeb0e0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 11:30:43 2010 +0000 + + contacts: Fix a leak in GDataContactsContact + +M gdata/services/contacts/gdata-contacts-contact.c + +commit 205874013f1d29df289f5ddc0ac019f11d207521 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 11:18:49 2010 +0000 + + contacts: Fix memory leaks in the contacts test suite + +M gdata/tests/contacts.c + +commit d85e212574069365574e0e31f009013cb0febc08 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 11:11:36 2010 +0000 + + contacts: Test that batch operations' callbacks are always called + +M gdata/tests/contacts.c + +commit 3de1294e146d33dff8cb94f01dbce1d2715c764b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 10:47:50 2010 +0000 + + calendar: Test that batch operations' callbacks are always called + +M gdata/tests/calendar.c + +commit c2703d63f24a77b5dfd440a69b91932c63c00199 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 10:46:29 2010 +0000 + + calendar: Fix memory leaks in the calendar test suite + +M gdata/tests/calendar.c + +commit 321fbe1f19184c2b9863c285c803fda120be9a41 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 10:39:44 2010 +0000 + + tests: Fix batch tests + + Due to the fixes in GDataBatchOperation which ensure that callbacks + are + always called for every operation, some of the batch operation + tests need + fixing. + +M gdata/tests/calendar.c +M gdata/tests/contacts.c + +commit a26e978bff4cb83845a822e1ff9d4356a860f047 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 01:59:20 2010 +0000 + + core: Fix a major memory leak in GDataDownloadStream + + It turns out that we were leaking the entirety of every file + downloaded using + a GDataDownloadStream. Whoops. + +M gdata/gdata-download-stream.c + +commit ac7299c52faed679d7135ed72861b35b329a6ad2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 01:52:54 2010 +0000 + + core: Fix a memory leak in the URI handling code + +M gdata/gdata-service.c + +commit 58964fb7f1e1608b32f275f28046fcffa6949fd7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Dec 10 01:50:39 2010 +0000 + + core: Fix a memory leak in the logging code + +M gdata/gdata-service.c + +commit 6a9e3708203828aabd4904d9b676603a6ea76726 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 21:50:20 2010 +0000 + + core: Rearrange some of the batch operation code + + This replaces a g_hash_table_foreach() call with use of a + GHashTableIter, + saving some function calls and reusing existing variables better. + +M gdata/gdata-batch-operation.c + +commit 17142ca07f96d671ad07c8be48df5892bd8187c2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 21:45:51 2010 +0000 + + core: Ensure GDataBatchOperation's operations' callbacks are always + called + + Even in error conditions, the callbacks for each of the operations + in a + GDataBatchOperation should be called, or memory leaks could result. + +M gdata/gdata-batch-feed.c +M gdata/gdata-batch-operation.c +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/documents.c + +commit d08105e42c0f6d93dfff9fd5e61fe9522579cdb6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 19:54:58 2010 +0000 + + core: Emit notifications from GDataDownloadStream in the download + thread + + Emitting them in the main thread doesn't guarantee us any extra thread + safety (the client is still required to be MT-safe, as the thread + which + started the download operation could be different from the one + with the + main loop), and can cause memory leaks if a main loop isn't running. + + Note that this is an API break (of sorts), as extra restrictions + have been + added to the use of notification signals for + GDataDownloadStream::content-length and + GDataDownloadStream::content-type. + +M gdata/gdata-download-stream.c + +commit b6a3b8e2dd1c844be5a8adda378ca900c255714c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 19:01:32 2010 +0000 + + documents: Fix some memory leaks in the documents test suite + +M gdata/tests/documents.c + +commit 940ef4279001cf2ea5551192e668865d1cc52375 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 18:58:33 2010 +0000 + + core: Fix a memory leak in GDataBatchOperation + +M gdata/gdata-batch-feed.c + +commit 118758e95854ae98ba8183e358d35be98d497fce +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 18:46:39 2010 +0000 + + documents: Fix a memory leak in GDataDocumentsQuery + +M gdata/services/documents/gdata-documents-query.c + +commit 7ba3624aac18d7233cae4901a0d02449f0ffeb0e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 17:48:37 2010 +0000 + + picasaweb: Fix a minor documentation problem + +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit 4e97fad4065c3d85ffe83406f38eb5de6dbadc7e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 17:30:02 2010 +0000 + + documents: Add an async method to remove entries from folders + + This adds an asynchronous version of + gdata_documents_service_remove_entry_from_folder(), and the associated + normal + and cancellation tests. + + The following API has been added: + • gdata_documents_service_from_entry_from_folder_async() + • gdata_documents_service_from_entry_from_folder_finish() + + Helps: bgo#633363 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/tests/documents.c + +commit 83b78714fa32ed23dbb16155d827f6bfad40ea13 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 17:23:28 2010 +0000 + + documents: Make the test for removing from a folder idempotent + + This helps towards the goal of making all tests idempotent, but + also means + that the setup and teardown code can be reused to test the + asynchronous + method gdata_documents_service_remove_entry_from_folder_async(). + + Helps: bgo#633359 + +M gdata/tests/documents.c + +commit 54c6db565cc1d4bb263d58aac2cb8e8743f44bbd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 17:09:11 2010 +0000 + + documents: Add an async method to add entries to folders + + This adds an asynchronous version of + gdata_documents_service_add_entry_to_folder(), and the associated + normal and + cancellation tests. + + The following API has been added: + • gdata_documents_service_add_entry_to_folder_async() + • gdata_documents_service_add_entry_to_folder_finish() + + Helps: bgo#633363 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/tests/documents.c + +commit e5ea2a506ca42ff7c4095c8aa06f17591a29d314 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 16:28:16 2010 +0000 + + documents: Make the test for adding to a folder idempotent + + This helps towards the goal of making all tests idempotent, but + also means + that the setup and teardown code can be reused to test the + asynchronous + method gdata_documents_service_add_entry_to_folder_async(). + + Helps: bgo#633359 + +M gdata/tests/documents.c + +commit de5b50417d7e128bd7eed12ed81dbf0247c28ee0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 15:40:02 2010 +0000 + + documents: Rename add to/remove from folder methods + + To better indicate that the following methods can be used on + documents and + folders, and because “move” was a misnomer (the document isn't + moved; it's + merely added to a new folder without being removed from its old + ones), two + methods in GDataDocumentsService have been renamed. + + The following API changes have been made: + • gdata_documents_service_move_document_to_folder() has been + renamed to + gdata_documents_service_add_entry_to_folder() + • gdata_documents_service_remove_document_from_folder() has been + renamed to + gdata_documents_service_remove_entry_from_folder() + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/tests/documents.c + +commit c5954219e84d94ee70cbde9390ed2f0da8d20893 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 15:25:30 2010 +0000 + + documents: Fix the API of the document upload methods + + Since the upload methods are now only for uploading documents + with data, + they should no longer be used to insert folders + (gdata_service_insert_entry() should be used instead). Consequently, + they + can accept the more specific GDataDocumentsDocument rather than + GDataDocumentsEntry. + + This changes the API of the following methods (again): + • gdata_documents_service_upload_document() + • gdata_documents_service_update_document() + • gdata_documents_service_finish_upload() + +M gdata/services/documents/gdata-documents-document.h +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/tests/documents.c + +commit 35b6599dff2d54e3ddc05ce43f75b87a8ef8c04c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 14:22:09 2010 +0000 + + documents: Don't fail the batch tests if cleaning up fails + +M gdata/tests/documents.c + +commit f3e8cc9bc4df36d0882b37734d1a44467eda4692 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 14:14:38 2010 +0000 + + documents: Work around an ETag problem when uploading new documents + + Google's servers appear to modify newly uploaded documents a few + seconds + after returning the entry and ETag for them to the client, thus + changing the + documents' ETags and causing subsequent queries by the client to + fail due to + an outdated ETag. This commit hacks the test suite to sleep for + 5 seconds + after uploading a new document before querying for the new document + to get + the updated ETag. + + See: + http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=2337 + +M gdata/tests/documents.c + +commit c405bb66b00a72a3882452ff11b29aac6f2a0e4e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 9 01:31:10 2010 +0000 + + documents: Switch to a stream-based upload API + + For similar reasons as the switch to a stream-based download API, + it makes + sense to switch to a stream-based upload API. This gives us + asynchronous + support for free. + + The test suite has been updated appropriately. + + The following API has been broken: + • gdata_documents_service_upload_document() + • gdata_documents_service_update_document() + + The following API has been added: + • gdata_documents_service_finish_upload() + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/tests/documents.c + +commit 3f3fd8ca71d10bb24b5b3ee8b12325f46f17cf34 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Dec 8 15:06:38 2010 +0000 + + documents: Switch to a stream-based download API + + Downloading to a file provided by its path was unnecessarily limiting, + forcing downloads to be made directly to disk instead of + (e.g.) another + network stream, and subjecting clients to libgdata's idea of + “Replace this + File?” logic. It's not much extra code for the clients to handle + this + themselves, and offers much greater flexibility. We also get async + support + for free, as creating the GDataDownloadStream is a cheap operation, + and it + already has async support. + + This updates the test suite appropriately. + + This is an API break which affects: + • gdata_documents_document_download() + +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-document.h +M gdata/tests/documents.c + +commit 0aa354ee8017e1a13f394c29e95ac5ba5b55363f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Dec 4 12:29:20 2010 +0000 + + picasaweb: Fix XML tag names for GDataPicasaWebFile:version + + The gphoto:version tag has been deprecated (see + http://code.google.com/apis/picasaweb/docs/2.0/releasenotes.html), and + appears to have been replaced by gphoto:imageVersion. + +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/tests/picasaweb.c + +commit abc595a95f9556678bde56364fdfe40920fbb5cb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 18:24:40 2010 +0000 + + picasaweb: Remove GDataPicasaWebFile:position + + The service no longer deals with photo positions in albums (see + http://code.google.com/apis/picasaweb/docs/2.0/releasenotes.html). The + following API has been removed: + • GDataPicasaWebFile:position + • gdata_picasaweb_file_get_position() + • gdata_picasaweb_file_set_position() + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/tests/picasaweb.c + +commit fadf3de794738340162b53c0390f4254614b7ebc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 18:19:45 2010 +0000 + + picasaweb: Remove GDataPicasaWebFile:client + + The service no longer deals with client information (see + http://code.google.com/apis/picasaweb/docs/2.0/releasenotes.html). The + following API has been removed: + • GDataPicasaWebFile:client + • gdata_picasaweb_file_get_client() + • gdata_picasaweb_file_set_client() + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/tests/picasaweb.c + +commit 8e751ef512ec8feae2e374d1e0698f2d9fa4efb9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 18:12:57 2010 +0000 + + picasaweb: Fix parsing of GDataPicasaWebFile:checksum + +M gdata/services/picasaweb/gdata-picasaweb-file.c + +commit a672b202e53fb46ddb9793d5d2cdfc43e55895f6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 18:07:06 2010 +0000 + + youtube: Fix attribute escaping for GDataYouTubeVideo + + Closes: bgo#631033 + +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/youtube.c + +commit a4c26eee25bdc5dfc87cc34998655f769b5b62b9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 18:06:15 2010 +0000 + + youtube: Emit XML for a video's aspect ratio + +M gdata/services/youtube/gdata-youtube-group.c + +commit 2b16dc2baf8a1691b078606d5dc8820b063f33bd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 18:00:54 2010 +0000 + + youtube: Don't notify on a non-existent property when changing + aspect ratio + +M gdata/services/youtube/gdata-youtube-group.c + +commit 6de8fc98f282e338e372b1ab612e05e37925707a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 17:24:55 2010 +0000 + + youtube: Fix attribute escaping for GDataYouTubeCredit + + Note: we can't add a test case for this, as GDataYouTubeCredit + isn't publicly + exposed. + + Helps: bgo#631033 + +M gdata/services/youtube/gdata-youtube-credit.c + +commit a4dae63676259caa67b48f0cefec4522c7516d56 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 17:19:27 2010 +0000 + + picasaweb: Fix attribute escaping for GDataPicasaWebFile + + Helps: bgo#631033 + +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/tests/picasaweb.c + +commit 58880acd7ad007d2fee1f2278ffbb78f7b7bea02 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 17:06:00 2010 +0000 + + picasaweb: Fix attribute escaping for GDataPicasaWebAlbum + + Helps: bgo#631033 + +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/tests/picasaweb.c + +commit a14db789764bd49a83d9a91d3682217a6dd492f2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 16:48:33 2010 +0000 + + documents: Fix attribute escaping for GDataDocumentsEntry subclasses + + No test cases can be added, as no public API is affected by the + escaping. + + Helps: bgo#631033 + +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c + +commit 82c4747c889d795841ae9c42310c60e421ea7274 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 16:37:14 2010 +0000 + + contacts: Fix attribute escaping for GDataContactsGroup + + Helps: bgo#631033 + +M gdata/services/contacts/gdata-contacts-group.c +M gdata/tests/contacts.c + +commit 9e04e24eaca7ddbb7a3c98f459baf1593f394e67 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 16:29:24 2010 +0000 + + contacts: Fix attribute escaping for GDataContactsContact + + Helps: bgo#631033 + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/tests/contacts.c + +commit c6bde418737a0816a839156055e0ebc860443031 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 15:58:09 2010 +0000 + + calendar: Fix attribute escaping for GDataCalendarEvent + + Helps: bgo#631033 + +M gdata/services/calendar/gdata-calendar-event.c +M gdata/tests/calendar.c + +commit 344a3136ba02ce33849d76318ea1c62e2c2057f8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 15:49:01 2010 +0000 + + calendar: Fix attribute escaping for GDataCalendarCalendar + + Helps: bgo#631033 + +M gdata/tests/calendar.c + +commit e18ee7f900762b49043849ad1d66c51357f2fead +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 15:36:21 2010 +0000 + + media: Fix attribute escaping for GDataMediaGroup + + Note: we can't add a test case for this, as GDataMediaGroup isn't + publicly + exposed. + + Helps: bgo#631033 + +M gdata/media/gdata-media-group.c + +commit 435d9a9b250e9e81f454912e344b5e4b7707c33c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 15:30:51 2010 +0000 + + media: Fix attribute escaping for GDataMediaCategory + + Helps: bgo#631033 + +M gdata/media/gdata-media-category.c +M gdata/tests/general.c + +commit 0e59d4caf5463d846322f240431128df0fddc771 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 12:23:42 2010 +0000 + + gcontact: Fix attribute escaping for GDataGContactWebsite + + Helps: bgo#631033 + +M gdata/gcontact/gdata-gcontact-website.c +M gdata/tests/general.c + +commit 91c1bc17304dcde4356652ac2ed2552961e34d36 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 12:20:40 2010 +0000 + + gcontact: Fix attribute escaping for GDataGContactRelation + + Helps: bgo#631033 + +M gdata/gcontact/gdata-gcontact-relation.c +M gdata/tests/general.c + +commit 807ae95cb8d2baac80002c4bb79118f9de2b1e1f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 12:17:31 2010 +0000 + + gcontact: Fix attribute escaping for GDataGContactLanguage + + Helps: bgo#631033 + +M gdata/gcontact/gdata-gcontact-language.c +M gdata/tests/general.c + +commit 0cf802f5f3c6f90e04cb6ef5f308ece73dca20e3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 12:14:35 2010 +0000 + + gcontact: Fix attribute escaping for GDataGContactJot + + Helps: bgo#631033 + +M gdata/gcontact/gdata-gcontact-jot.c +M gdata/tests/general.c + +commit db01acd110abb30bbce46d9e6d922a1947c84ef9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 12:12:11 2010 +0000 + + gcontact: Fix attribute escaping for GDataGContactExternalID + + Helps: bgo#631033 + +M gdata/gcontact/gdata-gcontact-external-id.c +M gdata/tests/general.c + +commit 1645782428aaf608bce29915641a91da3568ab20 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 12:08:16 2010 +0000 + + gcontact: Fix attribute escaping for GDataGContactEvent + + Helps: bgo#631033 + +M gdata/gcontact/gdata-gcontact-event.c +M gdata/tests/general.c + +commit d0060ea09749752aa6c15676beb0467faef0f9f1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 12:01:16 2010 +0000 + + gcontact: Fix attribute escaping for GDataGContactCalendar + + Helps: bgo#631033 + +M gdata/gcontact/gdata-gcontact-calendar.c +M gdata/tests/general.c + +commit 852579001a8e76c4cb5b5413429342dd643647f5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 11:53:27 2010 +0000 + + atom: Fix attribute escaping for GDataLink + + Helps: bgo#631033 + +M gdata/atom/gdata-link.c +M gdata/tests/general.c + +commit 47e85e0de0094fc161aa9ab4b53f23b64feecde8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 11:47:41 2010 +0000 + + atom: Fix attribute escaping for GDataCategory + + Helps: bgo#631033 + +M gdata/atom/gdata-category.c +M gdata/tests/general.c + +commit edf4d2e0afa128bcae9ef348a085e63fd6f19952 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 2 11:44:03 2010 +0000 + + atom: Fix attribute escaping for GDataAuthor + + Helps: bgo#631033 + +M gdata/tests/general.c + +commit ede9722c773167ff91af3d5b9f1f75bd5e1b82da +Author: Evan Nemerson <evan@coeus-group.com> +Date: Fri Nov 19 23:50:37 2010 -0800 + + build: Include information about exported packages in GIR + + Closes: bgo#635335 + +M Makefile.am + +commit 195819c7ee35dedbb0e55e0832b970977a21867d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Dec 1 20:56:19 2010 +0000 + + youtube: Remove GDataYouTubeService:youtube-user + + Due to standardisation on the ClientLogin interface for authentication + in the + YouTube service, the user's YouTube username is no longer accessible + to + libgdata (and would be largely irrelevant even if it + was). Consequently, the + following API has been removed: + • GDataYouTubeService:youtube-user + • gdata_youtube_service_get_youtube_user() + + See also: bgo#634033 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h + +commit a0944994877651f63fb7f9bcde76e9a7961d416c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Dec 1 20:52:08 2010 +0000 + + Bug 634033 — Use standard login URI for YouTube + + YouTube is switching over to using the same ClientLogin URI as + all other + GData services. This obsoletes GDataYouTubeService:youtube-user, + which will + disappear shortly. + + Closes: bgo#634033 + +M gdata/services/youtube/gdata-youtube-service.c +M gdata/tests/youtube.c + +commit 30ddfe1864085a1bdfe69a057065eaf977811771 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Dec 1 20:45:03 2010 +0000 + + Bug 635736 — Asynchronous authentication tests broken + + The asynchronous authentication tests have been broken for a while, + probably + caused due to changes of asynchronous callback functions within + GIO. We + previously depended on an idle function to set the username and + password + after a successful asynchronous authentication, but due to the + priority + changes this has stopped being called before the asynchronous result + callback, meaning that the results of authentication weren't + available to + the callback. This made it look like authentication had failed, + when in + reality it had succeeded and the results were waiting in the main + loop's + queue. + + This changes it so that the authentication information in GDataService + is + set inside the authentication thread, protected by a mutex. + + Closes: bgo#635736 + +M gdata/gdata-service.c + +commit acf599f253512bced955e5fa94528c82dac79f82 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Nov 30 23:56:18 2010 +0000 + + Bug 635959 — Proper cancellation support for GDataUploadStream + + Add proper cancellation support to GDataUploadStream. This involves + adding + support for not starting the upload thread if the operation has been + cancelled very early, plus adding support for cancelling it mid-upload + using + soup_session_cancel_message(). + + One of the PicasaWeb upload cancellation tests had to be changed to + use a + smaller timeout in order to provide more of a guarantee that it'll + cancel + during the upload. + + Closes: bgo#635959 + +M gdata/gdata-upload-stream.c +M gdata/tests/picasaweb.c + +commit 1cf698f8233f9a431a4b84cc4a69efbb125439b8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Nov 27 23:11:13 2010 +0000 + + core: Store the start index as an unsigned int in GDataQuery + + The external interface was accepting unsigned values, but was + storing them + as signed internally. + +M gdata/gdata-query.c + +commit 8fb1a2873e39e2e1dae6e405cef756e2a289653b +Author: George Stephanos <gaf.stephanos@gmail.com> +Date: Sat Nov 27 23:04:16 2010 +0000 + + Bug 607620 — Cancelled uploads appear partially complete in + PicasaWeb + + Ensure that the bottom multipart/related boundary string isn't sent + to the + server for cancelled uploads (or indeed, any uploads which have + experienced + an error). This prevents partial uploads from being interpreted by + the server + as images. Patch based directly on work by George Stephanos + <gaf.stephanos@gmail.com> for GCI 2010. Closes: bgo#607620 + +M gdata/gdata-upload-stream.c + +commit f80a20656ec3cdabc9882670769ebd331495d2f6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Nov 27 23:00:15 2010 +0000 + + core: Prevent deadlock when closing a cancelled GDataUploadStream + + When closing a GDataUploadStream which has already been cancelled, the + cancellation callback would be executed in the same thread as + gdata_upload_stream_close(), causing a deadlock (as they both tried + to hold + the same lock). The only solution I can think of is to move the + cancellation + out to the main thread, which ensures that deadlock will only happen + if the + application is doing synchronous I/O (i.e. gdata_upload_stream_close() + gets + called in the main thread). If they're doing that, they deserve + the deadlock. + Spotted by George Stephanos <gaf.stephanos@gmail.com>. Helps: + bgo#607620 + +M gdata/gdata-upload-stream.c + +commit c760229b57fa19a43777c96e32584432a3b3c894 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Nov 27 22:51:08 2010 +0000 + + picasaweb: Add tests for upload cancellation + + There are two tests: one cancels as early as possible (ideally + before any + data is uploaded, though that can't be guaranteed), and one cancels + at few + tens of milliseconds into the upload (ideally half-way through + uploading the + data). Helps: bgo#607620 + +M gdata/tests/picasaweb.c + +commit 61e704dc4a948f3fba2f874da5ca23593a5f8712 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Nov 27 21:47:46 2010 +0000 + + core: Store the maximum number of results as an unsigned int in + GDataQuery + + The external interface was accepting unsigned values, but was + storing them + as signed internally, leading to interesting things happening when + G_MAXUINT + was passed as max-results, as recommended by the documentation. + +M gdata/gdata-query.c + +commit 10356809fe9621b409266d0840c855f10e0f480b +Author: Eleanor Chen <chenyueg@gmail.com> +Date: Sat Nov 27 16:50:28 2010 +0000 + + Update Simplified Chinese translation. + +M po/zh_CN.po + +commit 48edf829a465abe7ff43d29a71ca6f1ecc7756e6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Nov 22 22:07:45 2010 +0000 + + build: Don't use IT_PROG_INTLTOOL and AM_GNU_GETTEXT + + They conflict. See bgo#635134. + +M configure.ac + +commit af998f97bc2efdeeed944ec87cc6f6080da9f66f +Author: Inaki Larranaga Murgoitio <dooteo@zundan.com> +Date: Thu Nov 18 22:38:55 2010 +0100 + + Updated Basque language + +M po/eu.po + +commit c2ef6202f60bbfb6f78dee8e72bc567435b924f0 +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Sun Nov 14 22:26:33 2010 +0100 + + Updated Hungarian translation + +M po/hu.po + +commit b13fe3d891264b520fa95e6d8512a48976187bbe +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Nov 7 16:15:22 2010 +0000 + + picasaweb: Add gdata_picasaweb_service_query_files_async() + + Helps: bgo#633363 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/picasaweb.c + +commit 79f37d272c704ef2000c087e6e9d70e599314c91 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Nov 7 15:49:02 2010 +0000 + + picasaweb: Add gdata_picasaweb_service_insert_album_async() + + Helps: bgo#633363 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/picasaweb.c + +commit 0ac15d351d22069476161adfbf1ca3c8faf98c18 +Author: Petr Kovar <pknbe@volny.cz> +Date: Sun Oct 31 12:32:33 2010 +0100 + + Update Czech translation by Marek Cernocky + +M po/cs.po + +commit e67903b21218455a405d2294f0516cf21896193f +Author: Carles Ferrando <carles.ferrando@gmail.com> +Date: Fri Oct 29 23:36:43 2010 +0100 + + Added Catalan (Valencian) translation + +M po/LINGUAS +A po/ca@valencia.po + +commit 85a249181981af3333673d9e1ea4e76c2b691c73 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Oct 28 10:10:17 2010 +0100 + + youtube: Add gdata_youtube_service_upload_video_async() + + This includes tests and documentation. + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/tests/youtube.c + +commit e1d1e949e49fb8ed84c274946318da1e1701e723 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Mon Oct 25 20:07:20 2010 +0200 + + [l10n] Updated German translation + +M po/de.po + +commit 877083a871a0d929ab818be7baf01c99ff034d5f +Author: Bruno Brouard <annoa.b@gmail.com> +Date: Sat Oct 23 19:51:53 2010 +0200 + + Updated French translation + +M po/fr.po + +commit 624badcb9219b3f18bc65e2d843b047f46c45f88 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Mon Oct 18 10:19:52 2010 +0200 + + Updated Spanish translation + +M po/es.po + +commit 1861636d0fae529d558bec9765194e2cacf09f84 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Sun Oct 17 20:29:57 2010 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit d9e70da78562534c1b7969eaa80f9c2521ac8284 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 17 15:49:15 2010 +0100 + + build: Increment version to 0.8.0 + +M configure.ac + +commit 57d7197bc07539e269d9eef4ecea4517f327eeef +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 17 15:45:49 2010 +0100 + + Release version 0.7.0 + +M NEWS +M configure.ac + +commit 8b440e4d7c95357d75d5b577b6a76ed850ea544f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 17 15:41:17 2010 +0100 + + l10n: Add a missing file to POTFILES.in + +M po/POTFILES.in + +commit d116a0b8721c3143d190b85f2781b4bde0a73a8b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 17 15:13:35 2010 +0100 + + build: Fix header inclusion checking for srcdir != builddir + +M Makefile.am + +commit 3dc5ed40ecbd95b8b3b990cb2644754b99c4e7ba +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 29 16:58:56 2010 +0100 + + build: Fix builddir != srcdir build with enum generation + +M Makefile.am + +commit 0e0947f442e3d90141f1e07e1ba9ce44ea99d5cb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 17 14:55:07 2010 +0100 + + l10n: Update British English translation + +M po/en_GB.po + +commit 35c44fd913939c0730b708bc024b39f5841f043c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 17 13:20:27 2010 +0100 + + tests: Disable the invalid proxy test + + There's a bug in libsoup (bgo#632354) which breaks our error codes, + and consequently breaks this test. + +M gdata/tests/general.c + +commit 6b9bafbad973acb026f4090cfd22d078ec0ad75c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 17 12:47:40 2010 +0100 + + calendar: Fix the batch operation tests + + The Calendar service can't deal with ETags properly, so we can't + test for + them being handled properly. + +M gdata/tests/calendar.c + +commit 98954c4a40681b0fef38197838be975eb931cc29 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 17 12:28:40 2010 +0100 + + core: Expand the GDataAccessRule documentation a little + +M gdata/gdata-access-rule.c + +commit 457e546708559af44091f01501373fb91bacee9f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 17 12:03:12 2010 +0100 + + contacts: Add contact group manipulation methods + + This adds gdata_contacts_service_query_groups(), + gdata_contacts_service_insert_group() and their async counterparts, + as well + as test cases for them. + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h +M gdata/tests/contacts.c + +commit d7fcbca5ab8bc6ee0b08e9feac83696eae26145e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Sep 6 09:57:54 2010 +0100 + + contacts: Add a GDataContactsGroup class + + This represents a group of contacts. Test cases included. + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/contacts/gdata-contacts-group.c +A gdata/services/contacts/gdata-contacts-group.h +M gdata/tests/contacts.c + +commit 89a659d6102433c63bfa4600a35e77b56d373b1b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Oct 9 09:41:39 2010 +0100 + + contacts: Add gdata_contacts_service_insert_contact_async() + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h + +commit f89a43ccdad7c4eab393246347f64d2089e8b5bf +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Oct 9 00:09:27 2010 +0100 + + build: Use upstream gettext instead of GLib's gettext + + As explained here: http://blogs.gnome.org/jjardon/2010/10/08 + /use-upstream-gettext-instead-the-glib-one/. + +M Makefile.am +M configure.ac + +commit d1ee7679981f42d5f32e334d04a3f51a426b5949 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Oct 6 16:32:03 2010 +0100 + + core: Add gdata_access_handler_get_rules_async() + +M docs/reference/gdata-sections.txt +M gdata/gdata-access-handler.c +M gdata/gdata-access-handler.h +M gdata/gdata.symbols + +commit 3d237ba01fc862697692764905609b2acea8847f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Oct 6 16:12:42 2010 +0100 + + core: Simplify gdata_access_handler_get_rules() + +M gdata/gdata-access-handler.c + +commit e5e811acdbe50c93de17575afd6683a88be180be +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Oct 5 13:51:49 2010 +0100 + + core: Override GDataEntry::etag in GDataAccessRule + + Access rules don't seem to support ETags (at least in Google + Calendar), so + we override GDataEntry::etag so that it's always NULL for access + rules. + +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c + +commit f9ebfd701a78ccef5b4ae01d136bd17d93f75928 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Oct 5 13:50:20 2010 +0100 + + core: Remove ACL modification methods from GDataAccessHandler + + • gdata_access_handler_insert_rule() → + gdata_service_insert_entry() + • gdata_access_handler_update_rule() → + gdata_service_update_entry() + • gdata_access_handler_delete_rule() → + gdata_service_delete_entry() + +M docs/reference/gdata-sections.txt +M gdata/gdata-access-handler.c +M gdata/gdata-access-handler.h +M gdata/gdata.symbols +M gdata/tests/calendar.c +M gdata/tests/documents.c + +commit 047b48ec87b70f8d2c662f5f28b9531cedabdd95 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Oct 5 13:05:07 2010 +0100 + + core: Add a GDATA_LINK_ACCESS_CONTROL_LIST #define for ACL links + +M docs/reference/gdata-sections.txt +M gdata/gdata-access-handler.c +M gdata/gdata-access-handler.h + +commit a46494f5ac624bcf79f088762e4b81dee3a21065 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 4 10:56:40 2010 +0100 + + introspection: Fix annotations on + gdata_contacts_contact_get_email_addresses() + +M gdata/services/contacts/gdata-contacts-contact.c + +commit 1c98bf024bcf06355fc5e77a0d7fa6cc59e126a0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 4 10:50:04 2010 +0100 + + introspection: Skip gdata_service_query_async() + + Its progress_callback parameter was incorrectly marked as (scope + async), + which could cause crashes in the bindings. It will have to be skipped. + +M gdata/gdata-service.c + +commit a6762e29ab0ffb275e907fe927c7fe96e3b1dfc8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 4 00:18:22 2010 +0100 + + core: Use gint64 timestamps instead of GTimeVals + + This means we no longer have to register GTimeVal with the GType + system, and + everything is generally neater because we never used GTimeVal's + microsecond + precision anyway. + +M docs/reference/gdata-sections.txt +M gdata/exif/gdata-exif-tags.c +M gdata/exif/gdata-exif-tags.h +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-when.h +M gdata/gdata-access-rule.c +M gdata/gdata-access-rule.h +M gdata/gdata-batch-operation.c +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-private.h +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-types.c +M gdata/gdata-types.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-entry.h +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-group.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/general.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit fc13dc995e8afc12e154f384554cbf613da76e48 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 19:44:31 2010 +0100 + + gd: Fix parsing and output of country codes in GDataGDPostalAddress + +M gdata/gd/gdata-gd-postal-address.c +M gdata/tests/general.c + +commit 98efcfaac4f06ebe25ea434f9337b18319d15bb7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 19:17:59 2010 +0100 + + gd: Fix attribute escaping for GDataGDWho + +M gdata/gd/gdata-gd-who.c +M gdata/tests/general.c + +commit c595f1fac6197838bd831e1bcfaaea0af51950f0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 19:13:30 2010 +0100 + + gd: Fix attribute escaping for GDataGDWhere + +M gdata/gd/gdata-gd-where.c +M gdata/tests/general.c + +commit c17b1478b6b798025f55bb8703c82588cce56a58 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 19:09:55 2010 +0100 + + gd: Fix attribute escaping for GDataGDWhen + +M gdata/gd/gdata-gd-when.c +M gdata/tests/general.c + +commit 5b3ff1ead3f14cfd9e8cbfcacc617461e3115f4a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 19:05:13 2010 +0100 + + gd: Fix attribute escaping for GDataGDReminder + +M gdata/gd/gdata-gd-reminder.c +M gdata/tests/general.c + +commit a0e97a3a386edca2c7da4137b0a0067066659520 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 18:59:10 2010 +0100 + + gd: Fix attribute escaping for GDataGDPostalAddress + +M gdata/gd/gdata-gd-postal-address.c +M gdata/tests/general.c + +commit 019f4c0c2be2d3ca486a9832d4121271e5ca6b5c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 18:44:07 2010 +0100 + + gd: Fix attribute escaping for GDataGDPhoneNumber + +M gdata/gd/gdata-gd-phone-number.c +M gdata/tests/general.c + +commit 135b790ca479085fec78e8f37de302cf2d04515c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 17:31:48 2010 +0100 + + gd: Fix attribute escaping for GDataGDOrganization + +M gdata/gd/gdata-gd-organization.c +M gdata/tests/general.c + +commit f37944aa5dabe5cb6c72002384ddb60416089738 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 17:23:46 2010 +0100 + + gd: Fix attribute escaping for GDataGDIMAddress + +M gdata/gd/gdata-gd-im-address.c +M gdata/tests/general.c + +commit 68584f8c6a3ae3564919b02343dcbaf2282a3c72 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Sep 30 17:10:12 2010 +0100 + + gd: Fix attribute escaping for GDataGDEmailAddress + + Add a test case for it too. Closes: bgo#630350 + +M gdata/gd/gdata-gd-email-address.c +M gdata/tests/general.c + +commit 5ea9abe1da7115f2828be474e2d13619f7d9f04a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 29 17:14:34 2010 +0100 + + build: Ensure g-ir-scanner is passed the correct includes + +M Makefile.am + +commit 22518fc61ebcb7f0aae41d0d125a6301ddbb089c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 29 15:23:07 2010 +0100 + + introspection: Add missing (transfer full) annotations + +M gdata/gdata-access-handler.c +M gdata/gdata-batchable.c +M gdata/gdata-service.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 9fe511b3fcb5fca3698f897a503cd24ec74fa4ed +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 29 15:11:49 2010 +0100 + + introspection: (skip) async query methods + + This is because they all take in a callback parameter which is neither + (scope call) or (scope async), so requires a GDestroyNotify callback + to be + properly introspectable. Since we're not breaking API for this + point release, + that isn't possible, so the functions have to be marked as + non-introspectable. + +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-service.c + +commit 7c87167f17b062ab40efb69fa53e1d7a8fd70552 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 29 15:08:28 2010 +0100 + + introspection: Add missing (scope call) annotations + +M gdata/gdata-access-handler.c +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-service.c + +commit 529dd65fd823fc677257298cc0dcd3000b2e3147 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 29 15:00:16 2010 +0100 + + introspection: Remove outdated (default) annotations + +M gdata/services/documents/gdata-documents-spreadsheet.c + +commit cd209b1b07bf163a011efbadaf2f742fee1edd2a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Sep 29 14:54:55 2010 +0100 + + introspection: Fix the type name registered by libgdata for GTimeVal + + This stops the introspection build failing because GData was + stomping on + GLib's namespace when registering GTimeVal with the type system. + +M gdata/gdata-types.c + +commit 867179aa0dbc7bbc62e576450e1a72fa016f1f57 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 18:15:10 2010 +0100 + + introspection: Port to Makefile.introspection + + This bumps our gobject-introspection dependency to 0.9.7 as we + require the + fix for bgo#628594. + +M Makefile.am +M configure.ac + +commit d14b3a80009df8c0418c827266b47e57e4c11215 +Author: Milo Casagrande <milo@ubuntu.com> +Date: Sun Sep 26 19:32:48 2010 +0200 + + [l10n] Updated Italian translation + +M po/it.po + +commit 427c277fb6294e1125824fde1d0e89d3ff1d3efb +Author: Piotr Drąg <piotrdrag@gmail.com> +Date: Wed Sep 22 23:21:59 2010 +0200 + + Updated Polish translation + +M po/pl.po + +commit 1bd68396b1d93d23ff0af6010a8597979ddc35fe +Author: Djavan Fagundes <djavan@comum.org> +Date: Tue Sep 21 17:53:13 2010 -0300 + + Updated Brazilian Portuguese translation + +M po/pt_BR.po + +commit f4646e01fb23b8ae1a7314a17d01cb274b69061d +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Tue Sep 14 12:06:06 2010 +0200 + + Updated Hungarian translation + +M po/hu.po + +commit 9bcac38a8819608633c24045df4098bbd4e0ae4b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Sep 7 09:30:08 2010 +0100 + + contacts: Remove gdata_contacts_service_update_contact() + + It was an unnecessary wrapper around gdata_service_update_entry(), + which + should be used instead. This is an API break. + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h +M gdata/tests/contacts.c + +commit 662fb24615c54e5cae7ca0cc456417aeecd14df1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Sep 7 09:24:49 2010 +0100 + + contacts: Add a contact update test + +M gdata/tests/contacts.c + +commit e88b9c0be1094773096735221aa14a7c2eda3e76 +Author: Aron Xu <aronxu@gnome.org> +Date: Sun Sep 5 04:18:16 2010 +0800 + + Update Simplified Chinese translation. + +M po/zh_CN.po + +commit 1ca1fe27891bf133ba61f33196c89d59c8ccb725 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Sep 4 15:33:42 2010 +0100 + + build: Depend on gdk-pixbuf instead of gdk + + Since we only use GdkPixbuf, and gdk-pixbuf was split out from GDK + a while + ago. + +M configure.ac +M gdata/tests/Makefile.am +M gdata/tests/picasaweb.c + +commit 2029616d693bf306092943ec118de3a8f43e5bb2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Sep 4 15:21:15 2010 +0100 + + contacts: Fix a leak in a parsing error condition + +M gdata/services/contacts/gdata-contacts-contact.c + +commit df443a3eabb743df695927fd2943e52d29ee2685 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Sep 4 15:20:19 2010 +0100 + + contacts: Ensure group IDs use the "base" projection + + Another example of GData services giving out two different formats + of the + same ID and only accepting one of them. We need to ensure that group + IDs sent + to the service use the "base" projection rather than the "full" + projection. + +M gdata/services/contacts/gdata-contacts-contact.c + +commit ef1a0fba654f403336d0bca0d81d28dcc9e10ec6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Sep 4 15:19:41 2010 +0100 + + contacts: Prevent a double free by correctly copying group names + +M gdata/services/contacts/gdata-contacts-contact.c + +commit b8dea231b15fc22bce35263e02d4a14a079b1bed +Author: Daniel Nylander <po@danielnylander.se> +Date: Fri Sep 3 00:33:22 2010 +0200 + + Updated Swedish translation + +M po/sv.po + +commit 282b8802922c5009f5057ca610ae790426c660c5 +Author: Claude Paroz <claude@2xlibre.net> +Date: Sun Aug 29 20:00:08 2010 +0200 + + Updated French translation + +M po/fr.po + +commit de54084b09f972715885fb7661a595cf4ebcd118 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Sat Aug 28 21:38:20 2010 +0200 + + [i18n] Updated German translation + +M po/de.po + +commit af0a2a6ef5f91f1b867636c3972c482aed439766 +Author: Lucian Adrian Grijincu <lucian.grijincu@gmail.com> +Date: Sat Aug 28 21:50:57 2010 +0300 + + Updated Romanian translation + +M po/ro.po + +commit d6fde667228d8f765d843acce5b4c3071c8d2e46 +Author: Daniel Șerbănescu <cyber19rider@gmail.com> +Date: Sat Aug 28 21:30:58 2010 +0300 + + Added Romanian translation + +M po/LINGUAS +A po/ro.po + +commit 71987dbf5b38c737d18a1e8fa0b2389bb6c8c9d2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Aug 27 09:22:20 2010 +0100 + + l10n: Update British English translation + +M po/en_GB.po + +commit 4fe7a305eb88a4d38a969f0c00485996802fdcf1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Aug 27 00:02:34 2010 +0100 + + Bug 624141 — Add batch operation support to Documents service + + Add the GDataBatchable interface to GDataDocumentsService and add + the relevant + test cases to the documents test suite. Closes: bgo#624141 + +M gdata/services/documents/gdata-documents-service.c +M gdata/tests/common.c +M gdata/tests/documents.c + +commit e21402592623baaec5498e6f61e00da6d5076581 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 26 21:01:01 2010 +0100 + + build: Add checks for various functions and headers to configure.ac + + As suggested by `autoscan`. + +M configure.ac + +commit f5e351ccb68a281f6405222522539e77c976bb05 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 26 20:58:54 2010 +0100 + + build: Clean up configure.ac + + Remove deprecated and unnecessary macros from configure.ac, as + suggested by + running `autoupdate`. + +M configure.ac + +commit a318351dc493529d43b325440920a3058994aa59 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 26 09:38:44 2010 +0100 + + core: Use the GDataEntry.get_entry_uri() method for batch queries + + To fix the YouTube batch operations so that video IDs can be used + in queries + instead of self URIs, GDataEntry.get_entry_uri() needs to be used + to get the + "ID" to send in a batch query. + +M gdata/gdata-batch-operation.c +M gdata/tests/youtube.c + +commit 2e26e1a0ca6ce6ac25f621b9ad057a65b71dc286 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 26 09:37:44 2010 +0100 + + contacts: Use "default" instead of the user's username in request URIs + + Just like with the Calendar service, this magically fixes batch + operations + so that the contact's ID can be used in them, rather than its + self URI. + +M gdata/services/contacts/gdata-contacts-service.c +M gdata/tests/contacts.c + +commit 730a8d66e9a38cbf50b07ffd4f01b0c629c9afe9 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Wed Aug 25 15:13:13 2010 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit c57da8c600e9581b3caa35955fbb0210935b30e3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 25 09:28:54 2010 +0100 + + build: Clean up checking logic + +M docs/reference/Makefile.am + +commit 40c1e0506dc7e5bb336717bd9aa05257a27ae9c1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 25 09:26:56 2010 +0100 + + build: Add a rule to check whether files are included in the public + header + +M Makefile.am + +commit e1938a8c1d418fd4f7543fe1e39cd5b2dcca32da +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 25 00:07:34 2010 +0100 + + Bug 624142 — Add batch operation support to Calendar service + + Add the GDataBatchable interface to GDataCalendarService and add + the relevant + test cases to the calendar test suite. Closes: bgo#624142 + +M gdata/services/calendar/gdata-calendar-service.c +M gdata/tests/calendar.c + +commit 1c193d636dca778d68135f9221ec60c6e41cc675 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 25 00:05:35 2010 +0100 + + calendar: Use "default" instead of the user's username in request URIs + + There appears to be a bug in the Google Calendar server which + returns a + different set of results if you query using the user's username + instead of + "default", which cause batch queries to inexplicably fail due + because of + "invalid" IDs, which are really actually valid. + + Thanks Google. + +M gdata/services/calendar/gdata-calendar-service.c + +commit 99636752cacaa97580e5575ae38372caa7a7fd8e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 25 00:03:15 2010 +0100 + + core: Use namespaces from all entries in a feed + + We were previously assuming that all entries in the feed had + identical sets + of namespaces, and just using the namespaces from the first + entry. This can + be untrue for batch feeds, so we must use the namespaces from all + entries in + the feed. + +M gdata/gdata-feed.c + +commit 0fcbae7db8cb519e83ebfcabae893bcd29251949 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 24 22:19:43 2010 +0100 + + build: Better document the LT version change process + +M HACKING +M configure.ac + +commit 892f77e28597331ad933c7d1f635f1f6d8170744 +Author: Kris Thomsen <lakristho@gmail.com> +Date: Tue Aug 24 09:41:16 2010 +0200 + + Updated Danish translation + +M po/da.po + +commit 436b26e5e8d1dd6036761040c54831dc36747434 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Tue Aug 24 00:23:43 2010 +0200 + + Updated Spanish translation + +M po/es.po + +commit 2d5dcc8195e565219b65713a139ba654a92fe4cc +Author: Kris Thomsen <lakristho@gmail.com> +Date: Mon Aug 23 23:45:59 2010 +0200 + + Updated Danish translation + +A po/da.po + +commit 750c401a66d4875edaca9a0e1246af781b8755fc +Author: Kenneth Nielsen <k.nielsen81@gmail.com> +Date: Mon Aug 23 23:45:58 2010 +0200 + + Added da to list of languages + +M po/LINGUAS + +commit 1667d0e5b1b1bf966dfccf93a5d67c000c154347 +Author: Petr Kovar <pknbe@volny.cz> +Date: Mon Aug 23 23:11:43 2010 +0200 + + Update Czech translation by Marek Cernocky + +M po/cs.po + +commit 23925976366313b6475801a732b42d293ff4aa7d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 23 09:55:46 2010 +0100 + + core: Add a _gdata_service_build_uri() function to escape URI + components + + This allows building URIs in a printf()-style manner, while + automatically + escaping the strings being substituted into the URI. This means that + malformed input can't cause requests to fail or execute incorrectly by + producing invalid or incorrect URIs. + +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit 33181607696118df9715f18e633a942dc10f470b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 23 22:04:32 2010 +0100 + + documents: Ensure the correct service is used to download spreadsheets + +M gdata/services/documents/gdata-documents-document.c + +commit d0313cce89cab39af917bd9bf1686db76f01b6fa +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 23 21:32:41 2010 +0100 + + youtube: Add a missing XML element to the upload test + +M gdata/tests/youtube.c + +commit b1199dfc2952ac776485f5822d77ff4fe7845c93 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 23 21:31:38 2010 +0100 + + calendar: Update GDataCalendarService to GDataEntry:content-uri + +M gdata/services/calendar/gdata-calendar-service.c + +commit 936e746d8e8a2a9550b685963355452c5b11726c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 23 21:13:41 2010 +0100 + + documents: Fix use of an uninitialised variable + +M gdata/services/documents/gdata-documents-document.c + +commit f4121290366419ff63966a747e9dbf74559df75a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 15:04:29 2010 +0100 + + docs: Add the deprecated API index to the documentation ToC + +M docs/reference/gdata-docs.xml + +commit ab429e5518e39bd112dc3126571e751b8dd45bd4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 14:58:42 2010 +0100 + + docs: Add an automake rule to check whether files are included in + the docs + +M docs/reference/Makefile.am + +commit 45d0208c981efc778a0649b08dbdb535ac07d946 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 14:21:57 2010 +0100 + + docs: Move the annotation glossary to a better location in the ToC + +M docs/reference/gdata-docs.xml + +commit 0a9bc352d02c5e507b9bcebb5144ce4fb7f4c28b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 14:15:06 2010 +0100 + + docs: Add gdata-running.xml to content_files + +M docs/reference/Makefile.am + +commit 2de2eef36afabb71a9a1e19168fbda03e8afdce1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 13:44:06 2010 +0100 + + docs: Use the no-tmpl flavour of gtk-doc + + This removes the need for the outdated tmpl directory, and means + we now + require gtk-doc >= 1.14. + +M autogen.sh +M configure.ac +M docs/reference/Makefile.am + +commit ae175298fd4c3d606c7c7bef24ac3a9655221d96 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 13:43:52 2010 +0100 + + build: Fix strings in autogen.sh + +M autogen.sh + +commit d326c297df49a6e8c69c056d5a0d066174d2dad2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 13:03:18 2010 +0100 + + docs: Fix some incorrect <ulink> tags in documentation comments + +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c + +commit e529d3b351510a30f8984061aa9f61dfd02024e2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 12:57:31 2010 +0100 + + docs: Switch to a new commit message tagging format + +M HACKING + +commit fff46be28a2e5da887fab946fdb416e6ae89f80b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 00:39:34 2010 +0100 + + [documents] Actually make GDataDocumentsEntry abstract + +M gdata/services/documents/gdata-documents-entry.c + +commit bf10250e65c9832056d0d1515e9dc884b9f57a41 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 22 00:34:34 2010 +0100 + + [documents] Move download methods to GDataDocumentsDocument + + This breaks API by removing the various download methods from + GDataDocumentsPresentation, GDataDocumentsSpreadsheet and + GDataDocumentsText. + +M docs/reference/gdata-sections.txt +M gdata/gdata-private.h +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-document.c +M gdata/services/documents/gdata-documents-document.h +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.c +M gdata/services/documents/gdata-documents-text.h +M gdata/tests/documents.c + +commit e7b9b03f19bbd3b6c07aa9fe19932c8b24771a5b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 21 23:48:31 2010 +0100 + + [documents] Add GDataDocumentsDocument below GDataDocumentsEntry + + It's the new parent class of GDataDocumentsPresentation, + GDataDocumentsSpreadsheet and GDataDocumentsText. This breaks API. + Helps: bgo#607616 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-private.h +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/documents/gdata-documents-document.c +A gdata/services/documents/gdata-documents-document.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.c +M gdata/services/documents/gdata-documents-text.h + +commit 14b888cd4da261e8fdc6b139d63c39d963b3ce29 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 21 23:24:48 2010 +0100 + + [core] Add a GDataEntry:content-uri property + + This complements the GDataEntry:content property by exposing + content which + is linked to by a URI, rather than embedded directly, in a more + natural way. + This is an API break, since GDataEntry:content may now return NULL + in cases + where it previously returned a URI (e.g. for GDataPicasaWebPhotos). + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata.symbols +M gdata/tests/common.c +M gdata/tests/general.c +M gdata/tests/picasaweb.c + +commit 2387cc736a6404ed3930a501d007358d2b77edda +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 21 23:04:43 2010 +0100 + + [core] Minor documentation fix + +M gdata/gdata-entry.c + +commit 0db5aeece161142093343263652fa5c498e169f6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 21 22:37:29 2010 +0100 + + [documents] Specify export format by strings instead of enums + + This makes libgdata more futureproof, as it allows future formats + to be used + with old versions of libgdata without modification. API compatibility + is + retained with #defines for each old enum member, but this is an + ABI break. + +M docs/reference/gdata-sections.txt +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.c +M gdata/services/documents/gdata-documents-text.h + +commit 57611eaec815c8182f4bbe7113bae7c2f4383958 +Author: António Lima <amrlima@gmail.com> +Date: Sat Aug 21 16:19:04 2010 +0100 + + Updated Portuguese translation + +M po/pt.po + +commit b941ce8d55cecfab3d53e65965df31f64deeff5e +Author: Andika Triwidada <andika@gmail.com> +Date: Mon Aug 16 05:45:50 2010 +0700 + + Added Indonesian translation + Added id to LINGUAS + +M po/LINGUAS +A po/id.po + +commit 082032b23eb167a97c1079399ecd7d7dda7be550 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 11 22:32:55 2010 +0100 + + [picasaweb] Fix timestamps in the PicasaWeb tests + +M gdata/tests/picasaweb.c + +commit 03034722aac6d625ca30ddb04425a90536f2db44 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 11 22:19:07 2010 +0100 + + [picasaweb] Move initialisation code into constructor() in PicasaWeb + service + +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c + +commit c2c4cfb9ac30ad5ad47573c8016b7858db567d6a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 11 22:10:05 2010 +0100 + + [contacts] Move initialisation code into constructor() in Contacts + service + +M gdata/services/contacts/gdata-contacts-contact.c + +commit f5722095a0f1daafc862ad7985b7b08a10805166 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 11 09:49:33 2010 +0100 + + [documents] Move initialisation code into constructor() in Documents + service + +M gdata/gdata-private.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c + +commit 20a2b4933fc823487949fe2fd5e59be3f195593a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 11 09:42:36 2010 +0100 + + [calendar] Move initialisation code to constructor() in Calendar + service + + Fix it in GDataCalendarCalendar and GDataCalendarEvent. + +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c + +commit 3aea865c76ac62c318a390b94fd95c78400bb9be +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 11 09:38:05 2010 +0100 + + [core] Move initialisation code to constructor() in + GDataDownloadStream + +M gdata/gdata-download-stream.c + +commit 360ddb1519bed387ab523c258dc878bb031270b4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 11 09:34:42 2010 +0100 + + [core] Move initialisation code to constructor() in GDataUploadStream + +M docs/reference/gdata-sections.txt +M gdata/gdata-upload-stream.c +M gdata/gdata-upload-stream.h +M gdata/gdata.symbols + +commit c779bfb0069a823c7606fc6defcfdaf616d864af +Author: Philip Withnall <philip.withnall@collabora.co.uk> +Date: Sat Aug 7 15:59:06 2010 +0100 + + [core] Move initialisation code to constructor() in GDataAccessRule + +M gdata/gdata-access-rule.c + +commit 8cfcb2c721425b18cce75823327a8a094da0e397 +Author: Philip Withnall <philip.withnall@collabora.co.uk> +Date: Sat Aug 7 15:58:21 2010 +0100 + + [youtube] Move initialisation code to constructor() in + GDataYouTubeVideo + +M gdata/services/youtube/gdata-youtube-video.c + +commit eadd48a4322791bfca16ada52310100bac15eae9 +Author: Philip Withnall <philip.withnall@collabora.co.uk> +Date: Sat Aug 7 15:45:39 2010 +0100 + + [core] Add a GDataParsable:constructed-from-xml property + + This allows code which was previously in GDataParsable subclasses' + *_new() + functions to be moved into their constructor() functions, making + them more + suitable for bindings. + +M gdata/gdata-parsable.c +M gdata/gdata-private.h + +commit b8db20a777e016b56b6c652dda0f73cb035a7631 +Author: Philip Withnall <philip.withnall@collabora.co.uk> +Date: Sat Aug 7 15:12:57 2010 +0100 + + [core] Minor documentation fix + +M gdata/gdata-parser.c + +commit 4575caa4b181db863d2c31dd29644588df76d661 +Author: Philip Withnall <philip.withnall@collabora.co.uk> +Date: Sat Aug 7 12:14:17 2010 +0100 + + [core] Fix a memory leak in an unlikely error condition + +M gdata/gdata-parsable.c + +commit d65da89752a44d1edf0b45f414122a1f7cadd2bb +Author: Philip Withnall <philip.withnall@collabora.co.uk> +Date: Mon Aug 9 17:31:37 2010 +0100 + + [build] Make gdata-marshal.c depend on gdata-marshal.h to fix build + + The build was failing to bootstrap since gdata-marshal.h wasn't + being built + for some reason. + +M Makefile.am + +commit 7231b18a03041139cf2309634c86aed3bc15e0b5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 19:29:36 2010 +0100 + + [core] Add an assertion to back up a comment + +M gdata/gdata-buffer.c + +commit 90a9933a633320089fb5995e8c5d0c5dc8fd62e6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 19:28:02 2010 +0100 + + [core] Remove a dead assignment + +M gdata/gdata-buffer.c + +commit e49d38b32f6697d785c133e12a0f02be40a36649 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 19:25:37 2010 +0100 + + [calendar] Remove half-baked comment support from GDataCalendarEvent + +M gdata/services/calendar/gdata-calendar-event.c + +commit b146e845f7cc82c6583318d27b11bd06689f9253 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 19:24:45 2010 +0100 + + [documents] Fix gdata_documents_entry_get_edited() + +M gdata/services/documents/gdata-documents-entry.c + +commit e31c3efad0364fc8aa989d4ab0d25d7cda794ff7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 19:23:51 2010 +0100 + + [youtube] Remove half-baked comment support from GDataYouTubeVideo + +M gdata/services/youtube/gdata-youtube-video.c + +commit 1afdab0f3d6adbd7ebbbf3bd7248651a924e6b68 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 19:21:45 2010 +0100 + + [core] Fix potential use of NULL in memcpy() + +M gdata/gdata-buffer.c + +commit 4f2db5a119f2e4a7a86ca3b9b72c9d085b5152bc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 19:19:16 2010 +0100 + + [documents] Fix potential use of NULL variable in strcmp() + +M gdata/services/documents/gdata-documents-service.c + +commit c033884168796d4ebd685532717dc47a24d7b703 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 17:16:02 2010 +0100 + + [tests] Rearrange tests to use --no-internet option + + This also removes the dependency of a lot of tests on the -m (mode) + command + line option, meaning that more tests get run by default. + +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 7a1d8784af0f1e36b0ae0cb84d02389537f54ba3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 17:02:21 2010 +0100 + + [tests] Add support for a --no-internet option to the tests + + This should allow automated testing to run more than just the + general tests. + +M gdata/tests/calendar.c +M gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/general.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 29c826bdcaa53992647f70d5a33fe24241fe8300 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 7 17:51:44 2010 +0100 + + [core] Explicitly mark private symbols as G_GNUC_INTERNAL + +M gdata/gdata-batch-private.h +M gdata/gdata-private.h + +commit dd62124509086b02367fcc231e409aaa58e4c111 +Author: Daniel Nylander <po@danielnylander.se> +Date: Fri Aug 6 14:53:47 2010 +0200 + + Updated Swedish translation + +M po/sv.po + +commit 9abba7d89741a9e47c9c0e880bd2a95ca987fb1f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 10:19:40 2010 +0100 + + [introspection] Add missing annotations to GDataYouTubeVideo + +M gdata/services/youtube/gdata-youtube-video.c + +commit 123fd8e1cded15d5c002e4d6aada303a4c1abad3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 10:14:19 2010 +0100 + + [introspection] Add missing annotations to GDataYouTubeService + +M gdata/services/youtube/gdata-youtube-service.c + +commit 9a0ada5d0e29974aa2003c67b9e5964d4c01f8e4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 10:11:54 2010 +0100 + + [introspection] Add missing annotations to GDataYouTubeQuery + +M gdata/services/youtube/gdata-youtube-query.c + +commit cde0c4bc90aa9bea5ef94d574a09953e7480f639 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 10:09:07 2010 +0100 + + [introspection] Add missing annotations to GDataYouTubeGroup + +M gdata/services/youtube/gdata-youtube-group.c + +commit bc6c4bd684b7996fac147b94d3e833093b3418d3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 10:08:50 2010 +0100 + + [youtube] Add missing precondition + +M gdata/services/youtube/gdata-youtube-group.c + +commit fbb19f672b68aef452bc64b22561e9b2119d3fe4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 10:07:04 2010 +0100 + + [introspection] Add missing annotations to GDataYouTubeControl + +M gdata/services/youtube/gdata-youtube-control.c + +commit 764fc0ae4ee74b1fd69533cad6e705a89c126526 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 10:01:02 2010 +0100 + + [introspection] Add missing annotations to GDataPicasaWebService + +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit 01bc90742eff08cec6eb55fa854f5b88ce85fe72 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:57:09 2010 +0100 + + [introspection] Add missing annotations to GDataPicasaWebQuery + +M gdata/services/picasaweb/gdata-picasaweb-query.c + +commit 94b8faf822afff1fe9e9aac2e92772d2d0db0902 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:53:51 2010 +0100 + + [introspection] Add missing annotations to GDataPicasaWebFile + +M gdata/services/picasaweb/gdata-picasaweb-file.c + +commit d3819a6b8be09dd17be2ffb3add6fe839185b2b2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:48:03 2010 +0100 + + [introspection] Add missing annotations to GDataPicasaWebAlbum + +M gdata/services/picasaweb/gdata-picasaweb-album.c + +commit 0b96db5ee45927b0eac5a491a2064f2f5d8747fa +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:42:04 2010 +0100 + + [introspection] Add missing annotations to GDataDocumentsText + +M gdata/services/documents/gdata-documents-text.c + +commit 10a3515fc13aa542dbda67a776e257d8a99680c0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:41:05 2010 +0100 + + [introspection] Add missing annotations to GDataDocumentsSpreadsheet + +M gdata/services/documents/gdata-documents-spreadsheet.c + +commit b6ee76b1a328140bc109cf4edf2c024c85d7b976 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:39:36 2010 +0100 + + [introspection] Add missing annotations to GDataDocumentsService + +M gdata/services/documents/gdata-documents-service.c + +commit 2c76309b3bd0f0484721948bfe933b02c227123d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:35:47 2010 +0100 + + [introspection] Add missing annotations to GDataDocumentsQuery + +M gdata/services/documents/gdata-documents-query.c + +commit 0b53641319ce14d5b97215db846a75cf5e472021 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:34:08 2010 +0100 + + [introspection] Add missing annotations to GDataDocumentsPresentation + +M gdata/services/documents/gdata-documents-presentation.c + +commit e8b0a10f3a67ca0c7873352a2d898d9a35562de5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:30:03 2010 +0100 + + [introspection] Add missing annotations to GDataDocumentsFolder + +M gdata/services/documents/gdata-documents-folder.c + +commit 2df578bc0d4ea43643ef81c447d936fc3e21a888 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 4 09:29:01 2010 +0100 + + [introspection] Add missing annotations to GDataDocumentsEntry + +M gdata/services/documents/gdata-documents-entry.c + +commit 450948f83dcec543904ece854f99f959f9a4d7bc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 23:36:33 2010 +0100 + + [introspection] Add missing annotations to GDataContactsService + +M gdata/services/contacts/gdata-contacts-service.c + +commit c44bac82e3347e7b87d5a2de5a9335be843355f3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 23:33:53 2010 +0100 + + [introspection] Add missing annotations to GDataContactsQuery + +M gdata/services/contacts/gdata-contacts-query.c + +commit bf9cccd6ecde074fd626d445b7e51537c4810122 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 23:31:42 2010 +0100 + + [introspection] Add missing annotations to GDataContactsContact + +M gdata/services/contacts/gdata-contacts-contact.c + +commit 51bd6c5a701ae5716577d42e524841f4d7f0dfac +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 23:15:34 2010 +0100 + + [introspection] Add missing annotations to GDataCalendarService + +M gdata/services/calendar/gdata-calendar-service.c + +commit 1dc351d916086e72663b28eed88a37291420dfb4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 23:09:55 2010 +0100 + + [introspection] Add missing annotations to GDataCalendarQuery + +M gdata/services/calendar/gdata-calendar-query.c + +commit 86e0eb33c5e6558f796fd8e9aedfd2fd452af796 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 23:05:08 2010 +0100 + + [introspection] Add missing annotations to GDataCalendarEvent + +M gdata/services/calendar/gdata-calendar-event.c + +commit 69694781910a89a50cbbc7f7a94a937b09cd41ef +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:58:01 2010 +0100 + + [introspection] Add missing annotations to GDataCalendarCalendar + +M gdata/services/calendar/gdata-calendar-calendar.c + +commit 1b66aea00acb59d2a186497137a439327a00a571 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:52:52 2010 +0100 + + [introspection] Add missing annotations to GDataMediaGroup + +M gdata/media/gdata-media-group.c + +commit 469b7a91d09aa178a770c08bbdc40223cb189fd4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:49:26 2010 +0100 + + [media] Small documentation fix + +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-thumbnail.c + +commit e493645e8b61c7fd23c95f21e774f8dae638ac0b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:44:51 2010 +0100 + + [introspection] Add missing annotations to GDataMediaCategory + +M gdata/media/gdata-media-category.c + +commit 7e208ced1b33315c3e3c0ffec2dee10a8b7150c7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:41:02 2010 +0100 + + [introspection] Add missing annotations to GDataGContactWebsite + +M gdata/gcontact/gdata-gcontact-website.c + +commit e4eae999ddcda10d1d880700017f7ad0592a7229 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:40:00 2010 +0100 + + [introspection] Add missing annotations to GDataGContactRelation + +M gdata/gcontact/gdata-gcontact-relation.c + +commit 90c4dada3b9f584cf2d9fd0bd0ca6c741e487110 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:39:06 2010 +0100 + + [introspection] Add missing annotations to GDataGContactLanguage + +M gdata/gcontact/gdata-gcontact-language.c + +commit 93dc86ab858a8e155aac72d1df81784071e45212 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:37:23 2010 +0100 + + [introspection] Add missing annotations to GDataGContactExternalID + +M gdata/gcontact/gdata-gcontact-external-id.c + +commit a097de2235fb9e5ed8f62e4cc20e410e11c1fef5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:35:53 2010 +0100 + + [introspection] Add missing annotations to GDataGContactEvent + +M gdata/gcontact/gdata-gcontact-event.c + +commit bd975321486b9366e4c0ff80ec3419a8818f2147 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:34:30 2010 +0100 + + [introspection] Add (out) annotations to GDate parameters + +M gdata/gcontact/gdata-gcontact-event.c +M gdata/services/contacts/gdata-contacts-contact.c + +commit 9782b8229fa681384a3a41bc5e3e2dd67183de2d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 22:32:25 2010 +0100 + + [introspection] Add missing annotations to GDataGContactCalendar + +M gdata/gcontact/gdata-gcontact-calendar.c + +commit ac8ed04346622ab8b53e117a15e201a4e02e91d5 +Author: Christian Kirbach <Christian.Kirbach@googlemail.com> +Date: Tue Aug 3 23:36:55 2010 +0200 + + Updated German translation + +M po/de.po + +commit 489ba73ed993cef4fe2edaf9fa1fbee71f5c55e5 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Tue Aug 3 14:38:12 2010 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit 61b244e0bb67faf75ebe549b4cd35022ce0f7c56 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:54:26 2010 +0100 + + [build] Silence g-ir-scanner + +M Makefile.am + +commit 43b885d25fb9f28d76a239185221b1cada71b22d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:50:30 2010 +0100 + + [introspection] Add missing annotations to GDataGDWho + +M gdata/gd/gdata-gd-who.c + +commit 3ebc546c1eea803201ca5636a1275278e5bcc8c2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:48:39 2010 +0100 + + [introspection] Add missing annotations to GDataGDWhere + +M gdata/gd/gdata-gd-where.c + +commit 760357e2b7f360af70097b52c58cf448e9b329ff +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:47:32 2010 +0100 + + [introspection] Add missing annotations to GDataGDWhen + +M gdata/gd/gdata-gd-when.c + +commit 2de0baff1bf820174564b92c8758de810bd83b9c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:45:53 2010 +0100 + + [introspection] Add missing annotations to GDataGDReminder + +M gdata/gd/gdata-gd-reminder.c + +commit 98ff632986df4dd3c4934119d75673c9c7dc0fe9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:44:25 2010 +0100 + + [introspection] Add missing annotations to GDataGDPostalAddress + +M gdata/gd/gdata-gd-postal-address.c + +commit cd7cc8b58832bc4a5137c9d22c9dac6a6451bac2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:40:01 2010 +0100 + + [introspection] Add missing annotations to GDataGDPhoneNumber + +M gdata/gd/gdata-gd-phone-number.c + +commit 83c4b44c839b21e2715166cde0d97e85d60b1a43 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:38:38 2010 +0100 + + [introspection] Add missing annotations to GDataGDOrganization + +M gdata/gd/gdata-gd-organization.c + +commit 311519d751d31c2a0ffe5eb1d4962f25509d81db +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:36:04 2010 +0100 + + [introspection] Add missing annotations to GDataGDName + +M gdata/gd/gdata-gd-name.c + +commit 6122f99aa2ed0273f9a6474a299e9636cc9e3750 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:34:17 2010 +0100 + + [introspection] Add missing annotations to GDataGDIMAddress + +M gdata/gd/gdata-gd-im-address.c + +commit 4fea0bc30ea89fb5f698fd9ca426629712adfb69 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:31:15 2010 +0100 + + [introspection] Add missing annotations to GDataGDEmailAddress + +M gdata/gd/gdata-gd-email-address.c + +commit 039c022ff686ff27c448789f0d727aeb129124f7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:29:08 2010 +0100 + + [introspection] Add missing annotations to GDataLink + +M gdata/atom/gdata-link.c + +commit d172a8e6accf5eed42edcd3b2252758fd4c169ee +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:26:03 2010 +0100 + + [introspection] Add missing annotations to GDataCategory + +M gdata/atom/gdata-category.c + +commit 9822973cf7288b6d942bfad6c8b136013d7136fb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 3 09:24:45 2010 +0100 + + [introspection] Add missing annotations to GDataAuthor + +M gdata/atom/gdata-author.c + +commit 48d44fceb9fa0ce95d482d0581834b8d8f3d2e22 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Tue Aug 3 07:55:10 2010 +0200 + + Updated Spanish translation + +M po/es.po + +commit e502b450702482ee649f504b6f4092997acc1b44 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 23:16:02 2010 +0100 + + [introspection] Add missing annotations to GDataUploadStream + +M gdata/gdata-upload-stream.c + +commit 182e28680a2db2643ab0d3773cb19c0dbfe8ae7f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 23:11:51 2010 +0100 + + [introspection] Add missing annotations to GDataColor + +M gdata/gdata-types.c + +commit 25ac0192d314422b0f903dc71cba80f4f0c669d1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 23:10:25 2010 +0100 + + [introspection] Add missing annotations to GDataQuery + +M gdata/gdata-query.c + +commit 88f5010f10ea50ef5acf87a117399a5afcd72df6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 22:56:01 2010 +0100 + + [introspection] Add missing annotations to GDataDownloadStream + +M gdata/gdata-download-stream.c + +commit b8ec49a28f012f92d69e681fb396bfd4a400c323 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 22:54:38 2010 +0100 + + [introspection] Add missing annotations to GDataComparable + +M gdata/gdata-comparable.c + +commit 4ebc986bca1d8447d9b6abec37ef3648975ccb57 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 22:43:57 2010 +0100 + + [introspection] Add missing annotations to GDataBatchOperation + +M gdata/gdata-batch-operation.c + +commit 57c2d72e1075a6615763956b55071246c84d5160 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 22:38:27 2010 +0100 + + [introspection] Add missing annotations to GDataAccessRule + +M gdata/gdata-access-rule.c +M gdata/gdata-batch-operation.c + +commit b93e8a9a4dd4235463a80d8b48cb4577d8ed0718 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 22:34:06 2010 +0100 + + [introspection] Add missing annotations to GDataFeed + +M gdata/gdata-feed.c + +commit 8315e83e806d8a1361f6c107a5191f401ba94be2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 22:32:38 2010 +0100 + + [introspection] Add missing annotations to GDataEntry + +M gdata/gdata-entry.c + +commit d66dd4ec51f8cf275a9bb76e6b4ea706aabdeda2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 22:29:50 2010 +0100 + + [introspection] Add (out) annotations to GTimeVal parameters + +M gdata/exif/gdata-exif-tags.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-when.c +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parser.c +M gdata/gdata-query.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-video.c + +commit e705e0fb18692589c2d383080cb5fb6375c2ee5b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 22:22:17 2010 +0100 + + [introspection] Add missing annotations to GDataService + +M gdata/gdata-service.c + +commit 667f685dcd6b318924d64c6743fe9796cf0f23dd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 2 00:11:26 2010 +0100 + + [youtube] Add batch operation support + + Add the GDataBatchable interface to GDataYouTubeService and add + the relevant + test cases to the youtube test suite. + +M gdata/services/youtube/gdata-youtube-service.c +M gdata/tests/youtube.c + +commit 161e3e57c4c722d6e4770475a76b85b4b7f18b90 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 1 23:04:34 2010 +0100 + + [youtube] Use migrated account details in tests + +M gdata/tests/youtube.c + +commit 3c184a926ec17a44b03a8cc13aaa30ee085f80c4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 1 23:02:39 2010 +0100 + + [core] Add support for AccountMigrated authentication errors + + These are used by YouTube to signal that new login credentials need to + be used in order to log in. + +M gdata/gdata-service.c +M gdata/gdata-service.h + +commit ac4e1b6e9a991c6d029b62a1aa43e63861061f53 +Author: Philip Withnall <philip.withnall@collabora.co.uk> +Date: Mon Jul 26 00:29:39 2010 +0200 + + [introspection] Add (closure) annotations + +M gdata/gdata-access-handler.c +M gdata/gdata-batch-operation.c +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-service.c + +commit bd9d18e340b7ab28f0416edd33072f682ec92fb8 +Author: Philip Withnall <philip.withnall@collabora.co.uk> +Date: Mon Jul 26 00:29:21 2010 +0200 + + [docs] Add annotation glossary + +M docs/reference/gdata-docs.xml + +commit 23ce123a0ccbd319891844b8c22a3c389ad5e788 +Author: António Lima <amrlima@gmail.com> +Date: Sun Jul 25 23:28:17 2010 +0100 + + Updated Portuguese translation + +M po/pt.po + +commit 593300b04fc75b78358193c8ae368a57e8697385 +Author: Aron Xu <aronxu@gnome.org> +Date: Mon Jul 19 00:56:44 2010 +0800 + + Update Simplified Chinese translation. + +M po/zh_CN.po + +commit 4294b256c2584504a913f426d15508cebb811ead +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Sun Jul 18 12:42:13 2010 +0200 + + Updated Spanish translation + +M po/es.po + +commit 5f1b98340f5050a9f4e3ae402bb6b45e52e7c582 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 16 10:09:34 2010 +0100 + + [introspection] Add (element-type) annotations + +M gdata/app/gdata-app-categories.c +M gdata/gd/gdata-gd-when.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/media/gdata-media-group.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-query.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 505045c324116e8b7ea12f38b94afc98db9cc62d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 16 10:08:52 2010 +0100 + + [introspection] Allow g-ir-scanner to actually pick up the gtk-doc + comments + + Also enable warnings from the scanner about missing annotations. + +M Makefile.am + +commit 441a650b516a680926b33ee9d14bd4489c07faed +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 16 10:08:39 2010 +0100 + + [docs] Add an "introspection" commit tag + +M HACKING + +commit 6a6578ee77e830b6b275153ea3e4b92a48a55458 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 16 09:44:09 2010 +0100 + + [build] Fix includes for GIR build + +M Makefile.am + +commit 5b570c019d4e5c9335b681427687a65cd8f650e3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 16 09:40:34 2010 +0100 + + [build] gcc warning fixes + +M gdata/services/youtube/gdata-youtube-category.c +M gdata/tests/general.c + +commit a76664d3fcecc53224b731257eca433b6791abf2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 16 09:11:24 2010 +0100 + + [atom] Remove the link rel hack used to work around cgo#2129 + +M gdata/atom/gdata-link.c + +commit 268f9dd4a62da5b9ab8b811e3acd9921589e3a13 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 16 09:08:48 2010 +0100 + + [contacts] Enforce use of the full projection in contact IDs + + The server can return contacts whose IDs use the base projection, + which will + cause problems if we then submit changes to those IDs. We need to + hack the + IDs to use the full projection as early as possible. Test case + included. + + Helps: http://code.google.com/p/gdata-issues/issues/detail?id=2129 + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/tests/contacts.c + +commit 24699f3a6b65e88260651473c0f79f5c13159d7c +Author: Petr Kovar <pknbe@volny.cz> +Date: Thu Jul 15 21:00:45 2010 +0200 + + Update Czech translation by Marek Cernocky + +M po/cs.po + +commit c8017672142ea3d9600b23ae8137dedf7a5e69a3 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Wed Jul 14 19:21:33 2010 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit 9d1cff4c2f6ff80cf087bc321f82c2eedd82a1b0 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Wed Jul 14 15:03:05 2010 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit 3e7c7af837fdade64a66cfd955924ad6640d89dd +Author: Mario Blättermann <mariobl@gnome.org> +Date: Tue Jul 13 23:26:10 2010 +0200 + + [i18n] Updated German translation + +M po/de.po + +commit 3bd5972905a0af089f44aa13a148a1e997426724 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jul 13 09:07:09 2010 +0100 + + [core] Ensure GDataEntry:title follows GDataAccessRule:role + +M gdata/gdata-access-rule.c +M gdata/tests/general.c + +commit 072cfc6d0029ffedd66af2e8cc8f29f8d0c1ab94 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jul 8 22:29:09 2010 +0100 + + [contacts] Add batch operation support + + Add the GDataBatchable interface to GDataContactsService and add + the relevant + test cases to the contacts test suite. + +M gdata/services/contacts/gdata-contacts-service.c +M gdata/tests/contacts.c + +commit 5c32aadbddb89eea4d8fc15626e179ce8a8f2d13 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jan 26 13:20:41 2010 +0000 + + [core] Batch operation support + + Add batch operation support. Batch operations are executed by creating + a new + GDataBatchOperation, adding the required operations to it, then + running it + (sync or async). Batch operations are only supported by services which + implement GDataBatchable. + + This includes full test cases and documentation. + + Closes: bgo#579169 + +M Makefile.am +M docs/reference/Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/atom/gdata-link.c +A gdata/gdata-batch-feed.c +A gdata/gdata-batch-feed.h +A gdata/gdata-batch-operation.c +A gdata/gdata-batch-operation.h +C055 gdata/tests/common.c gdata/gdata-batch-private.h +A gdata/gdata-batchable.c +A gdata/gdata-batchable.h +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/tests/common.c +M gdata/tests/common.h + +commit adf35ec6f1f46f0522d30f90140659a002c59122 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 12 08:58:20 2010 +0100 + + [build] Remove intltoolized file from git + +D po/Makefile.in.in + +commit f357ee80fe860ab1b55072e943bbe66bf61b485d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jul 8 21:40:07 2010 +0100 + + [core] Use the error reason phrase if the response body is empty + +M gdata/gdata-service.c + +commit e82a65cc3e5c224f423c1f4ed0d135fbc721326b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jul 8 21:38:09 2010 +0100 + + [core] Fix a return type + +M gdata/gdata-parsable.c + +commit 376973f9671765fab3a89aafe5282405233d7b09 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jul 8 21:37:34 2010 +0100 + + [core] Reference entries when adding them to feeds + +M gdata/gdata-feed.c +M gdata/services/documents/gdata-documents-feed.c + +commit 728424f9ed5e80f89ff2a3a3d7e36a8b9decb715 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jul 8 21:34:12 2010 +0100 + + [docs] Move the link types to the correct place + +M docs/reference/gdata-sections.txt + +commit c5347ce1992b51039270f0c5efd892cf6a833e3b +Author: Gil Forcada <gforcada@gnome.org> +Date: Sat Jun 26 13:21:24 2010 +0200 + + Updated Catalan translation + +M po/ca.po + +commit 2ed1c7cad2a2bf60c9fae644ea5f34f2dd5ce62a +Author: Fran Diéguez <fran.dieguez@mabishu.com> +Date: Mon Jun 21 11:18:43 2010 +0200 + + Updated Galician translations + +M po/gl.po + +commit 582cb55c6f559638211ca6987e3e71401bba2e51 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jun 16 16:12:59 2010 +0100 + + [core] Fix parameter name in header + + Fix it for consistency with the previous commit. + +M gdata/gdata-entry.h + +commit eec6379527f50f7356dc7f51e5616470ba870685 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jun 16 16:11:11 2010 +0100 + + [core] Remove more shadowing of functions from unistd.h + +M gdata/gdata-access-handler.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-service.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit ea180875d562fe38c846e04a258dd33194915b4f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jun 16 15:55:17 2010 +0100 + + [core] Move kind support to GDataEntry + + Add support for kinds in GDataEntry, consolidating the existing + code for + adding kind categories which existed in various GDataEntry subclasses + before. + +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/picasaweb.c + +commit 36bb9c9fe745cf42970b6088f805877e6f2f669b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jun 15 13:29:03 2010 +0100 + + [core] Add a GDataComparable interface + + Add a GDataComparable interface and use it to replace all the tiny + *_compare() + functions for various classes. They've consequently been removed + from the API + in a pretty massive API break. + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/atom/gdata-author.c +M gdata/atom/gdata-author.h +M gdata/atom/gdata-category.c +M gdata/atom/gdata-category.h +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-generator.h +M gdata/atom/gdata-link.c +M gdata/atom/gdata-link.h +M gdata/gcontact/gdata-gcontact-calendar.c +M gdata/gcontact/gdata-gcontact-calendar.h +M gdata/gcontact/gdata-gcontact-external-id.c +M gdata/gcontact/gdata-gcontact-external-id.h +M gdata/gcontact/gdata-gcontact-language.c +M gdata/gcontact/gdata-gcontact-language.h +M gdata/gcontact/gdata-gcontact-website.c +M gdata/gcontact/gdata-gcontact-website.h +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-im-address.h +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-name.h +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-phone-number.h +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-postal-address.h +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-when.h +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-where.h +M gdata/gd/gdata-gd-who.c +M gdata/gd/gdata-gd-who.h +A gdata/gdata-comparable.c +A gdata/gdata-comparable.h +M gdata/gdata-entry.c +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/tests/general.c + +commit 4416f9d5dafb5cac81c8598c02e4595c51233e46 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 14 20:41:02 2010 +0100 + + [core] Remove shadowing of functions from unistd.h + + I wish the C standard library was namespaced. + +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/tests/general.c + +commit 60dd6f1c939c1370daba65a49c4a6c897e9ff9c6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 14 20:29:33 2010 +0100 + + [documents] Clarified status of ETag support for adding documents + to folders + + Removed a TODO about ETag support for adding documents to folders. + +M gdata/services/documents/gdata-documents-service.c + +commit ac5100204516070296d0f54a5d3622ef06edbc13 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 14 17:00:14 2010 +0100 + + Bug 618586 — gdata_service_query_single_entry() encounters NULL + type class + + Fix a crasher when using gdata_service_query_single_entry() with a + type class + which hasn't previously been initialised. Based on a patch by Richard + Schwarting <aquarichy@gmail.com>. Closes: bgo#618586 + +M gdata/gdata-service.c + +commit 649ab36963e57d839a845bdf0dd823a1f4f14485 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 14 16:36:15 2010 +0100 + + Bug 615721 — Support listing video categories + + Add support for listing the categories currently available on + YouTube, along + with whether they're assignable, browsable or deprecated. Coupled + with locale + support, this provides for localised category listings, too. + Closes: bgo#615721 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +A gdata/app/gdata-app-categories.c +A gdata/app/gdata-app-categories.h +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/services/youtube/gdata-youtube-category.c +A gdata/services/youtube/gdata-youtube-category.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/tests/general.c +M gdata/tests/youtube.c + +commit 39c4bdd6ed202fdef6bd41259a63d86209f095ba +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jun 13 23:27:39 2010 +0100 + + [core] Add service locale support + + Add support for setting the locale for network requests on a + per-service + basis, using the Accept-Language header. Helps: bgo#615721 + +M docs/reference/gdata-sections.txt +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/tests/general.c + +commit 865618c3b9a202e2836cb5deb0786df0fdce4def +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jun 10 17:28:47 2010 +0100 + + [core] Makefile improvements + + An improvement to the marshalling stuff in the Makefile.am, plus a + fix for + EXTRA_DIST. + +M Makefile.am + +commit f74adf8b91241192b66b49eb8498d6388b028779 +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Tue Jun 8 15:26:29 2010 +0200 + + Updated Hungarian translation + +M po/hu.po + +commit 34ad1221607aab8f123faeedd9152a556c709d94 +Author: António Lima <amrlima@gmail.com> +Date: Tue May 25 00:20:58 2010 +0100 + + Updated Portuguese translation + +M po/pt.po + +commit 1c93522f7e82af080f4d467ddcc32d991cc2ad54 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Sat May 15 14:07:46 2010 +0100 + + Bug 618584 — Implement gdata_entry_get_authors() + + Add gdata_entry_get_authors(), documentation and test cases. + Closes: bgo#618584 + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata.symbols +M gdata/tests/general.c + +commit c06ae0489b53c7f54fd78e2e7526067b78bf07ea +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue May 4 00:09:56 2010 +0100 + + [contacts] Fix use of uninitialised memory + +M gdata/services/contacts/gdata-contacts-contact.c + +commit 68e224154436d5f67a8bb0aac2979d711b48d65d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 2 17:46:56 2010 +0100 + + [youtube] Fix documentation example formatting + +M gdata/services/youtube/gdata-youtube-video.c + +commit 4e45d2f1cf199f9eed524769a6344b4dab25d546 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Sun May 2 17:44:20 2010 +0100 + + Bug 579885 — Add code examples to documentation + + Add code examples to the documentation for GDataPicasaWebAlbum, + GDataPicasaWebFile and GDataPicasaWebService. Helps: bgo#579885 + +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit 91f7854eb50f05ca14fd4a151278f6c26951c51c +Author: Claude Paroz <claude@2xlibre.net> +Date: Fri Apr 30 21:43:40 2010 +0200 + + Updated French translation + +M po/fr.po + +commit b7e888d11c87b8a41c86bc15e1430f0f144ec13d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 25 22:59:42 2010 +0100 + + [core] Update authentication documentation + + Update the authentication property documentation to be more specific + about + client IDs, and improve the documentation for a few other properties + slightly. + +M gdata/gdata-service.c + +commit ed06b683af28db476d11be44c24dfeb0369c8af2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 25 22:55:21 2010 +0100 + + [youtube] Remove X-GData-Client header + + It was deprecated on 2010-03-22, so we might as well save the + bandwidth and + not send it with every request. + +M gdata/services/youtube/gdata-youtube-service.c + +commit ae22caed577207bf55a5d394eedfa413ed64c4d2 +Author: Daniel Nylander <po@danielnylander.se> +Date: Sun Apr 25 08:03:53 2010 +0200 + + Updated Swedish translation + +M po/sv.po + +commit b932c923d2ada7b552728d711f371728004f81cc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 24 20:37:52 2010 +0100 + + [build] Add introspection.m4 + + Add a copy of introspection.m4 to the tree, copied from the + gobject-introspection tree as per + http://mail.gnome.org/archives/gtk-devel-list/2010-April/msg00092.html, + since libgdata only has an optional dependency on g-i. + +M Makefile.am +A introspection.m4 + +commit 4468035a9fab71253d66bf50234d9ca50cb3328a +Author: Paul Smith <psmith@gnu.org> +Date: Fri Apr 23 14:13:09 2010 +0100 + + Bug 616222 — libgdata fails to build from a remote directory + + Be more strict in our use of top_[srcdir|builddir]. Closes: bgo#616222 + +M Makefile.am + +commit fd1ad35ae98f811a893392698a54f39a9b2ea268 +Author: Gintautas Miliauskas <gintautas@miliauskas.lt> +Date: Mon Apr 19 02:09:46 2010 +0300 + + Added Lithuanian translation by Aurimas Černius. + +A po/lt.po + +commit ebc4e10337016c258e90cef29d4e445d93349b55 +Author: Gintautas Miliauskas <gintautas@miliauskas.lt> +Date: Mon Apr 19 02:09:41 2010 +0300 + + Added Lithuanian translation by Aurimas Černius. + +M po/LINGUAS + +commit addb12cf63dedcd0b29543cc77693b741594a862 +Author: Petr Kovar <pknbe@volny.cz> +Date: Sat Apr 17 21:34:48 2010 +0200 + + Update Czech translation by Marek Cernocky + +M po/cs.po + +commit 77cb5aaa8ec8f67511d38d9b4f3977d316b3510a +Author: Petr Kovar <pknbe@volny.cz> +Date: Sat Apr 17 21:26:00 2010 +0200 + + Update Czech translation by Marek Cernocky + +M po/cs.po + +commit cccac6be204384c71b73a0ac8fbbb5a55b23d0c8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 17 13:55:27 2010 +0100 + + [core] Simplify GDataQuery + +M gdata/gdata-query.c + +commit f3d4e4261e0b1b06c2ab5ec401b08e518ed22090 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 3 00:02:49 2010 +0100 + + [core] Mark most getter functions as pure + + Add G_GNUC_PURE to all applicable getter functions, which should + allow gcc to + optimise calls to libgdata in some cases. This required a little + rewrite of + the authentication system to ensure the username and password + (etc.) are only + changed on the #GDataService from the main thread. + +M gdata/atom/gdata-author.h +M gdata/atom/gdata-category.h +M gdata/atom/gdata-generator.h +M gdata/atom/gdata-link.h +M gdata/exif/gdata-exif-tags.h +M gdata/gcontact/gdata-gcontact-calendar.h +M gdata/gcontact/gdata-gcontact-event.h +M gdata/gcontact/gdata-gcontact-external-id.h +M gdata/gcontact/gdata-gcontact-jot.h +M gdata/gcontact/gdata-gcontact-language.h +M gdata/gcontact/gdata-gcontact-relation.h +M gdata/gcontact/gdata-gcontact-website.h +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-im-address.h +M gdata/gd/gdata-gd-name.h +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-phone-number.h +M gdata/gd/gdata-gd-postal-address.h +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.h +M gdata/gd/gdata-gd-where.h +M gdata/gd/gdata-gd-who.h +M gdata/gdata-access-rule.h +M gdata/gdata-download-stream.h +M gdata/gdata-entry.h +M gdata/gdata-feed.h +M gdata/gdata-private.h +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata-upload-stream.h +M gdata/georss/gdata-georss-where.h +M gdata/media/gdata-media-category.h +M gdata/media/gdata-media-content.h +M gdata/media/gdata-media-credit.h +M gdata/media/gdata-media-group.h +M gdata/media/gdata-media-thumbnail.h +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/calendar/gdata-calendar-feed.h +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/documents/gdata-documents-entry.h +M gdata/services/documents/gdata-documents-query.h +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/picasaweb/gdata-picasaweb-query.h +M gdata/services/picasaweb/gdata-picasaweb-user.h +M gdata/services/youtube/gdata-youtube-content.h +M gdata/services/youtube/gdata-youtube-control.h +M gdata/services/youtube/gdata-youtube-credit.h +M gdata/services/youtube/gdata-youtube-group.h +M gdata/services/youtube/gdata-youtube-query.h +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-state.h +M gdata/services/youtube/gdata-youtube-video.h + +commit e54748533b841ffa9decbb0245b1bdb39a86ae3e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 16 19:45:30 2010 +0100 + + Bug 615506 — totem: Youtube Search lasts forever while playing Video + + Add a #GDataService:timeout property, proxying the + #SoupSession:timeout + property, and allowing network requests to return with + %GDATA_SERVICE_ERROR_NETWORK_ERROR if the timeout is exceeded. + Helps: bgo#615506 + +M docs/reference/gdata-sections.txt +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols + +commit 474abfaf1a30a3fa80283e716f1376a26bfefc70 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 14 18:47:24 2010 +0100 + + [core] Remove unused parameters from _gdata_service_query() + +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit 88fbd3e060b4f3ff43c38b5a41de9c405ea86924 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 12 20:46:19 2010 +0100 + + [core] Include an XML declaration in the result of + gdata_parsable_get_xml() + + Make the results of gdata_parsable_get_xml() valid XML documents in + themselves. + +M gdata/gdata-parsable.c +M gdata/gdata-upload-stream.c +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/general.c +M gdata/tests/youtube.c + +commit 5d41df2fb49d88ff84887e4923a5093d9e1a39e9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 12 20:18:17 2010 +0100 + + [core] Revert interface change + + For it to work, it would have to break API by renaming + GDataAccessHandlerIface to GDataAccessHandlerInterface. + +M README +M configure.ac +M gdata/gdata-access-handler.c + +commit 33ef10a4f0cd472c69d9651cee0184c20db8fa02 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 12 19:53:12 2010 +0100 + + [core] Use G_DEFINE_INTERFACE + + This bumps the GLib requirement up to 2.23.1. + +M README +M configure.ac +M gdata/gdata-access-handler.c + +commit 043bbfaf99f6cd4e186d458a1fbfae537d6e1a78 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 12 19:28:17 2010 +0100 + + [core] Whitespace fixes + + Make indentation and whitespacing consistent throughout the entire + project. + I am so sad. + +M HACKING +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/atom/gdata-link.h +M gdata/exif/gdata-exif-tags.c +M gdata/gcontact/gdata-gcontact-calendar.c +M gdata/gcontact/gdata-gcontact-event.c +M gdata/gcontact/gdata-gcontact-external-id.c +M gdata/gcontact/gdata-gcontact-jot.c +M gdata/gcontact/gdata-gcontact-language.c +M gdata/gcontact/gdata-gcontact-relation.c +M gdata/gcontact/gdata-gcontact-website.c +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-im-address.h +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-phone-number.h +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/gdata-access-handler.c +M gdata/gdata-access-handler.h +M gdata/gdata-access-rule.c +M gdata/gdata-buffer.c +M gdata/gdata-download-stream.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/gdata-parsable.h +M gdata/gdata-parser.c +M gdata/gdata-private.h +M gdata/gdata-query.c +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata-types.c +M gdata/gdata-upload-stream.c +M gdata/gdata-upload-stream.h +M gdata/georss/gdata-georss-where.c +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-feed.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.c +M gdata/services/documents/gdata-documents-text.h +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-feed.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-query.h +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/youtube/gdata-youtube-content.c +M gdata/services/youtube/gdata-youtube-control.c +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-group.h +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit 886a47e9cdbd964fb8808af59ccf7f670b865edf +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 10 18:34:18 2010 +0100 + + [documents] Fix type checks for document queries + +M gdata/services/documents/gdata-documents-service.c + +commit 3cfb19d58b7a817c36938ff4168ebf4e8b962440 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 10 18:27:02 2010 +0100 + + [core] Fix cancellation races in GDataBuffer and GDataUploadStream + +M gdata/gdata-buffer.c +M gdata/gdata-upload-stream.c + +commit ca20862ec3235e25763317ebdea60146327ecd14 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 10 18:13:52 2010 +0100 + + [core] Tidy up preconditions + + Tidy up the public API preconditions and ensure they're present + for all + public (and most semi-public) functions. + +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/gcontact/gdata-gcontact-calendar.c +M gdata/gcontact/gdata-gcontact-external-id.c +M gdata/gcontact/gdata-gcontact-language.c +M gdata/gcontact/gdata-gcontact-website.c +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/gdata-access-handler.c +M gdata/gdata-buffer.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/gdata-query.c +M gdata/gdata-service.c +M gdata/gdata-upload-stream.c +M gdata/media/gdata-media-group.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c + +commit f76e3ce0fdd14beb58fd1dae48eb865e21a54ee3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 10 16:23:43 2010 +0100 + + [core] Fix sign issues in GDataQuery + + Make GDataQuery:start-index and GDataQuery:max-results unsigned + integers, + rather than signed integers, with default values of 0. + + Note that this is an API break, though it doesn't affect any known + current + users of libgdata. + +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-query.h +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-query.h +M gdata/services/youtube/gdata-youtube-query.c +M gdata/tests/general.c + +commit eeaaf33238c08962c72193d90205fa490c5dfb87 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 9 22:34:56 2010 +0100 + + [core] Improve documentation a little + +M gdata/gdata-service.c + +commit 721dd8d66611474a71ec55ae86f133e4a67aac26 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 9 22:32:29 2010 +0100 + + [picasaweb] Fix small leak + +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit a7659ba16449f2cae97eadcb2e3ac59f01bfe016 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 9 22:31:30 2010 +0100 + + [gcontact] Fix documentation + +M gdata/gcontact/gdata-gcontact-external-id.c + +commit b56ed5d7d6bdebc793bbb5a13d022aa61fb86860 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 9 00:53:36 2010 +0100 + + [core] Improve cancellation support + + Make use of libsoup's message cancellation functionality, rather than + checking for cancellation ourselves at arbitrary points during + operations. + + This fixes cancellation support for sync and async operations, + and adds an + API guarantee that if an operation is cancelled before its network + activity + has finished (or started), the operation will always return a + cancelled + error. If an operation is cancelled after its network activity + has finished, + the operation will always return its results as normal. + +M docs/reference/gdata-overview.xml +M gdata/gdata-access-handler.c +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-service.c + +commit 5b7b1e0e6a18ae4dbc63aecc11c473b651e5244d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 9 19:18:20 2010 +0100 + + [core] Improve preconditions for GDataService methods + +M gdata/gdata-service.c + +commit e4ebb13a83cd9d2747ac8eedfd3b43997d6e48f0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 8 21:53:23 2010 +0100 + + [core] Fix ETag returns for async queries + + If an async query had an ETag match, a NULL feed was returned, but the + async query code didn't handle this properly. + +M gdata/gdata-service.c + +commit e2c05a5ec51624a17e1c7792eb55efed174c077e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 8 21:07:50 2010 +0100 + + [youtube] Fix parsing of content elements + +M gdata/media/gdata-media-group.c +M gdata/services/youtube/gdata-youtube-group.c + +commit eab9685d23dcd6e809281a04e1eef33faa9adeee +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Apr 6 19:00:24 2010 +0100 + + [gcontact] Add support for GDataGContactLanguage and hobbies + + Closes: bgo#613551 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +A gdata/gcontact/gdata-gcontact-language.c +A gdata/gcontact/gdata-gcontact-language.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c +M gdata/tests/general.c + +commit 4dd2c49b2039d8d6153cbe5563a531e6c55aa77f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Apr 6 18:04:08 2010 +0100 + + [gcontact] Add GDataGContactExternalID + + Helps: bgo#613551 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +A gdata/gcontact/gdata-gcontact-external-id.c +A gdata/gcontact/gdata-gcontact-external-id.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c +M gdata/tests/general.c + +commit 79e784f5d6151b4a1ec2c2799d9e4239a52d2b98 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Apr 6 17:14:23 2010 +0100 + + [contacts] Add user-defined field support + + Helps: bgo#613551 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit ac13100d5464e944aa8b07811202a410cd1546b8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Apr 6 16:32:29 2010 +0100 + + [build] Update git.mk from Pango + +M git.mk + +commit e82c804128fa775d26dad7a39acd09c1b0603b6a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Apr 6 15:51:10 2010 +0100 + + [contacts] Add support for more gContact namespace elements + + The following elements are now supported: + * billingInformation + * directoryServer + * gender + * initials + * maidenName + * mileage + * occupation + * priority + * sensitivity + * shortName + * subject + Helps: bgo#613551 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit 58da2602ea3616a6d397384d0b1bfae8eef0437a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Apr 6 09:35:08 2010 +0100 + + [core] Add support for <rights> to GDataFeed + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata.symbols +M gdata/tests/general.c + +commit 459aaf6d5931b426e062ecbe6d29df06cca2d7fe +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 3 09:10:57 2010 +0100 + + [core] Make function order consistent + +M gdata/gdata-access-rule.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-video.c + +commit f98aed130bb2275ab4ea50aaec6016562aa54a3a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 1 22:58:46 2010 +0100 + + [core] Add G_GNUC_MALLOC to all functions returning allocated data + + This is in addition to G_GNUC_WARN_UNUSED_RESULT, so that we get + the benefit + of compiler aliasing optimisations, plus a reminder to not discard + returned + values without freeing/unreffing them. + +M gdata/atom/gdata-author.h +M gdata/atom/gdata-category.h +M gdata/atom/gdata-link.h +M gdata/gcontact/gdata-gcontact-calendar.h +M gdata/gcontact/gdata-gcontact-event.h +M gdata/gcontact/gdata-gcontact-jot.h +M gdata/gcontact/gdata-gcontact-relation.h +M gdata/gcontact/gdata-gcontact-website.h +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-im-address.h +M gdata/gd/gdata-gd-name.h +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-phone-number.h +M gdata/gd/gdata-gd-postal-address.h +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.h +M gdata/gd/gdata-gd-where.h +M gdata/gd/gdata-gd-who.h +M gdata/gdata-access-handler.h +M gdata/gdata-access-rule.h +M gdata/gdata-buffer.h +M gdata/gdata-download-stream.h +M gdata/gdata-entry.h +M gdata/gdata-parsable.h +M gdata/gdata-parser.h +M gdata/gdata-private.h +M gdata/gdata-query.h +M gdata/gdata-service.h +M gdata/gdata-types.h +M gdata/gdata-upload-stream.h +M gdata/media/gdata-media-category.h +M gdata/media/gdata-media-content.h +M gdata/media/gdata-media-thumbnail.h +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/contacts/gdata-contacts-service.h +M gdata/services/documents/gdata-documents-entry.h +M gdata/services/documents/gdata-documents-folder.h +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-query.h +M gdata/services/documents/gdata-documents-service.h +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.h +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/picasaweb/gdata-picasaweb-query.h +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/services/youtube/gdata-youtube-query.h +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-video.h + +commit b926e8e717f309a7d49c57560b4ad4dbf683b215 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 1 20:58:00 2010 +0100 + + [docs] Add note about #defined strings + +M HACKING +M docs/reference/gdata-overview.xml + +commit f0a69f5d52511152e089977827eb69e0497c88d2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 1 20:23:36 2010 +0100 + + [core] Use libsoup status constants + + Use libsoup status constants when dealing with HTTP statuses for + clarity. + +M gdata/gdata-access-handler.c +M gdata/gdata-service.c +M gdata/gdata-upload-stream.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-service.c + +commit ce3e887ec2f1a4a5f10bb9276d25eff2dd057164 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 31 00:45:26 2010 +0100 + + [calendar] Add missing parsing fallback + +M gdata/services/calendar/gdata-calendar-feed.c + +commit a0742d438ac0cca989e3eb4756d9985596e5479a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 31 00:22:07 2010 +0100 + + [core] Unify queries for single entries + + Add a new gdata_service_query_single_entry() function (and async + variant) + to serve as the main function to call for retrieving a single + entry from + any service. + + As a consequence of this, the GDataQuery:entry-id property has + been removed, + as it's now redundant (and never worked well anyway). + + ABI has been broken apart from the API removals due to adding a + new member + to GDataEntryClass. + + Note that this includes the removal of: + * gdata_youtube_service_query_single_video() (and async variant) + * gdata_documents_service_query_single_document() + * gdata_query_new_for_id() + * gdata_query_[get|set]_entry_id() + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/general.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 4e36bb3457f45828c79f9f9794307f1205d9e59d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 30 17:24:31 2010 +0100 + + [youtube] Fix keyword tests + +M gdata/tests/youtube.c + +commit 66aa9b407b014aa8af1528f1a72fe3d097397429 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 30 17:19:59 2010 +0100 + + [picasaweb] Fix class definition for GDataPicasaWeb + +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/picasaweb/gdata-picasaweb-user.h + +commit 54a8022e06e986c06a0a5aa87458c2d3d8d7f4fb +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Tue Mar 30 20:53:16 2010 +0200 + + Updated Spanish translation + +M po/es.po + +commit 270b8bae0c238ea0b8335af8f04e4c20a505ddc1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 30 00:44:47 2010 +0100 + + Bug 614253 — GDataMediaGroup:tags should be a string array + + Convert GDataMediaGroup:tags to be a string array, which automatically + escapes and unescapes the tags passed to it. Also convert all + properties + which proxy GDataMediaGroup:tags, which means the following API + breaks: + * GDataPicasaWebAlbum:tags and getter/setter + * GDataPicasaWebFile:tags and getter/setter + * GDataYouTubeVideo:keywords and getter/setter + All these properties are now string arrays, and their getters/setters + deal + with them as such. Closes: bgo#614253 + +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-group.h +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/picasaweb.c + +commit 8625f6bf68dda2e4f973ca5c1dc92d81f55e4f6f +Author: Mario Blättermann <mariobl@gnome.org> +Date: Mon Mar 29 21:56:50 2010 +0200 + + Updated German translation + +M po/de.po + +commit 1fb54efce0bba1e611c3c5a7bb30258b9163e95e +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Mon Mar 29 20:57:16 2010 +0200 + + Updated Slovenian translation + +M po/sl.po + +commit ba286a7f4b52f9c35d2062a9cc5c7181cc6573c9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 29 19:19:45 2010 +0100 + + [core] Improve error reporting when there's no network connection + + Add GDATA_SERVICE_ERROR_NETWORK_ERROR and + GDATA_SERVICE_ERROR_PROXY_ERROR, + to be returned by all network operations (authentication, queries, + insertions, updates and deletions) in case of a local network error + or a + proxy error, respectively. + +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/tests/general.c + +commit b193da507a63da2fe1e0f7dc44aae9949f4d7545 +Author: Chao-Hsiung Liao <j_h_liau@yahoo.com.tw> +Date: Mon Mar 29 14:09:38 2010 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit 1ad02bfea27ef665e1298c1ca29208bdc30233cd +Author: Petr Kovar <pknbe@volny.cz> +Date: Mon Mar 29 00:47:30 2010 +0200 + + Update Czech translation + +M po/cs.po + +commit 3f159da1916e6d3c3c7728928b147c7c326976ca +Author: Marek Černocký <marek@manet.cz> +Date: Sun Mar 28 23:03:58 2010 +0200 + + Update Czech translation + +M po/cs.po + +commit fa4a5fdd33be5a7aac9a34e30efce744a22f88b5 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Sat Mar 27 19:31:44 2010 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit 7b79b7da769d96aacb182e684a4b85b3bb0140c5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Mar 27 16:21:19 2010 +0000 + + [docs] More documentation warning fixes + +M HACKING +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/exif/gdata-exif-tags.c +M gdata/gcontact/gdata-gcontact-calendar.c +M gdata/gcontact/gdata-gcontact-website.c +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/gdata-access-rule.c +M gdata/gdata-buffer.c +M gdata/gdata-download-stream.c +M gdata/gdata-feed.c +M gdata/gdata-parser.c +M gdata/gdata-query.c +M gdata/gdata-service.h +M gdata/gdata-upload-stream.c +M gdata/georss/gdata-georss-where.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 09022c450b40178782016036391d60973a7dba72 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Mar 27 15:04:10 2010 +0000 + + [youtube] Add #defines for YouTube objects + +M docs/reference/gdata-sections.txt +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-credit.h + +commit 548d9dda255f0f359e04280c0b1512459b7f606b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Mar 27 14:49:41 2010 +0000 + + [picasaweb] Add #defines for PicasaWeb objects + +M docs/reference/gdata-sections.txt +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h + +commit c78794f350371e31b54d4b44bb264ccb27238571 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Mar 27 14:38:03 2010 +0000 + + [calendar] Add #defines for Google Calendar objects + +M docs/reference/gdata-sections.txt +M gdata/gd/gdata-gd-when.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/tests/calendar.c +M gdata/tests/general.c + +commit d6a73292156dd30e779a85291f75ae23ccdfc38b +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Sat Mar 27 13:42:46 2010 +0100 + + Updated Spanish translation + +M po/es.po + +commit fe88f6da332e26a154b8ea241993b6f2405d1f7d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Mar 27 00:28:56 2010 +0000 + + [documents] Minor documentation fix + +M gdata/services/documents/gdata-documents-presentation.h + +commit a464563b8203381db2b708e65998ef6ae3ed6012 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Mar 27 00:18:49 2010 +0000 + + [gd] Add #defines for GData namespace objects + +M docs/reference/gdata-sections.txt +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-im-address.h +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-phone-number.h +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-postal-address.h +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-where.h +M gdata/gd/gdata-gd-who.c +M gdata/gd/gdata-gd-who.h +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/general.c + +commit 464988fc97a1aaa9eebcd8657626a0dab6f33597 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 26 22:57:27 2010 +0000 + + [core] Add #defines for GDataAccessRule-related things + + from the new defines, which are split across the gAcl, Google + Calendar and + Google Documents namespaces. + +M docs/reference/gdata-sections.txt +M gdata/gdata-access-rule.c +M gdata/gdata-access-rule.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-entry.h +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/calendar.c +M gdata/tests/documents.c +M gdata/tests/general.c + +commit 869553d37d02ddff39166c0c961c2697b59ae9ba +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 26 22:10:44 2010 +0000 + + [core] Remove several enumerated types + + Remove GDataYouTubeAspectRatio, and replace it with a + GDATA_YOUTUBE_ASPECT_RATIO_WIDESCREEN #define. + + Remove GDataYouTubeAction and replace it with #defines for all + its members. + + This is an API and ABI break necessary to enforce the newly-finalised + policy that enums are avoided where possible for API which interacts + with or + represents data from the server. + +M docs/reference/gdata-overview.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-group.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit 37376eb3e63da22c4ba766988810d4a0b72f8e84 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 26 19:35:25 2010 +0000 + + [docs] Add a philosophy section to the documentation + + This section gives some details about some of the design decisions in + libgdata which have affected the API. + + This also updates the HACKING file, with references to the new + documentation + sections, and a few updated commenting rules. + +M HACKING +M docs/reference/gdata-overview.xml + +commit dc7df0137940a62de0895d0831a7dd0965110b1c +Author: Mario Blättermann <mariobl@gnome.org> +Date: Fri Mar 26 11:57:24 2010 +0100 + + Updated German translation + +M po/de.po + +commit 2902326cd1437d7d3d9ee5f2298d8e6ad4b05c70 +Author: Bruno Brouard <annoa.b@gmail.com> +Date: Fri Mar 26 10:58:04 2010 +0100 + + Updated French translation + +M po/fr.po + +commit aa23ec1cdcaaa5511a5ba713bebdbe0f101bf180 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 25 00:43:09 2010 +0000 + + Bug 613551 — Add gContact namespace + + Add support for various elements from the gContact namespace, + and implement + them in #GDataContactsContact. There is now support for contact: + * nicknames + * birthdays + * jots (notes about a contact) + * relations (with other people, not necessarily family) + * websites + * events (anniversaries, important dates, etc.) + * calendar links + Helps: bgo#613551 + +M Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +A gdata/gcontact/gdata-gcontact-calendar.c +A gdata/gcontact/gdata-gcontact-calendar.h +A gdata/gcontact/gdata-gcontact-event.c +A gdata/gcontact/gdata-gcontact-event.h +A gdata/gcontact/gdata-gcontact-jot.c +A gdata/gcontact/gdata-gcontact-jot.h +A gdata/gcontact/gdata-gcontact-relation.c +A gdata/gcontact/gdata-gcontact-relation.h +A gdata/gcontact/gdata-gcontact-website.c +A gdata/gcontact/gdata-gcontact-website.h +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c +M gdata/tests/general.c + +commit 3dad7fe3e3b48fd7090b21dc92ed770c338732da +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 25 14:33:04 2010 +0000 + + [core] Add GDataAccessRule:edited + + Allow retrieval of the last edit time for access rules using the + +M docs/reference/gdata-sections.txt +M gdata/gdata-access-rule.c +M gdata/gdata-access-rule.h +M gdata/gdata.symbols +M gdata/tests/calendar.c +M gdata/tests/general.c + +commit c9dc64a56aa098a5dff2b1317d2916d182932619 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 25 13:38:32 2010 +0000 + + [core] Remove unnecessary preconditions in internal functions + +M gdata/gdata-entry.c +M gdata/gdata-feed.c + +commit 4193e1819b4d05a97c54803a71e1f4ff0f1df974 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 25 13:29:18 2010 +0000 + + [core] Ensure newly-created entries can never be inserted if they + have an ID + + It should not be possible to use gdata_service_insert_entry() on + an entry + created by the program which has an ID. + +M gdata/gdata-entry.c + +commit db1a1bdf07bb09ab6b59fc94872c87d67b0c841e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 25 13:10:22 2010 +0000 + + [docs] Small function link fix + +M gdata/gdata-entry.c + +commit 9b868119b6168dc1af26713a2be57f045db58482 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 25 12:54:12 2010 +0000 + + [core] Removed unnecessary *_GET_PRIVATE macros everywhere + +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/exif/gdata-exif-tags.c +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/gdata-access-rule.c +M gdata/gdata-download-stream.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/gdata-query.c +M gdata/gdata-service.c +M gdata/gdata-upload-stream.c +M gdata/georss/gdata-georss-where.c +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-feed.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/youtube/gdata-youtube-content.c +M gdata/services/youtube/gdata-youtube-control.c +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 8b64cfab781063e08432294786beb2ad433e4f58 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 25 00:27:06 2010 +0000 + + [picasaweb] Add functions to get album and file IDs + + Add gdata_picasaweb_album_get_id() and gdata_picasaweb_file_get_id() + to get + the forms of ID which were previously (incorrectly) returned by + gdata_entry_get_id() for the two classes. + +M docs/reference/gdata-sections.txt +M gdata/gdata-parsable.c +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/tests/picasaweb.c + +commit 469f55d88d624252641aeb76b6703a208b740c8b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 24 23:35:49 2010 +0000 + + [core] Add namespace checks to all parse_xml() functions + + This should (theoretically, though untested) speed up parsing a + little, since + whole chunks of unrelated elements can now be skipped at once in + the search + for the right element. + + Important: these changes accidentally fix the behaviour of + gdata_entry_get_id() for #GDataPicasaWebAlbum, which was returning + incorrect + results before. Any applications which depend on the broken behaviour + should + be updated to deal with the correct form IDs (i.e. URIs), or use a new + gdata_picasaweb_album_get_id() function which will be added shortly. + +M gdata/atom/gdata-author.c +M gdata/exif/gdata-exif-tags.c +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-when.c +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/georss/gdata-georss-where.c +M gdata/media/gdata-media-group.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-feed.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-feed.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/youtube/gdata-youtube-control.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/picasaweb.c + +commit 5c64f9db5a20fd4967a8e2190c9a719a1e04360e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 24 21:44:27 2010 +0000 + + [core] Move all GTimeVal parsing into a single function + +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-private.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/youtube/gdata-youtube-group.c + +commit 078e7bda419b5320d55c8d24ec80c545451f5bb1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 24 00:50:48 2010 +0000 + + [core] Tidy up some objects' parsing methods + +M gdata/atom/gdata-author.c +M gdata/atom/gdata-generator.c +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-credit.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-video.c + +commit c18152c862c7311c21293a6840ef8e20a77daa6a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 23 16:40:53 2010 +0000 + + [core] Move all element object parsing into two functions + +M docs/reference/gdata-sections.txt +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-when.h +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata.symbols +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-group.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/youtube/gdata-youtube-control.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/general.c + +commit 39c746ad78870a34dceec15a1775a6df3e3476d4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 23 00:19:47 2010 +0000 + + [core] Move all element string content parsing into one function + +M gdata/atom/gdata-author.c +M gdata/exif/gdata-exif-tags.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gdata-feed.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-group.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/youtube/gdata-youtube-group.c + +commit 3d42629c55cdaef4901d7cb343e3696a87d12030 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 22 21:55:47 2010 +0000 + + [core] Move all boolean property parsing into one function + +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/media/gdata-media-content.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-entry.c + +commit e33b3cf397ad635b47bb76f3d9ca00960df5b3de +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Wed Mar 24 14:28:41 2010 +0100 + + Updated Hungarian translation + +M po/hu.po + +commit bcccfa9dc3a3be7af3766daaac8989e79bc71a17 +Author: Bruno Brouard <annoa.b@gmail.com> +Date: Tue Mar 23 14:25:56 2010 +0100 + + Updated French translation + +M po/fr.po + +commit f749f3e6f351942a59211ce396d350164e6dd284 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 22 18:43:26 2010 +0000 + + [core] Constify GTimeVals and GDataColors where possible + + Add const attributes to add GTimeVals and GDataColors where they're + used + unmodified by a function. + +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-when.h +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-types.c +M gdata/gdata-types.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit 18831e7d65157a9f568b122b0411b3362c4f0f56 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 22 18:27:14 2010 +0000 + + [build] Add missing includes to gdata.h + +M gdata/gdata.h + +commit a739a08ba28fae9f6c38bf085e30e5b0fe25acf8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 22 18:16:12 2010 +0000 + + [docs] Added missing Since tags + +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-link.c +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-im-address.h +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-phone-number.h +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-postal-address.h +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-when.h +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-where.h +M gdata/gd/gdata-gd-who.c +M gdata/gd/gdata-gd-who.h +M gdata/gdata-access-handler.c +M gdata/gdata-access-rule.c +M gdata/gdata-parsable.c +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-content.h +M gdata/media/gdata-media-credit.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h +M gdata/services/documents/gdata-documents-feed.c +M gdata/services/documents/gdata-documents-folder.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-feed.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/youtube/gdata-youtube-content.c +M gdata/services/youtube/gdata-youtube-content.h +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-credit.h +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 6a5d3da539dbf124f6a795fc2b74ee82647b91a2 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Mon Mar 22 18:51:08 2010 +0100 + + Updated Spanish translation + +M po/es.po + +commit b1d21ba9a34aba333e2e737e2de30453e7107831 +Author: Christian.Kirbach <Christian.Kirbach@googlemail.com> +Date: Mon Mar 22 18:42:03 2010 +0100 + + Updated German translation + +M po/de.po + +commit b6092c7c204c1814d2d27488d70bd647612bbf47 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Mon Mar 22 18:20:15 2010 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit 1f1c5566c27b697c4f6e623e875f6feb919dae36 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 22 16:59:44 2010 +0000 + + [gd] Ensure comparisons of two NULL values return 0 + + Add test cases too. + +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/tests/general.c + +commit d40afb3d5c2df1c41bcbce11773a7be90bbad781 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 22 16:50:33 2010 +0000 + + [documents] Fix gcc printf format warning message + +M gdata/services/documents/gdata-documents-service.c + +commit c6f00c3f92ab4d51fb740f28a6d77221b468b4be +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 22 16:47:09 2010 +0000 + + [docs] Fix various documentation errors + + Fix various small documentation errors (generally broken links + and typos) + and add documentation for the properties in #GDataEntry. + +M gdata/gd/gdata-gd-who.c +M gdata/gdata-entry.c +M gdata/gdata-service.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/youtube/gdata-youtube-service.h + +commit bb89e0f9bedd0deec4c7ebd289de9cc46b172664 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 22 00:16:53 2010 +0000 + + [picasaweb] Fix casting + +M gdata/services/picasaweb/gdata-picasaweb-query.c + +commit 4cd13d3423b3f408bd3ed9b00704906bbb627273 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 22 00:12:07 2010 +0000 + + Ensure GDataYouTubeService's parse_error_response always sets an error + + Ensure #GDataYouTubeService's parse_error_response() always sets + an error + before returning; there was a case where it wouldn't if the server's + response + was completely unparsable. This could've caused the crash in + bgo#613529. + +M gdata/services/youtube/gdata-youtube-service.c + +commit 516f791014459a423930569edca0b470ded62473 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Mar 21 23:29:32 2010 +0000 + + Bug 613529 — Sending ETag with modified query + + Ensure #GDataQuery:etag is unset after any property of a query + is changed. + This ensures that if a single query instance is reused for multiple + queries + (as in Totem's YouTube plugin), there's no chance that the server + could + unexpectedly return an "unchanged" status. Closes: bgo#613529 + +M gdata/gdata-query.c +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/documents/gdata-documents-query.c +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/youtube/gdata-youtube-query.c +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/general.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 30425800e825d9d2d1a4525ad7d5c69fbcf3a2bb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Mar 21 20:07:48 2010 +0000 + + [docs] Added missing PicasaWeb class pages to the documentation + +M docs/reference/gdata-docs.xml + +commit dba66e7a0da3454cb7e7dac206c4469100e496e7 +Author: Takayuki KUSANO <AE5T-KSN@asahi-net.or.jp> +Date: Sat Mar 20 19:18:54 2010 +0900 + + Updated Japanese translation. + Merged with Nishio Futoshi's translation downloaded from + http://developer.momonga-linux.org/viewvc/pkgs/trunk/pkgs/libgdata/ja.po?view=log + +M po/ja.po + +commit 9fd77968057abc845bd4ee029fa95241cbf67508 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 19 15:54:38 2010 +0000 + + [core] Catch HTTP 412 errors as version mismatches + +M gdata/gdata-service.c + +commit 7644d2d821e10a4d5b94841e18d0a8cb88a48eb7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 19 15:18:54 2010 +0000 + + [gd] Reject empty strings from GDataGDPostalAddress' properties + +M gdata/gd/gdata-gd-postal-address.c + +commit a49dadd3890aee1ce51c918f2b54afb9b5c5b3a9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 19 15:12:22 2010 +0000 + + [contacts] Add the kind category to new GDataContactsContacts + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/tests/contacts.c + +commit 4aa89019908b1c6c951ffa5695e6678b6f2c8b52 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 19 14:03:54 2010 +0000 + + [contacts] Add gdata_contacts_contact_set_name() + + Make the #GDataContactsContact:name object writeable, instead + of making + people change the properties of the singleton GDataGDName. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/tests/contacts.c + +commit e29b4b724a3ebed858f3721d7a6e9f669fa11da9 +Author: Leonid Kanter <leon@asplinux.ru> +Date: Thu Mar 18 08:45:39 2010 +0200 + + Added Russian translation + +M po/LINGUAS +A po/ru.po + +commit 64bafaf44305d77567e292769e5b3a33a3f3e372 +Author: Inaki Larranaga Murgoitio <dooteo@zundan.com> +Date: Mon Mar 15 18:55:42 2010 +0100 + + Updated Basque language + +M po/eu.po + +commit 57df327231a48bb7a92e2c0d01393d7a8b2fac7b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 10 22:36:12 2010 +0000 + + Parse new format YouTube URIs + + Extend gdata_youtube_video_get_video_id_from_uri() to deal with + the new + format URIs introduced recently: + http://apiblog.youtube.com/2010/03/upcoming-change-to-youtube-video-page.html + +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/youtube.c + +commit aac0586ca01463dce55f2a1a123ff4f8e3fb217c +Author: Piotr Drąg <piotrdrag@gmail.com> +Date: Mon Mar 8 12:18:41 2010 +0100 + + Updated Polish translation + +M po/pl.po + +commit 745a59088cb0070ef3f5729ab62aa70e6d2487d3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Mar 7 22:23:12 2010 +0000 + + Bug 610948 — Improve access control support + + Remove the gdata_youtube_video_[get|set]_no_embed() functions + and replace + them with gdata_youtube_video_[get|set]_access_control(), + GDataYouTubeAction + and GDataYouTubePermission. This allows more permissions to be set on + YouTube videos, using their new permissions system. Closes: bgo#610948 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/youtube.c + +commit 41ba653f9fdaa44b81b591183a67898791eb1821 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Mar 7 21:09:51 2010 +0000 + + Bug 605699 — Add packet capture to test suite + + Add a LIBGDATA_DEBUG environment variable which allows setting + the debug + output level (from none, through messages and headers, to full network + logging). This variable is now used in the test suite, so that + output from + test programs can be piped to a log file and the network traces + analysed + later. + + The network logging uses libsoup's inbuilt logging facilities. + Closes: bgo#605699 + +M README +M docs/reference/gdata-docs.xml +A docs/reference/gdata-running.xml +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/tests/Makefile.am +M gdata/tests/calendar.c +C065 gdata/tests/common.h gdata/tests/common.c +M gdata/tests/common.h +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/general.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 69adbb8d33b4621ca1e1151e0819921039bf1c32 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Feb 18 12:55:20 2010 +0000 + + Bug 610273 — Fails to build without a system-wide libtool + + Fix the introspection build if a system-wide libtool isn't available. + Closes: bgo#610273 + +M Makefile.am + +commit c9966fde521542155062063f7b1d460d8e03ddae +Author: Aron Xu <aronxu@gnome.org> +Date: Tue Feb 16 09:55:31 2010 +0800 + + Update Simplified Chinese translation. + +M po/zh_CN.po + +commit 4e12a47186ebb6d9dbfe3285719ff9b7a8922cdc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Feb 15 17:46:47 2010 +0000 + + Updated British English translation + +M po/en_GB.po + +commit 43b43d55c9261b0ea838211ab6dceda0371433d6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Feb 15 17:45:16 2010 +0000 + + Bug 610007 — libgdata introspection support requires installed + libgdata.pc + + Fix the introspection build for a previously-non-installed libgdata. + Closes: bgo#610007 + +M Makefile.am + +commit 44f5093b69e5cad672564e3e21bb249c0a968251 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Feb 14 20:42:21 2010 +0000 + + [build] Increment version to 0.7.0 + +M configure.ac + +commit 85ecd4493e289a89d6039682e2f5f633628ea4e4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Feb 14 20:35:51 2010 +0000 + + Release version 0.6.0 + +M Makefile.am +M NEWS +M configure.ac + +commit d7aa66ba69788fd90ef2738f0f3dfb3d64bdf66e +Author: Julien Hardelin <jm.hard@wanadoo.fr> +Date: Mon Feb 8 22:17:13 2010 +0100 + + Updated French translation + +M po/fr.po + +commit 1655f211611b3d77650b26d59f6fdf3aa3dacc9f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 31 14:07:15 2010 +0000 + + [docs] Tidy up service propagation in documents tests + +M gdata/tests/documents.c + +commit fec244fd5e1693d8d60893be25e64fb6c575c64b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 31 14:03:12 2010 +0000 + + [core] Consolidate generic errors + + Consolidate the GDATA_SERVICE_ERROR_WITH_* generic errors, and convert + everything to use GDATA_SERVICE_ERROR_PROTOCOL_ERROR instead. This + is an API + break, as the old errors have now been removed. + +M docs/reference/gdata-sections.txt +M gdata/gdata-access-handler.c +M gdata/gdata-download-stream.c +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata-upload-stream.c +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/services/youtube/gdata-youtube-service.c + +commit 4e82deebe019dcab1e6f470ad7d9c3ad964c0692 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jan 30 20:15:57 2010 +0000 + + [build] Remove INSTALL file + + Remove the INSTALL file, as it's generated by autofoo. + +D INSTALL + +commit 8f41511b3d8dd02a7f7eaf4284d8223803300aa0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jan 30 20:14:36 2010 +0000 + + [build] Use API version for GIR file + + Add an API version variable (currently set to 0.0) for the GIR + filename, + rather than using the release version. The library itself will have + the API + version appended to the name when we reach API version 1.0. + +M Makefile.am +M configure.ac + +commit d39736dbc915a83c8ea687f714eb58ea61caa224 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jan 26 13:40:42 2010 +0000 + + [build] Modernise configure.ac + + Don't use deprecated Autoconf macros any more. + See: http://live.gnome.org/GnomeGoals/ModernAutotools + +M configure.ac +M libgdata.doap + +commit 8314ebcd5a4826aba1c1bc2e1c2f4c43afa40a33 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jan 25 15:42:54 2010 +0000 + + [general] Remove unnecessary g_object_notify() calls + + There's no need to notify of property changes during XML parsing, + as the + initial object state received from the server should be consistent. If + it + isn't, it's either a bug at Google's end, or a new addition to the + API which + libgdata shouldn't preempt. + +M gdata/gd/gdata-gd-name.c +M gdata/gdata-entry.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-video.c + +commit afd50ddc91bcd4a9cb1da17181f1f2e6658eb0ec +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jan 25 15:15:08 2010 +0000 + + [gd] Make string parsing UTF-8–safe + + Make the various small bits of string parsing/handling (which all + occur in + the GData code) UTF-8 safe, and add some test cases. + +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/tests/general.c + +commit 62fafe938a1dd03d763de1068d69495b3e219ba4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 24 17:18:55 2010 +0000 + + [tests] Add performance and callgrind tests + + Add perf and callgrind tests, and add the perf test to the test suite. + Add some more alloc-fns to the massif test case. + +M gdata/tests/Makefile.am +A gdata/tests/callgrind +M gdata/tests/massif +A gdata/tests/perf.c + +commit 6f3e933edf2d7538a65de14f10476776d92795c1 +Author: Aron Xu <aronxu@gnome.org> +Date: Sun Jan 24 14:54:50 2010 +0800 + + Add Simplified Chinese translation. + +M po/LINGUAS +A po/zh_CN.po + +commit 59fa2910237997073f8aa5eea0a5e02bc7ebf4ec +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jan 22 23:59:58 2010 +0000 + + [core] Fix memory leaks + + Fix a few memory leaks, including a fairly large one which would + leak the + entire XML parse tree for each GDataParsable. + +M gdata/atom/gdata-link.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gdata-access-rule.c +M gdata/gdata-parsable.c +M gdata/tests/memcheck + +commit 998f434ae52f82e4fcf81bc889069407b81941b6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jan 22 23:12:44 2010 +0000 + + [core] Use GLib memory functions with libxml2 + + Set the libxml2 memory allocation functions to be the GLib ones, + allowing + us to free libxml2's memory with g_free(), meaning all return + values from + libxml2 functions no longer have to be marshalled into the GLib memory + pool. This saves lots of string duplication. + + Some statistics: + * g_strdup() calls before: 223; after: 170 + * xmlFree() calls before: 296; after: 179 + + This only (apparently) gives a 2% decrease in memory usage according + to + tests/memory, but it's better than nothing. + +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/exif/gdata-exif-tags.c +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-name.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/gdata-service.h +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-feed.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-user.c +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/general.c + +commit 29566e6d895aab227854bd279b26466aae31a663 +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Fri Jan 22 01:50:02 2010 +0100 + + Updated Hungarian translation + +M po/hu.po + +commit 45f641673c3536f65f54d241c526132975617483 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jan 21 22:36:32 2010 +0000 + + [gd] Add support for e-mail display names and organization locations + + Add support for e-mail address display names, and divination of + the location + of organizations. This adds the following API: + * gdata_gd_organization_get_location + * gdata_gd_organization_set_location + * gdata_gd_email_address_get_display_name + * gdata_gd_email_address_set_display_name + Full documentation and test coverage is included. + +M docs/reference/gdata-sections.txt +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/gdata.symbols +M gdata/tests/general.c + +commit c8ccb796d7d4116d65d62fbb379d339655ff48df +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jan 21 21:30:16 2010 +0000 + + [core] Improve GDataEntry, GDataFeed and GDataAccessHandler test + coverage + + Improve the test coverage for those three classes, which necessitates + allowing GDataFeeds to be parsed from XML. + +M gdata/gdata-access-handler.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/gdata-service.c +M gdata/tests/general.c + +commit 03865e0ba1f998c6b3ce072545254d21da2e9d87 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jan 21 15:06:38 2010 +0000 + + Bug 607607 — Undefined symbol with introspection + + Fix introspection support. Closes: bgo#607607 + +M Makefile.am + +commit 6ce5aa368cdab2f885d8d99f9bebd3b735fb2fcd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jan 20 21:09:11 2010 +0000 + + [gd] Update documentation links + + Update the documentation links to point to the version of the GData + specification which is implemented (2.0, whereas it used to be 1.0), + and fix + a few small documentation bugs for the gd namespace. + +M docs/reference/gdata-docs.xml +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c + +commit a61f3c360cb0fcd4340cb468109b6ab212245690 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jan 20 20:54:46 2010 +0000 + + [youtube] Convert YouTube video uploading to use GDataUploadStream + + Convert gdata_youtube_service_upload_video() to use GDataUploadStream, + which + should lower memory consumption (by using streaming I/O) and ease + maintenance. + +M gdata/services/documents/gdata-documents-service.c +M gdata/services/youtube/gdata-youtube-service.c + +commit d04760535609c38ab2b53316f65995a235eaa0ea +Author: António Lima <amrlima@gmail.com> +Date: Mon Jan 18 01:42:54 2010 +0000 + + Updated Portuguese translation + +M po/pt.po + +commit 77c94bf6d165db7e3c2f85b714e6955f9f410bba +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jan 18 00:01:26 2010 +0000 + + [core] Use HTTPS URIs wherever possible + + Use HTTPS request URIs wherever services support them, as sensitive + data + could potentially be transmitted. So far, only the Calendar, + Contacts and + PicasaWeb services support HTTPS. + + If the LIBGDATA_FORCE_HTTP environment variable is defined, all + requests + (except authentication requests, which must always be HTTPS) will + be forced + to be HTTP, for debugging purposes. + +M README +M gdata/atom/gdata-link.c +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-text.c +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit 06ca3389099f3dee7b68a49ca5d18d39208d32fe +Author: Richard Schwarting <rschwart@src.gnome.org> +Date: Tue Jan 12 12:44:58 2010 -0500 + + Bug 598748 — *_download_document prevents non-overwriting saving + into directories + + Make _gdata_documents_entry_download_document rely on + _gdata_download_stream_find_destination to allow saving into + directories + without the overwrite flag. Closes: bgo#598748 + +M gdata/services/documents/gdata-documents-entry.c + +commit 7a9683604b48ddc1d369d0943f4f50db1ab697ca +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jan 12 12:38:02 2010 +0000 + + [docs] Small XML validity cleanups + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-overview.xml + +commit 6a0294a5ec0c70f492887f96d1357bb239bca18e +Author: Petr Kovar <pknbe@volny.cz> +Date: Tue Jan 12 00:28:04 2010 +0100 + + Add Czech translation by Marek Cernocky and Petr Kovar + +M po/LINGUAS +A po/cs.po + +commit 71ffb8912ef4a8cdaa5bec0334c837c9f46258e0 +Author: Daniel Nylander <po@danielnylander.se> +Date: Sun Jan 10 11:59:10 2010 +0100 + + Updated Swedish translation + +M po/sv.po + +commit 60a9e07c58dab8124044d30cfa401bcefc3cf55c +Author: Fran Dieguez <fran.dieguez@glug.es> +Date: Fri Jan 8 17:57:52 2010 +0100 + + Updated Galician Translation + +M po/gl.po + +commit 9a386001d802eca9075253c868696dac5b67ef22 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 3 13:17:30 2010 +0000 + + [build] Remove intltool scripts, introspection.m4, and rename + COPYING.LIB + + Remove mention of the intltool scripts from the Makefile, since + intltool >= 0.40.0 doesn't require them to be in-tree. Rename + COPYING.LIB to + COPYING to be more standardised, and remove introspection.m4 from + the tree + since it too can be installed system-wide. + +R100 COPYING.LIB COPYING +M Makefile.am +M autogen.sh +M configure.ac +D introspection.m4 + +commit 53c12f5b14e785e6cfa6a21d72d40c1e4e741d89 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Fri Jan 1 10:38:07 2010 +0100 + + Updated Slovenian translation + +M po/sl.po + +commit aaa3e476fa978a308d6873c2998d5020f845b782 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Dec 30 11:27:40 2009 +0000 + + [atom] Extend Atom tests to give complete coverage + + Extend the Atom test suite to give over 97% code coverage, and fix + a few + buglets in the process. + +M Makefile.am +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/gdata-parser.c +M gdata/tests/general.c + +commit c1c5fba2869847a30558130defeff6eda0c470e1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 29 20:46:22 2009 +0000 + + [build] Limit gcov profiling to the library itself + + Profiling was being done on the documentation scanner and test + files before, + which was less than desirable. Now only the main libgdata library + is compiled + with profiling support if it's enabled. + +M Makefile.am +M configure.ac + +commit 023e14a4cd33561209ba6148ff02a99cedb1073c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 29 17:19:57 2009 +0000 + + [contacts] Improved test coverage and fixed a few small bugs + + Improved the test coverage of the Google Contacts service, and + consequently + fixed a few small bugs, such as some uninitialised timestamps and + incorrect + signal names. This takes our overall test coverage up to about + 60%, not + including the Google Documents code. + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/tests/contacts.c + +commit 8eec98b6bb8ab6171e0fd13e1b56febd17a1e8de +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 29 01:06:21 2009 +0000 + + [tests] Fixed problems with types of data test functions + +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/documents.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 08ec075dd645934d1d81bffd61ff17196411495b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 29 00:23:51 2009 +0000 + + [docs] Fixed some gtk-doc warnings + +M gdata/exif/gdata-exif-tags.c +M gdata/gdata-buffer.c +M gdata/georss/gdata-georss-where.c +M gdata/media/gdata-media-group.c +M gdata/services/youtube/gdata-youtube-control.c +M gdata/services/youtube/gdata-youtube-group.c + +commit b96db0bf51ea05fed6ddec5af41d39add634d651 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Dec 29 00:18:36 2009 +0000 + + [build] Update git.mk and .gitignore generation + + Update our copy of git.mk from Pango and fix up some problems with + .gitignore + generation. + +M Makefile.am +M git.mk + +commit 30728e6de85c13f3839e36a7bc4c92551a3c9a25 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 20 22:53:21 2009 +0100 + + [build] Reorganised to use non-recursive automake and added gcov + support + + Reorganised to use non-recursive automake for everything except API + documentation and translations. As a consequence of this + reorganisation, two + private header files which were mistakenly installed before are + no longer + installed (this will not be considered an API break). The + introspection and + gtester include files have been updated. + + Support for code coverage checking for the test suite has been + added too, + using gcov. It can be invoked by `make gcov`, and will output a + file called + "gcov-report.txt" in the main source directory with the results of the + checks. + +M INSTALL +M Makefile.am +M configure.ac +M docs/reference/Makefile.am +D gdata/Makefile.am +D gdata/atom/Makefile.am +D gdata/exif/Makefile.am +D gdata/gd/Makefile.am +D gdata/georss/Makefile.am +D gdata/media/Makefile.am +D gdata/services/Makefile.am +D gdata/services/calendar/Makefile.am +D gdata/services/contacts/Makefile.am +D gdata/services/documents/Makefile.am +D gdata/services/picasaweb/Makefile.am +D gdata/services/youtube/Makefile.am +M gdata/tests/Makefile.am +M gdata/tests/documents.c +R092 Makefile.decl gtester.mk +M introspection.m4 + +commit ab9dc1cc20a61895f6d674018de3ade6cc515108 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 28 11:59:47 2009 +0000 + + [tests] Fix deletion of directories for PicasaWeb tests + +M gdata/tests/picasaweb.c + +commit 18fbd9320e49fe84f52fd411cbe018705a4023fa +Author: Rita Bandiera <rbandiera@email.it> +Date: Sat Dec 26 12:13:46 2009 +0100 + + Added Italian translation + Updated LINGUAS file + +M po/LINGUAS +A po/it.po + +commit 8881cf269c56c13bb6b2b79c3e5030050733093e +Author: Richard Schwarting <rschwart@src.gnome.org> +Date: Wed Dec 16 22:29:05 2009 +0000 + + Bug 601919 — Expand a comment, organise some media tests + + Closes: bgo#601919 + +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/tests/picasaweb.c + +commit 1c4d9fc24ad8a1f1c91b028811335ea398ed4048 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Dec 13 12:44:08 2009 +0000 + + [build] Tidy up build messages + + Remove an EXTRA_DIST warning message and quieten the introspection + build + messages. + +M gdata/Makefile.am +M gdata/tests/Makefile.am + +commit 031c67f23c171f98147a1f128b97ba20e237f22e +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Sun Dec 13 09:42:37 2009 +0100 + + Updated Spanish translation + +M po/es.po + +commit 1f2d46eaa957ddc3d70e5e12d0f2e2b48de6ec23 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Fri Dec 11 17:04:49 2009 +0100 + + Updated German translation + +M po/de.po + +commit fa135b0da0df85f751af84d136cce9a68e707a23 +Author: Richard Schwarting <rschwart@src.gnome.org> +Date: Fri Dec 11 11:27:45 2009 +1300 + + Bug 604313 — Test failures in 0.5.1 + + Google increased # of photos per album (hurrah), so update the tests + to something a little more robust. Closes: bgo#604313 + +M gdata/tests/picasaweb.c + +commit 79ab76ca03644618ec3d26c8d3e9642ba19f835e +Author: Richard Schwarting <rschwart@src.gnome.org> +Date: Sat Dec 12 01:30:16 2009 +1300 + + Bug 600262 — Add async PicasaWeb upload API + + Add an asynchronous file upload API to the PicasaWeb service. + Closes: bgo#600262 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/picasaweb.c + +commit 0c72c53de8cf5a85124d298e4c350fde3566e577 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Dec 7 15:31:57 2009 +0000 + + [tests] Fix GdkPixbuf declaration for non-installed GDK+ headers + +M gdata/tests/picasaweb.c + +commit cf9d6021e4e46d0d169a6c15fc25e18e14f3a5fb +Author: Richard Schwarting <rschwart@src.gnome.org> +Date: Sun Dec 6 18:03:05 2009 +1300 + + Bug 598913 - Add gdata_picasaweb_service_insert_album() + + Add an API to facilitate the creation of new PicasaWeb albums + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/picasaweb.c + +commit efc38812b658cf56f4141aa59dd1639b1430adde +Author: Richard Schwarting <rschwart@src.gnome.org> +Date: Sun Dec 6 17:46:07 2009 +1300 + + Bug 598649 — Download API for PicasaWeb images and thumbnails + + Add download APIs and infrastructure for GDataMedia and GDataThumbnail + +M configure.ac +M docs/reference/gdata-sections.txt +M gdata/gdata-download-stream.c +M gdata/gdata-private.h +M gdata/gdata.symbols +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-content.h +M gdata/media/gdata-media-thumbnail.c +M gdata/media/gdata-media-thumbnail.h +M gdata/tests/Makefile.am +M gdata/tests/picasaweb.c + +commit a3ad67db38082514cc85891df305369b3ba7ed98 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Dec 3 14:26:42 2009 +0000 + + Add GObject introspection support + + Add basic GObject introspection support for the library. None of + the GIR file + has been checked, and no annotations have been added yet. + +M Makefile.am +M configure.ac +M gdata/Makefile.am +A introspection.m4 + +commit f696772dfb63dbb9e032e8f0de5dde958354eef2 +Author: Djavan Fagundes <dnoway@gmail.com> +Date: Fri Nov 27 08:44:43 2009 -0200 + + Updated Brazilian Portuguese translation + +M po/pt_BR.po + +commit 84764e2042a8c51dcff4eccb4dd41e373302f42e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Nov 22 16:19:22 2009 +0000 + + Properly encode Unicode characters in query URIs + + Previously, Unicode characters would just be left in query URIs + unchanged. Google's servers don't like this, and tend to return empty + result sets (but without errors), so we should escape Unicode + characters + too. See: bgo#602497 + +M gdata/gdata-access-handler.c +M gdata/gdata-query.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/documents/gdata-documents-query.c +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/youtube/gdata-youtube-query.c +M gdata/tests/general.c + +commit 35a970c145c0390c6cbd663b7d04f515901cd2fc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Nov 17 12:46:39 2009 +0000 + + Bug 602156 — GDataUploadStream should close GOutputStream on dispose + + Close the GOutputStream before disposing private data for + GDataUploadStream which could be referenced by threaded code + called when + the upload is cancelled. Closes: bgo#602156 + +M gdata/gdata-upload-stream.c + +commit 15b567f35c5886301d5a07119bbb30b464ba2fc1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Nov 17 12:54:41 2009 +0000 + + Properly catch splice errors when uploading PicasaWeb files + + Use a known-existing child error instead of a potentially NULL + passed-in + error to detect whether splicing on upload failed. + +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit 9ed1ad613bd5d72d83139a1e851cacc2913b491d +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Fri Nov 13 12:08:35 2009 +0100 + + Added sl for Slovenian translation + +M po/LINGUAS + +commit 97a50f1ac9803ee1e18e432f967f0b7e51afaf99 +Author: Matej Urbančič <mateju@svn.gnome.org> +Date: Fri Nov 13 12:08:17 2009 +0100 + + Updated Slovenian translation + +A po/sl.po + +commit 8c397d328427ad0d2fb6a6cf1b08bbee23a6488e +Author: Daniel Nylander <po@danielnylander.se> +Date: Fri Oct 30 18:28:38 2009 +0100 + + Updated Swedish translation + +M po/sv.po + +commit 4ce8c2324106172d603ed3dabd44d18f8db5dac3 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Wed Oct 28 00:03:47 2009 +0100 + + Updated Spanish translation + +M po/es.po + +commit 857aebe4fe01a2c7174a9b5345754ea536a4279d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 26 21:36:53 2009 +0000 + + [youtube] Remove gdata_youtube_video_[get|set]_title + + They were duplicating the atom:title (accessible via + gdata_entry_[get|set]_title). + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/youtube.c + +commit 791711972c658d1aca0cddda8077bf7471adb6cd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 26 21:14:02 2009 +0000 + + Bug 579885 — Add code examples to documentation + + Added a code example for GDataYouTubeVideo. Helps: bgo#579885 + +M gdata/services/youtube/gdata-youtube-video.c + +commit 7cb98b535d40adf3d2016c5d72e344a4f11c5ec4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 26 20:39:40 2009 +0000 + + [picasaweb] Add missing User and Feed files + +A gdata/services/picasaweb/gdata-picasaweb-feed.c +A gdata/services/picasaweb/gdata-picasaweb-feed.h +A gdata/services/picasaweb/gdata-picasaweb-user.c +A gdata/services/picasaweb/gdata-picasaweb-user.h + +commit 66eaf1948c1d4c38482c37b0b8cd1cd89f65d0a9 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Sun Oct 25 15:34:23 2009 +0000 + + Bug 598913 — Add gdata_picasaweb_service_insert_album() + + Remove API bloat in GDataPicasaWebAlbum: *_get_name and + *_[get|set]_description are now gone. Helps: bgo#598913 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/tests/picasaweb.c + +commit bc738bcb272a815b58ae1d6202587a57c39120e0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Oct 25 15:11:02 2009 +0000 + + [picasaweb] Handle testing of album and photo timestamps + + Album and photo timestamps needed testing after being added + previously, + which requires the use of a regex in the testing suite, since the time + can change between building the expected XML string and the actual + one. + +M gdata/tests/picasaweb.c + +commit 68b774ab2134e311cd564139aa899d8fe8ecbb65 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Sun Oct 25 14:46:23 2009 +0000 + + Bug 589858 — Handle gphoto XML elements found in 'GDataFeed' + + Adds a GDataPicasaWebUser, which exposes information about each + registered user on PicasaWeb, queryable from the PicasaWeb + service. The + patch also suppresses gphoto XML elements on PicasaWeb feeds, since + they duplicate data available in other, better places. + Closes: bgo#589858 + +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/picasaweb/Makefile.am +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/picasaweb.c + +commit 4fca63c8e23ba788506f834228ff18ec1c8f152e +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Sat Oct 24 10:44:51 2009 +0100 + + Bug 599140 — Have albums initialise date to now by default + + Both albums and files now initialise their timestamps to the current + date, rather than the Unix epoch. Closes: bgo#599140 + +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c + +commit aed5482aa90d17e3c0ac9110b72dd19f79a2df17 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Sat Oct 24 10:40:00 2009 +0100 + + Bug 598893 — gdata_picasaweb_album_new doesn't set a valid + visibility + + Set GDataPicasaWebAlbum:visibility to private when creating a + new album. + Closes: bgo#598893 + +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/tests/picasaweb.c + +commit 3f9f7050ffaebc2b0b476997a0e063108b0c6f52 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Mon Oct 19 16:56:30 2009 +0100 + + Bug 598912 — Test data was changed by my mucking around with + comments + +M gdata/tests/picasaweb.c + +commit 7c342e241e7ccd581b28292b81b38d77c1d3b35e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Oct 19 16:53:57 2009 +0100 + + Bug 598910 — Timestamp bug + + Fixes incorrect usage of GTimeVal.tv_usec as milliseconds in the + PicasaWeb backend and in GDataGDWhen. Closes: bgo#598910. + +M gdata/gd/gdata-gd-when.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c + +commit f4550a6eccb918402cad18e49b64ed1006c1a07f +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Mon Oct 19 16:07:37 2009 +0100 + + Bug 598746 — gdata_picasaweb_query_set_image_size documentation fix + + Fixes the claim that set_image_size can deal with lists (it can't). + Closes: bgo#598746. + +M gdata/services/picasaweb/gdata-picasaweb-query.c + +commit ef2cdd8fe96a659cf8b764eae157f571e3b60887 +Author: Og B. Maciel <ogmaciel@gnome.org> +Date: Sun Oct 18 16:01:38 2009 -0400 + + Updated Brazilian Portuguese translation. + +M po/pt_BR.po + +commit ccadb2688bfcb05d422be4a06ce1060d0faa82f0 +Author: Takeshi AIHANA <takeshi.aihana@gmail.com> +Date: Mon Oct 12 18:47:02 2009 +0900 + + 2009-10-12 Updated Japanese translation. + +M po/LINGUAS +A po/ja.po + +commit 9b08a9ae6140ac7398ae4fd87910f555f95600a0 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Thu Oct 8 22:45:49 2009 +0100 + + [picasaweb] Suppress gphoto:access on GDataPicasaWebFile + + Handle the gphoto:access element for files with a stub, such that a + warning isn't printed. Proper support will be added when individual + file + permissions are supported by PicasaWeb. Helps: bgo#589858 + +M gdata/services/picasaweb/gdata-picasaweb-file.c + +commit ceb151b4f8b80722516478a577297431eed056d9 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Thu Oct 8 22:43:42 2009 +0100 + + [core] Add support for atom:icon to GDataFeed + + Add support for the atom:icon element to GDataFeed. Helps: bgo#589858 + +M docs/reference/gdata-sections.txt +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata.symbols +M gdata/tests/picasaweb.c + +commit d55b48bb650ff31c31f1611a59dec3c5de3b9979 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Thu Oct 8 22:34:18 2009 +0100 + + Bug 597248 — Add gdata_picasaweb_query_new_with_limits + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-query.h +M gdata/tests/picasaweb.c + +commit 4e5c7e57d50d42c0db1fc4fc32eb2084873cefd7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Oct 7 20:39:27 2009 +0100 + + [build] Renamed configure.in to configure.ac for clarity + +M autogen.sh +R100 configure.in configure.ac + +commit 46c7fe5d5788375068f78df0172218288ab4e773 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Mon Sep 28 22:07:43 2009 +0200 + + Updated Spanish translation + +M po/es.po + +commit 5142ec1ebb59bf8cb58f25f09c52e2c43122dc91 +Author: Claude Paroz <claude@2xlibre.net> +Date: Mon Sep 21 22:12:36 2009 +0200 + + Updated French translation + +M po/fr.po + +commit 054d5eff2d480c7dc29cdd346a3c0129eb5bc5e0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Sep 21 09:13:22 2009 +0100 + + [build] Increment version to 0.6.0 + +M configure.in + +commit 4004971de98ccb8d6e16ea0e88f65c6f2c6be295 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Sep 21 09:12:38 2009 +0100 + + Release version 0.5.0 + +M NEWS +M configure.in + +commit 9faa7ae4d66e7814399e22fd7ff8da15087e9679 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Sep 21 08:28:40 2009 +0100 + + [youtube] Fix potential unref of NULL + + This fixes a crash when querying for a single video without a + GDataQuery. + +M gdata/services/youtube/gdata-youtube-service.c + +commit fb9db6f6edb1480b54e281a1f4de57e492b0dfd4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Sep 21 08:25:31 2009 +0100 + + [media] Corrected Media RSS namespace + +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-thumbnail.c +M gdata/tests/general.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit c7e34540485457acbe1db545ea042ce9c0f796d4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Sep 21 08:17:04 2009 +0100 + + [youtube] Fix test suite + + Includes a change to the upload URI for videos to upload them to the + default (i.e. logged in) user, rather than having us worry about + whether + to send a Google Account username or YouTube username. + +M gdata/services/youtube/gdata-youtube-service.c +M gdata/tests/youtube.c + +commit 23a0b740e6d25bff76497f6e2743e67e0e6845cd +Author: Daniel Nylander <po@danielnylander.se> +Date: Mon Sep 21 00:33:53 2009 +0200 + + Updated Swedish translation + +M po/sv.po + +commit 371e7789ff3cc7a07bc61c5224bab674d4702541 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Sun Sep 20 22:02:50 2009 +0200 + + Updated German translation + +M po/de.po + +commit f9b71dd217f973157b66a6de3b37e5424aef4bbc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Sep 20 19:11:19 2009 +0100 + + [media] Added tests for media:category, :content, :credit and + :thumbnail + +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-thumbnail.c +M gdata/tests/general.c + +commit 5c4bf2c42063b9a0fcbaabc0802e7162d4155450 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Sep 20 17:28:40 2009 +0100 + + [documents] Make upload_update_document() static + +M gdata/services/documents/gdata-documents-service.c + +commit 37d2830af877827a73ae9f68f49422b5c913a67c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Sep 20 17:20:13 2009 +0100 + + Bug 593336 — Query parameter "q=..." isn't valid for album kinds + + Also add checks in gdata_picasaweb_service_query_all_albums*() + to ensure + the q parameter isn't set, including a corresponding error code and a + test in the suite. Closes: bgo#593336 + +M gdata/gdata-service.h +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/tests/picasaweb.c + +commit d499901b4a689db1218beeae693498e947db4025 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Sep 20 17:05:05 2009 +0100 + + Bug 593336 — Query parameter "q=..." isn't valid for album kinds + + Add a few notes in the API documentation to say that the q parameter + isn't valid for album queries. Closes: bgo#593336 + +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/picasaweb/gdata-picasaweb-service.c + +commit d33b3aad55a94d35a6fe9dc31d714da89c57e59d +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Sat Sep 19 02:56:37 2009 +0200 + + Added Hungarian translation + +A po/hu.po + +commit d2c64a8ba1293b4a7db37b4e1061e472b8cd6f3d +Author: Gabor Kelemen <kelemeng@gnome.hu> +Date: Sat Sep 19 02:56:26 2009 +0200 + + Added hu to LINGUAS + +M po/LINGUAS + +commit 5e2f2effe7cae3506602e71e0afc473340a075b2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Sep 13 13:44:38 2009 +0100 + + Updated British English translation + +M po/en_GB.po + +commit 67f09aa52323bc8f5e7c9e5beab44e386d19db1d +Author: António Lima <amrlima@gmail.com> +Date: Wed Sep 9 23:51:20 2009 +0100 + + Updated Portuguese translation + +M po/LINGUAS +A po/pt.po + +commit 80898b2e3addc980dc38d424fd8cdb9a08ba5c49 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Fri Aug 28 16:48:32 2009 +0100 + + Bug 593239 — Use GDataUploadStream for uploading files + + Use GDataUploadStream in the PicasaWeb service to upload photos. This + also + now adds the appropriate kind category to entries when they're + uploaded (if + it hasn't already been added to the entry), and improves the upload + test case + so that the current timestamp is added to the description for + uploaded files, + allowing for easier inspection of files online to see whether + the tests + were successful. Closes: bgo#593239 + +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/picasaweb.c + +commit 9fffe702b9f39a850925e830d55cd2ca1bcfa3b9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Aug 28 16:45:44 2009 +0100 + + [core] Fix race condition when updating authentication details + + If a GDataService is destroyed before the + set_authentication_details_cb idle + callback is called, it will access freed memory. The authentication + process + now keeps a reference to the service until it has finished updating + the + service's authentication details. + +M gdata/gdata-service.c + +commit 38026d747eb9e26118885fc6ba83e3806c5cb21e +Author: Inaki Larranaga <dooteo@zundan.com> +Date: Fri Aug 28 16:50:34 2009 +0200 + + Added Basque translation + +M po/LINGUAS +A po/eu.po + +commit 71f5d8c88576ba98aee7b4ae1aa0abe68b42531d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Aug 28 15:28:03 2009 +0100 + + Bug 592845 — Undefined symbol: gdata_picasaweb_query_new_with_limits + + Remove gdata_picasaweb_query_new_with_limits from the symbol file, + since it + doesn't exist. Closes: bgo#592845 + +M gdata/gdata.symbols + +commit d9cc2f8b1c5a517190c758baa7b6c5aca64f045e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Aug 18 16:29:54 2009 +0100 + + Bug 592124 — G_LOG_DOMAIN not set for subdirectories + + Patch based on one from Thibault Saunier <saunierthibault@gmail.com> + to + add G_LOG_DOMAIN to the Makefiles of build subdirectories, to + ensure the + "libgdata" log domain is set for all messages emitted by the library. + Closes: bgo#592124 + +M gdata/atom/Makefile.am +M gdata/exif/Makefile.am +M gdata/gd/Makefile.am +M gdata/georss/Makefile.am +M gdata/media/Makefile.am +M gdata/services/calendar/Makefile.am +M gdata/services/contacts/Makefile.am +M gdata/services/documents/Makefile.am +M gdata/services/picasaweb/Makefile.am +M gdata/services/youtube/Makefile.am + +commit 90fdd19d607d5b232e5678d50150fc670b208e4c +Author: Thibault Saunier <saunierthibault@gmail.com> +Date: Tue Aug 18 16:17:45 2009 +0100 + + Bug 591691 — Getting a feed containing PDF documents returns NULL + +M gdata/services/documents/gdata-documents-feed.c + +commit 442d1b58a45ad46416ecdfd64e1a19571402d6b1 +Author: Thibault Saunier <saunierthibault@gmail.com> +Date: Mon Aug 17 18:14:29 2009 +0100 + + Bug 591974 — remove_document_from_folder moves documents to + the trash + +M gdata/services/documents/gdata-documents-service.c + +commit 047e5af9fbfe5b3dbd90a5cb28880cc1710499f2 +Author: Thibault Saunier <saunierthibault@gmail.com> +Date: Mon Aug 17 17:58:14 2009 +0100 + + Bug 591966 — Can't query single spreadsheets + +M gdata/services/documents/gdata-documents-service.c + +commit c00fa4b85f81ee572ea1d56941cf015aa3ca5add +Author: Fran Dieguez <fran.dieguez@glug.es> +Date: Mon Aug 17 15:27:16 2009 +0200 + + Updated Galician Translation + +M po/gl.po + +commit f7520786e67bc71ec29d1f5a0691b656026e131f +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Sat Aug 15 13:31:31 2009 +0200 + + Updated Spanish translation + +M po/es.po + +commit 714222b63b9a7b21ccb335019abc4062ce37cb01 +Author: Daniel Nylander <po@danielnylander.se> +Date: Fri Aug 14 10:01:38 2009 +0200 + + Updated Swedish translation + +M po/sv.po + +commit 31238b0ce7f199098f9ca40aa1cba94dc9b37dc3 +Author: Leonardo Ferreira Fontenelle <leonardof@gnome.org> +Date: Fri Aug 14 00:24:44 2009 -0300 + + Fixed typos in the Brazilian Portuguese translation. + + Thanks to Rodolfo Ribeiro Gomes for spoting them. + +M po/pt_BR.po + +commit d75811855d956b62b3d983e59553155c8ec9a071 +Author: Leonardo Ferreira Fontenelle <leonardof@gnome.org> +Date: Thu Aug 13 23:29:48 2009 -0300 + + Updated Brazilian Portuguese translation. + +M po/pt_BR.po + +commit ad8eb5ad901c1c1ad7ac35b054fd646ed7c768da +Author: Flamarion Jorge <jorge.flamarion@gmail.com> +Date: Thu Aug 13 22:39:46 2009 -0300 + + Added Brazilian Portuguese translation. + +M po/LINGUAS +A po/pt_BR.po + +commit 5fca748b86f46a67daa13e437fa14faf8af506c8 +Author: Piotr Drąg <piotrdrag@gmail.com> +Date: Thu Aug 13 15:51:48 2009 +0200 + + Added Polish translation + +M po/LINGUAS +A po/pl.po + +commit 3775bb85db79e4f9609a60dac1409a870ba4a0e9 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Tue Aug 11 21:38:00 2009 +0200 + + Updated German translation + +M po/de.po + +commit 372610c967ac8bd1e088a290dd62299b5261dd02 +Author: Thibault Saunier <saunierthibault@gmail.com> +Date: Mon Aug 10 21:20:25 2009 +0100 + + [documents] Added a function to get the document upload URI + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h + +commit 0a8e11dbbc4208acebbbdbc21588f8cfd06bf4d7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 10 20:53:06 2009 +0100 + + [gd] Updated the GData namespace to version 3 + + Added structured name and postal address handling from version 3 + of the + GData namespace, including updated test cases. + +M docs/reference/gdata-sections.txt +M gdata/gd/Makefile.am +A gdata/gd/gdata-gd-name.c +A gdata/gd/gdata-gd-name.h +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-postal-address.h +M gdata/gdata-parser.c +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-service.c +M gdata/tests/contacts.c +M gdata/tests/general.c + +commit 6d5a2712416a2f70e87b47a2efe6f9abfdb1ee36 +Author: Thibault Saunier <saunierthibault@gmail.com> +Date: Sat Aug 8 16:29:50 2009 +0100 + + Bug 590568 – Crash on querying inside a folder + + Re-fix queries in folders to use the correct URI as per the API + change on + 2009-08-03 (http://code.google.com/apis/documents/changelog.html). + +M gdata/services/documents/gdata-documents-service.c + +commit caa0947705aad4cbc6b2b8d853772f35752239d8 +Author: Chao-Hsiung Liao <j_h_liau@yahoo.com.tw> +Date: Sat Aug 8 21:44:06 2009 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit da8f20efdb2ddb640c42d2f0ff4f695467ef21c1 +Author: Kjartan Maraas <kmaraas@gnome.org> +Date: Fri Aug 7 14:06:08 2009 +0200 + + Updated Norwegian bokmål translation. + +M po/nb.po + +commit 69a8ef2bffd54fac4bf68dee175293bc47b05fec +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 6 23:30:56 2009 +0100 + + [documents] Fix the "remove all" test case so it doesn't fail on + old ETags + +M gdata/gdata-service.c +M gdata/tests/documents.c + +commit e66e42f1637f5ed07efdde31aad5602aa30d2f89 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 6 23:07:20 2009 +0100 + + [documents] Re-query the document when removing it from a folder + + This ensures we return the latest version of the document, rather + than having + to hack around with removing the old folder's links and categories + ourselves. + See: http://code.google.com/p/gdata-issues/issues/detail?id=1380 + +M gdata/gdata-upload-stream.c +M gdata/services/documents/gdata-documents-service.c + +commit c6a02abf76fd6c29b2eac61c107c8f4101af11c4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 6 22:09:16 2009 +0100 + + [documents] Test case fixes + + Use the correct HTTP method when updating documents, check more + strictly for + missing XML responses, use the Google-provided URI for removing + documents from + folders, and don't try to parse a response to the same request + which doesn't + exist. + +M gdata/gdata-parsable.c +M gdata/gdata-service.c +M gdata/gdata-upload-stream.c +M gdata/gdata-upload-stream.h +M gdata/services/documents/gdata-documents-service.c + +commit d51293735acc3e136374a5d3c0cc589e13936011 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 6 20:07:47 2009 +0100 + + [core] Fix some warnings + +M gdata/gdata-buffer.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c + +commit db45f076ced74e28e6cb45bfd7d618ac71be3857 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Aug 6 20:07:00 2009 +0100 + + [build] Added support for AM_SILENT_RULES and updated git.mk + +M configure.in +M gdata/Makefile.am +M gdata/media/Makefile.am +M gdata/services/documents/Makefile.am +M gdata/services/picasaweb/Makefile.am +M gdata/services/youtube/Makefile.am +M git.mk + +commit ef78512a717eb47533ff45c0f6222cef0691fbe3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 5 22:53:31 2009 +0100 + + [core] Fix premature termination of request body on buffer underflow + + EOF and buffer underflow returns from gdata_buffer_pop_data() + were getting + confused and, if data wasn't pushed to a GDataUploadStream fast + enough, would + result in premature termination of the request body. + +M gdata/gdata-buffer.c +M gdata/gdata-buffer.h +M gdata/gdata-download-stream.c +M gdata/gdata-upload-stream.c + +commit 7c0cd3d0f1d14cbf7d39cadbc2b1b258351e47f8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 5 21:58:46 2009 +0100 + + [documents] Don't try to insert documents when updating without a + new file + +M gdata/services/documents/gdata-documents-service.c + +commit 68d89ae3953aaaa0741ec3726450275436eada6d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 5 20:16:20 2009 +0100 + + [docs] Added missing image + + Add the data flow diagram to the list of images to be packaged. + +M docs/reference/Makefile.am + +commit 4369021250a06320c56654616e8ef20bb6da4e2e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Aug 5 20:14:45 2009 +0100 + + [core] Added GDataUploadStream to allow easy uploading of large files + + GDataUploadStream is a subclass of GOutputStream designed to + allow easy + uploading of files (with or without an associated entry) to a + service using + streaming I/O. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +M gdata/gdata-buffer.c +M gdata/gdata-buffer.h +M gdata/gdata-service.c +M gdata/gdata-service.h +A gdata/gdata-upload-stream.c +A gdata/gdata-upload-stream.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-service.c + +commit 7444c1c6d60332445b4771d813c528702a3e2853 +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Tue Aug 4 20:03:22 2009 +0200 + + Updated Spanish translation + +M po/es.po + +commit da82480d680f9871ca4120b304728170bc7fa3b7 +Author: Claude Paroz <claude@2xlibre.net> +Date: Mon Aug 3 21:13:31 2009 +0200 + + Updated French translation + + Contributed by Nicolas Repentin and Claude Paroz + +M po/fr.po + +commit d35e5400ca860a5ea12c734bd6b4a9f8437cd091 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 3 19:05:27 2009 +0100 + + [core] Added GDataDownloadStream to allow easy downloading of + large files + + GDataDownloadStream is a subclass of GInputStream which allows large + files to + be downloaded in a more controlled manner than by just specifying the + file to save them to. + +M docs/reference/Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +A gdata/gdata-buffer.c +A gdata/gdata-buffer.h +A gdata/gdata-download-stream.c +A gdata/gdata-download-stream.h +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.c +M gdata/services/documents/gdata-documents-text.h + +commit d61d33f99968e7493afccadd9816a7a3d2f95128 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Aug 3 18:35:59 2009 +0100 + + [core] Added a method to escape text and append it to a GString + + This reduces the number of small allocations required when building up + an XML output tree by a large number. XML output checks in the test + suites can act as a test case. + +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-link.c +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/gdata-entry.c +M gdata/gdata-parsable.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-private.h +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-group.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 82fa0a20505cc85bfcc0355fbf3f35c7a8a62fba +Author: Thibault Saunier <saunierthibault@gmail.com> +Date: Mon Aug 3 18:01:47 2009 +0100 + + Bug 590568 – Crash on querying inside a folder + +M gdata/services/documents/gdata-documents-query.c + +commit 02488eeb8cf890ec2fd52791edb3153c6d84a4ee +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 2 23:31:58 2009 +0100 + + [georss] Add missing files + +A gdata/georss/Makefile.am +A gdata/georss/gdata-georss-where.c +A gdata/georss/gdata-georss-where.h + +commit 3c735026b6b8d587c48139b3c7e504353192aec9 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Sun Aug 2 22:52:16 2009 +0100 + + Bug 590132 – Unhandled XML for georss + + Patch to add GeoRSS support to the PicasaWeb backend, with support for + getting and setting coordinates of albums and files, including + test cases. + Closes: bgo#590132 + +M configure.in +M docs/reference/Makefile.am +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/tests/picasaweb.c + +commit 953d0c148e412b45bd7f1d0e8f36309f256d131f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 2 19:57:28 2009 +0100 + + [core] Added error domain + + Added an error domain ("libgdata") and made all "unhandled element" + messages + into proper messages, rather than warnings. This means that all + command line + output of libgdata can now be redirected so it doesn't mess up + command line + applications. + +M gdata/Makefile.am +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/youtube/gdata-youtube-service.c + +commit abaa3f0c0eca903206bb81fa28edf4c9213ffb1f +Author: Thibault Saunier <saunierthibault@gmail.com> +Date: Sun Aug 2 19:39:06 2009 +0100 + + [documents] Fix GDataDocumentsEntry:is-deleted + + Brown paper bag commit of a fix to the is-deleted property of + GDataDocumentsEntry, which apparently doesn't have any attributes. + Closes: bgo#590345 + +M gdata/services/documents/gdata-documents-entry.c + +commit f79e6196edb542911c2fde15756676f7f1753f70 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 2 19:32:48 2009 +0100 + + [documents] Warning fixes and extra error checking + +M gdata/services/documents/gdata-documents-service.c +M gdata/tests/documents.c + +commit 0f63d2d39d5514bcbd53002a5496a773b2f5cf40 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 2 18:24:01 2009 +0100 + + Bug 590341 – Allow querying of single documents + + Patch from Thibault Saunier <saunierthibault@gmail.com> to allow + querying of + single documents from the Google Documents backend. Closes: bgo#590341 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-query.c +M gdata/services/documents/gdata-documents-service.c +M gdata/services/documents/gdata-documents-service.h +M gdata/tests/documents.c + +commit c04a3fa92d193c2ae1cd68174129dfb3bb56f2be +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Aug 2 17:08:42 2009 +0100 + + Bug 589855 – Obsolete <rights> not handled in GDataPicasaWebAlbum + parse_xml() + + Changes based on a patch from Richard Schwarting <aquarichy@gmail.com> + to + handle the Atom <rights> element in GDataEntry. Closes: bgo#589855 + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/tests/picasaweb.c + +commit f500b1b6b8b698a87f3cdfd17dd562f67f9ec659 +Author: Chao-Hsiung Liao <j_h_liau@yahoo.com.tw> +Date: Sun Aug 2 16:13:55 2009 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + +M po/zh_HK.po +M po/zh_TW.po + +commit 68bd454a875f8f1a83791fff1d3db59399e138c9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Aug 1 11:23:45 2009 +0100 + + Bug 590345 – <gd:deleted> handling in GDataDocumentsEntry + + Patch by Thibault Saunier <saunierthibault@gmail.com> to add handling + for <gd:deleted> tags in the Documents service. Closes: bgo#590345 + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-entry.h + +commit 1a02a3574ec4f8864f38c8edbc1a79b2ce586963 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Wed Jul 29 19:37:45 2009 +0100 + + Bug 589850 – gdata_picasaweb_album_get_timestamp() returns date + in 1970! + + Patch from Richard Schwarting <aquarichy@gmail.com> to fix timestamp + parsing + re. word size incompatibilities in the PicasaWeb service. Closes: + bgo#589850 + +M gdata/exif/gdata-exif-tags.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/tests/picasaweb.c + +commit 1e971a20100097c5cad077dffa5b3e30bb9db2ae +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jul 28 21:52:35 2009 +0100 + + [picasaweb] Added missing EXIF tag files + + I'm an idiot. + +A gdata/exif/Makefile.am +A gdata/exif/gdata-exif-tags.c +A gdata/exif/gdata-exif-tags.h + +commit 34b758dea90cfc87dab4f78b151ac597ec62c2c5 +Author: Richard Schwarting <aquarichy@gmail.com> +Date: Tue Jul 28 19:44:53 2009 +0100 + + Bug 589201 – Add EXIF support for PicasaWeb image files + + Patch from Richard Schwarting <aquarichy@gmail.com> to add support + for EXIF + attributes to the PicasaWeb service. Closes: bgo#589201 + +M configure.in +M docs/reference/Makefile.am +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +M gdata/gdata.symbols +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/tests/picasaweb.c + +commit 88159d6a2c37cf3edd1b80398a020968d6728c39 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 27 23:42:34 2009 +0100 + + Bug 589545 – *_download_document(): let the client decide where + to download + + Patch from Thibault Saunier <saunierthibault@gmail.com> to change the + semantics of the *_download_document() functions. Closes: bgo#589545 + +M gdata/gdata-private.h +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-presentation.c +M gdata/services/documents/gdata-documents-presentation.h +M gdata/services/documents/gdata-documents-spreadsheet.c +M gdata/services/documents/gdata-documents-spreadsheet.h +M gdata/services/documents/gdata-documents-text.c +M gdata/services/documents/gdata-documents-text.h +M gdata/tests/documents.c + +commit c6c5a1c41c2a3f30a61898effaa824bea27c05c1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 25 18:48:17 2009 +0100 + + [core] Changed error handling to print the response message + + It previously printed the human-readable version of the HTTP status + code. + This doesn't introduce any string changes. + +M gdata/gdata-service.c + +commit 96d9d1ba0adb0a3f3d399f45e6432c23819fe453 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Fri Jul 24 17:32:00 2009 +0200 + + Updated German translation + +M po/de.po + +commit dbb25d3103466bd205f66572a64982e94109b871 +Author: Daniel Nylander <po@danielnylander.se> +Date: Wed Jul 22 23:28:32 2009 +0200 + + Updated Swedish translation + +M po/sv.po + +commit 9b67a37d9af5f0200b7da6c49e3ae494ac4a995a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jul 21 19:23:54 2009 +0100 + + Bug 589265 – Crash on query error + +M gdata/gdata-service.c + +commit a2b06cc6c4f01f5cce7838a9af50da93477ecaea +Author: Jorge González <jorgegonz@svn.gnome.org> +Date: Tue Jul 21 19:35:37 2009 +0200 + + Updated Spanish translation + +M po/es.po + +commit eabbfce26c99bebcd61fd46285266ad95515193d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 20 20:43:42 2009 +0100 + + [build] Increment version to 0.5.0 + +M configure.in + +commit cc58afed3ee1003f20fa93c6401020025c25c316 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 20 20:40:38 2009 +0100 + + Release version 0.4.0 + +M NEWS +M configure.in +M gdata/tests/Makefile.am +M gdata/tests/documents.c +A gdata/tests/test_updated_file.ppt +M po/POTFILES.in +M po/en_GB.po + +commit 28676603a8aec0167662448702d8c9699ba5bc74 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 20 19:40:50 2009 +0100 + + [picasaweb] Test suite fixes + + Someone went and edited the photos online! They destroyed my test + cases! + +M gdata/tests/picasaweb.c + +commit e2882f3cd445cb2e4fbc9ffd25e5addcb9fa6010 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 20 19:27:29 2009 +0100 + + [docs] Added some missing YouTube functions to the documentation + +M docs/reference/gdata-sections.txt + +commit a1824d8706439c882f3e6fcb6496120fd4300e78 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jul 20 19:18:16 2009 +0100 + + [documents] Fixed gdata_documents_entry_get_path function + + Necessarily also fixed gdata_entry_look_up_links, and added test + cases for + it. Based on patches by Thibault Saunier <saunierthibault@gmail.com>. + Closes: bgo#589067 + +M gdata/atom/gdata-link.c +M gdata/gdata-entry.c +M gdata/gdata.symbols +M gdata/services/documents/gdata-documents-entry.c +M gdata/services/documents/gdata-documents-entry.h +M gdata/tests/general.c + +commit 8940a0b026bf9b6df9c602430057af5934951c18 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 19 18:50:38 2009 +0100 + + [documents] Added missing test files + +M gdata/tests/Makefile.am +A gdata/tests/test.doc +A gdata/tests/test.ods +A gdata/tests/test.odt +A gdata/tests/test.ppt +A gdata/tests/test.xls +A gdata/tests/test_updated.odt + +commit 352a620bff7fd01d5c9e9fd455b42eeecce16786 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 19 18:43:05 2009 +0100 + + [contacts] Added methods to remove all (e.g.) phone numbers from + a contact + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h + +commit 9ab94286da929f3bfa0c04a052963b608a45f956 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 19 12:41:02 2009 +0100 + + Bug 588995 – float radix character depends on LC_NUMERIC, but + Google wants "." + + Changes based on a patch by Richard Schwarting <aquarichy@gmail.com> + to + use locale-independent functions to print doubles. Closes: bgo#588995 + +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-query.c +M gdata/services/youtube/gdata-youtube-query.c +M gdata/tests/youtube.c + +commit 4ee6c030ecdc75086d6317fd0e2e8fa8ae454903 +Author: Thibault Saunier <saunierthibault@gmail.com> +Date: Fri Jul 17 19:04:15 2009 +0100 + + Bug 587073 – Add Google Documents service + + Added support for Google Documents, from work done by Thibault Saunier + <saunierthibault@gmail.com>. Closes bgo#587073 and bgo#588282. + +M HACKING +M configure.in +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +M gdata/atom/gdata-link.c +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/gdata-private.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/Makefile.am +A gdata/services/documents/Makefile.am +A gdata/services/documents/gdata-documents-entry.c +A gdata/services/documents/gdata-documents-entry.h +A gdata/services/documents/gdata-documents-feed.c +A gdata/services/documents/gdata-documents-feed.h +A gdata/services/documents/gdata-documents-folder.c +A gdata/services/documents/gdata-documents-folder.h +A gdata/services/documents/gdata-documents-presentation.c +A gdata/services/documents/gdata-documents-presentation.h +A gdata/services/documents/gdata-documents-query.c +A gdata/services/documents/gdata-documents-query.h +A gdata/services/documents/gdata-documents-service.c +A gdata/services/documents/gdata-documents-service.h +A gdata/services/documents/gdata-documents-spreadsheet.c +A gdata/services/documents/gdata-documents-spreadsheet.h +A gdata/services/documents/gdata-documents-text.c +A gdata/services/documents/gdata-documents-text.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/Makefile.am +M gdata/tests/common.h +A gdata/tests/documents.c +M gdata/tests/picasaweb.c +M po/fr.po + +commit 533ad2afe4cb37307dcec180759f0741a5cf39f0 +Author: Víctor Manuel Jáquez Leal <vjaquez@igalia.com> +Date: Fri Jul 10 14:55:47 2009 +0200 + + Bug 588052 – Parse the yt:aspectratio tag + + Add support for aspect ratios to YouTube videos. Patch by Víctor + Manuel + Jáquez Leal. Closes bgo#588052. + +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-group.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/youtube.c + +commit 31ae4270a735e768901b03e230845713a8a51395 +Author: Daniel Nylander <po@danielnylander.se> +Date: Fri Jul 10 17:30:37 2009 +0200 + + Updated Swedish translation + +M po/sv.po + +commit 11feedf628437743836ec02bb2ed22bd35672d66 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jul 8 15:26:18 2009 +0100 + + [youtube] Check the hostname when extracting video IDs from URIs + +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/youtube.c + +commit 4a7c1d78a04ad6be69705eaf036913ee76e4e3c9 +Author: Chao-Hsiung Liao <j_h_liau@yahoo.com.tw> +Date: Mon Jul 6 21:00:59 2009 +0800 + + Added Traditional Chinese translation(Hong Kong and Taiwan) + +M po/LINGUAS +A po/zh_HK.po +A po/zh_TW.po + +commit fdcfed6f126a622e946532dba12a3cc3596d562a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 5 23:15:15 2009 +0100 + + [youtube] Added a convenience function to extract video IDs from + video URIs + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/youtube.c + +commit f8490dd614d953e1d28835d97bc70b6746f4e224 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jul 5 22:44:19 2009 +0100 + + [youtube] Added a query to retrieve the details of a single video + + Added sync and async query functions to retrieve the details of a + single video + based on its video ID. Test cases and documentation are included. + +M docs/reference/gdata-sections.txt +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/tests/youtube.c + +commit dfff80454d66075b0ce1dbbd85b823ebe3df9625 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 4 18:09:39 2009 +0100 + + [tests] Rearchitected the test suites to not use global variables + + The global main_loop and service variables are now declared in the + scope of + the main function, and passed to the appropriate test + cases. Individual test + cases can now be run without needing to also run the authentication + test. + +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 54a08c31db4c3ab6904f2f52bbb77102b351e459 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jul 4 15:11:30 2009 +0100 + + [tests] Use better paths for test files in the test suite + +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit 97355e5cfc3bb12afb30b690aa0e4b185457b931 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jul 3 10:12:09 2009 +0100 + + [core] Made the get_xml functions use a single GString throughout + + Previously, each call to _gdata_parsable_get_xml would create its + own GString, + then destroy it at the end. Now, the same GString is reused throughout + a tree + of calls to _gdata_parsable_get_xml, saving quite a few + allocations/frees + (in exchange for more reallocations). + +M gdata/gd/gdata-gd-when.c +M gdata/gdata-entry.c +M gdata/gdata-parsable.c +M gdata/gdata-private.h +M gdata/media/gdata-media-group.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 65531a6bae54340722c2cdaa5e156a9ca9a49637 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jul 2 16:09:37 2009 +0100 + + [contacts] Added gdata_contacts_service_update_contact + + Added gdata_contacts_service_update_contact to work around some + weirdness + with the edit URIs the contacts service gives us, and also fixed + some bugs + with handling empty extended properties. + +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h +M gdata/tests/contacts.c + +commit 362a970abd6623d09fc4194d57e840996c9b702c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jun 30 18:36:26 2009 +0100 + + [atom] Added #defined values for the standard link relation types + +M docs/reference/gdata-sections.txt +M gdata/atom/gdata-link.c +M gdata/atom/gdata-link.h +M gdata/gdata-access-handler.c +M gdata/gdata-entry.c +M gdata/gdata-service.c +M gdata/tests/general.c + +commit ca7aba560734b3b3a6999e8a869b77ae6492e87a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jul 1 14:12:10 2009 +0100 + + [picasaweb] Fixed declaration of gdata_picasaweb_file_get_size + +M gdata/services/picasaweb/gdata-picasaweb-file.h + +commit 7b45582cdda4ce176c8106b008448814e81e6409 +Author: Maxim V. Dziumanenko <dziumanenko@gmail.com> +Date: Wed Jul 1 15:21:40 2009 +0300 + + Updated Ukrainian translation + +M po/LINGUAS + +commit a5c983cea95e9faea1c42120fd40e7891e22a459 +Author: Maxim V. Dziumanenko <dziumanenko@gmail.com> +Date: Wed Jul 1 15:20:54 2009 +0300 + + Updated Ukrainian translation + +A po/uk.po + +commit f752236c8dfdbcf1e0e123b70a1e039a4ce6aef8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 29 16:20:57 2009 +0100 + + [gd] Added test cases for the GData elements with classes + + Added test cases for all the GData elements represented in gdata/gd. A + few + bugs (mainly escaping bugs) in the classes were fixed as a result. + +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-postal-address.h +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/tests/general.c + +commit be8b372b310579d17d042afb0fc6145348cec328 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 29 10:44:26 2009 +0100 + + Bug 587277 – Some files are GPLv3 but license is LGPLv2.1? + + Fix licencing headers to consistently be LGPLv2.1+. + +M gdata/atom/gdata-author.c +M gdata/atom/gdata-author.h +M gdata/atom/gdata-category.c +M gdata/atom/gdata-category.h +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-generator.h +M gdata/atom/gdata-link.c +M gdata/atom/gdata-link.h +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-email-address.h +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-im-address.h +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-organization.h +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-phone-number.h +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-postal-address.h +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-reminder.h +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-when.h +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-where.h +M gdata/gd/gdata-gd-who.c +M gdata/gd/gdata-gd-who.h +M gdata/gdata-access-handler.c +M gdata/gdata-access-handler.h +M gdata/gdata-parsable.c +M gdata/gdata-parsable.h +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-category.h +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-content.h +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-credit.h +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-group.h +M gdata/media/gdata-media-thumbnail.c +M gdata/media/gdata-media-thumbnail.h +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/calendar/gdata-calendar-feed.h +M gdata/services/youtube/gdata-youtube-content.c +M gdata/services/youtube/gdata-youtube-content.h +M gdata/services/youtube/gdata-youtube-control.c +M gdata/services/youtube/gdata-youtube-control.h +M gdata/services/youtube/gdata-youtube-credit.c +M gdata/services/youtube/gdata-youtube-credit.h +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-group.h +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-state.h + +commit 33be5a3f48f400611132c3a85e8f1b17fd5f383e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 29 01:05:08 2009 +0100 + + [atom] Added test cases for the Atom elements with classes + + Added test cases for all the Atom elements represented in + gdata/atom. A few + bugs in GDataParsable, GDataGenerator and GDataLink were fixed as + a result. + Most notably, gdata_link_get_uri will now always return a valid IRI. + +M HACKING +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/gdata-parsable.c +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/general.c +M gdata/tests/youtube.c + +commit 20cad32f52be0505a25305bad7d6167df6ad8de6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jun 28 22:31:44 2009 +0100 + + [media] Fixed a crasher when trying to free static memory + + Static memory was being inserted into a hash table, then later freed. + Also updated the list of allowed commit tags in HACKING. + +M gdata/media/gdata-media-group.c + +commit 920c0249bd241320abcd15cf3379b66d6c83e2f5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jun 28 22:23:55 2009 +0100 + + [core] Link element names and namespaces to the relevant classes + + This introduces new element_name and element_namespaces fields to the + GDataParsableClass struct, allowing for simpler parsing of XML + by linking + XML element names to parsable object types. Some of the GDataParsable + API + is now public, which will allow for a more comprehensive test suite + in future. + +M docs/reference/gdata-sections.txt +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +M gdata/gd/gdata-gd-email-address.c +M gdata/gd/gdata-gd-im-address.c +M gdata/gd/gdata-gd-organization.c +M gdata/gd/gdata-gd-phone-number.c +M gdata/gd/gdata-gd-postal-address.c +M gdata/gd/gdata-gd-reminder.c +M gdata/gd/gdata-gd-when.c +M gdata/gd/gdata-gd-where.c +M gdata/gd/gdata-gd-who.c +M gdata/gdata-access-handler.c +M gdata/gdata-access-rule.c +M gdata/gdata-access-rule.h +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/gdata-parsable.h +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata.symbols +M gdata/media/gdata-media-category.c +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-thumbnail.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/picasaweb/gdata-picasaweb-album.c +M gdata/services/picasaweb/gdata-picasaweb-album.h +M gdata/services/picasaweb/gdata-picasaweb-file.c +M gdata/services/picasaweb/gdata-picasaweb-file.h +M gdata/services/picasaweb/gdata-picasaweb-service.c +M gdata/services/youtube/gdata-youtube-control.c +M gdata/services/youtube/gdata-youtube-group.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-state.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/general.c +M gdata/tests/picasaweb.c +M gdata/tests/youtube.c + +commit dad5356795c230886e11d8a63fbd4fc27596b2f4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jun 28 17:34:33 2009 +0100 + + [docs] Added data flow diagram and protocol description + +A docs/reference/data-flow.dia +A docs/reference/data-flow.png +M docs/reference/gdata-overview.xml +M docs/reference/structure.dia +M docs/reference/structure.png + +commit f989a8f8474ad92e8bc43bd6143af0a6d6566300 +Author: Jorge Gonzalez <jorgegonz@svn.gnome.org> +Date: Sun Jun 28 12:48:51 2009 +0200 + + Updated Spanish translation + +M po/es.po + +commit 3364795201c16230102a3f9120515d026845bf4a +Author: Mario Blättermann <mariobl@gnome.org> +Date: Mon Jun 22 22:00:37 2009 +0200 + + Updated German translation + +M po/de.po + +commit 0f9d29fdbb87e6bb2a4a0e5d239e6e8a8f8fe3f3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jun 21 20:24:34 2009 +0100 + + [picasaweb] Added a PicasaWeb service + + Originally written by Richard Schwarting <aquarichy@gmail.com>, + the PicasaWeb + service has decent test suite coverage, decent documentation, and + support for + common PicasaWeb operations. Closes: bgo#580375 + +M configure.in +M docs/reference/Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-service.c +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/media/gdata-media-content.c +M gdata/media/gdata-media-credit.c +M gdata/media/gdata-media-group.c +M gdata/media/gdata-media-group.h +M gdata/services/Makefile.am +A gdata/services/picasaweb/Makefile.am +A gdata/services/picasaweb/gdata-picasaweb-album.c +A gdata/services/picasaweb/gdata-picasaweb-album.h +A gdata/services/picasaweb/gdata-picasaweb-file.c +A gdata/services/picasaweb/gdata-picasaweb-file.h +A gdata/services/picasaweb/gdata-picasaweb-query.c +A gdata/services/picasaweb/gdata-picasaweb-query.h +A gdata/services/picasaweb/gdata-picasaweb-service.c +A gdata/services/picasaweb/gdata-picasaweb-service.h +M gdata/tests/Makefile.am +A gdata/tests/picasaweb.c +M po/POTFILES.in + +commit f81049f70f1568f95b3db8ca5ed6d7e8891b0644 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jun 13 19:44:17 2009 +0100 + + Bug 579170 – Eliminate gdata_parser_error_unhandled_element + + Split parsing of app:control elements in GDataYouTubeVideo out into + GDataYouTubeControl, and converted the GDataYouTubeState struct to + a GObject. + + All instances of gdata_parser_error_unhandled_element are now + banished. + Closes: bgo#579170 + +M docs/reference/Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/youtube/Makefile.am +A gdata/services/youtube/gdata-youtube-control.c +A gdata/services/youtube/gdata-youtube-control.h +M gdata/services/youtube/gdata-youtube-service.c +A gdata/services/youtube/gdata-youtube-state.c +A gdata/services/youtube/gdata-youtube-state.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +D gdata/services/youtube/gdata-youtube.c +D gdata/services/youtube/gdata-youtube.h +M gdata/tests/youtube.c + +commit 0ec119dc1af85ef45ac333c584f6939b7e93bdf9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jun 13 18:14:31 2009 +0100 + + [core] Converted Media RSS structs to GObjects + + Converted all the Media RSS structs to GObjects, and moved them to a + "media" + directory. The documentation for the new objects is mostly complete, + but no + new test cases have been added. + A few of the new classes had to be subclassed to add YouTube-specific + properties to them. Helps: bgo#579170 + +M configure.in +M docs/reference/Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +D gdata/gdata-media-rss.c +D gdata/gdata-media-rss.h +M gdata/gdata.h +M gdata/gdata.symbols +A gdata/media/Makefile.am +A gdata/media/gdata-media-category.c +A gdata/media/gdata-media-category.h +A gdata/media/gdata-media-content.c +A gdata/media/gdata-media-content.h +A gdata/media/gdata-media-credit.c +A gdata/media/gdata-media-credit.h +A gdata/media/gdata-media-group.c +A gdata/media/gdata-media-group.h +A gdata/media/gdata-media-thumbnail.c +A gdata/media/gdata-media-thumbnail.h +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/youtube/Makefile.am +A gdata/services/youtube/gdata-youtube-content.c +A gdata/services/youtube/gdata-youtube-content.h +A gdata/services/youtube/gdata-youtube-credit.c +A gdata/services/youtube/gdata-youtube-credit.h +A gdata/services/youtube/gdata-youtube-group.c +A gdata/services/youtube/gdata-youtube-group.h +M gdata/services/youtube/gdata-youtube-query.c +M gdata/services/youtube/gdata-youtube-query.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/general.c +M gdata/tests/youtube.c + +commit a53ecbd393e8eac9b773743bc7963d613deaafa0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jun 10 19:43:07 2009 +0100 + + [core] Converted GData structs to GObjects + + Converted all the GData structs to GObjects, and moved them to a "gd" + directory. The documentation for the new objects is mostly complete, + but + no new test cases have been added. Helps: bgo#579170 + +M configure.in +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +M gdata/atom/gdata-author.c +M gdata/atom/gdata-category.c +M gdata/atom/gdata-generator.c +M gdata/atom/gdata-link.c +A gdata/gd/Makefile.am +A gdata/gd/gdata-gd-email-address.c +A gdata/gd/gdata-gd-email-address.h +A gdata/gd/gdata-gd-im-address.c +A gdata/gd/gdata-gd-im-address.h +A gdata/gd/gdata-gd-organization.c +A gdata/gd/gdata-gd-organization.h +A gdata/gd/gdata-gd-phone-number.c +A gdata/gd/gdata-gd-phone-number.h +A gdata/gd/gdata-gd-postal-address.c +A gdata/gd/gdata-gd-postal-address.h +A gdata/gd/gdata-gd-reminder.c +A gdata/gd/gdata-gd-reminder.h +A gdata/gd/gdata-gd-when.c +A gdata/gd/gdata-gd-when.h +A gdata/gd/gdata-gd-where.c +A gdata/gd/gdata-gd-where.h +A gdata/gd/gdata-gd-who.c +A gdata/gd/gdata-gd-who.h +M gdata/gdata-access-rule.c +M gdata/gdata-access-rule.h +D gdata/gdata-gdata.c +D gdata/gdata-gdata.h +M gdata/gdata-parsable.c +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/calendar.c +M gdata/tests/contacts.c +M gdata/tests/general.c +M gdata/tests/youtube.c + +commit 05d2280925c8492764b2bdc8d9a2f7957dafc877 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jun 4 11:34:25 2009 +0100 + + [core] Converted Atom structs to GObjects + + Converted all the Atom structs to GObjects, and moved them to an + "atom" + directory. This entailed moving get_xml and get_namespaces to + GDataParsable, + which simplifies things anyway. The documentation for the new + Atom objects + is mostly complete, but no new test cases have been added. Helps: + bgo#579170 + +M configure.in +M docs/reference/Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +A gdata/atom/Makefile.am +A gdata/atom/gdata-author.c +A gdata/atom/gdata-author.h +A gdata/atom/gdata-category.c +A gdata/atom/gdata-category.h +A gdata/atom/gdata-generator.c +A gdata/atom/gdata-generator.h +A gdata/atom/gdata-link.c +A gdata/atom/gdata-link.h +M gdata/gdata-access-handler.c +M gdata/gdata-access-rule.c +D gdata/gdata-atom.c +D gdata/gdata-atom.h +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-parsable.c +M gdata/gdata-parsable.h +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/calendar.c +M gdata/tests/general.c + +commit 16e5b361250164b503e4dc84a0ac24391438adb9 +Author: Kjartan Maraas <kmaraas@gnome.org> +Date: Wed Jun 10 15:31:38 2009 +0200 + + Add Norwegian bokmål + +M po/LINGUAS + +commit 6913ffea72ba5db340821de3ce66f63a6a89bb0d +Author: Kjartan Maraas <kmaraas@gnome.org> +Date: Wed Jun 10 15:31:14 2009 +0200 + + Updated Norwegian bokmål translation. + +A po/nb.po + +commit 111ba382c2de7ad24424da6de391865057e9bf9f +Author: Claude Paroz <claude@2xlibre.net> +Date: Thu Jun 4 19:24:35 2009 +0200 + + Added French translation by Laurent Coudeur and Claude Paroz + +M po/LINGUAS +A po/fr.po + +commit 0d73821eae07ab62745dec65530e212e1f5ef09e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jun 3 19:00:35 2009 +0100 + + [core] Fix usage of a potentially-NULL object + +M gdata/gdata-service.c + +commit 1b2292336c6864456ad84ec319f672fb6c0a1463 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jun 3 17:30:25 2009 +0100 + + Bug 584737 – String parsing is locale-sensitive + + Replace some uses of strtod() with g_ascii_strtod() so that string + parsing + isn't locale-dependent. Add a test case. Closes: bgo#584737 + +M gdata/gdata-media-rss.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/general.c + +commit ccf58327523258335f77eb07ed3162411ddbdce7 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Wed Jun 3 20:21:45 2009 +0200 + + Updated German translation + +M po/de.po + +commit bac9dc210a6d344c61c09458a46cdb7a96b28796 +Author: Jorge Gonzalez <jorgegonz@svn.gnome.org> +Date: Wed Jun 3 20:04:57 2009 +0200 + + Updated Spanish translation + +M po/es.po + +commit e74940e22180cdd8cedd79270c118991d3e96c87 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Jun 3 13:39:48 2009 +0100 + + Bug 584417 – Strings are not properly formed for localisation + + Reworded a number of strings to make them (hopefully) easier to + translate, and + added translator comments to every string which takes + parameters. Moved a few + existing translator comments so gettext actually picks them up. + Closes: bgo#584417 + +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parsable.c +M gdata/gdata-parser.c +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-feed.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c + +commit ff5ff0632b572fdd01092df9950abbd07c1b23fa +Author: Joan Duran <jodufi@gmail.com> +Date: Tue Jun 2 23:18:56 2009 +0200 + + Added Catalan translation + +M po/LINGUAS +A po/ca.po + +commit 639bb11b26e13935cc6fab741c19f99fa1325f9f +Author: Jorge Gonzalez <jorgegonz@svn.gnome.org> +Date: Tue Jun 2 20:19:05 2009 +0200 + + Updated Spanish translation + +M po/es.po + +commit 59fca6a0a7fc0f68f0767c4260d3c0dd9625b635 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Jun 2 00:15:49 2009 +0100 + + [contacts] Add contact photo support + + Add support for getting, setting and removing contact photos. Full + test cases + and documentation are included. + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-service.h +M gdata/tests/contacts.c +A gdata/tests/photo.jpg + +commit 371fceb5a6913e4d4eac69f5e850a76ab4847288 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 1 18:06:58 2009 +0100 + + [core] Add comparison functions for main Atom and GData structs + + Consequently, add code to *_add_* functions to prevent duplicate + structs being + added to entries. + +M docs/reference/gdata-sections.txt +M gdata/gdata-atom.c +M gdata/gdata-atom.h +M gdata/gdata-entry.c +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c + +commit 3684d2e4276c4a98b30e38613114456f20f84c31 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Jun 1 16:46:50 2009 +0100 + + [contacts] Add the ability to list all extended properties of + a contact + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h + +commit 8a3390b19c25730dba1f578c986911dc3c963aa8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 31 17:01:52 2009 +0100 + + [docs] Add the builddir to gtkdoc-mkhtml's path so builddir != + srcdir works + +M docs/reference/Makefile.am + +commit 2e960de884529f63c939e08f80c22c62208e1e6c +Author: A S Alam <aalam@users.sf.net> +Date: Tue May 26 19:16:58 2009 +0530 + + Adding Punjabi (Gurmukhi) Language to Project by A S Alam + +M po/LINGUAS +A po/pa.po + +commit 135312e5a803997e54bbacfbdf198aea187b3d02 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon May 25 11:28:06 2009 +0100 + + [build] Increment version to 0.4.0 + +M configure.in + +commit 7e684c0fee65c65a6f07c4d458032024072790ea +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon May 25 11:24:55 2009 +0100 + + Release version 0.3.0 + +M Makefile.am +M NEWS +M configure.in +M gdata/tests/youtube.c +M po/Makefile.in.in + +commit 81cea2e1830f2925f865894da0bb0ed0069aa108 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon May 25 10:30:18 2009 +0100 + + Updated British English translation + +M po/en_GB.po + +commit e4d91569399a17cea1807087390c01258dc117fa +Author: Jorge Gonzalez <jorgegonz@svn.gnome.org> +Date: Sat May 23 19:58:28 2009 +0200 + + Updated Spanish translation + +M po/es.po + +commit e83e538ba4ecd795206e494615308282f4113503 +Author: Simos Xenitellis <simos@gnome.org> +Date: Fri May 22 17:45:34 2009 +0100 + + Added el to LINGUAS + +M po/LINGUAS + +commit 02537937225f29d769c09e1bd64c7237fe1c9e61 +Author: Γιάννης Κατσαμπίρης <juankatsampirhs@gmail.com> +Date: Fri May 22 17:44:36 2009 +0100 + + Added Greek UI translation + +A po/el.po + +commit bf88dd2c10b6e7228e065791ad5ba7362ab6d6ae +Author: Jorge Gonzalez <jorgegonz@svn.gnome.org> +Date: Fri May 22 07:31:42 2009 +0200 + + Updated Spanish translation + +M po/es.po + +commit 027133b8e96849355a3c38ce6f297a85a4bcd059 +Author: Jorge Gonzalez <jorgegonz@svn.gnome.org> +Date: Wed May 20 20:50:59 2009 +0200 + + Added es to LINGUAS + +M po/LINGUAS + +commit f30d9187090faac5d8596318e7a512c87640fd83 +Author: Jorge Gonzalez <jorgegonz@svn.gnome.org> +Date: Wed May 20 20:50:40 2009 +0200 + + Added initial Spanish translation + +A po/es.po + +commit 93681c6fddf142291b9c2375cc68ceee91214f96 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed May 20 07:07:01 2009 +0100 + + [core] Made GDataEntry a prerequisite for GDataAccessHandler + +M gdata/gdata-access-handler.c + +commit e48934965085fdf12e58222c573d123a81dbbc89 +Author: Fran Diéguez <fran.dieguez@mabishu.com> +Date: Mon May 18 14:47:00 2009 +0200 + + Added Galician Translation. + +M po/LINGUAS +A po/gl.po + +commit be665338dbfc10f935d9efed6d315015e1b2abf7 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Sun May 17 21:03:36 2009 +0200 + + Updated German translation + +M po/de.po + +commit 36472b67980073b816a9e3717ccde57b76a43e23 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 17 18:53:53 2009 +0100 + + [calendar] Added GDataCalendarFeed to parse Calendar-specific feed + properties + + GDataCalendarFeed is a subclass of GDataFeed, and implements parsing + of two + Calendar-specific feed properties. Documentation is included, but + there are + no test cases. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-access-handler.c +M gdata/gdata-feed.c +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/calendar/Makefile.am +A gdata/services/calendar/gdata-calendar-feed.c +A gdata/services/calendar/gdata-calendar-feed.h +M gdata/services/calendar/gdata-calendar-service.c +M gdata/tests/calendar.c + +commit c1c6885e2cf997175e8a71470e74e2deddcb6c2f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 17 18:03:26 2009 +0100 + + [core] Abstract XML parsing from GDataFeed and GDataEntry into + GDataParsable + + Adds a new abstract class, GDataParsable, which adds extensible + XML parsing + functionality to inheriting classes. A little documentation is + included, but + there is no real public API for the class. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +M gdata/gdata-access-rule.c +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-feed.h +A gdata/gdata-parsable.c +A gdata/gdata-parsable.h +M gdata/gdata-private.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c +M po/POTFILES.in + +commit 164c9b9fbd8c9bf35427e088973b0b79a90bca3e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 17 12:54:00 2009 +0100 + + [core] Fix reference problems and filter out duplicate namespaces + + Fixes reference problems in the error case of + gdata_service_delete_entry, + and ensures that the extra_namespaces hash table doesn't contain any + namespaces which are duplicates of the defined set (when building + XML). + +M gdata/gdata-entry.c +M gdata/gdata-service.c + +commit c81b6308a8fbad64618073df83a92d2ff8a5f2c2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 17 12:53:16 2009 +0100 + + [calendar] Implement ACL functionality on GDataCalendarCalendar + + GDataCalendarCalendar now implements the GDataAccessHandler + interface. A + complete set of test cases is included. + +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/tests/calendar.c + +commit 5d853ec5706129ce8af1bc0a2baae3dfed52d8d0 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 17 12:50:57 2009 +0100 + + Bug 582026 – Access Control List functionality + + This adds a framework for controlling access control lists (ACLs). It + includes GDataAccessHandler, an interface to be implemented by + any GDataEntry + which has an ACL. It also includes GDataAccessRule, a GDataEntry + representing + a single access control rule, initially written by Thibault Saunier + <saunierthibault@gmail.com>. + + Full documentation is included, and test cases will be added + per-service. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/Makefile.am +A gdata/gdata-access-handler.c +A gdata/gdata-access-handler.h +A gdata/gdata-access-rule.c +A gdata/gdata-access-rule.h +M gdata/gdata-service.h +M gdata/gdata.h +M gdata/gdata.symbols +M po/POTFILES.in + +commit 1b9bff25139448bc18f4afd3025d86c5fe942362 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri May 15 07:32:37 2009 +0100 + + [contacts] Don't require that queries are GDataContactsQuerys + +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h + +commit 4236f11e671e3e1cb45193b5a5ab6c29252f2b00 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri May 15 07:32:05 2009 +0100 + + [calendar] Don't require that queries are GDataCalendarQuerys + +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h + +commit 480d4ea370cb80930ea6e75fce976643b570ac30 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri May 15 07:26:20 2009 +0100 + + Bug 578367 – Add support for YouTube-specific query parameters + + Adds a GDataYouTubeQuery class, implementing the custom query + parameters + supported by YouTube. A test case is included. Closes: bgo#578367 + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/youtube/Makefile.am +A gdata/services/youtube/gdata-youtube-query.c +A gdata/services/youtube/gdata-youtube-query.h +M gdata/tests/youtube.c + +commit b29ff8b0a5efbc44bd3559c1b1e01276b7e10a1f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed May 13 07:51:40 2009 +0100 + + [youtube] Added support for recorded times and comment feed links + + Added tests to the YouTube test suite, and also fixed parsing + media:group/category elements. + +M docs/reference/gdata-sections.txt +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/youtube.c + +commit 710d8a8281c341d124e74c8d039253cf8124736c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue May 12 22:14:41 2009 +0100 + + [docs] Add a basic section to the documentation about the class + structure + +M docs/reference/Makefile.am +M docs/reference/gdata-docs.xml +A docs/reference/gdata-overview.xml +A docs/reference/structure.dia +A docs/reference/structure.png +M gdata/services/calendar/gdata-calendar-event.c + +commit a777890b44052c1266deb51864444a901511bb1c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 10 23:29:12 2009 +0100 + + [calendar] Add the remaining XML output to GDataCalendarCalendar + +M docs/reference/gdata-sections.txt +M gdata/gdata-types.c +M gdata/gdata-types.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/tests/general.c + +commit f7596a72609017537d8ef3cd677369b8db28cd4a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun May 10 22:27:41 2009 +0100 + + [core] Cleaned up a few TODO comments + +M gdata/gdata-entry.c +M gdata/gdata-feed.c + +commit ca6bd816e64e1a3aa28f507e67777742fdf0621f +Author: Mario Blättermann <mariobl@gnome.org> +Date: Sat May 9 21:16:24 2009 +0200 + + Updated German translation + +M po/de.po + +commit e7cb37bcf253d42e0c568640ce0bc7ff27b8c4b1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat May 9 17:31:16 2009 +0100 + + [core] Added async versions of insert_entry, update_entry and + delete_entry + + There aren't currently any test cases for this API, since none of + the services + implement it yet. + +M docs/reference/gdata-sections.txt +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols + +commit 185026570b0887ea94f769f9a53462b237df0ed8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat May 9 16:51:52 2009 +0100 + + [core] Improved default error handling for insertions, updates + and deletions + + Wrote a better implementation of real_parse_error_response, which + will examine + the HTTP status code to choose a more appropriate error + message. Failing that, + it will fall back to generic error messages for each different action + (insertion, update, etc.). + + This has changed the API of GDataServiceClass->parse_error_response. + +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/services/youtube/gdata-youtube-service.c + +commit 116e74b7b9ab9bd6fc47b47c3e36b5e2a92b5e19 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Sat May 9 12:08:01 2009 +0200 + + Updated German translation + +M po/de.po + +commit 2d3386d6827e524dd103a0bff629c4919398f8a8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu May 7 21:05:21 2009 +0100 + + Bug 581706 – translation issues + + Added more translator comments and corrected minor problems in + a couple + of error strings. Closes: bgo#581706 + +M gdata/gdata-parser.c +M gdata/services/calendar/gdata-calendar-calendar.c + +commit 91d50308d1f8152b9fb4e4f613bbd9a95f442b99 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu May 7 18:52:51 2009 +0100 + + Bug 581706 – translation issues + + Added some translator comments and improved a few strings a little. + +M gdata/gdata-parser.c +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/youtube/gdata-youtube-service.c + +commit c712a5ae0e75bfec4db6780237887d4ce45e782f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu May 7 17:17:42 2009 +0100 + + [core] Remove use of a deprecated libsoup symbol, bumping req. to + 2.26.1 + + This bumps the libsoup requirement to 2.26.1. + +M README +M configure.in +M gdata/gdata-service.c + +commit 2404e380873bfce8c60ee8ea43dd19f63489555b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu May 7 07:37:10 2009 +0100 + + [docs] Updated HACKING and README + +M HACKING +M README + +commit 7c7edec310c636cfbe0b91ca2dc2bcc4d1ffa83c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed May 6 21:19:15 2009 +0100 + + [build] Removed generated files which don't belong in git + +D config.h.in +D intltool-extract.in +D intltool-merge.in +D intltool-update.in + +commit 3cd11c1bbc1e4f6e9ddbb62505f32f012efbd86a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed May 6 21:16:43 2009 +0100 + + [core] Added GNOME support for automagical proxy use + +M configure.in +M gdata/Makefile.am +M gdata/gdata-service.c + +commit 219d5c069e3172f374d472f19adb9ae552840fcb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed May 6 20:45:58 2009 +0100 + + [calendar] Added missing documentation about freeing memory + +M gdata/services/calendar/gdata-calendar-event.c + +commit 54819628cbf2c1a4d1a907dac0d9f3aee6628e88 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 27 19:39:19 2009 +0100 + + [core] Corrected uses of deprecated libxml API + +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 895a3f25756f0a368e6844c6caaf0b80c5612bef +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 27 18:44:26 2009 +0100 + + [calendar] Added recurrence support to GDataCalendarEvent + + Added gdata_calendar_event_[get|set]_recurrence, + gdata_calendar_event_get_original_event_details and + gdata_calendar_event_is_exception. Added a test case too. + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h +M gdata/tests/calendar.c + +commit 1ebf97cb0f45d12f3b1de608ffab00ba11606e2d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 27 17:46:19 2009 +0100 + + [core] Bug 580330 – Rejects empty entry titles + + Empty (but present) entry titles now result in GDataEntry:title + being set + to an empty string, while non-present titles continue to set it + to NULL. + A test case has been added. + +M gdata/gdata-entry.c +M gdata/tests/contacts.c + +commit ea3f9525d952da1d3302084e587b88a2884337d4 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Mon Apr 27 19:45:31 2009 +0200 + + Updated German translation + +M po/de.po + +commit 5ba1e0437e22d9adfe24bb46ddc9af05267af246 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 27 07:20:55 2009 +0100 + + [core] Fixed a crasher on oddly-formatted error messages + +M gdata/gdata-service.c + +commit c32d976cfa735c80c8cc2d90c8527deff61ad36a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 25 09:10:42 2009 +0100 + + Removed MAINTAINERS file and updated DOAP file + +D MAINTAINERS +M libgdata.doap + +commit 45554e6f9272a053d5bc6e07deaf9941a9b4c3b8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 23:37:56 2009 +0100 + + Incremented version number — switching to post-release incrementing + +M configure.in + +commit 15a2192105eaa9fb3cd0492b948ec02949309513 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 23:22:52 2009 +0100 + + Release version 0.2.0 + +M NEWS +M configure.in + +commit fac869e281111e7f937c2b7afe18699ba6b803a5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 23:17:09 2009 +0100 + + Updated British English translation and added missing file to + POTFILES.in + +M po/POTFILES.in +M po/en_GB.po + +commit 7ad97f6c6df7adb212d0dfd1c1c5d74f97bce0f4 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 23:14:27 2009 +0100 + + [core] Renamed gdata_service_[get|set]_proxy to *_proxy_uri + +M docs/reference/gdata-sections.txt +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols + +commit 31d0669d49abf1d1b0d605045d57687e12f4dda7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 22:18:44 2009 +0100 + + [youtube] Improved error handling when uploading videos + + Improved error handling when uploading videos so that it didn't + set GErrors + on top of older GErrors. Also updated the test suite to be in-line + with XML + changes. + +M gdata/services/youtube/gdata-youtube-service.c +M gdata/tests/youtube.c + +commit 9d40d2f5edfc76c877c7755f9e55edbbbdac4a57 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 22:17:56 2009 +0100 + + [calendar] Fixed test suite to run with latest XML changes + +M gdata/tests/calendar.c + +commit bf2d1638914db6a028c0d414b3a0e07cffe3a06f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 22:16:34 2009 +0100 + + [core] Fix a race condition crash when authenticating + + Fixed a race condition crash when authenticating asynchronously, + where the + authentication struct would sometimes get freed before the username + and + password were saved from it. + + Also removed gdata-marshal.h from gdata.h. + +M gdata/gdata-service.c +M gdata/gdata.h + +commit b1c6fc17500fd8fc94ad14665f197dab5196aa48 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 20:30:17 2009 +0100 + + [core] Don't install the marshalling functions as public API + +M gdata/Makefile.am + +commit 9c00679859d7f5d865185983f9cc34c142035ff6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 19:15:32 2009 +0100 + + [docs] Added "Since" clauses to all relevant documentation + +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-gdata.c +M gdata/gdata-query.c +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/contacts/gdata-contacts-service.c + +commit aa27bc07b28b2130263516a6fb59611cced5cefd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 18:44:58 2009 +0100 + + [youtube] Fixed overly-restrictive checks on constructing a + GDataYouTubeState + +M gdata/services/youtube/gdata-youtube.c + +commit fe0d4b5ec37fe451e3f76b0952f8eb6afae6622e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 18:40:48 2009 +0100 + + [docs] Standardised documentation a little better + +M gdata/gdata-atom.c +M gdata/gdata-feed.c +M gdata/gdata-gdata.c +M gdata/gdata-media-rss.c +M gdata/gdata-query.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube.c + +commit c7458e622d06a584b821a5a855d76559719a56e5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 18:29:22 2009 +0100 + + [docs] Added a HACKING file + +A HACKING +M Makefile.am + +commit b8c3977020051059695ed86abde47b01b7aa4dad +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 17:45:12 2009 +0100 + + [core] Boolean logic and casting fixes for GDataQuery + +M gdata/gdata-query.c + +commit 45b97b8400af31a21eb5730cadc54d93b925b5f5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 17:36:12 2009 +0100 + + [contacts] Build query URIs for GDataContactsQuery + + GDataContactsQuery can now put its properties into a query URI. A + test case + for contact query URIs has been added. + +M gdata/services/contacts/gdata-contacts-query.c +M gdata/tests/calendar.c +M gdata/tests/contacts.c + +commit 78634a3d84a8f4717e1a5d9d1b5393bb567f0536 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 24 07:31:14 2009 +0100 + + Build query URIs for GDataCalendarQuery + + GDataCalendarQuery can now put its properties into a query URI, as the + gdata_query_get_query_uri function has been virtualised. A test + case for + calendar query URIs has been added. + +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/tests/calendar.c + +commit 599e39034bd5abdbd2a3b20399193457c2192282 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 23 21:03:08 2009 +0100 + + Fixed colour parsing from hexadecimal + + Fixed gdata_color_from_hexadecimal to parse colours properly with + needing + any memory allocations. Added a test case for it. + +M gdata/gdata-types.c +M gdata/tests/general.c + +commit ff36399a92ced3c6a478a5961963d6ac2547d46f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 23 20:04:37 2009 +0100 + + Fixed handling of ISO 8601 dates (not date times) in calendar events + + Pure dates (not including a time) were not being handled at + all. Parsing + and producing XML for them now works, and a date parsing test case + has been + added. + +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/gdata-parser.c +M gdata/gdata-private.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/tests/calendar.c + +commit 536d985087eb2a65717ce35fbe0f933c22281fc9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 23 18:25:56 2009 +0100 + + Added a convenience function to get the time of a calendar event + + Added gdata_calendar_event_get_primary_time, allowing the only + time period + of an event to be easily retrieved. + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h + +commit 5cbbe124c9b3659f30bd41ce7128e94639002669 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 23 17:44:14 2009 +0100 + + Added the last bits of API documentation + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-media-rss.c +M gdata/gdata-types.c +M gdata/gdata-types.h +M gdata/services/youtube/Makefile.am +M gdata/services/youtube/gdata-youtube.c + +commit e41798a2ce893817be1c5f8601c48c7abf9a600b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 23 07:36:57 2009 +0100 + + Added API documentation for structs in the Media RSS and YouTube + namespaces + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-media-rss.c +M gdata/gdata-media-rss.h +M gdata/services/youtube/gdata-youtube.c +M gdata/services/youtube/gdata-youtube.h + +commit 5c5e31c4b0bf58b5237cd7fb019d1f055bcdbe26 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 22 22:00:51 2009 +0100 + + Added API documentation to GDataCalendarEvent + + Added the API documentation to GDataCalendarEvent, renamed + GDataCalendarEvent:event-status to :status, removed + gdata_calendar_event_set_edited and made the :edited property + read-only. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h +M gdata/tests/calendar.c + +commit da63cd5a60953a4e14990be483c29f99d2fd5dbb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 22 21:18:12 2009 +0100 + + Improved time handling for GDataCalendarEvent + + GDataCalendarEvent now fully supports multiple times, with the new + GDataGDWhen struct. Reminders are not yet supported, but the fields + exist + for them in the structs. + +M docs/reference/gdata-sections.txt +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h +M gdata/tests/calendar.c + +commit 172ac2c22c853841c2edfb405976bc3f962586fb +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 22 17:38:33 2009 +0100 + + General API cleanup + + Added gdata_service_get_proxy and a corresponding + GDataService:proxy-uri + property, which proxies SoupSession's proxy-uri property. + Renamed gdata_query_get_strict and gdata_query_set_strict to + gdata_query_is_strict and gdata_query_set_is_strict, respectively; + also + renamed the corresponding :strict property to :is-strict. + Renamed the boxed type function for GTimeVal to + gdata_g_time_val_get_type, + to avoid namespace clashes. + Added some functions to the symbols file which were missing. + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata-types.c +M gdata/gdata-types.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 4b341005cadd9852087c9cbbab79393cf3ff74ae +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 22 17:22:48 2009 +0100 + + Added API documentation for GDataCalendarCalendar + + Added the API documentation to GDataCalendarCalendar, renamed + :hidden to + :is-hidden and :selected to :is-selected, and removed + gdata_calendar_calendar_set_times_cleaned, + gdata_calendar_calendar_set_access level and + gdata_calendar_calendar_set_edited. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h + +commit c41114dd844d9f30ad0e8053085fe4eec3097993 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 22 16:25:54 2009 +0100 + + Added API documentation for GDataCalendarService and + GDataCalendarQuery + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h + +commit 3f7a541350d7effb1ab3d9ae26c49bc417ee0ad3 +Author: Mario Blättermann <mariobl@gnome.org> +Date: Tue Apr 21 19:11:30 2009 +0200 + + Added German translation + +M po/LINGUAS +A po/de.po + +commit e5ac4b50e82dbbb87b8b4b5afb1dc6cbd408189c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 20 22:14:16 2009 +0100 + + Bug 579631 – Add G_GNUC_WARN_UNUSED_RESULT to functions + + Added G_GNUC_WARN_UNUSED_RESULT attributes to all functions which + return + allocated memory, especially the _insert_entry and _update_entry + functions, + which return the updated entries, which might be missed by some users. + +M gdata/gdata-atom.h +M gdata/gdata-entry.h +M gdata/gdata-gdata.h +M gdata/gdata-media-rss.h +M gdata/gdata-private.h +M gdata/gdata-query.h +M gdata/gdata-service.h +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/contacts/gdata-contacts-service.h +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-video.h +M gdata/services/youtube/gdata-youtube.h + +commit b187cdcfad632f6657db411643efef5d60a29d99 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 20 21:42:38 2009 +0100 + + Added G_GNUC_CONST attributes to all _get_type functions + +M gdata/gdata-entry.h +M gdata/gdata-feed.h +M gdata/gdata-parser.h +M gdata/gdata-query.h +M gdata/gdata-service.h +M gdata/gdata-types.h +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/contacts/gdata-contacts-service.h +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-video.h + +commit 1ff0f89f10419c442ed4a1bb05569501724eae88 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 20 19:21:47 2009 +0100 + + Limit handling for gdata_contacts_contact_set_extended_property + + Return FALSE from gdata_contacts_contact_set_extended_property if + the user + attempts to set more than the allowed number of extended properties + (10). + +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h + +commit 99cabc1aa57eaff4d33818c9b87babda1fd06051 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 20 19:07:40 2009 +0100 + + Added API documentation for GDataContactsContact + + Added full API documentation for GDataContactsContact, and removed + gdata_contacts_contact_set_edited, since the :edited property is + read-only. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h + +commit cf5e5c5813737e2bd468beb2fdd41ddece3b7089 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Apr 20 07:57:45 2009 +0100 + + Added API documentation for GDataContactsQuery and + GDataContactsService + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-service.c +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/contacts/gdata-contacts-query.h +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h + +commit 057d049176c2c56381716134cd6355feb9fe9785 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 19 21:39:37 2009 +0100 + + Renamed GDataGDPhoneNumber->phone_number to ->number for consistency + +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/services/contacts/gdata-contacts-contact.c + +commit ce0ac112bf3a370a2ffd727b8074fd41a54afa80 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 19 21:08:55 2009 +0100 + + Added methods to get the primary e-mail address (etc.) from a contact + +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-contact.h + +commit 68676c15218cd44866b6186289f231dad7957cab +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 19 18:30:23 2009 +0100 + + Add contact insertion support and test suite + + Added gdata_contacts_service_insert_contact to allow contacts to + be inserted, + and added a contacts service test suite, testing queries and + insertion. + Also fixed parsing of contacts without "primary" parameters. + +M gdata/gdata.symbols +M gdata/services/contacts/gdata-contacts-contact.c +M gdata/services/contacts/gdata-contacts-service.c +M gdata/services/contacts/gdata-contacts-service.h +M gdata/tests/Makefile.am +A gdata/tests/contacts.c + +commit 4d8a57133367e40d1c7bc5b17d362f0160f7c98a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 19 16:31:12 2009 +0100 + + Added GDataContactsContact + + Added support for individual contacts in the contacts backend, + including + full XML parsing and building support. No documentation or test + cases yet. + +M gdata/Makefile.am +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/contacts/Makefile.am +A gdata/services/contacts/gdata-contacts-contact.c +A gdata/services/contacts/gdata-contacts-contact.h +M gdata/services/contacts/gdata-contacts-query.c +M gdata/services/contacts/gdata-contacts-service.h + +commit 87066f62ecd474423ff00359d27852e67d829e42 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 19 10:54:10 2009 +0100 + + Added initial contacts service work + + Added GDataContactsService with skeleton code for querying for + contacts. + Added the necessary support for more elements in the GData namespace + to + gdata-gdata.[ch], and also added a GDataContactsQuery with + contact-specific + query parameters. + +M configure.in +M docs/reference/gdata-sections.txt +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/Makefile.am +A gdata/services/contacts/Makefile.am +A gdata/services/contacts/gdata-contacts-query.c +A gdata/services/contacts/gdata-contacts-query.h +A gdata/services/contacts/gdata-contacts-service.c +A gdata/services/contacts/gdata-contacts-service.h + +commit 725d5fc1d845781645633fd12c5a732cda0a8f3e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 19 18:24:24 2009 +0100 + + Fixed typo in previous commit + +M gdata/gdata-feed.c + +commit a793b9eda493fe083a0968d1691fa6fa9710193b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 19 17:17:03 2009 +0100 + + Fix a NULL pointer dereference in gdata-feed.c + +M gdata/gdata-feed.c + +commit 47def37a7238f9454efd3120e5dbda09c90301d7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 19 08:08:47 2009 +0100 + + Removed redundant parameters from insert and update functions + + Removed the entry_type parameters from _insert_entry and + _update_entry, as + the entry's type can be acquired from the entry being inserted + or updated + itself. + +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/services/calendar/gdata-calendar-service.c + +commit a3ab634d90395ee6a143da96c3c248e9748ed728 +Author: Daniel Nylander <po@danielnylander.se> +Date: Sun Apr 19 05:10:06 2009 +0200 + + Added sv translation + +M po/LINGUAS +A po/sv.po + +commit f19d93c7ff15cfeccc7ea089b327945cd89fba4b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 19 00:22:56 2009 +0100 + + Updated ChangeLog code and .gitignore macro file + + Updated ChangeLog Automake code from + http://live.gnome.org/Git/ChangeLog, + and .gitignore macro file from Pango master. + +M Makefile.am +M git.mk + +commit 08a5db51d3a1d4f796cd9c12c04400a704b57ba3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 18 23:58:02 2009 +0100 + + Compiler warning fixes + +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-media-rss.c +M gdata/gdata-media-rss.h +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 4122109f69a71e49cbe314b0f5f15b4c6e7c4af2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Apr 18 15:46:21 2009 +0100 + + Auto-generate .gitignore file using git.mk from Pango + + The .gitignore files are now auto-generated using git.mk. A few + cleanups have + been made to the Makefiles to ensure everything's cleaned up properly. + +D .gitignore +M Makefile.am +M docs/Makefile.am +D docs/reference/.gitignore +M docs/reference/Makefile.am +M gdata/Makefile.am +M gdata/services/Makefile.am +M gdata/services/calendar/Makefile.am +M gdata/services/youtube/Makefile.am +M gdata/tests/Makefile.am +A git.mk + +commit 750f8b0598c8c365b22f8bd5594e7de6f4ad3f8b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 17 19:11:58 2009 +0100 + + Added British English translation + +M po/LINGUAS +A po/en_GB.po + +commit b411e37c4728429b6658107bc5e45247d5d69747 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 17 11:48:59 2009 +0100 + + Removed po ChangeLog and fixed permissions + + Removed the po ChangeLog too (see previous commit), and removed + an extraneous + execute permission bit. + +M docs/reference/version.xml.in +D po/ChangeLog + +commit b3043e515d0b06d04d640aa0cce14866ba57ff04 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 17 11:40:53 2009 +0100 + + Add a DOAP file and auto-generate the ChangeLog + + Add a DOAP file to give cgit a module description, and convert to + auto-generating the ChangeLog from the git log. + +D ChangeLog +M Makefile.am +A libgdata.doap + +commit 008e022c0307be0b1e1833266a8a5480c2f979d1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 16 15:40:53 2009 +0100 + + Bug 578661 – ETag support + + Add support for ETags, to allow for versioning when querying, updating + and deleting entries. This involved adding new API to GDataQuery to + allow the + required ETag to be set for queries, as well as new properties in + GDataEntry and GDataFeed for the ETags. + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/general.c + +commit 290b92c174680472ca75eb07f7fb84902b3248fd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 16 13:20:01 2009 +0100 + + Refactored entry creation a little + + The code to create entries from XML strings was duplicated in several + places and has now been refactored out into _gdata_entry_new_from_xml. + +M gdata/gdata-entry.c +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/youtube/gdata-youtube-video.c + +commit efaa27526a42956ece7a43132f41640bbbcf073c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 16 12:51:03 2009 +0100 + + Improve namespace handling regarding unhandled XML elements + + The namespaces for unhandled XML elements are now appended to the + list of namespaces used when updating entries, so that server-side + XML validation + errors don't occur. + +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/general.c + +commit d7ceecab8c0622947e3cd826b4901fbcf8fca329 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 16 11:47:58 2009 +0100 + + Bug 578662 – Support unknown XML elements + + Add support for storing the XML for unknown elements, and including + it when updating entries, so that data added by protocol updates + isn't lost by + older versions of libgdata. Adds a test case. + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-private.h +M gdata/gdata-query.c +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/general.c + +commit d6daa624389df926bb59b9b288cd20be69d7450d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 15 23:55:23 2009 +0100 + + Improved documentation gdata_service_authenticate + +M gdata/gdata-service.c + +commit 3ac9d496f1a70033db532f213328a88a0e8fd494 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 15 22:25:05 2009 +0100 + + Added calendar event insertion support + + GDataCalendarEvents can now be serialised to XML, and a convenience + method in GDataCalendarService, gdata_calendar_service_insert_event, + has been + added to allow events to be inserted. A test case has been added. + +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/tests/calendar.c +M gdata/tests/common.h + +commit f56b50521b0826b3d9210b3e9fb97a0de2249442 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 15 22:23:50 2009 +0100 + + Force usernames to be e-mail addresses + + GDataService will now silently correct usernames which are not e-mail + addresses such that they are, assuming they're on the gmail.com + domain. This is + required for the Calendar service. + +M gdata/gdata-service.c + +commit 00880095176e801031c66ad8fc90e17fab2737b6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 15 22:21:40 2009 +0100 + + Added proper redirection handling for insertions, updates and + deletions + + Redirects from the server are now handled correctly when inserting, + updating or deleting entries. The code to send SoupMessages has + been refactored + a little, and gdata_service_get_session has consequently been removed. + +M docs/reference/gdata-sections.txt +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-service.c + +commit e5369451280a7cfa15ea7756ee204cb2911f5f11 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 15 12:31:22 2009 +0100 + + Fixed include in gdata-youtube-enums.c + + Patch by Víctor Manuel Jáquez Leal <vjaquez@igalia.com> (by + e-mail) to + fix the includes in gdata-youtube-enums.c. + +M gdata/services/youtube/Makefile.am + +commit 88106a366e4539772406a92786ca6ad347e4454d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 10 23:44:50 2009 +0100 + + Fix asynchronous queries without a GDataQuery + + Drop the requirement of having a GDataQuery for asynchronous queries, + as has been done for synchronous ones. + +M gdata/gdata-service.c + +commit 3a23d80a2068c7285dbca119d1342aa16140b2ea +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 10 21:04:24 2009 +0100 + + Bug 578653 – self-test fails to build on glib-2.18.x + + Push the GLib requirement up to 2.19.0, spotted by Daniel Macks. + +M configure.in + +commit 4c528d3e15439d1f297bb3e943f10be8fbe0348d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Apr 10 20:52:06 2009 +0100 + + Bug 578652 — Build failure: missing symbol: + gdata_query_param_get_type + + Removed a non-existent symbol from gdata.symbols, spotted by Daniel + Macks. + +M gdata/gdata.symbols + +commit 631fb2cdde424a742a1739528e0e62174e17e0b7 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 9 17:49:20 2009 +0100 + + Added basic proxy support to GDataService. + +M docs/reference/gdata-sections.txt +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols + +commit 89bfc2ed7c021315cdcd74130da19a0b12fde79f +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 9 17:36:48 2009 +0100 + + Added the ability to delete entries from the server. + A few small fixes to other service functions. + +M docs/reference/gdata-sections.txt +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols + +commit 0beb4016bd4b7628e236aea1e81d40b266a08677 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 9 17:25:00 2009 +0100 + + Added functionality to update entries. + Fix for previous commit. + +M docs/reference/gdata-sections.txt +M gdata/gdata-feed.c +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols + +commit 0902ab374fa8903d29d5e787fedaa3708d29b080 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 9 16:56:46 2009 +0100 + + Added a function to look up an entry from a feed by ID. + +M docs/reference/gdata-sections.txt +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata.symbols + +commit 41443aa559334b709b0e5d310096455b258cbdc9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 9 16:24:56 2009 +0100 + + Return the updated entry when inserting an entry. + A few fixes for previous commits. + +M gdata/gdata-entry.c +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/general.c +M gdata/tests/youtube.c + +commit 5657b4d6013f16700bd205a85963572b98c62522 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 9 10:07:24 2009 +0100 + + Allowed IDs to be specified when creating a GDataEntry (or + derivative). + +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit b853a5684397e852485194bc3e3a05462b7b26bc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Apr 9 10:03:23 2009 +0100 + + Added some missing getters for lists of data in the main and calendar + services. + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h + +commit 8a69d8bb3c5eb526d75f61ce4ac75836d0da2b2a +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Apr 5 19:38:43 2009 +0100 + + Only run the gtk-doc test suite if we're compiling with gtk-doc + support + enabled. + +M docs/reference/Makefile.am + +commit 058643abbc2fce01ef4f9500b37ca9cfb6364529 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 1 22:03:29 2009 +0100 + + Release version 0.1.1. + Fix a few missed function call renames. + +M NEWS +M configure.in +M docs/reference/Makefile.am +M gdata/gdata-service.c +M gdata/services/youtube/gdata-youtube-service.c + +commit 29d12a6695a8622e48cd92c857cfb48294a113c9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 1 21:43:24 2009 +0100 + + Updated the README and added the library's web page. + +M README + +commit e5121b48d38ed1b2a06b7ec051b9fce64fa65145 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 1 21:39:47 2009 +0100 + + Fixed licence to consistently be LGPLv2.1. + +M COPYING.LIB +M gdata/gdata-atom.c +M gdata/gdata-atom.h +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/gdata-media-rss.c +M gdata/gdata-media-rss.h +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-private.h +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata-types.c +M gdata/gdata-types.h +M gdata/gdata.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +M gdata/services/youtube/gdata-youtube.c +M gdata/services/youtube/gdata-youtube.h +M gdata/tests/calendar.c +M gdata/tests/common.h +M gdata/tests/general.c +M gdata/tests/memory.c +M gdata/tests/youtube.c + +commit 48ce93902fc9dd6684e14830c07199ac830c30af +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 1 18:40:55 2009 +0100 + + Rename some functions from "lookup" -> "look_up". + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata.symbols + +commit 3694f62b4eb92d16d68561790ce7b209cf86e904 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 1 18:16:53 2009 +0100 + + Release version 0.1.0. + Fix a few things breaking the build, and temporarily remove the + gtk-doc testsuite. + +M Makefile.am +M NEWS +M README +M configure.in +M gdata/Makefile.am +M gdata/gdata.h +M gdata/services/calendar/Makefile.am +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/youtube/Makefile.am +M gdata/services/youtube/gdata-youtube-video.c +M gdata/tests/Makefile.am +M gdata/tests/general.c +M po/POTFILES.in + +commit cef0a15269e28917531defa7aad03bd4ce193003 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Apr 1 00:17:17 2009 +0100 + + Finished documenting GDataYouTubeVideo, and fixed a few small code + issues elsewhere. + Lots of API was removed from GDataYouTubeVideo, as it involved + modifying server-side-only data. + +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-query.c +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit 40000c0fd519757e24624dbb5a032396a0a8340e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 31 07:52:42 2009 +0100 + + More documentation and some API removal for GDataYouTubeVideo. + +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-video.c + +commit 52cb30d80e21348a08a760c5eef213980dd08173 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 30 21:30:02 2009 +0100 + + Added the beginnings of documentation for GDataYouTubeVideo. + +M docs/reference/Makefile.am +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit 252f60c1de6325dd7b2197d8d9a0c46b855df585 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 30 20:44:26 2009 +0100 + + Made a few parser functions private and documented the parser + error codes. + +M docs/reference/Makefile.am +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-private.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/youtube/gdata-youtube-video.c + +commit 4d2a7e57506eaeb8e02f3453d8d19cc466f278c1 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 30 20:25:48 2009 +0100 + + Added documentation to the GData and Atom namespace structs and + functions. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-atom.c +M gdata/gdata-atom.h +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/services/youtube/gdata-youtube-service.h + +commit 07ce9c743d1756c99aea631358ebcd7f8d463b99 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 27 18:57:10 2009 +0000 + + Finished documentation for GDataYouTubeService. + +M gdata/services/youtube/gdata-youtube-service.c + +commit 0429c15711b758762a69734550cbf8751c29eafc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 26 23:41:32 2009 +0000 + + Started documenting GDataYouTube service, and added support for + building proper GObject enums for the YouTube backend. + +M .gitignore +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata.symbols +M gdata/services/youtube/Makefile.am +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h + +commit b62f351ecf1f0f5ee75a61eb26a472ad58d5ad68 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Mar 26 23:12:58 2009 +0000 + + Finished GDataQuery documentation and improved some of its API in + the process. + +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-service.h + +commit 15dded293df6980731f6fd43d63660030846b896 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 25 23:14:50 2009 +0000 + + Added half of the documentation to GDataQuery, and removed a few + unnecessary functions. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-query.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/tests/general.c + +commit 48ca5e98e4ec233f6cd5df3fe061e8afd4a6b50e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 24 23:50:26 2009 +0000 + + Added documentation to GDataEntry and removed a few bits of API + which shouldn't exist. + +M docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-service.c +M gdata/tests/general.c + +commit 4958c840ddff2f432127e5edcefbf8c539b937a5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 24 20:19:24 2009 +0000 + + Started work on the API documentation, adding documentation to + GDataService and GDataFeed. + Privatised some API in the process. + +A docs/reference/.gitignore +D docs/reference/MODULE.types +M docs/reference/Makefile.am +A docs/reference/gdata-docs.xml +M docs/reference/gdata-sections.txt +D docs/reference/gdata.sgml +D docs/reference/gdata.types +M docs/reference/version.xml.in +M gdata/Makefile.am +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-service.c + +commit 069df1bd0d77ef9195102e0caa9d63356fcc71a8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 23 22:55:06 2009 +0000 + + Added support for the app:control element. + Fixed a crash when executing a query with pagination but without + a GDataQuery. + Added a testcase for app:control. + +M gdata/gdata-query.c +M gdata/gdata-service.c +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/youtube/Makefile.am +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h +C050 gdata/gdata.h gdata/services/youtube/gdata-youtube.c +C051 gdata/gdata.h gdata/services/youtube/gdata-youtube.h +M gdata/tests/youtube.c + +commit 914b443a8d2c18858e22502867012308438c54f3 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Mar 22 14:49:06 2009 +0000 + + Fix query URI building for feed URIs which already have query + parameters + +M gdata/gdata-query.c + +commit b24819a5f0feb30bb92cefe8ec63746078383a3c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Mar 22 14:25:03 2009 +0000 + + Fixed problems with the progress callback for entry parsing, ensuring + the total_results is the number of results which will actually be + retrieved, rather than the number of results available for the search + altogether; also ensuring that the callback's called with an equal + priority to the ready callback. + +M gdata/gdata-feed.c +M gdata/gdata-query.c + +commit c3b56e77b05a0f2ccd1f9854ae3d62b11f6c4d94 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 18 18:33:15 2009 +0000 + + Added pagination functionality to GDataQuery. + +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-private.h +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata.symbols + +commit 8a8f585051762101d500f15125c4316210b743fc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Mar 15 23:19:19 2009 +0000 + + Some fixes to error handling in the face of no network connection. + Addition of a function to get media content from YouTube videos. + +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit 8a09b7931f3e9826e6fd595f1eaa5b8eca519f03 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Mar 15 21:05:21 2009 +0000 + + Ensured the feed parsing progress callback is called in the main + thread. + +M gdata/gdata-feed.c + +commit ab7a62b1c166b511ac42d70d9fb5e7e899290862 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 13 22:59:40 2009 +0000 + + Fixed some bad NULL checks in the GData element code. + Vastly improved default query error handling. + Fixed a bug where all requests would fail if you weren't + authenticated. + +M gdata/gdata-gdata.c +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h + +commit 0be5c6a09966cbc8a7d72f803e05aacd19a6fb60 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 13 21:44:12 2009 +0000 + + Added a function to allow the list of thumbnails for a YouTube video + to be retrieved. + +M gdata/gdata.symbols +M gdata/services/youtube/gdata-youtube-video.c +M gdata/services/youtube/gdata-youtube-video.h + +commit 6b43de4caf03f89fe6db40b84771da7f0aeab2fd +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Mar 13 19:57:08 2009 +0000 + + Added progress callbacks. + Rearranged API to use GDataQuerys exclusively, rather than having + simple and "full" versions of each and every query function. + +M gdata/gdata-feed.c +M gdata/gdata-private.h +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h +M gdata/tests/calendar.c +M gdata/tests/memory.c +M gdata/tests/youtube.c + +commit 338110cf62c513ca1a9a5b8024df79190f4a9cb2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 11 23:38:50 2009 +0000 + + Fixed includes in public headers. + Updated and fixed the pkg-config file. + +M .gitignore +M Makefile.am +M configure.in +M gdata/gdata-entry.h +M gdata/gdata-feed.h +M gdata/gdata-private.h +M gdata/gdata-service.h +M gdata/services/calendar/gdata-calendar-calendar.h +M gdata/services/calendar/gdata-calendar-event.h +M gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.h +M gdata/services/youtube/gdata-youtube-service.h +M gdata/services/youtube/gdata-youtube-video.h +R080 gdata.pc.in libgdata.pc.in + +commit f4984a79e5748a239c2d93edc54d89d359cfb911 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Mar 10 00:02:59 2009 +0000 + + Enabled building of enums and tidied up a few TODOs relating to + error handling. + +M .gitignore +M gdata/Makefile.am +M gdata/gdata-parser.h +M gdata/gdata-service.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h + +commit 7fdc4b68c4929426dca95b131338fde41a2b24b9 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Mon Mar 9 23:17:14 2009 +0000 + + Improved error handling for the YouTube service. + +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/services/youtube/gdata-youtube-service.c +M gdata/services/youtube/gdata-youtube-service.h + +commit 37a995845cd8d7ee45e2748f6256991cb633f8f8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 4 21:38:32 2009 +0000 + + Refactored some of the test suites to use a common username, password + and client ID. + Added some memory tests and fixed a few small memory leaks. + +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/tests/Makefile.am +M gdata/tests/calendar.c +A gdata/tests/common.h +A gdata/tests/massif +A gdata/tests/memcheck +A gdata/tests/memory.c +M gdata/tests/youtube.c + +commit 18b1306943d126cd09ddba5f21c31077ecc92d45 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Mar 4 18:16:10 2009 +0000 + + Added the rest of the parsing code to GDataCalendarEvent so that the + calendar test suite succeeds. + +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h + +commit 348277440991e68bc6d100b27aa0908204870f67 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Mar 1 00:43:55 2009 +0000 + + Fixes and additions to calendar event feed parsing. + +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-gdata.c +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-event.c +M gdata/services/calendar/gdata-calendar-event.h + +commit b33d07bb83d52a0d5dcb38e41941c08d9092a7a6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Feb 24 22:49:51 2009 +0000 + + Added a small note about missing functionality. + +M gdata/services/calendar/gdata-calendar-query.c + +commit 9ba26a99e02a3c75dd3261d10022580ce4db52bc +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Feb 24 22:47:56 2009 +0000 + + Added the beginnings of support for calendar event feeds, including + basic support for Google Calendar-specific query parameters. + +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-private.h +M gdata/gdata-query.c +M gdata/gdata.symbols +M gdata/services/calendar/Makefile.am +M gdata/services/calendar/gdata-calendar-calendar.c +A gdata/services/calendar/gdata-calendar-event.c +A gdata/services/calendar/gdata-calendar-event.h +A gdata/services/calendar/gdata-calendar-query.c +A gdata/services/calendar/gdata-calendar-query.h +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/tests/calendar.c + +commit d9936425571b0ea8faeb2fd58071c2b5edede36d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Feb 24 21:22:53 2009 +0000 + + Added "own calendars" query. + +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/calendar/gdata-calendar-service.h +M gdata/tests/calendar.c + +commit 26f35eac2fc9c07f24cb6d29b93281aad3e2169e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Feb 24 21:18:40 2009 +0000 + + Changed to use g_set_error_literal instead of g_set_error where + possible. + Changed "log in" terminology to "authenticate" to be more in-line + with the specification. + +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/calendar/gdata-calendar-service.c +M gdata/services/youtube/gdata-youtube-service.c +M gdata/tests/calendar.c +M gdata/tests/youtube.c + +commit 1ea0f3cc26f2abf8788166cf0728b764c19dc1f5 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Feb 22 22:22:52 2009 +0000 + + Added support for quite a few gCal elements to GDataCalendarCalendar + such that the "all calendars" query now works. + +M gdata/gdata-types.c +M gdata/gdata-types.h +M gdata/services/calendar/gdata-calendar-calendar.c +M gdata/services/calendar/gdata-calendar-calendar.h + +commit da0e1af3b9b408772b094b2abfb37059bdb6734b +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Feb 22 19:51:48 2009 +0000 + + Fixed authentication error handling a little, and re-enabled + authentication for Google Calendar and YouTube. + +M gdata/gdata-service.c +M gdata/gdata.symbols +M gdata/tests/calendar.c +M gdata/tests/youtube.c + +commit aea5e19e97a80f9b9f694914c36611a27e94ab6d +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Feb 22 18:13:59 2009 +0000 + + Added the basic framework for a Google Calendar service. + +M configure.in +M gdata/Makefile.am +M gdata/gdata-private.h +M gdata/gdata.h +M gdata/gdata.symbols +M gdata/services/Makefile.am +A gdata/services/calendar/Makefile.am +A gdata/services/calendar/gdata-calendar-calendar.c +A gdata/services/calendar/gdata-calendar-calendar.h +A gdata/services/calendar/gdata-calendar-service.c +A gdata/services/calendar/gdata-calendar-service.h +M gdata/tests/Makefile.am +A gdata/tests/calendar.c + +commit 479fe7e547efea28613a1df123e1b2cc34c3b4b6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Tue Feb 24 21:00:52 2009 +0000 + + Updated git ignore list. + +M .gitignore + +commit d497598bd16f5009b25a204a08954beaedbdbca6 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Feb 22 19:16:02 2009 +0000 + + Added proper error handling for authentication, including support + for CAPTCHA challenges. + +M gdata/gdata-marshal.list +M gdata/gdata-service.c +M gdata/gdata-service.h + +commit 7cbc1041d643363a7bf7d1d3697483c091f6e824 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Feb 22 11:50:39 2009 +0000 + + Moved the YouTube service files to a subdirectory, to be built into + their own noinst library. + + Fixed some bugs causing the general test suite to fail. + +M configure.in +M gdata/Makefile.am +M gdata/gdata-entry.c +M gdata/gdata-private.h +M gdata/gdata.h +M gdata/services/Makefile.am +A gdata/services/youtube/Makefile.am +R100 gdata/services/gdata-youtube-service.c +gdata/services/youtube/gdata-youtube-service.c +R100 gdata/services/gdata-youtube-service.h +gdata/services/youtube/gdata-youtube-service.h +R100 gdata/services/gdata-youtube-video.c +gdata/services/youtube/gdata-youtube-video.c +R100 gdata/services/gdata-youtube-video.h +gdata/services/youtube/gdata-youtube-video.h +M gdata/tests/general.c + +commit 9bf0973ccc444b0598a8e9a8721a463c2f462a2c +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Feb 22 11:37:39 2009 +0000 + + Fix the README, and change .bzrignore to .gitignore. + +R100 .bzrignore .gitignore +M README + +commit c9eadbe3c6bd99a0d05c677681b80b0c7a428723 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Feb 22 11:29:00 2009 +0000 + + 2009-02-22 Philip Withnall <philip@tecnocode.co.uk> + + Improved documentation (README, ChangeLog). + +M ChangeLog +M README +M po/Makefile.in.in + +commit c0e43775ee41bf06e890b2e64d251b1341ef61e2 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Feb 21 14:00:20 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090221140020-bbhqtx4gyh2yxg5e] + Added support for querying for related videos and fixed a bug parsing + <yt:statistics/>. + +M .bzrignore +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata.symbols +M gdata/services/gdata-youtube-service.c +M gdata/services/gdata-youtube-service.h +M gdata/services/gdata-youtube-video.c +M gdata/tests/youtube.c + +commit e18cc8aa1376ab406f7a65d2885160056902a828 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Feb 20 00:08:33 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090220000833-9goap90j2b3xbtc0] + Completed functionality to upload videos to YouTube. There are a few + elements in the response which are still unparsed, but the tests in + the suite + work. + +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-media-rss.c +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/gdata-youtube-service.c +M gdata/services/gdata-youtube-service.h +M gdata/services/gdata-youtube-video.c +M gdata/services/gdata-youtube-video.h +A gdata/tests/sample.ogg +M gdata/tests/youtube.c + +commit a88f19fda5f31941ae43961e012fc927d214d3be +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Wed Feb 11 17:58:53 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090211175853-ecv85loqsylxxl9x] + Removed generated file. + +D gtk-doc.make + +commit 06e337bdbc9e22293113d4775fb50424e822e836 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun Jan 25 15:23:26 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090125152326-biwzyqlh333h7ikc] + Initial support for inserting entries, mainly adding functionality + to serialise GDataEntry and GDataYouTubeVideo to XML. + +M gdata/gdata-atom.c +M gdata/gdata-atom.h +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-media-rss.c +M gdata/gdata-media-rss.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/gdata-youtube-service.c +M gdata/services/gdata-youtube-video.c +M gdata/tests/general.c + +commit b154cde46cafba05efc852c4a9cd7fceeac36e6e +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jan 24 17:10:09 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090124171009-sk8dkywi1ag24j7v] + Converted all async functions to use GAsyncResult, and implemented + overridden versions for YouTubeVideo. Added testcases, and generally + made sure all + current async functionality works nicely. + + Fixed a small bug when parsing <media:credit> elements. + +M gdata/gdata-query.c +M gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/gdata-youtube-service.c +M gdata/services/gdata-youtube-service.h +M gdata/services/gdata-youtube-video.c +M gdata/tests/youtube.c + +commit 363fde1acb9f3d7bd12e185b666b7422c9408a75 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jan 24 12:11:13 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090124121113-it97rcwt39n19riq] + Consolidated the MediaGroup classes into YouTubeVideo, since that + was the only class which would ever use them. + +M gdata/Makefile.am +D gdata/gdata-media-group.c +D gdata/gdata-media-group.h +M gdata/gdata-private.h +M gdata/services/Makefile.am +D gdata/services/gdata-youtube-media-group.c +D gdata/services/gdata-youtube-media-group.h +M gdata/services/gdata-youtube-video.c +M gdata/services/gdata-youtube-video.h + +commit 00d0c84dc37da65b98a23d1c593ea189d5fc2dc8 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jan 23 23:42:49 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090123234249-obzjzy8dvtmkz3hl] + Redesigned how feeds are parsed such that there is no longer any + need for public setters, and there should be fewer memcpys. + +M gdata/gdata-feed.c +M gdata/gdata-feed.h +M gdata/gdata-parser.c +M gdata/gdata-parser.h +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/gdata-youtube-media-group.c +M gdata/services/gdata-youtube-video.c + +commit ec04a065e4ef476ebd656919919751d220b2ef48 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Fri Jan 23 22:40:17 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090123224017-l6p5ji4oqu3e8xxr] + Added mostly-complete support for video comments. + +M gdata/gdata-gdata.c +M gdata/gdata-gdata.h +M gdata/services/gdata-youtube-video.c + +commit c836518e056bd3b862e12360af5ab53cd2122a12 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jan 22 19:13:58 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090122191358-5ko4fx27s8hlmpw7] + Cleaned up parsing of numbers a little, and cleaned up parsing + error handling. + Also tidied up feed creation, and removed the now-redundant + GDataYouTubeVideoFeed object. + +M gdata/Makefile.am +M gdata/gdata-entry.c +M gdata/gdata-feed.c +M gdata/gdata-media-group.c +A gdata/gdata-parser.c +A gdata/gdata-parser.h +M gdata/gdata-private.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.h +M gdata/services/Makefile.am +M gdata/services/gdata-youtube-media-group.c +M gdata/services/gdata-youtube-service.c +M gdata/services/gdata-youtube-service.h +D gdata/services/gdata-youtube-video-feed.c +D gdata/services/gdata-youtube-video-feed.h +M gdata/services/gdata-youtube-video.c +M gdata/tests/youtube.c + +commit a02546b08437fe3552c0b2591721953d36aaae79 +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Thu Jan 22 18:00:38 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090122180038-32miepaqnljxjtcu] + Added basic async support, and greatly expanded the parsing code + such that almost all of a typical YouTube GData query is now parsed + into data + structures. + +M .bzrignore +M gdata/Makefile.am +A gdata/gdata-atom.c +A gdata/gdata-atom.h +M gdata/gdata-entry.c +M gdata/gdata-entry.h +M gdata/gdata-feed.c +M gdata/gdata-feed.h +A gdata/gdata-gdata.c +A gdata/gdata-gdata.h +A gdata/gdata-marshal.list +A gdata/gdata-media-group.c +A gdata/gdata-media-group.h +A gdata/gdata-media-rss.c +A gdata/gdata-media-rss.h +M gdata/gdata-private.h +A gdata/gdata-query.c +A gdata/gdata-query.h +M gdata/gdata-service.c +M gdata/gdata-service.h +M gdata/gdata.symbols +M gdata/services/Makefile.am +A gdata/services/gdata-youtube-media-group.c +A gdata/services/gdata-youtube-media-group.h +M gdata/services/gdata-youtube-service.c +M gdata/services/gdata-youtube-video.c +M gdata/services/gdata-youtube-video.h + +commit 3ea04f77323acbd85b95d863dd730e2fd8f009ed +Author: Philip Withnall <philip@tecnocode.co.uk> +Date: Sat Jan 3 10:02:43 2009 +0000 + + [project @ philip@tecnocode.co.uk-20090103100243-4ge6fir3bu8o3t3d] + 2009-01-03 Philip Withnall <philip@tecnocode.co.uk> + + Initial commit, with basic functional queries for YouTube + and the + generic GData API. No async support, and limited support + for lots + of the XML elements. + +A .bzrignore +A AUTHORS +A COPYING.LIB +A ChangeLog +A INSTALL +A MAINTAINERS +A Makefile.am +A Makefile.decl +A NEWS +A README +A autogen.sh +A config.h.in +A configure.in +A docs/Makefile.am +A docs/reference/MODULE.types +A docs/reference/Makefile.am +A docs/reference/gdata-overrides.txt +A docs/reference/gdata-sections.txt +A docs/reference/gdata.sgml +A docs/reference/gdata.types +A docs/reference/version.xml.in +A gdata.pc.in +A gdata/Makefile.am +A gdata/gdata-entry.c +A gdata/gdata-entry.h +A gdata/gdata-feed.c +A gdata/gdata-feed.h +A gdata/gdata-private.h +A gdata/gdata-service.c +A gdata/gdata-service.h +A gdata/gdata-types.c +A gdata/gdata-types.h +A gdata/gdata.h +A gdata/gdata.symbols +A gdata/services/Makefile.am +A gdata/services/gdata-youtube-service.c +A gdata/services/gdata-youtube-service.h +A gdata/services/gdata-youtube-video-feed.c +A gdata/services/gdata-youtube-video-feed.h +A gdata/services/gdata-youtube-video.c +A gdata/services/gdata-youtube-video.h +A gdata/tests/Makefile.am +A gdata/tests/general.c +A gdata/tests/youtube.c +A gtk-doc.make +A intltool-extract.in +A intltool-merge.in +A intltool-update.in +A po/ChangeLog +A po/LINGUAS +A po/Makefile.in.in +A po/POTFILES.in diff --git a/HACKING b/HACKING new file mode 100644 index 0000000..32917c7 --- /dev/null +++ b/HACKING @@ -0,0 +1,216 @@ +Formatting +========== + +All code should follow the same formatting standards which are broadly based on the GNU style (http://www.gnu.org/prep/standards.html) with some +additions. Briefly: + + - Tab indents are used and braces for blocks go on the same line as the block statement: + + if (x < foo (y, z)) { + haha = bar[4] + 5; + } else { + while (z) { + haha += foo (z, z); + z--; + } + return abc (haha); + } + + Braces should be omitted for single-line blocks, but included for all blocks in a multi-part if statement which has blocks containing more than + one line (as above). + + - Spaces should be present between function name and argument block, and after commas: + + foo (z, z) + + - In pointer types, the '*' is grouped with the variable name, not with the base type. + + int *a; + + Not: + + int* a; + + In cases where there is no variable name, for instance, return values, there should be a single space between the base type and the '*'. + + Type casts should have no space between the type and '*', but a space before the variable being cast: + + (gchar*) foobar; + (gchar**) &foobar; + + - Function and variable names are lower_case_with_underscores, type names are CamelCase and macro names are UPPER_CASE_WITH_UNDERSCORES. + + - Comparisons to NULL, TRUE and FALSE should always be made explicit, for clarity. + + - Code should be wrapped at the 150th column, such that it doesn't require horizontal scrolling on a decent-sized display. + Don't wrap at the 80th column. + +Documentation comments +====================== + +All public API functions should have inline documentation headers in the gtk-doc style. For more information about gtk-doc comments, see the gtk-doc +manual (http://library.gnome.org/devel/gtk-doc-manual/stable/). There are a few conventions above and beyond the standard gtk-doc formatting which +libgdata employs: + + - For API which returns allocated memory, the relevant free/unref function must be mentioned in the "Return value" part of the documentation: + + * Return value: a new #GDataEntry; unref with g_object_unref() + + If the function can also return NULL (on error, for example) or some other "default" value (-1, 0, etc.), format it as follows: + + * Return value: a new #GDataGDFeedLink, or %NULL; free with gdata_gd_feed_link_free() + + Note that if a function returns NULL as a result of a precondition or assertion failure, this should not be listed in the documentation. The + precondition itself may be listed in the function documentation prose, but if it's the only reason for a function to return NULL, the "or %NULL" + clause should be omitted. + + - When adding API, make sure to add a "Since" clause: + + * Since: 0.2.0 + + - For object methods, the "self" parameter should be documented simply as "a #GObjectType": + + * @self: a #GDataQuery + + - For function parameters which can legitimately be set to NULL (or some other default value), list that as follows: + + * @updated_max: the new maximum update time, or %NULL + + - If numbers, such as -1, are mentioned in documentation as values to be passed around in code, they should be wrapped in a DocBook "code" tag + (e.g. "<code class="literal">-1</code>"), so that they appear similarly to NULL in the documentation. + + - The documentation explaining the purpose of a property, its limitations, interpretation, etc., should be given in the gtk-doc comment for the + GObject property itself, not in the documentation for its getter or setter. The documentation for the getter and setter should be stubs which + refer to the property's documentation. The getter and setter documentation should, however, still include full details about whether NULL values + are permissible for the function parameters, or are possible as the return value, for example. + +Adding public API +================= + + - Ensure it has proper guards against bad parameters: + + g_return_if_fail (GDATA_IS_QUERY (self)); + g_return_if_fail (foobar != NULL); + + - All public API must have a gtk-doc comment, and be added to the docs/reference/gdata-sections.txt file, to include it in the documentation. + The documentation comment must have a "Since" clause (see "Documentation comments" section). + + - All public API must be listed in gdata/gdata-*.symbols. + + - Non-trivial API should have a test case added in the relevant test suite file in gdata/tests. Note that the "general" test suite file cannot make + network requests in the course of running its test cases. + + - All GObject properties must have getter/setter functions. + + - All API which returns allocated memory must be tagged with G_GNUC_WARN_UNUSED_RESULT after its declaration, to safeguard against consumers of the + API forgetting to use (and consequently free) the memory. This is unlikely, but adding the macro costs little and acts as a reminder in the API + documentation to free the result. + + - All GObject *_get_type function declarations must be tagged with the G_GNUC_CONST macro, as well as any other applicable functions + (see the gcc documentation: http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bconst_007d-function-attribute-2207). + + - All properties which could be considered to use an enumerated value should almost definitely use a string instead. See the documentation section + on "Enumerable Properties" in the "GData Overview" section. Where appropriate, the values for these string properties should be made available + as #defines. + + - New services should be implemented in libgdata itself, not by applications which use libgdata. See the documentation section on "New Services" in + the "GData Overview" section. + + - New API must never be added in a stable micro release. API additions can only be made in a major or minor release; this is to prevent the LT version + of one minor version's micro releases exceeding the LT version of the next minor version as almost happened between versions 0.6.3 and 0.7.0. + See http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html for information about libtool's versioning system. See also the + “Versioning” section below. + + - Any async function which uses non-async-scope callbacks as well as the async ready callback should provide GDestroyNotify callbacks for destroying + the user data for those callbacks. See https://bugzilla.gnome.org/show_bug.cgi?id=649728 for details. + + - Any new class’ class structure (e.g. GDataServiceClass) must have reserved slots to allow future API additions of virtual functions without + breaking ABI. + +Choosing function names +======================= + +In general, use common sense. However, there are some specific cases where a standard is enforced: + + - For boolean getters (e.g. for FooBar:is-baz) use foo_bar_is_baz, rather than foo_bar_get_is_baz. Note that the property name should be "is-baz", + rather than just "baz". + + - For boolean setters use foo_bar_set_is_baz, rather than foo_bar_set_baz. + + - In general, try to keep API named similarly to the actual GData API constructs. In certain cases, however, it might make more sense to rename pieces + of API to be less cryptic (e.g. "timezone" instead of "ctz"). + +Deprecating public API +====================== + +As libgdata moves towards API stability, old API should be deprecated rather than broken or removed entirely. The following should be ensured when +deprecating API: + + - G_GNUC_DEPRECATED_FOR is added to the API in the public header file. + + - A “Deprecated:” line is added to the gtk-doc comment for the API. This should mention what API replaces it, give a brief explanation of why the + API has been deprecated, and finish with “(Since: [version].)” to list the version the API was deprecated. + + - “#ifndef LIBGDATA_DISABLE_DEPRECATED” should be wrapped around the API in the public header file. + + - All references to the API/uses of the API in libgdata code (including demos and the test suite) should be ported to use the replacement API instead. + If this isn't possible, the deprecated function should be split into a static function which contains all the code, and the public symbol should + become a simple wrapper of this static function. This allows the static function to be used inside libgdata without causing deprecation warnings. + + - Don't remove deprecated symbols from gdata-*.symbols. + + - Don't forget to also deprecate related symbols, such as the getter/setter for a property (or vice-versa). + +Commit messages +=============== + +libgdata does not use a ChangeLog; it is auto-generated from the git log when packaging a release. Commit messages should follow the GNOME commit +message guidelines (https://wiki.gnome.org/Git/CommitMessages), with the exception that when a commit closes a bug, the short explanation of the commit +should simply be the bug's title, as copied from Bugzilla (e.g. "Bug 579885 – Add code examples to documentation"). The long explanation should then +be used to give details of the changes. If the bug's title is not relevant, it should be changed before committing the changes. + +Unless the short explanation of a commit is a bug title, it should always be prefixed by a tag to describe the part of the library it touches, using +the following format "tag: Short explanation". The following tags are valid: + + - core: for the core code in the gdata directory, such as GDataEntry. + + - atom: for the Atom-namespaced code in the gdata/atom directory. + + - gcontact: for the gContact-namespaced code in the gdata/gcontact directory. + + - gd: for the GData-namespaced code in the gdata/gd directory. + + - media: for the Media RSS-namespaced code in the gdata/media directory. + + - build: for build changes and releases. + + - docs: for documentation changes which are not specific to a service, such as updates to the docs directory, NEWS, README, this file, etc. + + - tests: for changes to the test code in gdata/tests which are not specific to a service or namespace. + + - demos: for changes to the demo applications in the demos directory. + + - introspection: for introspection annotations and build changes. + + - calendar: for the Google Calendar code in gdata/services/calendar. + + - contacts: for the Google Contacts code in gdata/services/contacts. + + - documents: for the Google Documents code in gdata/services/documents. + + - picasaweb: for the PicasaWeb code in gdata/services/picasaweb. + + - youtube: for the YouTube code in gdata/services/youtube. + +The only commits which should not have a tag are translation commits, touching only the po directory. + +Versioning +========== + +Starting with version 0.9.0, libgdata has adopted an even–odd/stable–unstable versioning policy, where odd minor version numbers are unstable releases, +released periodically (with increasing micro version numbers) and leading to a stable release with the next even minor version number. API breaks of +new API are allowed in micro releases with an odd minor version number, but not in micro releases with an even minor version number. + +ABI and API backwards compatibility must be preserved unless the major version number is changed. libgdata is now ABI-stable. + +It is encouraged to make a new micro release of an odd minor series after each large API addition or break. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..2099840 --- /dev/null +++ b/INSTALL @@ -0,0 +1,370 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `<wchar.h>' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf limitation. Until the limitation is lifted, you can use +this workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..044193c --- /dev/null +++ b/Makefile.am @@ -0,0 +1,874 @@ +SUBDIRS = . po docs gdata/tests + +ACLOCAL_AMFLAGS = --install -I m4 ${ACLOCAL_FLAGS} + +DISTCHECK_CONFIGURE_FLAGS = +MAINTAINERCLEANFILES = + +CLEANFILES = +EXTRA_DIST = +BUILT_SOURCES = + +# Marshalling +GDATA_MARSHAL_FILES = \ + gdata/gdata-marshal.c \ + gdata/gdata-marshal.h + +gdata/gdata-marshal.h: $(top_srcdir)/gdata/gdata-marshal.list + $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=gdata_marshal --header $< > $@ +gdata/gdata-marshal.c: $(top_srcdir)/gdata/gdata-marshal.list gdata/gdata-marshal.h + $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=gdata_marshal --header --body $< > $@ + +EXTRA_DIST += $(top_srcdir)/gdata/gdata-marshal.list +CLEANFILES += $(GDATA_MARSHAL_FILES) + +# Enums +GDATA_ENUM_FILES = \ + gdata/gdata-enums.c \ + gdata/gdata-enums.h \ + gdata/media/gdata-media-enums.c \ + gdata/media/gdata-media-enums.h \ + gdata/services/documents/gdata-documents-enums.c \ + gdata/services/documents/gdata-documents-enums.h \ + gdata/services/freebase/gdata-freebase-enums.c \ + gdata/services/freebase/gdata-freebase-enums.h \ + gdata/services/picasaweb/gdata-picasaweb-enums.c \ + gdata/services/picasaweb/gdata-picasaweb-enums.h \ + gdata/services/youtube/gdata-youtube-enums.c \ + gdata/services/youtube/gdata-youtube-enums.h + +gdata/gdata-enums.h: $(gdata_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_ENUMS_H\n#define GDATA_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_ENUMS_H */" $(addprefix $(srcdir)/,$(gdata_headers)) > gdata/gdata-enums.h.tmp \ + && sed "s/g_data/gdata/" gdata/gdata-enums.h.tmp > gdata/gdata-enums.h \ + && rm -f gdata/gdata-enums.h.tmp) + +gdata/gdata-enums.c: $(gdata_headers) Makefile gdata/gdata-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-service.h\"\n#include \"gdata-parsable.h\"\n#include \"gdata-batch-operation.h\"\n#include \"gdata-enums.h\"\n#include \"gdata-client-login-authorizer.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_headers)) > gdata/gdata-enums.c.tmp \ + && sed "s/g_data/gdata/" gdata/gdata-enums.c.tmp > gdata/gdata-enums.c \ + && rm -f gdata/gdata-enums.c.tmp) + +gdata/media/gdata-media-enums.h: $(gdata_media_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_MEDIA_ENUMS_H\n#define GDATA_MEDIA_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_MEDIA_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_media_headers)) > gdata/media/gdata-media-enums.h.tmp \ + && sed "s/g_data/gdata/" gdata/media/gdata-media-enums.h.tmp > gdata/media/gdata-media-enums.h.tmp2 \ + && sed "s/GDATA_TYPE_DATA/GDATA_TYPE/" gdata/media/gdata-media-enums.h.tmp2 > gdata/media/gdata-media-enums.h \ + && rm -f gdata/media/gdata-media-enums.h.tmp \ + && rm -f gdata/media/gdata-media-enums.h.tmp2) + +gdata/media/gdata-media-enums.c: $(gdata_media_headers) Makefile gdata/media/gdata-media-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-media-content.h\"\n#include \"gdata-media-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_media_headers)) > gdata/media/gdata-media-enums.c.tmp \ + && sed "s/g_data/gdata/" gdata/media/gdata-media-enums.c.tmp > gdata/media/gdata-media-enums.c \ + && rm -f gdata/media/gdata-media-enums.c.tmp) + +gdata/services/documents/gdata-documents-enums.h: $(gdata_documents_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_DOCUMENTS_ENUMS_H\n#define GDATA_DOCUMENTS_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_DOCUMENTS_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_documents_headers)) > gdata/services/documents/gdata-documents-enums.h.tmp \ + && sed "s/g_data/gdata/" gdata/services/documents/gdata-documents-enums.h.tmp > gdata/services/documents/gdata-documents-enums.h \ + && rm -f gdata/services/documents/gdata-documents-enums.h.tmp) + +gdata/services/documents/gdata-documents-enums.c: $(gdata_documents_headers) Makefile gdata/services/documents/gdata-documents-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-documents-service.h\"\n#include \"gdata-documents-text.h\"\n#include \"gdata-documents-spreadsheet.h\"\n#include \"gdata-documents-drawing.h\"\n#include \"gdata-documents-pdf.h\"\n#include \"gdata-documents-presentation.h\"\n#include \"gdata-documents-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_documents_headers)) > gdata/services/documents/gdata-documents-enums.c.tmp \ + && sed "s/g_data/gdata/" gdata/services/documents/gdata-documents-enums.c.tmp > gdata/services/documents/gdata-documents-enums.c \ + && rm -f gdata/services/documents/gdata-documents-enums.c.tmp) + +gdata/services/freebase/gdata-freebase-enums.h: $(gdata_freebase_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_FREEBASE_ENUMS_H\n#define GDATA_FREEBASE_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_FREEBASE_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_freebase_headers)) > gdata/services/freebase/gdata-freebase-enums.h.tmp \ + && sed "s/g_data_freebase/gdata_freebase/" gdata/services/freebase/gdata-freebase-enums.h.tmp > gdata/services/freebase/gdata-freebase-enums.h.tmp2 \ + && sed "s/GDATA_TYPE_DATA_FREEBASE/GDATA_TYPE_FREEBASE/" gdata/services/freebase/gdata-freebase-enums.h.tmp2 > gdata/services/freebase/gdata-freebase-enums.h \ + && rm -f gdata/services/freebase/gdata-freebase-enums.h.tmp \ + && rm -f gdata/services/freebase/gdata-freebase-enums.h.tmp2) + +gdata/services/freebase/gdata-freebase-enums.c: $(gdata_freebase_headers) Makefile gdata/services/freebase/gdata-freebase-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-freebase-service.h\"\n#include \"gdata-freebase-search-query.h\"\n#include \"gdata-freebase-result.h\"\n#include \"gdata-freebase-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_freebase_headers)) > gdata/services/freebase/gdata-freebase-enums.c.tmp \ + && sed "s/g_data_freebase/gdata_freebase/" gdata/services/freebase/gdata-freebase-enums.c.tmp > gdata/services/freebase/gdata-freebase-enums.c \ + && rm -f gdata/services/freebase/gdata-freebase-enums.c.tmp) + +gdata/services/picasaweb/gdata-picasaweb-enums.h: $(gdata_picasaweb_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_PICASAWEB_ENUMS_H\n#define GDATA_PICASAWEB_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_PICASAWEB_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_picasaweb_headers)) > gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp \ + && sed "s/g_data_picasa_web/gdata_picasaweb/" gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp > gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp2 \ + && sed "s/GDATA_TYPE_DATA_PICASA_WEB/GDATA_TYPE_PICASAWEB/" gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp2 > gdata/services/picasaweb/gdata-picasaweb-enums.h \ + && rm -f gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp \ + && rm -f gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp2) + +gdata/services/picasaweb/gdata-picasaweb-enums.c: $(gdata_picasaweb_headers) Makefile gdata/services/picasaweb/gdata-picasaweb-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-picasaweb-album.h\"\n#include \"gdata-picasaweb-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_picasaweb_headers)) > gdata/services/picasaweb/gdata-picasaweb-enums.c.tmp \ + && sed "s/g_data_picasa_web/gdata_picasaweb/" gdata/services/picasaweb/gdata-picasaweb-enums.c.tmp > gdata/services/picasaweb/gdata-picasaweb-enums.c \ + && rm -f gdata/services/picasaweb/gdata-picasaweb-enums.c.tmp) + +gdata/services/youtube/gdata-youtube-enums.h: $(gdata_youtube_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_YOUTUBE_ENUMS_H\n#define GDATA_YOUTUBE_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_YOUTUBE_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_youtube_headers)) > gdata/services/youtube/gdata-youtube-enums.h.tmp \ + && sed "s/g_data_you_tube/gdata_youtube/" gdata/services/youtube/gdata-youtube-enums.h.tmp > gdata/services/youtube/gdata-youtube-enums.h.tmp2 \ + && sed "s/GDATA_TYPE_DATA_YOU_TUBE/GDATA_TYPE_YOUTUBE/" gdata/services/youtube/gdata-youtube-enums.h.tmp2 > gdata/services/youtube/gdata-youtube-enums.h \ + && rm -f gdata/services/youtube/gdata-youtube-enums.h.tmp \ + && rm -f gdata/services/youtube/gdata-youtube-enums.h.tmp2) + +gdata/services/youtube/gdata-youtube-enums.c: $(gdata_youtube_headers) Makefile gdata/services/youtube/gdata-youtube-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-youtube-service.h\"\n#include \"gdata-youtube-query.h\"\n#include \"gdata-youtube-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_youtube_headers)) > gdata/services/youtube/gdata-youtube-enums.c.tmp \ + && sed "s/g_data_you_tube/gdata_youtube/" gdata/services/youtube/gdata-youtube-enums.c.tmp > gdata/services/youtube/gdata-youtube-enums.c \ + && rm -f gdata/services/youtube/gdata-youtube-enums.c.tmp) + +BUILT_SOURCES += $(GDATA_ENUM_FILES) +CLEANFILES += $(GDATA_ENUM_FILES) + +# libgdata library +lib_LTLIBRARIES = gdata/libgdata.la + +gdataincludedir = $(pkgincludedir)/gdata +gdata_headers = \ + gdata/gdata.h \ + gdata/gdata-entry.h \ + gdata/gdata-feed.h \ + gdata/gdata-service.h \ + gdata/gdata-query.h \ + gdata/gdata-commentable.h \ + gdata/gdata-comment.h \ + gdata/gdata-access-handler.h \ + gdata/gdata-access-rule.h \ + gdata/gdata-parsable.h \ + gdata/gdata-download-stream.h \ + gdata/gdata-upload-stream.h \ + gdata/gdata-comparable.h \ + gdata/gdata-batch-operation.h \ + gdata/gdata-batchable.h \ + gdata/gdata-authorizer.h \ + gdata/gdata-authorization-domain.h \ + gdata/gdata-client-login-authorizer.h \ + gdata/gdata-oauth1-authorizer.h \ + gdata/gdata-oauth2-authorizer.h \ + $(NULL) + +if ENABLE_GOA +gdata_headers += \ + gdata/gdata-goa-authorizer.h \ + $(NULL) +endif + +# The following headers are private, and shouldn't be installed: +private_headers = \ + gdata/gdata-private.h \ + gdata/gdata-batch-private.h \ + gdata/gdata-batch-feed.h \ + gdata/gdata-parser.h \ + gdata/gdata-buffer.h \ + gdata/gd/gdata-gd-feed-link.h \ + gdata/exif/gdata-exif-tags.h \ + gdata/georss/gdata-georss-where.h +gdatainclude_HEADERS = \ + $(gdata_headers) \ + gdata/gdata-enums.h \ + gdata/gdata-types.h \ + gdata/gdata-version.h + +gdataatomincludedir = $(gdataincludedir)/atom +gdataatominclude_HEADERS = \ + gdata/atom/gdata-author.h \ + gdata/atom/gdata-category.h \ + gdata/atom/gdata-generator.h \ + gdata/atom/gdata-link.h + +gdataappincludedir = $(gdataincludedir)/app +gdataappinclude_HEADERS = \ + gdata/app/gdata-app-categories.h + +gdatagdincludedir = $(gdataincludedir)/gd +gdatagdinclude_HEADERS = \ + gdata/gd/gdata-gd-email-address.h \ + gdata/gd/gdata-gd-im-address.h \ + gdata/gd/gdata-gd-organization.h \ + gdata/gd/gdata-gd-phone-number.h \ + gdata/gd/gdata-gd-postal-address.h \ + gdata/gd/gdata-gd-reminder.h \ + gdata/gd/gdata-gd-when.h \ + gdata/gd/gdata-gd-where.h \ + gdata/gd/gdata-gd-who.h \ + gdata/gd/gdata-gd-name.h + +gdatagcontactincludedir = $(gdataincludedir)/gcontact +gdatagcontactinclude_HEADERS = \ + gdata/gcontact/gdata-gcontact-calendar.h \ + gdata/gcontact/gdata-gcontact-event.h \ + gdata/gcontact/gdata-gcontact-external-id.h \ + gdata/gcontact/gdata-gcontact-jot.h \ + gdata/gcontact/gdata-gcontact-language.h \ + gdata/gcontact/gdata-gcontact-relation.h \ + gdata/gcontact/gdata-gcontact-website.h + +gdatamediaincludedir = $(gdataincludedir)/media +gdata_media_headers = \ + gdata/media/gdata-media-category.h \ + gdata/media/gdata-media-content.h \ + gdata/media/gdata-media-credit.h \ + gdata/media/gdata-media-thumbnail.h +private_headers += gdata/media/gdata-media-group.h +gdatamediainclude_HEADERS = \ + $(gdata_media_headers) \ + gdata/media/gdata-media-enums.h + +gdatacalendarincludedir = $(gdataincludedir)/services/calendar +gdatacalendarinclude_HEADERS = \ + gdata/services/calendar/gdata-calendar-service.h \ + gdata/services/calendar/gdata-calendar-calendar.h \ + gdata/services/calendar/gdata-calendar-event.h \ + gdata/services/calendar/gdata-calendar-query.h \ + gdata/services/calendar/gdata-calendar-feed.h \ + gdata/services/calendar/gdata-calendar-access-rule.h \ + $(NULL) + +gdatacontactsincludedir = $(gdataincludedir)/services/contacts +gdatacontactsinclude_HEADERS = \ + gdata/services/contacts/gdata-contacts-service.h \ + gdata/services/contacts/gdata-contacts-contact.h \ + gdata/services/contacts/gdata-contacts-group.h \ + gdata/services/contacts/gdata-contacts-query.h + +gdatadocumentsincludedir = $(gdataincludedir)/services/documents +gdata_documents_headers = \ + gdata/services/documents/gdata-documents-service.h \ + gdata/services/documents/gdata-documents-metadata.h \ + gdata/services/documents/gdata-documents-feed.h \ + gdata/services/documents/gdata-documents-entry.h \ + gdata/services/documents/gdata-documents-query.h \ + gdata/services/documents/gdata-documents-document.h \ + gdata/services/documents/gdata-documents-text.h \ + gdata/services/documents/gdata-documents-presentation.h \ + gdata/services/documents/gdata-documents-folder.h \ + gdata/services/documents/gdata-documents-drawing.h \ + gdata/services/documents/gdata-documents-pdf.h \ + gdata/services/documents/gdata-documents-spreadsheet.h \ + gdata/services/documents/gdata-documents-upload-query.h \ + gdata/services/documents/gdata-documents-access-rule.h +private_headers += gdata/services/documents/gdata-documents-utils.h +gdatadocumentsinclude_HEADERS = \ + $(gdata_documents_headers) \ + gdata/services/documents/gdata-documents-enums.h + +gdatapicasawebincludedir = $(gdataincludedir)/services/picasaweb +gdata_picasaweb_headers = \ + gdata/services/picasaweb/gdata-picasaweb-service.h \ + gdata/services/picasaweb/gdata-picasaweb-query.h \ + gdata/services/picasaweb/gdata-picasaweb-file.h \ + gdata/services/picasaweb/gdata-picasaweb-album.h \ + gdata/services/picasaweb/gdata-picasaweb-user.h \ + gdata/services/picasaweb/gdata-picasaweb-feed.h \ + gdata/services/picasaweb/gdata-picasaweb-comment.h +gdatapicasawebinclude_HEADERS = \ + $(gdata_picasaweb_headers) \ + gdata/services/picasaweb/gdata-picasaweb-enums.h + +gdatayoutubeincludedir = $(gdataincludedir)/services/youtube +gdata_youtube_headers = \ + gdata/services/youtube/gdata-youtube-service.h \ + gdata/services/youtube/gdata-youtube-video.h \ + gdata/services/youtube/gdata-youtube-content.h \ + gdata/services/youtube/gdata-youtube-credit.h \ + gdata/services/youtube/gdata-youtube-query.h \ + gdata/services/youtube/gdata-youtube-state.h \ + gdata/services/youtube/gdata-youtube-category.h \ + gdata/services/youtube/gdata-youtube-comment.h \ + gdata/services/youtube/gdata-youtube-feed.h +gdatayoutubeinclude_HEADERS = \ + $(gdata_youtube_headers) \ + gdata/services/youtube/gdata-youtube-enums.h + +gdatatasksincludedir = $(gdataincludedir)/services/tasks +gdatatasksinclude_HEADERS = \ + gdata/services/tasks/gdata-tasks-service.h \ + gdata/services/tasks/gdata-tasks-tasklist.h \ + gdata/services/tasks/gdata-tasks-task.h \ + gdata/services/tasks/gdata-tasks-query.h + +gdatafreebaseincludedir = $(gdataincludedir)/services/freebase +gdata_freebase_headers = \ + gdata/services/freebase/gdata-freebase-service.h \ + gdata/services/freebase/gdata-freebase-result.h \ + gdata/services/freebase/gdata-freebase-search-query.h \ + gdata/services/freebase/gdata-freebase-search-result.h \ + gdata/services/freebase/gdata-freebase-topic-query.h \ + gdata/services/freebase/gdata-freebase-topic-result.h \ + gdata/services/freebase/gdata-freebase-query.h +gdatafreebaseinclude_HEADERS = \ + $(gdata_freebase_headers) \ + gdata/services/freebase/gdata-freebase-enums.h + +gdata_sources = \ + gdata/gdata-entry.c \ + gdata/gdata-feed.c \ + gdata/gdata-service.c \ + gdata/gdata-types.c \ + gdata/gdata-query.c \ + gdata/gdata-parser.c \ + gdata/gdata-commentable.c \ + gdata/gdata-comment.c \ + gdata/gdata-access-handler.c \ + gdata/gdata-access-rule.c \ + gdata/gdata-parsable.c \ + gdata/gdata-download-stream.c \ + gdata/gdata-upload-stream.c \ + gdata/gdata-buffer.c \ + gdata/gdata-comparable.c \ + gdata/gdata-batch-operation.c \ + gdata/gdata-batchable.c \ + gdata/gdata-batch-feed.c \ + gdata/gdata-authorizer.c \ + gdata/gdata-authorization-domain.c \ + gdata/gdata-client-login-authorizer.c \ + gdata/gdata-oauth1-authorizer.c \ + gdata/gdata-oauth2-authorizer.c \ + \ + gdata/atom/gdata-author.c \ + gdata/atom/gdata-category.c \ + gdata/atom/gdata-generator.c \ + gdata/atom/gdata-link.c \ + \ + gdata/app/gdata-app-categories.c \ + \ + gdata/exif/gdata-exif-tags.c \ + \ + gdata/gd/gdata-gd-email-address.c \ + gdata/gd/gdata-gd-feed-link.c \ + gdata/gd/gdata-gd-im-address.c \ + gdata/gd/gdata-gd-organization.c \ + gdata/gd/gdata-gd-phone-number.c \ + gdata/gd/gdata-gd-postal-address.c \ + gdata/gd/gdata-gd-reminder.c \ + gdata/gd/gdata-gd-when.c \ + gdata/gd/gdata-gd-where.c \ + gdata/gd/gdata-gd-who.c \ + gdata/gd/gdata-gd-name.c \ + \ + gdata/gcontact/gdata-gcontact-calendar.c \ + gdata/gcontact/gdata-gcontact-event.c \ + gdata/gcontact/gdata-gcontact-external-id.c \ + gdata/gcontact/gdata-gcontact-jot.c \ + gdata/gcontact/gdata-gcontact-language.c \ + gdata/gcontact/gdata-gcontact-relation.c \ + gdata/gcontact/gdata-gcontact-website.c \ + \ + gdata/georss/gdata-georss-where.c \ + \ + gdata/media/gdata-media-category.c \ + gdata/media/gdata-media-content.c \ + gdata/media/gdata-media-credit.c \ + gdata/media/gdata-media-thumbnail.c \ + gdata/media/gdata-media-group.c \ + \ + gdata/services/calendar/gdata-calendar-service.c \ + gdata/services/calendar/gdata-calendar-calendar.c \ + gdata/services/calendar/gdata-calendar-event.c \ + gdata/services/calendar/gdata-calendar-query.c \ + gdata/services/calendar/gdata-calendar-feed.c \ + gdata/services/calendar/gdata-calendar-access-rule.c \ + \ + gdata/services/contacts/gdata-contacts-service.c \ + gdata/services/contacts/gdata-contacts-contact.c \ + gdata/services/contacts/gdata-contacts-group.c \ + gdata/services/contacts/gdata-contacts-query.c \ + \ + gdata/services/documents/gdata-documents-service.c \ + gdata/services/documents/gdata-documents-metadata.c \ + gdata/services/documents/gdata-documents-feed.c \ + gdata/services/documents/gdata-documents-entry.c \ + gdata/services/documents/gdata-documents-document.c \ + gdata/services/documents/gdata-documents-text.c \ + gdata/services/documents/gdata-documents-presentation.c \ + gdata/services/documents/gdata-documents-spreadsheet.c \ + gdata/services/documents/gdata-documents-folder.c \ + gdata/services/documents/gdata-documents-drawing.c \ + gdata/services/documents/gdata-documents-pdf.c \ + gdata/services/documents/gdata-documents-query.c \ + gdata/services/documents/gdata-documents-upload-query.c \ + gdata/services/documents/gdata-documents-access-rule.c \ + gdata/services/documents/gdata-documents-utils.c \ + \ + gdata/services/picasaweb/gdata-picasaweb-album.c \ + gdata/services/picasaweb/gdata-picasaweb-query.c \ + gdata/services/picasaweb/gdata-picasaweb-file.c \ + gdata/services/picasaweb/gdata-picasaweb-service.c \ + gdata/services/picasaweb/gdata-picasaweb-user.c \ + gdata/services/picasaweb/gdata-picasaweb-feed.c \ + gdata/services/picasaweb/gdata-picasaweb-comment.c \ + \ + gdata/services/youtube/gdata-youtube-service.c \ + gdata/services/youtube/gdata-youtube-video.c \ + gdata/services/youtube/gdata-youtube-content.c \ + gdata/services/youtube/gdata-youtube-credit.c \ + gdata/services/youtube/gdata-youtube-query.c \ + gdata/services/youtube/gdata-youtube-state.c \ + gdata/services/youtube/gdata-youtube-category.c \ + gdata/services/youtube/gdata-youtube-comment.c \ + gdata/services/youtube/gdata-youtube-feed.c \ + \ + gdata/services/tasks/gdata-tasks-service.c \ + gdata/services/tasks/gdata-tasks-tasklist.c \ + gdata/services/tasks/gdata-tasks-task.c \ + gdata/services/tasks/gdata-tasks-query.c \ + \ + gdata/services/freebase/gdata-freebase-service.c \ + gdata/services/freebase/gdata-freebase-result.c \ + gdata/services/freebase/gdata-freebase-search-query.c \ + gdata/services/freebase/gdata-freebase-search-result.c \ + gdata/services/freebase/gdata-freebase-topic-query.c \ + gdata/services/freebase/gdata-freebase-topic-result.c \ + gdata/services/freebase/gdata-freebase-query.c + + +if ENABLE_GOA +gdata_sources += \ + gdata/gdata-goa-authorizer.c \ + $(NULL) +endif + +main_header = gdata/gdata.h +public_headers = \ + $(gdatainclude_HEADERS) \ + $(gdataatominclude_HEADERS) \ + $(gdataappinclude_HEADERS) \ + $(gdatagdinclude_HEADERS) \ + $(gdatagcontactinclude_HEADERS) \ + $(gdatamediainclude_HEADERS) \ + $(gdatacalendarinclude_HEADERS) \ + $(gdatacontactsinclude_HEADERS) \ + $(gdatadocumentsinclude_HEADERS) \ + $(gdatapicasawebinclude_HEADERS) \ + $(gdatayoutubeinclude_HEADERS) \ + $(gdatatasksinclude_HEADERS) \ + $(gdatafreebaseinclude_HEADERS) + +gdata_libgdata_la_SOURCES = \ + $(GDATA_MARSHAL_FILES) \ + $(GDATA_ENUM_FILES) \ + $(private_headers) \ + $(gdata_sources) + +# All but the first two -I flags here are to cope with compiling the enum files in a srcdir!=builddir environment +gdata_libgdata_la_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/gdata \ + -I$(top_srcdir)/gdata/media \ + -I$(top_srcdir)/gdata/services/documents \ + -I$(top_srcdir)/gdata/services/picasaweb \ + -I$(top_srcdir)/gdata/services/youtube \ + -I$(top_srcdir)/gdata/services/freebase \ + -I$(top_builddir)/gdata \ + -I$(top_builddir)/gdata/media \ + -I$(top_builddir)/gdata/services/picasaweb \ + -I$(top_builddir)/gdata/services/youtube \ + -I$(top_builddir)/gdata/services/freebase \ + -DG_LOG_DOMAIN=\"libgdata\" \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) + +gdata_libgdata_la_CFLAGS = \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(CODE_COVERAGE_CFLAGS) \ + $(WARN_CFLAGS) \ + $(AM_CFLAGS) + +gdata_libgdata_la_LIBADD = \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(CODE_COVERAGE_LIBS) \ + $(AM_LIBADD) + +gdata_libgdata_la_LDFLAGS = \ + -version-info $(GDATA_LT_VERSION) \ + -export-symbols $(builddir)/gdata/gdata.symbols \ + -no-undefined \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) + +# Symbols file +gdata/gdata.symbols: $(top_srcdir)/gdata/gdata-core.symbols $(top_srcdir)/gdata/gdata-goa.symbols +if ENABLE_GOA + $(AM_V_GEN)cat $(top_srcdir)/gdata/gdata-core.symbols $(top_srcdir)/gdata/gdata-goa.symbols > $@ +else + $(AM_V_GEN)cat $(top_srcdir)/gdata/gdata-core.symbols > $@ +endif + +EXTRA_gdata_libgdata_la_DEPENDENCIES = gdata/gdata.symbols +EXTRA_DIST += gdata/gdata-core.symbols gdata/gdata-goa.symbols +CLEANFILES += gdata/gdata.symbols + +# Check if gdata.h includes all the public headers +check-local: check-headers +check-headers: + @any_missing=0; for header_file in $(public_headers); do \ + if test "x$$header_file" != "x$(main_header)"; then \ + if ! grep "#include <$$header_file>" $(top_srcdir)/$(main_header) >/dev/null; then \ + echo "$(main_header) doesn't appear to include \"$$header_file\""; \ + any_missing=1; \ + fi; \ + fi; \ + done; exit "$$any_missing" + +# Introspection +-include $(INTROSPECTION_MAKEFILE) +INTROSPECTION_GIRS = +INTROSPECTION_SCANNER_ARGS = --warn-all +INTROSPECTION_COMPILER_ARGS = +DISTCHECK_CONFIGURE_FLAGS += --enable-introspection +EXTRA_DIST += m4/introspection.m4 + +if HAVE_INTROSPECTION +gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.gir: gdata/libgdata.la +gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_INCLUDES = GObject-2.0 libxml2-2.0 Soup-2.4 Json-1.0 +if ENABLE_GOA +gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_INCLUDES += Goa-1.0 +endif +gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_CFLAGS = $(GDATA_CFLAGS) $(GNOME_CFLAGS) $(gdata_libgdata_la_CPPFLAGS) +gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_LIBS = gdata/libgdata.la +gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_FILES = $(gdata_sources) $(public_headers) +gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_NAMESPACE = GData +gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_EXPORT_PACKAGES = libgdata +gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_SCANNERFLAGS = \ + --nsversion=$(GDATA_API_VERSION) \ + --symbol-prefix=gdata \ + --c-include="gdata/gdata.h" \ + $(WARN_SCANNERFLAGS) \ + $(NULL) + +INTROSPECTION_GIRS += gdata/GData-$(GDATA_API_VERSION).gir + +girdir = $(datadir)/gir-1.0 +gir_DATA = $(INTROSPECTION_GIRS) + +typelibdir = $(libdir)/girepository-1.0 +typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) + +CLEANFILES += $(gir_DATA) $(typelib_DATA) + +if ENABLE_VAPIGEN +-include $(VAPIGEN_MAKEFILE) + +# Note: The VAPI file name has to match the pkg-config file name. +# If we break API and add a version number to the pkg-config file name, the VAPI can be changed to match. +# See: https://bugzilla.gnome.org/show_bug.cgi?id=693865 +gdata/libgdata.vapi: gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.gir gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.metadata + +VAPIGEN_VAPIS = gdata/libgdata.vapi + +gdata_libgdata_vapi_DEPS = libxml-2.0 libsoup-2.4 json-glib-1.0 +if ENABLE_GOA +gdata_libgdata_vapi_DEPS += goa-1.0 +endif +gdata_libgdata_vapi_METADATADIRS = $(srcdir)/gdata +gdata_libgdata_vapi_FILES = gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.gir + +gdata/libgdata.deps: + $(AM_V_GEN) for pkg in $(gdata_libgdata_vapi_DEPS); do \ + echo $$pkg >> $@; \ + done + +vapidir = $(datadir)/vala/vapi +vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps) + +CLEANFILES += $(vapi_DATA) + +EXTRA_DIST += gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.metadata +endif +endif + +# Code coverage +@CODE_COVERAGE_RULES@ +CODE_COVERAGE_DIRECTORY = $(top_builddir)/gdata +CODE_COVERAGE_LCOV_OPTIONS = --base-directory $(abs_top_srcdir) + +# Demo programs +noinst_PROGRAMS = \ + demos/youtube/youtube-cli \ + demos/calendar/calendar-cli \ + demos/tasks/tasks-cli \ + $(NULL) + +if ENABLE_GOA +noinst_PROGRAMS += demos/docs-list/docs-list +endif + +if HAVE_GTK +noinst_PROGRAMS += \ + demos/scrapbook/scrapbook +endif + +demos_docs_list_docs_list_SOURCES = \ + demos/docs-list/docs-list.c \ + $(NULL) + +demos_docs_list_docs_list_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"docs-list\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_docs_list_docs_list_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_docs_list_docs_list_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_docs_list_docs_list_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +demos_scrapbook_scrapbook_SOURCES = \ + demos/scrapbook/scrapbook.c \ + demos/scrapbook/scrapbook.h \ + $(NULL) + +demos_scrapbook_scrapbook_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"scrapbook\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_scrapbook_scrapbook_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GTK_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_scrapbook_scrapbook_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_scrapbook_scrapbook_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GTK_LIBS) \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +demos_youtube_youtube_cli_SOURCES = \ + demos/youtube/youtube-cli.c \ + $(NULL) + +demos_youtube_youtube_cli_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"youtube\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_youtube_youtube_cli_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_youtube_youtube_cli_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_youtube_youtube_cli_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +demos_calendar_calendar_cli_SOURCES = \ + demos/calendar/calendar-cli.c \ + $(NULL) + +demos_calendar_calendar_cli_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"calendar\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_calendar_calendar_cli_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_calendar_calendar_cli_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_calendar_calendar_cli_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +demos_tasks_tasks_cli_SOURCES = \ + demos/tasks/tasks-cli.c \ + $(NULL) + +demos_tasks_tasks_cli_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"tasks\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_tasks_tasks_cli_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_tasks_tasks_cli_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_tasks_tasks_cli_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +# Cleaning +EXTRA_DIST += \ + autogen.sh \ + HACKING \ + gtk-doc.make \ + libgdata.doap \ + glib-tap.mk \ + tap-driver.sh \ + tap-test \ + $(NULL) + +CLEANFILES += \ + `find "$(srcdir)" -type f -name .dirstamp -print` + +DISTCLEANFILES = \ + gtk-doc.make \ + default.profraw \ + $(NULL) + +MAINTAINERCLEANFILES += \ + $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ + $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ + $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \ + build-aux/ \ + INSTALL \ + omf.make \ + gtk-doc.make \ + ABOUT-NLS \ + config.rpath \ + po/Makevars.template \ + po/Rules-quot \ + po/boldquot.sed \ + po/en@boldquot.header \ + po/en@quot.header \ + po/insert-header.sin \ + po/quot.sed \ + po/remove-potcdate.sin \ + m4/gtk-doc.m4 \ + m4/intltool.m4 \ + $(NULL) + +DISTCHECK_CONFIGURE_FLAGS += --enable-gtk-doc + +# pkgconfig data +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libgdata.pc + +CLEANFILES += $(pkgconfig_DATA) +EXTRA_DIST += libgdata.pc.in \ + gdata/gdata-version.h.in + +# ChangeLog +@GENERATE_CHANGELOG_RULES@ +dist-hook: dist-ChangeLog + +-include $(top_srcdir)/git.mk diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..2f92658 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,4137 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@ENABLE_GOA_TRUE@am__append_1 = \ +@ENABLE_GOA_TRUE@ gdata/gdata-goa-authorizer.h \ +@ENABLE_GOA_TRUE@ $(NULL) + +@ENABLE_GOA_TRUE@am__append_2 = \ +@ENABLE_GOA_TRUE@ gdata/gdata-goa-authorizer.c \ +@ENABLE_GOA_TRUE@ $(NULL) + +@ENABLE_GOA_TRUE@@HAVE_INTROSPECTION_TRUE@am__append_3 = Goa-1.0 +@HAVE_INTROSPECTION_TRUE@am__append_4 = gdata/GData-$(GDATA_API_VERSION).gir +@HAVE_INTROSPECTION_TRUE@am__append_5 = $(gir_DATA) $(typelib_DATA) +@ENABLE_GOA_TRUE@@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@am__append_6 = goa-1.0 +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@am__append_7 = $(vapi_DATA) +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@am__append_8 = gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.metadata +noinst_PROGRAMS = demos/youtube/youtube-cli$(EXEEXT) \ + demos/calendar/calendar-cli$(EXEEXT) \ + demos/tasks/tasks-cli$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) +@ENABLE_GOA_TRUE@am__append_9 = demos/docs-list/docs-list +@HAVE_GTK_TRUE@am__append_10 = \ +@HAVE_GTK_TRUE@ demos/scrapbook/scrapbook + +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_append_link_flags.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_check_link_flag.m4 \ + $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_compiler_flags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_cflags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_cxxflags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_gir.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_ldflags.m4 \ + $(top_srcdir)/m4/ax_generate_changelog.m4 \ + $(top_srcdir)/m4/ax_is_release.m4 \ + $(top_srcdir)/m4/ax_require_defined.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(gdataappinclude_HEADERS) \ + $(gdataatominclude_HEADERS) $(gdatacalendarinclude_HEADERS) \ + $(gdatacontactsinclude_HEADERS) \ + $(gdatadocumentsinclude_HEADERS) \ + $(gdatafreebaseinclude_HEADERS) \ + $(gdatagcontactinclude_HEADERS) $(gdatagdinclude_HEADERS) \ + $(am__gdatainclude_HEADERS_DIST) $(gdatamediainclude_HEADERS) \ + $(gdatapicasawebinclude_HEADERS) $(gdatatasksinclude_HEADERS) \ + $(gdatayoutubeinclude_HEADERS) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = libgdata.pc gdata/gdata-version.h +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" \ + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(typelibdir)" \ + "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(gdataappincludedir)" \ + "$(DESTDIR)$(gdataatomincludedir)" \ + "$(DESTDIR)$(gdatacalendarincludedir)" \ + "$(DESTDIR)$(gdatacontactsincludedir)" \ + "$(DESTDIR)$(gdatadocumentsincludedir)" \ + "$(DESTDIR)$(gdatafreebaseincludedir)" \ + "$(DESTDIR)$(gdatagcontactincludedir)" \ + "$(DESTDIR)$(gdatagdincludedir)" \ + "$(DESTDIR)$(gdataincludedir)" \ + "$(DESTDIR)$(gdatamediaincludedir)" \ + "$(DESTDIR)$(gdatapicasawebincludedir)" \ + "$(DESTDIR)$(gdatatasksincludedir)" \ + "$(DESTDIR)$(gdatayoutubeincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +gdata_libgdata_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__gdata_libgdata_la_SOURCES_DIST = gdata/gdata-marshal.c \ + gdata/gdata-marshal.h gdata/gdata-enums.c gdata/gdata-enums.h \ + gdata/media/gdata-media-enums.c \ + gdata/media/gdata-media-enums.h \ + gdata/services/documents/gdata-documents-enums.c \ + gdata/services/documents/gdata-documents-enums.h \ + gdata/services/freebase/gdata-freebase-enums.c \ + gdata/services/freebase/gdata-freebase-enums.h \ + gdata/services/picasaweb/gdata-picasaweb-enums.c \ + gdata/services/picasaweb/gdata-picasaweb-enums.h \ + gdata/services/youtube/gdata-youtube-enums.c \ + gdata/services/youtube/gdata-youtube-enums.h \ + gdata/gdata-private.h gdata/gdata-batch-private.h \ + gdata/gdata-batch-feed.h gdata/gdata-parser.h \ + gdata/gdata-buffer.h gdata/gd/gdata-gd-feed-link.h \ + gdata/exif/gdata-exif-tags.h gdata/georss/gdata-georss-where.h \ + gdata/media/gdata-media-group.h \ + gdata/services/documents/gdata-documents-utils.h \ + gdata/gdata-entry.c gdata/gdata-feed.c gdata/gdata-service.c \ + gdata/gdata-types.c gdata/gdata-query.c gdata/gdata-parser.c \ + gdata/gdata-commentable.c gdata/gdata-comment.c \ + gdata/gdata-access-handler.c gdata/gdata-access-rule.c \ + gdata/gdata-parsable.c gdata/gdata-download-stream.c \ + gdata/gdata-upload-stream.c gdata/gdata-buffer.c \ + gdata/gdata-comparable.c gdata/gdata-batch-operation.c \ + gdata/gdata-batchable.c gdata/gdata-batch-feed.c \ + gdata/gdata-authorizer.c gdata/gdata-authorization-domain.c \ + gdata/gdata-client-login-authorizer.c \ + gdata/gdata-oauth1-authorizer.c \ + gdata/gdata-oauth2-authorizer.c gdata/atom/gdata-author.c \ + gdata/atom/gdata-category.c gdata/atom/gdata-generator.c \ + gdata/atom/gdata-link.c gdata/app/gdata-app-categories.c \ + gdata/exif/gdata-exif-tags.c gdata/gd/gdata-gd-email-address.c \ + gdata/gd/gdata-gd-feed-link.c gdata/gd/gdata-gd-im-address.c \ + gdata/gd/gdata-gd-organization.c \ + gdata/gd/gdata-gd-phone-number.c \ + gdata/gd/gdata-gd-postal-address.c \ + gdata/gd/gdata-gd-reminder.c gdata/gd/gdata-gd-when.c \ + gdata/gd/gdata-gd-where.c gdata/gd/gdata-gd-who.c \ + gdata/gd/gdata-gd-name.c \ + gdata/gcontact/gdata-gcontact-calendar.c \ + gdata/gcontact/gdata-gcontact-event.c \ + gdata/gcontact/gdata-gcontact-external-id.c \ + gdata/gcontact/gdata-gcontact-jot.c \ + gdata/gcontact/gdata-gcontact-language.c \ + gdata/gcontact/gdata-gcontact-relation.c \ + gdata/gcontact/gdata-gcontact-website.c \ + gdata/georss/gdata-georss-where.c \ + gdata/media/gdata-media-category.c \ + gdata/media/gdata-media-content.c \ + gdata/media/gdata-media-credit.c \ + gdata/media/gdata-media-thumbnail.c \ + gdata/media/gdata-media-group.c \ + gdata/services/calendar/gdata-calendar-service.c \ + gdata/services/calendar/gdata-calendar-calendar.c \ + gdata/services/calendar/gdata-calendar-event.c \ + gdata/services/calendar/gdata-calendar-query.c \ + gdata/services/calendar/gdata-calendar-feed.c \ + gdata/services/calendar/gdata-calendar-access-rule.c \ + gdata/services/contacts/gdata-contacts-service.c \ + gdata/services/contacts/gdata-contacts-contact.c \ + gdata/services/contacts/gdata-contacts-group.c \ + gdata/services/contacts/gdata-contacts-query.c \ + gdata/services/documents/gdata-documents-service.c \ + gdata/services/documents/gdata-documents-metadata.c \ + gdata/services/documents/gdata-documents-feed.c \ + gdata/services/documents/gdata-documents-entry.c \ + gdata/services/documents/gdata-documents-document.c \ + gdata/services/documents/gdata-documents-text.c \ + gdata/services/documents/gdata-documents-presentation.c \ + gdata/services/documents/gdata-documents-spreadsheet.c \ + gdata/services/documents/gdata-documents-folder.c \ + gdata/services/documents/gdata-documents-drawing.c \ + gdata/services/documents/gdata-documents-pdf.c \ + gdata/services/documents/gdata-documents-query.c \ + gdata/services/documents/gdata-documents-upload-query.c \ + gdata/services/documents/gdata-documents-access-rule.c \ + gdata/services/documents/gdata-documents-utils.c \ + gdata/services/picasaweb/gdata-picasaweb-album.c \ + gdata/services/picasaweb/gdata-picasaweb-query.c \ + gdata/services/picasaweb/gdata-picasaweb-file.c \ + gdata/services/picasaweb/gdata-picasaweb-service.c \ + gdata/services/picasaweb/gdata-picasaweb-user.c \ + gdata/services/picasaweb/gdata-picasaweb-feed.c \ + gdata/services/picasaweb/gdata-picasaweb-comment.c \ + gdata/services/youtube/gdata-youtube-service.c \ + gdata/services/youtube/gdata-youtube-video.c \ + gdata/services/youtube/gdata-youtube-content.c \ + gdata/services/youtube/gdata-youtube-credit.c \ + gdata/services/youtube/gdata-youtube-query.c \ + gdata/services/youtube/gdata-youtube-state.c \ + gdata/services/youtube/gdata-youtube-category.c \ + gdata/services/youtube/gdata-youtube-comment.c \ + gdata/services/youtube/gdata-youtube-feed.c \ + gdata/services/tasks/gdata-tasks-service.c \ + gdata/services/tasks/gdata-tasks-tasklist.c \ + gdata/services/tasks/gdata-tasks-task.c \ + gdata/services/tasks/gdata-tasks-query.c \ + gdata/services/freebase/gdata-freebase-service.c \ + gdata/services/freebase/gdata-freebase-result.c \ + gdata/services/freebase/gdata-freebase-search-query.c \ + gdata/services/freebase/gdata-freebase-search-result.c \ + gdata/services/freebase/gdata-freebase-topic-query.c \ + gdata/services/freebase/gdata-freebase-topic-result.c \ + gdata/services/freebase/gdata-freebase-query.c \ + gdata/gdata-goa-authorizer.c +am__dirstamp = $(am__leading_dot)dirstamp +am__objects_1 = gdata/gdata_libgdata_la-gdata-marshal.lo +am__objects_2 = gdata/gdata_libgdata_la-gdata-enums.lo \ + gdata/media/gdata_libgdata_la-gdata-media-enums.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-enums.lo \ + gdata/services/freebase/gdata_libgdata_la-gdata-freebase-enums.lo \ + gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-enums.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-enums.lo +am__objects_3 = +@ENABLE_GOA_TRUE@am__objects_4 = gdata/gdata_libgdata_la-gdata-goa-authorizer.lo +am__objects_5 = gdata/gdata_libgdata_la-gdata-entry.lo \ + gdata/gdata_libgdata_la-gdata-feed.lo \ + gdata/gdata_libgdata_la-gdata-service.lo \ + gdata/gdata_libgdata_la-gdata-types.lo \ + gdata/gdata_libgdata_la-gdata-query.lo \ + gdata/gdata_libgdata_la-gdata-parser.lo \ + gdata/gdata_libgdata_la-gdata-commentable.lo \ + gdata/gdata_libgdata_la-gdata-comment.lo \ + gdata/gdata_libgdata_la-gdata-access-handler.lo \ + gdata/gdata_libgdata_la-gdata-access-rule.lo \ + gdata/gdata_libgdata_la-gdata-parsable.lo \ + gdata/gdata_libgdata_la-gdata-download-stream.lo \ + gdata/gdata_libgdata_la-gdata-upload-stream.lo \ + gdata/gdata_libgdata_la-gdata-buffer.lo \ + gdata/gdata_libgdata_la-gdata-comparable.lo \ + gdata/gdata_libgdata_la-gdata-batch-operation.lo \ + gdata/gdata_libgdata_la-gdata-batchable.lo \ + gdata/gdata_libgdata_la-gdata-batch-feed.lo \ + gdata/gdata_libgdata_la-gdata-authorizer.lo \ + gdata/gdata_libgdata_la-gdata-authorization-domain.lo \ + gdata/gdata_libgdata_la-gdata-client-login-authorizer.lo \ + gdata/gdata_libgdata_la-gdata-oauth1-authorizer.lo \ + gdata/gdata_libgdata_la-gdata-oauth2-authorizer.lo \ + gdata/atom/gdata_libgdata_la-gdata-author.lo \ + gdata/atom/gdata_libgdata_la-gdata-category.lo \ + gdata/atom/gdata_libgdata_la-gdata-generator.lo \ + gdata/atom/gdata_libgdata_la-gdata-link.lo \ + gdata/app/gdata_libgdata_la-gdata-app-categories.lo \ + gdata/exif/gdata_libgdata_la-gdata-exif-tags.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-email-address.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-feed-link.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-im-address.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-organization.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-phone-number.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-postal-address.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-reminder.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-when.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-where.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-who.lo \ + gdata/gd/gdata_libgdata_la-gdata-gd-name.lo \ + gdata/gcontact/gdata_libgdata_la-gdata-gcontact-calendar.lo \ + gdata/gcontact/gdata_libgdata_la-gdata-gcontact-event.lo \ + gdata/gcontact/gdata_libgdata_la-gdata-gcontact-external-id.lo \ + gdata/gcontact/gdata_libgdata_la-gdata-gcontact-jot.lo \ + gdata/gcontact/gdata_libgdata_la-gdata-gcontact-language.lo \ + gdata/gcontact/gdata_libgdata_la-gdata-gcontact-relation.lo \ + gdata/gcontact/gdata_libgdata_la-gdata-gcontact-website.lo \ + gdata/georss/gdata_libgdata_la-gdata-georss-where.lo \ + gdata/media/gdata_libgdata_la-gdata-media-category.lo \ + gdata/media/gdata_libgdata_la-gdata-media-content.lo \ + gdata/media/gdata_libgdata_la-gdata-media-credit.lo \ + gdata/media/gdata_libgdata_la-gdata-media-thumbnail.lo \ + gdata/media/gdata_libgdata_la-gdata-media-group.lo \ + gdata/services/calendar/gdata_libgdata_la-gdata-calendar-service.lo \ + gdata/services/calendar/gdata_libgdata_la-gdata-calendar-calendar.lo \ + gdata/services/calendar/gdata_libgdata_la-gdata-calendar-event.lo \ + gdata/services/calendar/gdata_libgdata_la-gdata-calendar-query.lo \ + gdata/services/calendar/gdata_libgdata_la-gdata-calendar-feed.lo \ + gdata/services/calendar/gdata_libgdata_la-gdata-calendar-access-rule.lo \ + gdata/services/contacts/gdata_libgdata_la-gdata-contacts-service.lo \ + gdata/services/contacts/gdata_libgdata_la-gdata-contacts-contact.lo \ + gdata/services/contacts/gdata_libgdata_la-gdata-contacts-group.lo \ + gdata/services/contacts/gdata_libgdata_la-gdata-contacts-query.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-service.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-metadata.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-feed.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-entry.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-document.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-text.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-presentation.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-spreadsheet.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-folder.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-drawing.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-pdf.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-query.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-upload-query.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-access-rule.lo \ + gdata/services/documents/gdata_libgdata_la-gdata-documents-utils.lo \ + gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-album.lo \ + gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-query.lo \ + gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-file.lo \ + gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-service.lo \ + gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-user.lo \ + gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-feed.lo \ + gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-comment.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-service.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-video.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-content.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-credit.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-query.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-state.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-category.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-comment.lo \ + gdata/services/youtube/gdata_libgdata_la-gdata-youtube-feed.lo \ + gdata/services/tasks/gdata_libgdata_la-gdata-tasks-service.lo \ + gdata/services/tasks/gdata_libgdata_la-gdata-tasks-tasklist.lo \ + gdata/services/tasks/gdata_libgdata_la-gdata-tasks-task.lo \ + gdata/services/tasks/gdata_libgdata_la-gdata-tasks-query.lo \ + gdata/services/freebase/gdata_libgdata_la-gdata-freebase-service.lo \ + gdata/services/freebase/gdata_libgdata_la-gdata-freebase-result.lo \ + gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-query.lo \ + gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-result.lo \ + gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-query.lo \ + gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-result.lo \ + gdata/services/freebase/gdata_libgdata_la-gdata-freebase-query.lo \ + $(am__objects_4) +am_gdata_libgdata_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_5) +gdata_libgdata_la_OBJECTS = $(am_gdata_libgdata_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +gdata_libgdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(gdata_libgdata_la_CFLAGS) $(CFLAGS) \ + $(gdata_libgdata_la_LDFLAGS) $(LDFLAGS) -o $@ +@ENABLE_GOA_TRUE@am__EXEEXT_1 = demos/docs-list/docs-list$(EXEEXT) +@HAVE_GTK_TRUE@am__EXEEXT_2 = demos/scrapbook/scrapbook$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +am_demos_calendar_calendar_cli_OBJECTS = demos/calendar/demos_calendar_calendar_cli-calendar-cli.$(OBJEXT) +demos_calendar_calendar_cli_OBJECTS = \ + $(am_demos_calendar_calendar_cli_OBJECTS) +demos_calendar_calendar_cli_DEPENDENCIES = \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +demos_calendar_calendar_cli_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(demos_calendar_calendar_cli_CFLAGS) $(CFLAGS) \ + $(demos_calendar_calendar_cli_LDFLAGS) $(LDFLAGS) -o $@ +am_demos_docs_list_docs_list_OBJECTS = \ + demos/docs-list/demos_docs_list_docs_list-docs-list.$(OBJEXT) +demos_docs_list_docs_list_OBJECTS = \ + $(am_demos_docs_list_docs_list_OBJECTS) +demos_docs_list_docs_list_DEPENDENCIES = \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +demos_docs_list_docs_list_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(demos_docs_list_docs_list_CFLAGS) $(CFLAGS) \ + $(demos_docs_list_docs_list_LDFLAGS) $(LDFLAGS) -o $@ +am_demos_scrapbook_scrapbook_OBJECTS = \ + demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.$(OBJEXT) +demos_scrapbook_scrapbook_OBJECTS = \ + $(am_demos_scrapbook_scrapbook_OBJECTS) +demos_scrapbook_scrapbook_DEPENDENCIES = \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +demos_scrapbook_scrapbook_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(demos_scrapbook_scrapbook_CFLAGS) $(CFLAGS) \ + $(demos_scrapbook_scrapbook_LDFLAGS) $(LDFLAGS) -o $@ +am_demos_tasks_tasks_cli_OBJECTS = \ + demos/tasks/demos_tasks_tasks_cli-tasks-cli.$(OBJEXT) +demos_tasks_tasks_cli_OBJECTS = $(am_demos_tasks_tasks_cli_OBJECTS) +demos_tasks_tasks_cli_DEPENDENCIES = \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +demos_tasks_tasks_cli_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(demos_tasks_tasks_cli_CFLAGS) $(CFLAGS) \ + $(demos_tasks_tasks_cli_LDFLAGS) $(LDFLAGS) -o $@ +am_demos_youtube_youtube_cli_OBJECTS = \ + demos/youtube/demos_youtube_youtube_cli-youtube-cli.$(OBJEXT) +demos_youtube_youtube_cli_OBJECTS = \ + $(am_demos_youtube_youtube_cli_OBJECTS) +demos_youtube_youtube_cli_DEPENDENCIES = \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +demos_youtube_youtube_cli_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(demos_youtube_youtube_cli_CFLAGS) $(CFLAGS) \ + $(demos_youtube_youtube_cli_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(gdata_libgdata_la_SOURCES) \ + $(demos_calendar_calendar_cli_SOURCES) \ + $(demos_docs_list_docs_list_SOURCES) \ + $(demos_scrapbook_scrapbook_SOURCES) \ + $(demos_tasks_tasks_cli_SOURCES) \ + $(demos_youtube_youtube_cli_SOURCES) +DIST_SOURCES = $(am__gdata_libgdata_la_SOURCES_DIST) \ + $(demos_calendar_calendar_cli_SOURCES) \ + $(demos_docs_list_docs_list_SOURCES) \ + $(demos_scrapbook_scrapbook_SOURCES) \ + $(demos_tasks_tasks_cli_SOURCES) \ + $(demos_youtube_youtube_cli_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(gir_DATA) $(pkgconfig_DATA) $(typelib_DATA) $(vapi_DATA) +am__gdatainclude_HEADERS_DIST = gdata/gdata.h gdata/gdata-entry.h \ + gdata/gdata-feed.h gdata/gdata-service.h gdata/gdata-query.h \ + gdata/gdata-commentable.h gdata/gdata-comment.h \ + gdata/gdata-access-handler.h gdata/gdata-access-rule.h \ + gdata/gdata-parsable.h gdata/gdata-download-stream.h \ + gdata/gdata-upload-stream.h gdata/gdata-comparable.h \ + gdata/gdata-batch-operation.h gdata/gdata-batchable.h \ + gdata/gdata-authorizer.h gdata/gdata-authorization-domain.h \ + gdata/gdata-client-login-authorizer.h \ + gdata/gdata-oauth1-authorizer.h \ + gdata/gdata-oauth2-authorizer.h gdata/gdata-goa-authorizer.h \ + gdata/gdata-enums.h gdata/gdata-types.h gdata/gdata-version.h +HEADERS = $(gdataappinclude_HEADERS) $(gdataatominclude_HEADERS) \ + $(gdatacalendarinclude_HEADERS) \ + $(gdatacontactsinclude_HEADERS) \ + $(gdatadocumentsinclude_HEADERS) \ + $(gdatafreebaseinclude_HEADERS) \ + $(gdatagcontactinclude_HEADERS) $(gdatagdinclude_HEADERS) \ + $(gdatainclude_HEADERS) $(gdatamediainclude_HEADERS) \ + $(gdatapicasawebinclude_HEADERS) $(gdatatasksinclude_HEADERS) \ + $(gdatayoutubeinclude_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/libgdata.pc.in $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/missing \ + $(top_srcdir)/gdata/gdata-version.h.in AUTHORS COPYING \ + ChangeLog INSTALL NEWS README build-aux/compile \ + build-aux/config.guess build-aux/config.sub build-aux/depcomp \ + build-aux/install-sh build-aux/ltmain.sh build-aux/missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_LDFLAGS = @AM_LDFLAGS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_ALWAYS_BUILD_TESTS = @ENABLE_ALWAYS_BUILD_TESTS@ +ENABLE_INSTALLED_TESTS = @ENABLE_INSTALLED_TESTS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GDATA_API_VERSION = @GDATA_API_VERSION@ +GDATA_API_VERSION_MAJOR = @GDATA_API_VERSION_MAJOR@ +GDATA_API_VERSION_MINOR = @GDATA_API_VERSION_MINOR@ +GDATA_CFLAGS = @GDATA_CFLAGS@ +GDATA_LIBS = @GDATA_LIBS@ +GDATA_LT_VERSION = @GDATA_LT_VERSION@ +GDATA_PACKAGES = @GDATA_PACKAGES@ +GDATA_PACKAGES_PRIVATE = @GDATA_PACKAGES_PRIVATE@ +GDATA_PACKAGES_PUBLIC = @GDATA_PACKAGES_PUBLIC@ +GDATA_VERSION_MAJOR = @GDATA_VERSION_MAJOR@ +GDATA_VERSION_MICRO = @GDATA_VERSION_MICRO@ +GDATA_VERSION_MINOR = @GDATA_VERSION_MINOR@ +GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@ +GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@ +GENHTML = @GENHTML@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIT = @GIT@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GNOME_CFLAGS = @GNOME_CFLAGS@ +GNOME_LIBS = @GNOME_LIBS@ +GNOME_PACKAGES = @GNOME_PACKAGES@ +GNOME_PACKAGES_PRIVATE = @GNOME_PACKAGES_PRIVATE@ +GNOME_PACKAGES_PUBLIC = @GNOME_PACKAGES_PUBLIC@ +GOA_ENABLED = @GOA_ENABLED@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LCOV = @LCOV@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ +LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UHTTPMOCK_CFLAGS = @UHTTPMOCK_CFLAGS@ +UHTTPMOCK_LIBS = @UHTTPMOCK_LIBS@ +USE_NLS = @USE_NLS@ +VAPIGEN = @VAPIGEN@ +VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ +VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CXXFLAGS = @WARN_CXXFLAGS@ +WARN_LDFLAGS = @WARN_LDFLAGS@ +WARN_SCANNERFLAGS = @WARN_SCANNERFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = . po docs gdata/tests +ACLOCAL_AMFLAGS = --install -I m4 ${ACLOCAL_FLAGS} +DISTCHECK_CONFIGURE_FLAGS = --enable-introspection --enable-gtk-doc +MAINTAINERCLEANFILES = $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ + $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ + $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) build-aux/ \ + INSTALL omf.make gtk-doc.make ABOUT-NLS config.rpath \ + po/Makevars.template po/Rules-quot po/boldquot.sed \ + po/en@boldquot.header po/en@quot.header po/insert-header.sin \ + po/quot.sed po/remove-potcdate.sin m4/gtk-doc.m4 \ + m4/intltool.m4 $(NULL) +CLEANFILES = $(GDATA_MARSHAL_FILES) $(GDATA_ENUM_FILES) \ + gdata/gdata.symbols $(am__append_5) $(am__append_7) `find \ + "$(srcdir)" -type f -name .dirstamp -print` $(pkgconfig_DATA) + +# Cleaning +EXTRA_DIST = $(top_srcdir)/gdata/gdata-marshal.list \ + gdata/gdata-core.symbols gdata/gdata-goa.symbols \ + m4/introspection.m4 $(am__append_8) autogen.sh HACKING \ + gtk-doc.make libgdata.doap glib-tap.mk tap-driver.sh tap-test \ + $(NULL) libgdata.pc.in gdata/gdata-version.h.in +BUILT_SOURCES = $(GDATA_ENUM_FILES) + +# Marshalling +GDATA_MARSHAL_FILES = \ + gdata/gdata-marshal.c \ + gdata/gdata-marshal.h + + +# Enums +GDATA_ENUM_FILES = \ + gdata/gdata-enums.c \ + gdata/gdata-enums.h \ + gdata/media/gdata-media-enums.c \ + gdata/media/gdata-media-enums.h \ + gdata/services/documents/gdata-documents-enums.c \ + gdata/services/documents/gdata-documents-enums.h \ + gdata/services/freebase/gdata-freebase-enums.c \ + gdata/services/freebase/gdata-freebase-enums.h \ + gdata/services/picasaweb/gdata-picasaweb-enums.c \ + gdata/services/picasaweb/gdata-picasaweb-enums.h \ + gdata/services/youtube/gdata-youtube-enums.c \ + gdata/services/youtube/gdata-youtube-enums.h + + +# libgdata library +lib_LTLIBRARIES = gdata/libgdata.la +gdataincludedir = $(pkgincludedir)/gdata +gdata_headers = gdata/gdata.h gdata/gdata-entry.h gdata/gdata-feed.h \ + gdata/gdata-service.h gdata/gdata-query.h \ + gdata/gdata-commentable.h gdata/gdata-comment.h \ + gdata/gdata-access-handler.h gdata/gdata-access-rule.h \ + gdata/gdata-parsable.h gdata/gdata-download-stream.h \ + gdata/gdata-upload-stream.h gdata/gdata-comparable.h \ + gdata/gdata-batch-operation.h gdata/gdata-batchable.h \ + gdata/gdata-authorizer.h gdata/gdata-authorization-domain.h \ + gdata/gdata-client-login-authorizer.h \ + gdata/gdata-oauth1-authorizer.h \ + gdata/gdata-oauth2-authorizer.h $(NULL) $(am__append_1) + +# The following headers are private, and shouldn't be installed: +private_headers = gdata/gdata-private.h gdata/gdata-batch-private.h \ + gdata/gdata-batch-feed.h gdata/gdata-parser.h \ + gdata/gdata-buffer.h gdata/gd/gdata-gd-feed-link.h \ + gdata/exif/gdata-exif-tags.h gdata/georss/gdata-georss-where.h \ + gdata/media/gdata-media-group.h \ + gdata/services/documents/gdata-documents-utils.h +gdatainclude_HEADERS = \ + $(gdata_headers) \ + gdata/gdata-enums.h \ + gdata/gdata-types.h \ + gdata/gdata-version.h + +gdataatomincludedir = $(gdataincludedir)/atom +gdataatominclude_HEADERS = \ + gdata/atom/gdata-author.h \ + gdata/atom/gdata-category.h \ + gdata/atom/gdata-generator.h \ + gdata/atom/gdata-link.h + +gdataappincludedir = $(gdataincludedir)/app +gdataappinclude_HEADERS = \ + gdata/app/gdata-app-categories.h + +gdatagdincludedir = $(gdataincludedir)/gd +gdatagdinclude_HEADERS = \ + gdata/gd/gdata-gd-email-address.h \ + gdata/gd/gdata-gd-im-address.h \ + gdata/gd/gdata-gd-organization.h \ + gdata/gd/gdata-gd-phone-number.h \ + gdata/gd/gdata-gd-postal-address.h \ + gdata/gd/gdata-gd-reminder.h \ + gdata/gd/gdata-gd-when.h \ + gdata/gd/gdata-gd-where.h \ + gdata/gd/gdata-gd-who.h \ + gdata/gd/gdata-gd-name.h + +gdatagcontactincludedir = $(gdataincludedir)/gcontact +gdatagcontactinclude_HEADERS = \ + gdata/gcontact/gdata-gcontact-calendar.h \ + gdata/gcontact/gdata-gcontact-event.h \ + gdata/gcontact/gdata-gcontact-external-id.h \ + gdata/gcontact/gdata-gcontact-jot.h \ + gdata/gcontact/gdata-gcontact-language.h \ + gdata/gcontact/gdata-gcontact-relation.h \ + gdata/gcontact/gdata-gcontact-website.h + +gdatamediaincludedir = $(gdataincludedir)/media +gdata_media_headers = \ + gdata/media/gdata-media-category.h \ + gdata/media/gdata-media-content.h \ + gdata/media/gdata-media-credit.h \ + gdata/media/gdata-media-thumbnail.h + +gdatamediainclude_HEADERS = \ + $(gdata_media_headers) \ + gdata/media/gdata-media-enums.h + +gdatacalendarincludedir = $(gdataincludedir)/services/calendar +gdatacalendarinclude_HEADERS = \ + gdata/services/calendar/gdata-calendar-service.h \ + gdata/services/calendar/gdata-calendar-calendar.h \ + gdata/services/calendar/gdata-calendar-event.h \ + gdata/services/calendar/gdata-calendar-query.h \ + gdata/services/calendar/gdata-calendar-feed.h \ + gdata/services/calendar/gdata-calendar-access-rule.h \ + $(NULL) + +gdatacontactsincludedir = $(gdataincludedir)/services/contacts +gdatacontactsinclude_HEADERS = \ + gdata/services/contacts/gdata-contacts-service.h \ + gdata/services/contacts/gdata-contacts-contact.h \ + gdata/services/contacts/gdata-contacts-group.h \ + gdata/services/contacts/gdata-contacts-query.h + +gdatadocumentsincludedir = $(gdataincludedir)/services/documents +gdata_documents_headers = \ + gdata/services/documents/gdata-documents-service.h \ + gdata/services/documents/gdata-documents-metadata.h \ + gdata/services/documents/gdata-documents-feed.h \ + gdata/services/documents/gdata-documents-entry.h \ + gdata/services/documents/gdata-documents-query.h \ + gdata/services/documents/gdata-documents-document.h \ + gdata/services/documents/gdata-documents-text.h \ + gdata/services/documents/gdata-documents-presentation.h \ + gdata/services/documents/gdata-documents-folder.h \ + gdata/services/documents/gdata-documents-drawing.h \ + gdata/services/documents/gdata-documents-pdf.h \ + gdata/services/documents/gdata-documents-spreadsheet.h \ + gdata/services/documents/gdata-documents-upload-query.h \ + gdata/services/documents/gdata-documents-access-rule.h + +gdatadocumentsinclude_HEADERS = \ + $(gdata_documents_headers) \ + gdata/services/documents/gdata-documents-enums.h + +gdatapicasawebincludedir = $(gdataincludedir)/services/picasaweb +gdata_picasaweb_headers = \ + gdata/services/picasaweb/gdata-picasaweb-service.h \ + gdata/services/picasaweb/gdata-picasaweb-query.h \ + gdata/services/picasaweb/gdata-picasaweb-file.h \ + gdata/services/picasaweb/gdata-picasaweb-album.h \ + gdata/services/picasaweb/gdata-picasaweb-user.h \ + gdata/services/picasaweb/gdata-picasaweb-feed.h \ + gdata/services/picasaweb/gdata-picasaweb-comment.h + +gdatapicasawebinclude_HEADERS = \ + $(gdata_picasaweb_headers) \ + gdata/services/picasaweb/gdata-picasaweb-enums.h + +gdatayoutubeincludedir = $(gdataincludedir)/services/youtube +gdata_youtube_headers = \ + gdata/services/youtube/gdata-youtube-service.h \ + gdata/services/youtube/gdata-youtube-video.h \ + gdata/services/youtube/gdata-youtube-content.h \ + gdata/services/youtube/gdata-youtube-credit.h \ + gdata/services/youtube/gdata-youtube-query.h \ + gdata/services/youtube/gdata-youtube-state.h \ + gdata/services/youtube/gdata-youtube-category.h \ + gdata/services/youtube/gdata-youtube-comment.h \ + gdata/services/youtube/gdata-youtube-feed.h + +gdatayoutubeinclude_HEADERS = \ + $(gdata_youtube_headers) \ + gdata/services/youtube/gdata-youtube-enums.h + +gdatatasksincludedir = $(gdataincludedir)/services/tasks +gdatatasksinclude_HEADERS = \ + gdata/services/tasks/gdata-tasks-service.h \ + gdata/services/tasks/gdata-tasks-tasklist.h \ + gdata/services/tasks/gdata-tasks-task.h \ + gdata/services/tasks/gdata-tasks-query.h + +gdatafreebaseincludedir = $(gdataincludedir)/services/freebase +gdata_freebase_headers = \ + gdata/services/freebase/gdata-freebase-service.h \ + gdata/services/freebase/gdata-freebase-result.h \ + gdata/services/freebase/gdata-freebase-search-query.h \ + gdata/services/freebase/gdata-freebase-search-result.h \ + gdata/services/freebase/gdata-freebase-topic-query.h \ + gdata/services/freebase/gdata-freebase-topic-result.h \ + gdata/services/freebase/gdata-freebase-query.h + +gdatafreebaseinclude_HEADERS = \ + $(gdata_freebase_headers) \ + gdata/services/freebase/gdata-freebase-enums.h + +gdata_sources = gdata/gdata-entry.c gdata/gdata-feed.c \ + gdata/gdata-service.c gdata/gdata-types.c gdata/gdata-query.c \ + gdata/gdata-parser.c gdata/gdata-commentable.c \ + gdata/gdata-comment.c gdata/gdata-access-handler.c \ + gdata/gdata-access-rule.c gdata/gdata-parsable.c \ + gdata/gdata-download-stream.c gdata/gdata-upload-stream.c \ + gdata/gdata-buffer.c gdata/gdata-comparable.c \ + gdata/gdata-batch-operation.c gdata/gdata-batchable.c \ + gdata/gdata-batch-feed.c gdata/gdata-authorizer.c \ + gdata/gdata-authorization-domain.c \ + gdata/gdata-client-login-authorizer.c \ + gdata/gdata-oauth1-authorizer.c \ + gdata/gdata-oauth2-authorizer.c gdata/atom/gdata-author.c \ + gdata/atom/gdata-category.c gdata/atom/gdata-generator.c \ + gdata/atom/gdata-link.c gdata/app/gdata-app-categories.c \ + gdata/exif/gdata-exif-tags.c gdata/gd/gdata-gd-email-address.c \ + gdata/gd/gdata-gd-feed-link.c gdata/gd/gdata-gd-im-address.c \ + gdata/gd/gdata-gd-organization.c \ + gdata/gd/gdata-gd-phone-number.c \ + gdata/gd/gdata-gd-postal-address.c \ + gdata/gd/gdata-gd-reminder.c gdata/gd/gdata-gd-when.c \ + gdata/gd/gdata-gd-where.c gdata/gd/gdata-gd-who.c \ + gdata/gd/gdata-gd-name.c \ + gdata/gcontact/gdata-gcontact-calendar.c \ + gdata/gcontact/gdata-gcontact-event.c \ + gdata/gcontact/gdata-gcontact-external-id.c \ + gdata/gcontact/gdata-gcontact-jot.c \ + gdata/gcontact/gdata-gcontact-language.c \ + gdata/gcontact/gdata-gcontact-relation.c \ + gdata/gcontact/gdata-gcontact-website.c \ + gdata/georss/gdata-georss-where.c \ + gdata/media/gdata-media-category.c \ + gdata/media/gdata-media-content.c \ + gdata/media/gdata-media-credit.c \ + gdata/media/gdata-media-thumbnail.c \ + gdata/media/gdata-media-group.c \ + gdata/services/calendar/gdata-calendar-service.c \ + gdata/services/calendar/gdata-calendar-calendar.c \ + gdata/services/calendar/gdata-calendar-event.c \ + gdata/services/calendar/gdata-calendar-query.c \ + gdata/services/calendar/gdata-calendar-feed.c \ + gdata/services/calendar/gdata-calendar-access-rule.c \ + gdata/services/contacts/gdata-contacts-service.c \ + gdata/services/contacts/gdata-contacts-contact.c \ + gdata/services/contacts/gdata-contacts-group.c \ + gdata/services/contacts/gdata-contacts-query.c \ + gdata/services/documents/gdata-documents-service.c \ + gdata/services/documents/gdata-documents-metadata.c \ + gdata/services/documents/gdata-documents-feed.c \ + gdata/services/documents/gdata-documents-entry.c \ + gdata/services/documents/gdata-documents-document.c \ + gdata/services/documents/gdata-documents-text.c \ + gdata/services/documents/gdata-documents-presentation.c \ + gdata/services/documents/gdata-documents-spreadsheet.c \ + gdata/services/documents/gdata-documents-folder.c \ + gdata/services/documents/gdata-documents-drawing.c \ + gdata/services/documents/gdata-documents-pdf.c \ + gdata/services/documents/gdata-documents-query.c \ + gdata/services/documents/gdata-documents-upload-query.c \ + gdata/services/documents/gdata-documents-access-rule.c \ + gdata/services/documents/gdata-documents-utils.c \ + gdata/services/picasaweb/gdata-picasaweb-album.c \ + gdata/services/picasaweb/gdata-picasaweb-query.c \ + gdata/services/picasaweb/gdata-picasaweb-file.c \ + gdata/services/picasaweb/gdata-picasaweb-service.c \ + gdata/services/picasaweb/gdata-picasaweb-user.c \ + gdata/services/picasaweb/gdata-picasaweb-feed.c \ + gdata/services/picasaweb/gdata-picasaweb-comment.c \ + gdata/services/youtube/gdata-youtube-service.c \ + gdata/services/youtube/gdata-youtube-video.c \ + gdata/services/youtube/gdata-youtube-content.c \ + gdata/services/youtube/gdata-youtube-credit.c \ + gdata/services/youtube/gdata-youtube-query.c \ + gdata/services/youtube/gdata-youtube-state.c \ + gdata/services/youtube/gdata-youtube-category.c \ + gdata/services/youtube/gdata-youtube-comment.c \ + gdata/services/youtube/gdata-youtube-feed.c \ + gdata/services/tasks/gdata-tasks-service.c \ + gdata/services/tasks/gdata-tasks-tasklist.c \ + gdata/services/tasks/gdata-tasks-task.c \ + gdata/services/tasks/gdata-tasks-query.c \ + gdata/services/freebase/gdata-freebase-service.c \ + gdata/services/freebase/gdata-freebase-result.c \ + gdata/services/freebase/gdata-freebase-search-query.c \ + gdata/services/freebase/gdata-freebase-search-result.c \ + gdata/services/freebase/gdata-freebase-topic-query.c \ + gdata/services/freebase/gdata-freebase-topic-result.c \ + gdata/services/freebase/gdata-freebase-query.c $(am__append_2) +main_header = gdata/gdata.h +public_headers = \ + $(gdatainclude_HEADERS) \ + $(gdataatominclude_HEADERS) \ + $(gdataappinclude_HEADERS) \ + $(gdatagdinclude_HEADERS) \ + $(gdatagcontactinclude_HEADERS) \ + $(gdatamediainclude_HEADERS) \ + $(gdatacalendarinclude_HEADERS) \ + $(gdatacontactsinclude_HEADERS) \ + $(gdatadocumentsinclude_HEADERS) \ + $(gdatapicasawebinclude_HEADERS) \ + $(gdatayoutubeinclude_HEADERS) \ + $(gdatatasksinclude_HEADERS) \ + $(gdatafreebaseinclude_HEADERS) + +gdata_libgdata_la_SOURCES = \ + $(GDATA_MARSHAL_FILES) \ + $(GDATA_ENUM_FILES) \ + $(private_headers) \ + $(gdata_sources) + + +# All but the first two -I flags here are to cope with compiling the enum files in a srcdir!=builddir environment +gdata_libgdata_la_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/gdata \ + -I$(top_srcdir)/gdata/media \ + -I$(top_srcdir)/gdata/services/documents \ + -I$(top_srcdir)/gdata/services/picasaweb \ + -I$(top_srcdir)/gdata/services/youtube \ + -I$(top_srcdir)/gdata/services/freebase \ + -I$(top_builddir)/gdata \ + -I$(top_builddir)/gdata/media \ + -I$(top_builddir)/gdata/services/picasaweb \ + -I$(top_builddir)/gdata/services/youtube \ + -I$(top_builddir)/gdata/services/freebase \ + -DG_LOG_DOMAIN=\"libgdata\" \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) + +gdata_libgdata_la_CFLAGS = \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(CODE_COVERAGE_CFLAGS) \ + $(WARN_CFLAGS) \ + $(AM_CFLAGS) + +gdata_libgdata_la_LIBADD = \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(CODE_COVERAGE_LIBS) \ + $(AM_LIBADD) + +gdata_libgdata_la_LDFLAGS = \ + -version-info $(GDATA_LT_VERSION) \ + -export-symbols $(builddir)/gdata/gdata.symbols \ + -no-undefined \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) + +EXTRA_gdata_libgdata_la_DEPENDENCIES = gdata/gdata.symbols +INTROSPECTION_GIRS = $(am__append_4) +INTROSPECTION_SCANNER_ARGS = --warn-all +INTROSPECTION_COMPILER_ARGS = +@HAVE_INTROSPECTION_TRUE@gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_INCLUDES = \ +@HAVE_INTROSPECTION_TRUE@ GObject-2.0 libxml2-2.0 Soup-2.4 \ +@HAVE_INTROSPECTION_TRUE@ Json-1.0 $(am__append_3) +@HAVE_INTROSPECTION_TRUE@gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_CFLAGS = $(GDATA_CFLAGS) $(GNOME_CFLAGS) $(gdata_libgdata_la_CPPFLAGS) +@HAVE_INTROSPECTION_TRUE@gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_LIBS = gdata/libgdata.la +@HAVE_INTROSPECTION_TRUE@gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_FILES = $(gdata_sources) $(public_headers) +@HAVE_INTROSPECTION_TRUE@gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_NAMESPACE = GData +@HAVE_INTROSPECTION_TRUE@gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_EXPORT_PACKAGES = libgdata +@HAVE_INTROSPECTION_TRUE@gdata_GData_@GDATA_API_VERSION_MAJOR@_@GDATA_API_VERSION_MINOR@_gir_SCANNERFLAGS = \ +@HAVE_INTROSPECTION_TRUE@ --nsversion=$(GDATA_API_VERSION) \ +@HAVE_INTROSPECTION_TRUE@ --symbol-prefix=gdata \ +@HAVE_INTROSPECTION_TRUE@ --c-include="gdata/gdata.h" \ +@HAVE_INTROSPECTION_TRUE@ $(WARN_SCANNERFLAGS) \ +@HAVE_INTROSPECTION_TRUE@ $(NULL) + +@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0 +@HAVE_INTROSPECTION_TRUE@gir_DATA = $(INTROSPECTION_GIRS) +@HAVE_INTROSPECTION_TRUE@typelibdir = $(libdir)/girepository-1.0 +@HAVE_INTROSPECTION_TRUE@typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@VAPIGEN_VAPIS = gdata/libgdata.vapi +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@gdata_libgdata_vapi_DEPS = \ +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@ libxml-2.0 \ +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@ libsoup-2.4 \ +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@ json-glib-1.0 \ +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@ $(am__append_6) +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@gdata_libgdata_vapi_METADATADIRS = $(srcdir)/gdata +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@gdata_libgdata_vapi_FILES = gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.gir +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@vapidir = $(datadir)/vala/vapi +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps) +CODE_COVERAGE_DIRECTORY = $(top_builddir)/gdata +CODE_COVERAGE_LCOV_OPTIONS = --base-directory $(abs_top_srcdir) +demos_docs_list_docs_list_SOURCES = \ + demos/docs-list/docs-list.c \ + $(NULL) + +demos_docs_list_docs_list_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"docs-list\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_docs_list_docs_list_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_docs_list_docs_list_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_docs_list_docs_list_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +demos_scrapbook_scrapbook_SOURCES = \ + demos/scrapbook/scrapbook.c \ + demos/scrapbook/scrapbook.h \ + $(NULL) + +demos_scrapbook_scrapbook_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"scrapbook\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_scrapbook_scrapbook_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GTK_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_scrapbook_scrapbook_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_scrapbook_scrapbook_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GTK_LIBS) \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +demos_youtube_youtube_cli_SOURCES = \ + demos/youtube/youtube-cli.c \ + $(NULL) + +demos_youtube_youtube_cli_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"youtube\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_youtube_youtube_cli_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_youtube_youtube_cli_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_youtube_youtube_cli_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +demos_calendar_calendar_cli_SOURCES = \ + demos/calendar/calendar-cli.c \ + $(NULL) + +demos_calendar_calendar_cli_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"calendar\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_calendar_calendar_cli_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_calendar_calendar_cli_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_calendar_calendar_cli_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +demos_tasks_tasks_cli_SOURCES = \ + demos/tasks/tasks-cli.c \ + $(NULL) + +demos_tasks_tasks_cli_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"tasks\" \ + -DLIBGDATA_DISABLE_DEPRECATED \ + $(DISABLE_DEPRECATED) \ + $(AM_CPPFLAGS) \ + $(NULL) + +demos_tasks_tasks_cli_CFLAGS = \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(AM_CFLAGS) \ + $(NULL) + +demos_tasks_tasks_cli_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +demos_tasks_tasks_cli_LDADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(AM_LDADD) \ + $(NULL) + +DISTCLEANFILES = \ + gtk-doc.make \ + default.profraw \ + $(NULL) + + +# pkgconfig data +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libgdata.pc +all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +libgdata.pc: $(top_builddir)/config.status $(srcdir)/libgdata.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +gdata/gdata-version.h: $(top_builddir)/config.status $(top_srcdir)/gdata/gdata-version.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +gdata/$(am__dirstamp): + @$(MKDIR_P) gdata + @: > gdata/$(am__dirstamp) +gdata/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/$(DEPDIR) + @: > gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-marshal.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-enums.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/media/$(am__dirstamp): + @$(MKDIR_P) gdata/media + @: > gdata/media/$(am__dirstamp) +gdata/media/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/media/$(DEPDIR) + @: > gdata/media/$(DEPDIR)/$(am__dirstamp) +gdata/media/gdata_libgdata_la-gdata-media-enums.lo: \ + gdata/media/$(am__dirstamp) \ + gdata/media/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/$(am__dirstamp): + @$(MKDIR_P) gdata/services/documents + @: > gdata/services/documents/$(am__dirstamp) +gdata/services/documents/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/services/documents/$(DEPDIR) + @: > gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-enums.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/freebase/$(am__dirstamp): + @$(MKDIR_P) gdata/services/freebase + @: > gdata/services/freebase/$(am__dirstamp) +gdata/services/freebase/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/services/freebase/$(DEPDIR) + @: > gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-enums.lo: \ + gdata/services/freebase/$(am__dirstamp) \ + gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) +gdata/services/picasaweb/$(am__dirstamp): + @$(MKDIR_P) gdata/services/picasaweb + @: > gdata/services/picasaweb/$(am__dirstamp) +gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/services/picasaweb/$(DEPDIR) + @: > gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-enums.lo: \ + gdata/services/picasaweb/$(am__dirstamp) \ + gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/$(am__dirstamp): + @$(MKDIR_P) gdata/services/youtube + @: > gdata/services/youtube/$(am__dirstamp) +gdata/services/youtube/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/services/youtube/$(DEPDIR) + @: > gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-enums.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-entry.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-feed.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-service.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-types.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-query.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-parser.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-commentable.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-comment.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-access-handler.lo: \ + gdata/$(am__dirstamp) gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-access-rule.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-parsable.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-download-stream.lo: \ + gdata/$(am__dirstamp) gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-upload-stream.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-buffer.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-comparable.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-batch-operation.lo: \ + gdata/$(am__dirstamp) gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-batchable.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-batch-feed.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-authorizer.lo: gdata/$(am__dirstamp) \ + gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-authorization-domain.lo: \ + gdata/$(am__dirstamp) gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-client-login-authorizer.lo: \ + gdata/$(am__dirstamp) gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-oauth1-authorizer.lo: \ + gdata/$(am__dirstamp) gdata/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-oauth2-authorizer.lo: \ + gdata/$(am__dirstamp) gdata/$(DEPDIR)/$(am__dirstamp) +gdata/atom/$(am__dirstamp): + @$(MKDIR_P) gdata/atom + @: > gdata/atom/$(am__dirstamp) +gdata/atom/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/atom/$(DEPDIR) + @: > gdata/atom/$(DEPDIR)/$(am__dirstamp) +gdata/atom/gdata_libgdata_la-gdata-author.lo: \ + gdata/atom/$(am__dirstamp) \ + gdata/atom/$(DEPDIR)/$(am__dirstamp) +gdata/atom/gdata_libgdata_la-gdata-category.lo: \ + gdata/atom/$(am__dirstamp) \ + gdata/atom/$(DEPDIR)/$(am__dirstamp) +gdata/atom/gdata_libgdata_la-gdata-generator.lo: \ + gdata/atom/$(am__dirstamp) \ + gdata/atom/$(DEPDIR)/$(am__dirstamp) +gdata/atom/gdata_libgdata_la-gdata-link.lo: \ + gdata/atom/$(am__dirstamp) \ + gdata/atom/$(DEPDIR)/$(am__dirstamp) +gdata/app/$(am__dirstamp): + @$(MKDIR_P) gdata/app + @: > gdata/app/$(am__dirstamp) +gdata/app/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/app/$(DEPDIR) + @: > gdata/app/$(DEPDIR)/$(am__dirstamp) +gdata/app/gdata_libgdata_la-gdata-app-categories.lo: \ + gdata/app/$(am__dirstamp) gdata/app/$(DEPDIR)/$(am__dirstamp) +gdata/exif/$(am__dirstamp): + @$(MKDIR_P) gdata/exif + @: > gdata/exif/$(am__dirstamp) +gdata/exif/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/exif/$(DEPDIR) + @: > gdata/exif/$(DEPDIR)/$(am__dirstamp) +gdata/exif/gdata_libgdata_la-gdata-exif-tags.lo: \ + gdata/exif/$(am__dirstamp) \ + gdata/exif/$(DEPDIR)/$(am__dirstamp) +gdata/gd/$(am__dirstamp): + @$(MKDIR_P) gdata/gd + @: > gdata/gd/$(am__dirstamp) +gdata/gd/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/gd/$(DEPDIR) + @: > gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-email-address.lo: \ + gdata/gd/$(am__dirstamp) gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-feed-link.lo: \ + gdata/gd/$(am__dirstamp) gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-im-address.lo: \ + gdata/gd/$(am__dirstamp) gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-organization.lo: \ + gdata/gd/$(am__dirstamp) gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-phone-number.lo: \ + gdata/gd/$(am__dirstamp) gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-postal-address.lo: \ + gdata/gd/$(am__dirstamp) gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-reminder.lo: \ + gdata/gd/$(am__dirstamp) gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-when.lo: gdata/gd/$(am__dirstamp) \ + gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-where.lo: \ + gdata/gd/$(am__dirstamp) gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-who.lo: gdata/gd/$(am__dirstamp) \ + gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gd/gdata_libgdata_la-gdata-gd-name.lo: gdata/gd/$(am__dirstamp) \ + gdata/gd/$(DEPDIR)/$(am__dirstamp) +gdata/gcontact/$(am__dirstamp): + @$(MKDIR_P) gdata/gcontact + @: > gdata/gcontact/$(am__dirstamp) +gdata/gcontact/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/gcontact/$(DEPDIR) + @: > gdata/gcontact/$(DEPDIR)/$(am__dirstamp) +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-calendar.lo: \ + gdata/gcontact/$(am__dirstamp) \ + gdata/gcontact/$(DEPDIR)/$(am__dirstamp) +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-event.lo: \ + gdata/gcontact/$(am__dirstamp) \ + gdata/gcontact/$(DEPDIR)/$(am__dirstamp) +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-external-id.lo: \ + gdata/gcontact/$(am__dirstamp) \ + gdata/gcontact/$(DEPDIR)/$(am__dirstamp) +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-jot.lo: \ + gdata/gcontact/$(am__dirstamp) \ + gdata/gcontact/$(DEPDIR)/$(am__dirstamp) +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-language.lo: \ + gdata/gcontact/$(am__dirstamp) \ + gdata/gcontact/$(DEPDIR)/$(am__dirstamp) +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-relation.lo: \ + gdata/gcontact/$(am__dirstamp) \ + gdata/gcontact/$(DEPDIR)/$(am__dirstamp) +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-website.lo: \ + gdata/gcontact/$(am__dirstamp) \ + gdata/gcontact/$(DEPDIR)/$(am__dirstamp) +gdata/georss/$(am__dirstamp): + @$(MKDIR_P) gdata/georss + @: > gdata/georss/$(am__dirstamp) +gdata/georss/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/georss/$(DEPDIR) + @: > gdata/georss/$(DEPDIR)/$(am__dirstamp) +gdata/georss/gdata_libgdata_la-gdata-georss-where.lo: \ + gdata/georss/$(am__dirstamp) \ + gdata/georss/$(DEPDIR)/$(am__dirstamp) +gdata/media/gdata_libgdata_la-gdata-media-category.lo: \ + gdata/media/$(am__dirstamp) \ + gdata/media/$(DEPDIR)/$(am__dirstamp) +gdata/media/gdata_libgdata_la-gdata-media-content.lo: \ + gdata/media/$(am__dirstamp) \ + gdata/media/$(DEPDIR)/$(am__dirstamp) +gdata/media/gdata_libgdata_la-gdata-media-credit.lo: \ + gdata/media/$(am__dirstamp) \ + gdata/media/$(DEPDIR)/$(am__dirstamp) +gdata/media/gdata_libgdata_la-gdata-media-thumbnail.lo: \ + gdata/media/$(am__dirstamp) \ + gdata/media/$(DEPDIR)/$(am__dirstamp) +gdata/media/gdata_libgdata_la-gdata-media-group.lo: \ + gdata/media/$(am__dirstamp) \ + gdata/media/$(DEPDIR)/$(am__dirstamp) +gdata/services/calendar/$(am__dirstamp): + @$(MKDIR_P) gdata/services/calendar + @: > gdata/services/calendar/$(am__dirstamp) +gdata/services/calendar/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/services/calendar/$(DEPDIR) + @: > gdata/services/calendar/$(DEPDIR)/$(am__dirstamp) +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-service.lo: \ + gdata/services/calendar/$(am__dirstamp) \ + gdata/services/calendar/$(DEPDIR)/$(am__dirstamp) +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-calendar.lo: \ + gdata/services/calendar/$(am__dirstamp) \ + gdata/services/calendar/$(DEPDIR)/$(am__dirstamp) +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-event.lo: \ + gdata/services/calendar/$(am__dirstamp) \ + gdata/services/calendar/$(DEPDIR)/$(am__dirstamp) +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-query.lo: \ + gdata/services/calendar/$(am__dirstamp) \ + gdata/services/calendar/$(DEPDIR)/$(am__dirstamp) +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-feed.lo: \ + gdata/services/calendar/$(am__dirstamp) \ + gdata/services/calendar/$(DEPDIR)/$(am__dirstamp) +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-access-rule.lo: \ + gdata/services/calendar/$(am__dirstamp) \ + gdata/services/calendar/$(DEPDIR)/$(am__dirstamp) +gdata/services/contacts/$(am__dirstamp): + @$(MKDIR_P) gdata/services/contacts + @: > gdata/services/contacts/$(am__dirstamp) +gdata/services/contacts/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/services/contacts/$(DEPDIR) + @: > gdata/services/contacts/$(DEPDIR)/$(am__dirstamp) +gdata/services/contacts/gdata_libgdata_la-gdata-contacts-service.lo: \ + gdata/services/contacts/$(am__dirstamp) \ + gdata/services/contacts/$(DEPDIR)/$(am__dirstamp) +gdata/services/contacts/gdata_libgdata_la-gdata-contacts-contact.lo: \ + gdata/services/contacts/$(am__dirstamp) \ + gdata/services/contacts/$(DEPDIR)/$(am__dirstamp) +gdata/services/contacts/gdata_libgdata_la-gdata-contacts-group.lo: \ + gdata/services/contacts/$(am__dirstamp) \ + gdata/services/contacts/$(DEPDIR)/$(am__dirstamp) +gdata/services/contacts/gdata_libgdata_la-gdata-contacts-query.lo: \ + gdata/services/contacts/$(am__dirstamp) \ + gdata/services/contacts/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-service.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-metadata.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-feed.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-entry.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-document.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-text.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-presentation.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-spreadsheet.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-folder.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-drawing.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-pdf.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-query.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-upload-query.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-access-rule.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/documents/gdata_libgdata_la-gdata-documents-utils.lo: \ + gdata/services/documents/$(am__dirstamp) \ + gdata/services/documents/$(DEPDIR)/$(am__dirstamp) +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-album.lo: \ + gdata/services/picasaweb/$(am__dirstamp) \ + gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-query.lo: \ + gdata/services/picasaweb/$(am__dirstamp) \ + gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-file.lo: \ + gdata/services/picasaweb/$(am__dirstamp) \ + gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-service.lo: \ + gdata/services/picasaweb/$(am__dirstamp) \ + gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-user.lo: \ + gdata/services/picasaweb/$(am__dirstamp) \ + gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-feed.lo: \ + gdata/services/picasaweb/$(am__dirstamp) \ + gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-comment.lo: \ + gdata/services/picasaweb/$(am__dirstamp) \ + gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-service.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-video.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-content.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-credit.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-query.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-state.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-category.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-comment.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-feed.lo: \ + gdata/services/youtube/$(am__dirstamp) \ + gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) +gdata/services/tasks/$(am__dirstamp): + @$(MKDIR_P) gdata/services/tasks + @: > gdata/services/tasks/$(am__dirstamp) +gdata/services/tasks/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdata/services/tasks/$(DEPDIR) + @: > gdata/services/tasks/$(DEPDIR)/$(am__dirstamp) +gdata/services/tasks/gdata_libgdata_la-gdata-tasks-service.lo: \ + gdata/services/tasks/$(am__dirstamp) \ + gdata/services/tasks/$(DEPDIR)/$(am__dirstamp) +gdata/services/tasks/gdata_libgdata_la-gdata-tasks-tasklist.lo: \ + gdata/services/tasks/$(am__dirstamp) \ + gdata/services/tasks/$(DEPDIR)/$(am__dirstamp) +gdata/services/tasks/gdata_libgdata_la-gdata-tasks-task.lo: \ + gdata/services/tasks/$(am__dirstamp) \ + gdata/services/tasks/$(DEPDIR)/$(am__dirstamp) +gdata/services/tasks/gdata_libgdata_la-gdata-tasks-query.lo: \ + gdata/services/tasks/$(am__dirstamp) \ + gdata/services/tasks/$(DEPDIR)/$(am__dirstamp) +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-service.lo: \ + gdata/services/freebase/$(am__dirstamp) \ + gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-result.lo: \ + gdata/services/freebase/$(am__dirstamp) \ + gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-query.lo: \ + gdata/services/freebase/$(am__dirstamp) \ + gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-result.lo: \ + gdata/services/freebase/$(am__dirstamp) \ + gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-query.lo: \ + gdata/services/freebase/$(am__dirstamp) \ + gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-result.lo: \ + gdata/services/freebase/$(am__dirstamp) \ + gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-query.lo: \ + gdata/services/freebase/$(am__dirstamp) \ + gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) +gdata/gdata_libgdata_la-gdata-goa-authorizer.lo: \ + gdata/$(am__dirstamp) gdata/$(DEPDIR)/$(am__dirstamp) + +gdata/libgdata.la: $(gdata_libgdata_la_OBJECTS) $(gdata_libgdata_la_DEPENDENCIES) $(EXTRA_gdata_libgdata_la_DEPENDENCIES) gdata/$(am__dirstamp) + $(AM_V_CCLD)$(gdata_libgdata_la_LINK) -rpath $(libdir) $(gdata_libgdata_la_OBJECTS) $(gdata_libgdata_la_LIBADD) $(LIBS) + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +demos/calendar/$(am__dirstamp): + @$(MKDIR_P) demos/calendar + @: > demos/calendar/$(am__dirstamp) +demos/calendar/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) demos/calendar/$(DEPDIR) + @: > demos/calendar/$(DEPDIR)/$(am__dirstamp) +demos/calendar/demos_calendar_calendar_cli-calendar-cli.$(OBJEXT): \ + demos/calendar/$(am__dirstamp) \ + demos/calendar/$(DEPDIR)/$(am__dirstamp) + +demos/calendar/calendar-cli$(EXEEXT): $(demos_calendar_calendar_cli_OBJECTS) $(demos_calendar_calendar_cli_DEPENDENCIES) $(EXTRA_demos_calendar_calendar_cli_DEPENDENCIES) demos/calendar/$(am__dirstamp) + @rm -f demos/calendar/calendar-cli$(EXEEXT) + $(AM_V_CCLD)$(demos_calendar_calendar_cli_LINK) $(demos_calendar_calendar_cli_OBJECTS) $(demos_calendar_calendar_cli_LDADD) $(LIBS) +demos/docs-list/$(am__dirstamp): + @$(MKDIR_P) demos/docs-list + @: > demos/docs-list/$(am__dirstamp) +demos/docs-list/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) demos/docs-list/$(DEPDIR) + @: > demos/docs-list/$(DEPDIR)/$(am__dirstamp) +demos/docs-list/demos_docs_list_docs_list-docs-list.$(OBJEXT): \ + demos/docs-list/$(am__dirstamp) \ + demos/docs-list/$(DEPDIR)/$(am__dirstamp) + +demos/docs-list/docs-list$(EXEEXT): $(demos_docs_list_docs_list_OBJECTS) $(demos_docs_list_docs_list_DEPENDENCIES) $(EXTRA_demos_docs_list_docs_list_DEPENDENCIES) demos/docs-list/$(am__dirstamp) + @rm -f demos/docs-list/docs-list$(EXEEXT) + $(AM_V_CCLD)$(demos_docs_list_docs_list_LINK) $(demos_docs_list_docs_list_OBJECTS) $(demos_docs_list_docs_list_LDADD) $(LIBS) +demos/scrapbook/$(am__dirstamp): + @$(MKDIR_P) demos/scrapbook + @: > demos/scrapbook/$(am__dirstamp) +demos/scrapbook/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) demos/scrapbook/$(DEPDIR) + @: > demos/scrapbook/$(DEPDIR)/$(am__dirstamp) +demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.$(OBJEXT): \ + demos/scrapbook/$(am__dirstamp) \ + demos/scrapbook/$(DEPDIR)/$(am__dirstamp) + +demos/scrapbook/scrapbook$(EXEEXT): $(demos_scrapbook_scrapbook_OBJECTS) $(demos_scrapbook_scrapbook_DEPENDENCIES) $(EXTRA_demos_scrapbook_scrapbook_DEPENDENCIES) demos/scrapbook/$(am__dirstamp) + @rm -f demos/scrapbook/scrapbook$(EXEEXT) + $(AM_V_CCLD)$(demos_scrapbook_scrapbook_LINK) $(demos_scrapbook_scrapbook_OBJECTS) $(demos_scrapbook_scrapbook_LDADD) $(LIBS) +demos/tasks/$(am__dirstamp): + @$(MKDIR_P) demos/tasks + @: > demos/tasks/$(am__dirstamp) +demos/tasks/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) demos/tasks/$(DEPDIR) + @: > demos/tasks/$(DEPDIR)/$(am__dirstamp) +demos/tasks/demos_tasks_tasks_cli-tasks-cli.$(OBJEXT): \ + demos/tasks/$(am__dirstamp) \ + demos/tasks/$(DEPDIR)/$(am__dirstamp) + +demos/tasks/tasks-cli$(EXEEXT): $(demos_tasks_tasks_cli_OBJECTS) $(demos_tasks_tasks_cli_DEPENDENCIES) $(EXTRA_demos_tasks_tasks_cli_DEPENDENCIES) demos/tasks/$(am__dirstamp) + @rm -f demos/tasks/tasks-cli$(EXEEXT) + $(AM_V_CCLD)$(demos_tasks_tasks_cli_LINK) $(demos_tasks_tasks_cli_OBJECTS) $(demos_tasks_tasks_cli_LDADD) $(LIBS) +demos/youtube/$(am__dirstamp): + @$(MKDIR_P) demos/youtube + @: > demos/youtube/$(am__dirstamp) +demos/youtube/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) demos/youtube/$(DEPDIR) + @: > demos/youtube/$(DEPDIR)/$(am__dirstamp) +demos/youtube/demos_youtube_youtube_cli-youtube-cli.$(OBJEXT): \ + demos/youtube/$(am__dirstamp) \ + demos/youtube/$(DEPDIR)/$(am__dirstamp) + +demos/youtube/youtube-cli$(EXEEXT): $(demos_youtube_youtube_cli_OBJECTS) $(demos_youtube_youtube_cli_DEPENDENCIES) $(EXTRA_demos_youtube_youtube_cli_DEPENDENCIES) demos/youtube/$(am__dirstamp) + @rm -f demos/youtube/youtube-cli$(EXEEXT) + $(AM_V_CCLD)$(demos_youtube_youtube_cli_LINK) $(demos_youtube_youtube_cli_OBJECTS) $(demos_youtube_youtube_cli_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f demos/calendar/*.$(OBJEXT) + -rm -f demos/docs-list/*.$(OBJEXT) + -rm -f demos/scrapbook/*.$(OBJEXT) + -rm -f demos/tasks/*.$(OBJEXT) + -rm -f demos/youtube/*.$(OBJEXT) + -rm -f gdata/*.$(OBJEXT) + -rm -f gdata/*.lo + -rm -f gdata/app/*.$(OBJEXT) + -rm -f gdata/app/*.lo + -rm -f gdata/atom/*.$(OBJEXT) + -rm -f gdata/atom/*.lo + -rm -f gdata/exif/*.$(OBJEXT) + -rm -f gdata/exif/*.lo + -rm -f gdata/gcontact/*.$(OBJEXT) + -rm -f gdata/gcontact/*.lo + -rm -f gdata/gd/*.$(OBJEXT) + -rm -f gdata/gd/*.lo + -rm -f gdata/georss/*.$(OBJEXT) + -rm -f gdata/georss/*.lo + -rm -f gdata/media/*.$(OBJEXT) + -rm -f gdata/media/*.lo + -rm -f gdata/services/calendar/*.$(OBJEXT) + -rm -f gdata/services/calendar/*.lo + -rm -f gdata/services/contacts/*.$(OBJEXT) + -rm -f gdata/services/contacts/*.lo + -rm -f gdata/services/documents/*.$(OBJEXT) + -rm -f gdata/services/documents/*.lo + -rm -f gdata/services/freebase/*.$(OBJEXT) + -rm -f gdata/services/freebase/*.lo + -rm -f gdata/services/picasaweb/*.$(OBJEXT) + -rm -f gdata/services/picasaweb/*.lo + -rm -f gdata/services/tasks/*.$(OBJEXT) + -rm -f gdata/services/tasks/*.lo + -rm -f gdata/services/youtube/*.$(OBJEXT) + -rm -f gdata/services/youtube/*.lo + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@demos/calendar/$(DEPDIR)/demos_calendar_calendar_cli-calendar-cli.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@demos/docs-list/$(DEPDIR)/demos_docs_list_docs_list-docs-list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@demos/scrapbook/$(DEPDIR)/demos_scrapbook_scrapbook-scrapbook.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@demos/tasks/$(DEPDIR)/demos_tasks_tasks_cli-tasks-cli.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@demos/youtube/$(DEPDIR)/demos_youtube_youtube_cli-youtube-cli.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-access-handler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-access-rule.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-authorization-domain.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-authorizer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batch-feed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batch-operation.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batchable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-client-login-authorizer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-comment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-commentable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-comparable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-download-stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-entry.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-enums.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-feed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-goa-authorizer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-marshal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-oauth1-authorizer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-oauth2-authorizer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-parsable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-parser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/$(DEPDIR)/gdata_libgdata_la-gdata-upload-stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/app/$(DEPDIR)/gdata_libgdata_la-gdata-app-categories.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-author.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-category.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-generator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-link.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/exif/$(DEPDIR)/gdata_libgdata_la-gdata-exif-tags.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-calendar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-event.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-external-id.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-jot.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-language.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-relation.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-website.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-email-address.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-feed-link.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-im-address.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-name.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-organization.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-phone-number.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-postal-address.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-reminder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-when.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-where.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-who.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/georss/$(DEPDIR)/gdata_libgdata_la-gdata-georss-where.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-category.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-content.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-credit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-enums.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-group.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-thumbnail.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-access-rule.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-calendar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-event.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-feed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-contact.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-group.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-access-rule.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-document.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-drawing.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-entry.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-enums.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-feed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-folder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-metadata.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-pdf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-presentation.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-spreadsheet.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-text.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-upload-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-enums.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-result.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-search-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-search-result.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-topic-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-topic-result.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-album.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-comment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-enums.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-feed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-user.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-task.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-tasklist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-category.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-comment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-content.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-credit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-enums.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-feed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-state.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-video.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +gdata/gdata_libgdata_la-gdata-marshal.lo: gdata/gdata-marshal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-marshal.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-marshal.Tpo -c -o gdata/gdata_libgdata_la-gdata-marshal.lo `test -f 'gdata/gdata-marshal.c' || echo '$(srcdir)/'`gdata/gdata-marshal.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-marshal.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-marshal.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-marshal.c' object='gdata/gdata_libgdata_la-gdata-marshal.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-marshal.lo `test -f 'gdata/gdata-marshal.c' || echo '$(srcdir)/'`gdata/gdata-marshal.c + +gdata/gdata_libgdata_la-gdata-enums.lo: gdata/gdata-enums.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-enums.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-enums.Tpo -c -o gdata/gdata_libgdata_la-gdata-enums.lo `test -f 'gdata/gdata-enums.c' || echo '$(srcdir)/'`gdata/gdata-enums.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-enums.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-enums.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-enums.c' object='gdata/gdata_libgdata_la-gdata-enums.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-enums.lo `test -f 'gdata/gdata-enums.c' || echo '$(srcdir)/'`gdata/gdata-enums.c + +gdata/media/gdata_libgdata_la-gdata-media-enums.lo: gdata/media/gdata-media-enums.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/media/gdata_libgdata_la-gdata-media-enums.lo -MD -MP -MF gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-enums.Tpo -c -o gdata/media/gdata_libgdata_la-gdata-media-enums.lo `test -f 'gdata/media/gdata-media-enums.c' || echo '$(srcdir)/'`gdata/media/gdata-media-enums.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-enums.Tpo gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-enums.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/media/gdata-media-enums.c' object='gdata/media/gdata_libgdata_la-gdata-media-enums.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/media/gdata_libgdata_la-gdata-media-enums.lo `test -f 'gdata/media/gdata-media-enums.c' || echo '$(srcdir)/'`gdata/media/gdata-media-enums.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-enums.lo: gdata/services/documents/gdata-documents-enums.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-enums.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-enums.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-enums.lo `test -f 'gdata/services/documents/gdata-documents-enums.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-enums.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-enums.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-enums.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-enums.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-enums.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-enums.lo `test -f 'gdata/services/documents/gdata-documents-enums.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-enums.c + +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-enums.lo: gdata/services/freebase/gdata-freebase-enums.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/freebase/gdata_libgdata_la-gdata-freebase-enums.lo -MD -MP -MF gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-enums.Tpo -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-enums.lo `test -f 'gdata/services/freebase/gdata-freebase-enums.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-enums.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-enums.Tpo gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-enums.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/freebase/gdata-freebase-enums.c' object='gdata/services/freebase/gdata_libgdata_la-gdata-freebase-enums.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-enums.lo `test -f 'gdata/services/freebase/gdata-freebase-enums.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-enums.c + +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-enums.lo: gdata/services/picasaweb/gdata-picasaweb-enums.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-enums.lo -MD -MP -MF gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-enums.Tpo -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-enums.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-enums.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-enums.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-enums.Tpo gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-enums.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/picasaweb/gdata-picasaweb-enums.c' object='gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-enums.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-enums.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-enums.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-enums.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-enums.lo: gdata/services/youtube/gdata-youtube-enums.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-enums.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-enums.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-enums.lo `test -f 'gdata/services/youtube/gdata-youtube-enums.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-enums.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-enums.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-enums.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-enums.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-enums.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-enums.lo `test -f 'gdata/services/youtube/gdata-youtube-enums.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-enums.c + +gdata/gdata_libgdata_la-gdata-entry.lo: gdata/gdata-entry.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-entry.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-entry.Tpo -c -o gdata/gdata_libgdata_la-gdata-entry.lo `test -f 'gdata/gdata-entry.c' || echo '$(srcdir)/'`gdata/gdata-entry.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-entry.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-entry.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-entry.c' object='gdata/gdata_libgdata_la-gdata-entry.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-entry.lo `test -f 'gdata/gdata-entry.c' || echo '$(srcdir)/'`gdata/gdata-entry.c + +gdata/gdata_libgdata_la-gdata-feed.lo: gdata/gdata-feed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-feed.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-feed.Tpo -c -o gdata/gdata_libgdata_la-gdata-feed.lo `test -f 'gdata/gdata-feed.c' || echo '$(srcdir)/'`gdata/gdata-feed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-feed.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-feed.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-feed.c' object='gdata/gdata_libgdata_la-gdata-feed.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-feed.lo `test -f 'gdata/gdata-feed.c' || echo '$(srcdir)/'`gdata/gdata-feed.c + +gdata/gdata_libgdata_la-gdata-service.lo: gdata/gdata-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-service.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-service.Tpo -c -o gdata/gdata_libgdata_la-gdata-service.lo `test -f 'gdata/gdata-service.c' || echo '$(srcdir)/'`gdata/gdata-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-service.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-service.c' object='gdata/gdata_libgdata_la-gdata-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-service.lo `test -f 'gdata/gdata-service.c' || echo '$(srcdir)/'`gdata/gdata-service.c + +gdata/gdata_libgdata_la-gdata-types.lo: gdata/gdata-types.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-types.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-types.Tpo -c -o gdata/gdata_libgdata_la-gdata-types.lo `test -f 'gdata/gdata-types.c' || echo '$(srcdir)/'`gdata/gdata-types.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-types.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-types.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-types.c' object='gdata/gdata_libgdata_la-gdata-types.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-types.lo `test -f 'gdata/gdata-types.c' || echo '$(srcdir)/'`gdata/gdata-types.c + +gdata/gdata_libgdata_la-gdata-query.lo: gdata/gdata-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-query.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-query.Tpo -c -o gdata/gdata_libgdata_la-gdata-query.lo `test -f 'gdata/gdata-query.c' || echo '$(srcdir)/'`gdata/gdata-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-query.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-query.c' object='gdata/gdata_libgdata_la-gdata-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-query.lo `test -f 'gdata/gdata-query.c' || echo '$(srcdir)/'`gdata/gdata-query.c + +gdata/gdata_libgdata_la-gdata-parser.lo: gdata/gdata-parser.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-parser.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-parser.Tpo -c -o gdata/gdata_libgdata_la-gdata-parser.lo `test -f 'gdata/gdata-parser.c' || echo '$(srcdir)/'`gdata/gdata-parser.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-parser.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-parser.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-parser.c' object='gdata/gdata_libgdata_la-gdata-parser.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-parser.lo `test -f 'gdata/gdata-parser.c' || echo '$(srcdir)/'`gdata/gdata-parser.c + +gdata/gdata_libgdata_la-gdata-commentable.lo: gdata/gdata-commentable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-commentable.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-commentable.Tpo -c -o gdata/gdata_libgdata_la-gdata-commentable.lo `test -f 'gdata/gdata-commentable.c' || echo '$(srcdir)/'`gdata/gdata-commentable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-commentable.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-commentable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-commentable.c' object='gdata/gdata_libgdata_la-gdata-commentable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-commentable.lo `test -f 'gdata/gdata-commentable.c' || echo '$(srcdir)/'`gdata/gdata-commentable.c + +gdata/gdata_libgdata_la-gdata-comment.lo: gdata/gdata-comment.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-comment.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-comment.Tpo -c -o gdata/gdata_libgdata_la-gdata-comment.lo `test -f 'gdata/gdata-comment.c' || echo '$(srcdir)/'`gdata/gdata-comment.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-comment.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-comment.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-comment.c' object='gdata/gdata_libgdata_la-gdata-comment.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-comment.lo `test -f 'gdata/gdata-comment.c' || echo '$(srcdir)/'`gdata/gdata-comment.c + +gdata/gdata_libgdata_la-gdata-access-handler.lo: gdata/gdata-access-handler.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-access-handler.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-access-handler.Tpo -c -o gdata/gdata_libgdata_la-gdata-access-handler.lo `test -f 'gdata/gdata-access-handler.c' || echo '$(srcdir)/'`gdata/gdata-access-handler.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-access-handler.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-access-handler.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-access-handler.c' object='gdata/gdata_libgdata_la-gdata-access-handler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-access-handler.lo `test -f 'gdata/gdata-access-handler.c' || echo '$(srcdir)/'`gdata/gdata-access-handler.c + +gdata/gdata_libgdata_la-gdata-access-rule.lo: gdata/gdata-access-rule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-access-rule.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-access-rule.Tpo -c -o gdata/gdata_libgdata_la-gdata-access-rule.lo `test -f 'gdata/gdata-access-rule.c' || echo '$(srcdir)/'`gdata/gdata-access-rule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-access-rule.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-access-rule.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-access-rule.c' object='gdata/gdata_libgdata_la-gdata-access-rule.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-access-rule.lo `test -f 'gdata/gdata-access-rule.c' || echo '$(srcdir)/'`gdata/gdata-access-rule.c + +gdata/gdata_libgdata_la-gdata-parsable.lo: gdata/gdata-parsable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-parsable.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-parsable.Tpo -c -o gdata/gdata_libgdata_la-gdata-parsable.lo `test -f 'gdata/gdata-parsable.c' || echo '$(srcdir)/'`gdata/gdata-parsable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-parsable.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-parsable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-parsable.c' object='gdata/gdata_libgdata_la-gdata-parsable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-parsable.lo `test -f 'gdata/gdata-parsable.c' || echo '$(srcdir)/'`gdata/gdata-parsable.c + +gdata/gdata_libgdata_la-gdata-download-stream.lo: gdata/gdata-download-stream.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-download-stream.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-download-stream.Tpo -c -o gdata/gdata_libgdata_la-gdata-download-stream.lo `test -f 'gdata/gdata-download-stream.c' || echo '$(srcdir)/'`gdata/gdata-download-stream.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-download-stream.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-download-stream.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-download-stream.c' object='gdata/gdata_libgdata_la-gdata-download-stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-download-stream.lo `test -f 'gdata/gdata-download-stream.c' || echo '$(srcdir)/'`gdata/gdata-download-stream.c + +gdata/gdata_libgdata_la-gdata-upload-stream.lo: gdata/gdata-upload-stream.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-upload-stream.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-upload-stream.Tpo -c -o gdata/gdata_libgdata_la-gdata-upload-stream.lo `test -f 'gdata/gdata-upload-stream.c' || echo '$(srcdir)/'`gdata/gdata-upload-stream.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-upload-stream.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-upload-stream.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-upload-stream.c' object='gdata/gdata_libgdata_la-gdata-upload-stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-upload-stream.lo `test -f 'gdata/gdata-upload-stream.c' || echo '$(srcdir)/'`gdata/gdata-upload-stream.c + +gdata/gdata_libgdata_la-gdata-buffer.lo: gdata/gdata-buffer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-buffer.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-buffer.Tpo -c -o gdata/gdata_libgdata_la-gdata-buffer.lo `test -f 'gdata/gdata-buffer.c' || echo '$(srcdir)/'`gdata/gdata-buffer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-buffer.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-buffer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-buffer.c' object='gdata/gdata_libgdata_la-gdata-buffer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-buffer.lo `test -f 'gdata/gdata-buffer.c' || echo '$(srcdir)/'`gdata/gdata-buffer.c + +gdata/gdata_libgdata_la-gdata-comparable.lo: gdata/gdata-comparable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-comparable.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-comparable.Tpo -c -o gdata/gdata_libgdata_la-gdata-comparable.lo `test -f 'gdata/gdata-comparable.c' || echo '$(srcdir)/'`gdata/gdata-comparable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-comparable.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-comparable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-comparable.c' object='gdata/gdata_libgdata_la-gdata-comparable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-comparable.lo `test -f 'gdata/gdata-comparable.c' || echo '$(srcdir)/'`gdata/gdata-comparable.c + +gdata/gdata_libgdata_la-gdata-batch-operation.lo: gdata/gdata-batch-operation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-batch-operation.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batch-operation.Tpo -c -o gdata/gdata_libgdata_la-gdata-batch-operation.lo `test -f 'gdata/gdata-batch-operation.c' || echo '$(srcdir)/'`gdata/gdata-batch-operation.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batch-operation.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batch-operation.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-batch-operation.c' object='gdata/gdata_libgdata_la-gdata-batch-operation.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-batch-operation.lo `test -f 'gdata/gdata-batch-operation.c' || echo '$(srcdir)/'`gdata/gdata-batch-operation.c + +gdata/gdata_libgdata_la-gdata-batchable.lo: gdata/gdata-batchable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-batchable.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batchable.Tpo -c -o gdata/gdata_libgdata_la-gdata-batchable.lo `test -f 'gdata/gdata-batchable.c' || echo '$(srcdir)/'`gdata/gdata-batchable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batchable.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batchable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-batchable.c' object='gdata/gdata_libgdata_la-gdata-batchable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-batchable.lo `test -f 'gdata/gdata-batchable.c' || echo '$(srcdir)/'`gdata/gdata-batchable.c + +gdata/gdata_libgdata_la-gdata-batch-feed.lo: gdata/gdata-batch-feed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-batch-feed.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batch-feed.Tpo -c -o gdata/gdata_libgdata_la-gdata-batch-feed.lo `test -f 'gdata/gdata-batch-feed.c' || echo '$(srcdir)/'`gdata/gdata-batch-feed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batch-feed.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-batch-feed.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-batch-feed.c' object='gdata/gdata_libgdata_la-gdata-batch-feed.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-batch-feed.lo `test -f 'gdata/gdata-batch-feed.c' || echo '$(srcdir)/'`gdata/gdata-batch-feed.c + +gdata/gdata_libgdata_la-gdata-authorizer.lo: gdata/gdata-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-authorizer.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-authorizer.Tpo -c -o gdata/gdata_libgdata_la-gdata-authorizer.lo `test -f 'gdata/gdata-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-authorizer.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-authorizer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-authorizer.c' object='gdata/gdata_libgdata_la-gdata-authorizer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-authorizer.lo `test -f 'gdata/gdata-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-authorizer.c + +gdata/gdata_libgdata_la-gdata-authorization-domain.lo: gdata/gdata-authorization-domain.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-authorization-domain.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-authorization-domain.Tpo -c -o gdata/gdata_libgdata_la-gdata-authorization-domain.lo `test -f 'gdata/gdata-authorization-domain.c' || echo '$(srcdir)/'`gdata/gdata-authorization-domain.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-authorization-domain.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-authorization-domain.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-authorization-domain.c' object='gdata/gdata_libgdata_la-gdata-authorization-domain.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-authorization-domain.lo `test -f 'gdata/gdata-authorization-domain.c' || echo '$(srcdir)/'`gdata/gdata-authorization-domain.c + +gdata/gdata_libgdata_la-gdata-client-login-authorizer.lo: gdata/gdata-client-login-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-client-login-authorizer.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-client-login-authorizer.Tpo -c -o gdata/gdata_libgdata_la-gdata-client-login-authorizer.lo `test -f 'gdata/gdata-client-login-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-client-login-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-client-login-authorizer.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-client-login-authorizer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-client-login-authorizer.c' object='gdata/gdata_libgdata_la-gdata-client-login-authorizer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-client-login-authorizer.lo `test -f 'gdata/gdata-client-login-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-client-login-authorizer.c + +gdata/gdata_libgdata_la-gdata-oauth1-authorizer.lo: gdata/gdata-oauth1-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-oauth1-authorizer.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-oauth1-authorizer.Tpo -c -o gdata/gdata_libgdata_la-gdata-oauth1-authorizer.lo `test -f 'gdata/gdata-oauth1-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-oauth1-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-oauth1-authorizer.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-oauth1-authorizer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-oauth1-authorizer.c' object='gdata/gdata_libgdata_la-gdata-oauth1-authorizer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-oauth1-authorizer.lo `test -f 'gdata/gdata-oauth1-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-oauth1-authorizer.c + +gdata/gdata_libgdata_la-gdata-oauth2-authorizer.lo: gdata/gdata-oauth2-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-oauth2-authorizer.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-oauth2-authorizer.Tpo -c -o gdata/gdata_libgdata_la-gdata-oauth2-authorizer.lo `test -f 'gdata/gdata-oauth2-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-oauth2-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-oauth2-authorizer.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-oauth2-authorizer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-oauth2-authorizer.c' object='gdata/gdata_libgdata_la-gdata-oauth2-authorizer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-oauth2-authorizer.lo `test -f 'gdata/gdata-oauth2-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-oauth2-authorizer.c + +gdata/atom/gdata_libgdata_la-gdata-author.lo: gdata/atom/gdata-author.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/atom/gdata_libgdata_la-gdata-author.lo -MD -MP -MF gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-author.Tpo -c -o gdata/atom/gdata_libgdata_la-gdata-author.lo `test -f 'gdata/atom/gdata-author.c' || echo '$(srcdir)/'`gdata/atom/gdata-author.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-author.Tpo gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-author.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/atom/gdata-author.c' object='gdata/atom/gdata_libgdata_la-gdata-author.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/atom/gdata_libgdata_la-gdata-author.lo `test -f 'gdata/atom/gdata-author.c' || echo '$(srcdir)/'`gdata/atom/gdata-author.c + +gdata/atom/gdata_libgdata_la-gdata-category.lo: gdata/atom/gdata-category.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/atom/gdata_libgdata_la-gdata-category.lo -MD -MP -MF gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-category.Tpo -c -o gdata/atom/gdata_libgdata_la-gdata-category.lo `test -f 'gdata/atom/gdata-category.c' || echo '$(srcdir)/'`gdata/atom/gdata-category.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-category.Tpo gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-category.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/atom/gdata-category.c' object='gdata/atom/gdata_libgdata_la-gdata-category.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/atom/gdata_libgdata_la-gdata-category.lo `test -f 'gdata/atom/gdata-category.c' || echo '$(srcdir)/'`gdata/atom/gdata-category.c + +gdata/atom/gdata_libgdata_la-gdata-generator.lo: gdata/atom/gdata-generator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/atom/gdata_libgdata_la-gdata-generator.lo -MD -MP -MF gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-generator.Tpo -c -o gdata/atom/gdata_libgdata_la-gdata-generator.lo `test -f 'gdata/atom/gdata-generator.c' || echo '$(srcdir)/'`gdata/atom/gdata-generator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-generator.Tpo gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-generator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/atom/gdata-generator.c' object='gdata/atom/gdata_libgdata_la-gdata-generator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/atom/gdata_libgdata_la-gdata-generator.lo `test -f 'gdata/atom/gdata-generator.c' || echo '$(srcdir)/'`gdata/atom/gdata-generator.c + +gdata/atom/gdata_libgdata_la-gdata-link.lo: gdata/atom/gdata-link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/atom/gdata_libgdata_la-gdata-link.lo -MD -MP -MF gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-link.Tpo -c -o gdata/atom/gdata_libgdata_la-gdata-link.lo `test -f 'gdata/atom/gdata-link.c' || echo '$(srcdir)/'`gdata/atom/gdata-link.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-link.Tpo gdata/atom/$(DEPDIR)/gdata_libgdata_la-gdata-link.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/atom/gdata-link.c' object='gdata/atom/gdata_libgdata_la-gdata-link.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/atom/gdata_libgdata_la-gdata-link.lo `test -f 'gdata/atom/gdata-link.c' || echo '$(srcdir)/'`gdata/atom/gdata-link.c + +gdata/app/gdata_libgdata_la-gdata-app-categories.lo: gdata/app/gdata-app-categories.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/app/gdata_libgdata_la-gdata-app-categories.lo -MD -MP -MF gdata/app/$(DEPDIR)/gdata_libgdata_la-gdata-app-categories.Tpo -c -o gdata/app/gdata_libgdata_la-gdata-app-categories.lo `test -f 'gdata/app/gdata-app-categories.c' || echo '$(srcdir)/'`gdata/app/gdata-app-categories.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/app/$(DEPDIR)/gdata_libgdata_la-gdata-app-categories.Tpo gdata/app/$(DEPDIR)/gdata_libgdata_la-gdata-app-categories.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/app/gdata-app-categories.c' object='gdata/app/gdata_libgdata_la-gdata-app-categories.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/app/gdata_libgdata_la-gdata-app-categories.lo `test -f 'gdata/app/gdata-app-categories.c' || echo '$(srcdir)/'`gdata/app/gdata-app-categories.c + +gdata/exif/gdata_libgdata_la-gdata-exif-tags.lo: gdata/exif/gdata-exif-tags.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/exif/gdata_libgdata_la-gdata-exif-tags.lo -MD -MP -MF gdata/exif/$(DEPDIR)/gdata_libgdata_la-gdata-exif-tags.Tpo -c -o gdata/exif/gdata_libgdata_la-gdata-exif-tags.lo `test -f 'gdata/exif/gdata-exif-tags.c' || echo '$(srcdir)/'`gdata/exif/gdata-exif-tags.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/exif/$(DEPDIR)/gdata_libgdata_la-gdata-exif-tags.Tpo gdata/exif/$(DEPDIR)/gdata_libgdata_la-gdata-exif-tags.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/exif/gdata-exif-tags.c' object='gdata/exif/gdata_libgdata_la-gdata-exif-tags.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/exif/gdata_libgdata_la-gdata-exif-tags.lo `test -f 'gdata/exif/gdata-exif-tags.c' || echo '$(srcdir)/'`gdata/exif/gdata-exif-tags.c + +gdata/gd/gdata_libgdata_la-gdata-gd-email-address.lo: gdata/gd/gdata-gd-email-address.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-email-address.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-email-address.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-email-address.lo `test -f 'gdata/gd/gdata-gd-email-address.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-email-address.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-email-address.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-email-address.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-email-address.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-email-address.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-email-address.lo `test -f 'gdata/gd/gdata-gd-email-address.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-email-address.c + +gdata/gd/gdata_libgdata_la-gdata-gd-feed-link.lo: gdata/gd/gdata-gd-feed-link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-feed-link.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-feed-link.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-feed-link.lo `test -f 'gdata/gd/gdata-gd-feed-link.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-feed-link.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-feed-link.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-feed-link.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-feed-link.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-feed-link.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-feed-link.lo `test -f 'gdata/gd/gdata-gd-feed-link.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-feed-link.c + +gdata/gd/gdata_libgdata_la-gdata-gd-im-address.lo: gdata/gd/gdata-gd-im-address.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-im-address.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-im-address.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-im-address.lo `test -f 'gdata/gd/gdata-gd-im-address.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-im-address.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-im-address.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-im-address.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-im-address.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-im-address.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-im-address.lo `test -f 'gdata/gd/gdata-gd-im-address.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-im-address.c + +gdata/gd/gdata_libgdata_la-gdata-gd-organization.lo: gdata/gd/gdata-gd-organization.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-organization.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-organization.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-organization.lo `test -f 'gdata/gd/gdata-gd-organization.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-organization.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-organization.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-organization.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-organization.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-organization.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-organization.lo `test -f 'gdata/gd/gdata-gd-organization.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-organization.c + +gdata/gd/gdata_libgdata_la-gdata-gd-phone-number.lo: gdata/gd/gdata-gd-phone-number.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-phone-number.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-phone-number.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-phone-number.lo `test -f 'gdata/gd/gdata-gd-phone-number.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-phone-number.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-phone-number.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-phone-number.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-phone-number.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-phone-number.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-phone-number.lo `test -f 'gdata/gd/gdata-gd-phone-number.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-phone-number.c + +gdata/gd/gdata_libgdata_la-gdata-gd-postal-address.lo: gdata/gd/gdata-gd-postal-address.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-postal-address.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-postal-address.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-postal-address.lo `test -f 'gdata/gd/gdata-gd-postal-address.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-postal-address.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-postal-address.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-postal-address.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-postal-address.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-postal-address.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-postal-address.lo `test -f 'gdata/gd/gdata-gd-postal-address.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-postal-address.c + +gdata/gd/gdata_libgdata_la-gdata-gd-reminder.lo: gdata/gd/gdata-gd-reminder.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-reminder.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-reminder.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-reminder.lo `test -f 'gdata/gd/gdata-gd-reminder.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-reminder.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-reminder.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-reminder.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-reminder.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-reminder.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-reminder.lo `test -f 'gdata/gd/gdata-gd-reminder.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-reminder.c + +gdata/gd/gdata_libgdata_la-gdata-gd-when.lo: gdata/gd/gdata-gd-when.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-when.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-when.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-when.lo `test -f 'gdata/gd/gdata-gd-when.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-when.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-when.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-when.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-when.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-when.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-when.lo `test -f 'gdata/gd/gdata-gd-when.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-when.c + +gdata/gd/gdata_libgdata_la-gdata-gd-where.lo: gdata/gd/gdata-gd-where.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-where.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-where.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-where.lo `test -f 'gdata/gd/gdata-gd-where.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-where.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-where.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-where.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-where.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-where.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-where.lo `test -f 'gdata/gd/gdata-gd-where.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-where.c + +gdata/gd/gdata_libgdata_la-gdata-gd-who.lo: gdata/gd/gdata-gd-who.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-who.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-who.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-who.lo `test -f 'gdata/gd/gdata-gd-who.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-who.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-who.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-who.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-who.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-who.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-who.lo `test -f 'gdata/gd/gdata-gd-who.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-who.c + +gdata/gd/gdata_libgdata_la-gdata-gd-name.lo: gdata/gd/gdata-gd-name.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gd/gdata_libgdata_la-gdata-gd-name.lo -MD -MP -MF gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-name.Tpo -c -o gdata/gd/gdata_libgdata_la-gdata-gd-name.lo `test -f 'gdata/gd/gdata-gd-name.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-name.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-name.Tpo gdata/gd/$(DEPDIR)/gdata_libgdata_la-gdata-gd-name.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gd/gdata-gd-name.c' object='gdata/gd/gdata_libgdata_la-gdata-gd-name.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gd/gdata_libgdata_la-gdata-gd-name.lo `test -f 'gdata/gd/gdata-gd-name.c' || echo '$(srcdir)/'`gdata/gd/gdata-gd-name.c + +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-calendar.lo: gdata/gcontact/gdata-gcontact-calendar.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gcontact/gdata_libgdata_la-gdata-gcontact-calendar.lo -MD -MP -MF gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-calendar.Tpo -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-calendar.lo `test -f 'gdata/gcontact/gdata-gcontact-calendar.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-calendar.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-calendar.Tpo gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-calendar.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gcontact/gdata-gcontact-calendar.c' object='gdata/gcontact/gdata_libgdata_la-gdata-gcontact-calendar.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-calendar.lo `test -f 'gdata/gcontact/gdata-gcontact-calendar.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-calendar.c + +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-event.lo: gdata/gcontact/gdata-gcontact-event.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gcontact/gdata_libgdata_la-gdata-gcontact-event.lo -MD -MP -MF gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-event.Tpo -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-event.lo `test -f 'gdata/gcontact/gdata-gcontact-event.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-event.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-event.Tpo gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-event.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gcontact/gdata-gcontact-event.c' object='gdata/gcontact/gdata_libgdata_la-gdata-gcontact-event.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-event.lo `test -f 'gdata/gcontact/gdata-gcontact-event.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-event.c + +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-external-id.lo: gdata/gcontact/gdata-gcontact-external-id.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gcontact/gdata_libgdata_la-gdata-gcontact-external-id.lo -MD -MP -MF gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-external-id.Tpo -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-external-id.lo `test -f 'gdata/gcontact/gdata-gcontact-external-id.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-external-id.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-external-id.Tpo gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-external-id.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gcontact/gdata-gcontact-external-id.c' object='gdata/gcontact/gdata_libgdata_la-gdata-gcontact-external-id.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-external-id.lo `test -f 'gdata/gcontact/gdata-gcontact-external-id.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-external-id.c + +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-jot.lo: gdata/gcontact/gdata-gcontact-jot.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gcontact/gdata_libgdata_la-gdata-gcontact-jot.lo -MD -MP -MF gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-jot.Tpo -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-jot.lo `test -f 'gdata/gcontact/gdata-gcontact-jot.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-jot.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-jot.Tpo gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-jot.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gcontact/gdata-gcontact-jot.c' object='gdata/gcontact/gdata_libgdata_la-gdata-gcontact-jot.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-jot.lo `test -f 'gdata/gcontact/gdata-gcontact-jot.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-jot.c + +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-language.lo: gdata/gcontact/gdata-gcontact-language.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gcontact/gdata_libgdata_la-gdata-gcontact-language.lo -MD -MP -MF gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-language.Tpo -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-language.lo `test -f 'gdata/gcontact/gdata-gcontact-language.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-language.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-language.Tpo gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-language.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gcontact/gdata-gcontact-language.c' object='gdata/gcontact/gdata_libgdata_la-gdata-gcontact-language.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-language.lo `test -f 'gdata/gcontact/gdata-gcontact-language.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-language.c + +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-relation.lo: gdata/gcontact/gdata-gcontact-relation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gcontact/gdata_libgdata_la-gdata-gcontact-relation.lo -MD -MP -MF gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-relation.Tpo -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-relation.lo `test -f 'gdata/gcontact/gdata-gcontact-relation.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-relation.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-relation.Tpo gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-relation.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gcontact/gdata-gcontact-relation.c' object='gdata/gcontact/gdata_libgdata_la-gdata-gcontact-relation.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-relation.lo `test -f 'gdata/gcontact/gdata-gcontact-relation.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-relation.c + +gdata/gcontact/gdata_libgdata_la-gdata-gcontact-website.lo: gdata/gcontact/gdata-gcontact-website.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gcontact/gdata_libgdata_la-gdata-gcontact-website.lo -MD -MP -MF gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-website.Tpo -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-website.lo `test -f 'gdata/gcontact/gdata-gcontact-website.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-website.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-website.Tpo gdata/gcontact/$(DEPDIR)/gdata_libgdata_la-gdata-gcontact-website.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gcontact/gdata-gcontact-website.c' object='gdata/gcontact/gdata_libgdata_la-gdata-gcontact-website.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gcontact/gdata_libgdata_la-gdata-gcontact-website.lo `test -f 'gdata/gcontact/gdata-gcontact-website.c' || echo '$(srcdir)/'`gdata/gcontact/gdata-gcontact-website.c + +gdata/georss/gdata_libgdata_la-gdata-georss-where.lo: gdata/georss/gdata-georss-where.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/georss/gdata_libgdata_la-gdata-georss-where.lo -MD -MP -MF gdata/georss/$(DEPDIR)/gdata_libgdata_la-gdata-georss-where.Tpo -c -o gdata/georss/gdata_libgdata_la-gdata-georss-where.lo `test -f 'gdata/georss/gdata-georss-where.c' || echo '$(srcdir)/'`gdata/georss/gdata-georss-where.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/georss/$(DEPDIR)/gdata_libgdata_la-gdata-georss-where.Tpo gdata/georss/$(DEPDIR)/gdata_libgdata_la-gdata-georss-where.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/georss/gdata-georss-where.c' object='gdata/georss/gdata_libgdata_la-gdata-georss-where.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/georss/gdata_libgdata_la-gdata-georss-where.lo `test -f 'gdata/georss/gdata-georss-where.c' || echo '$(srcdir)/'`gdata/georss/gdata-georss-where.c + +gdata/media/gdata_libgdata_la-gdata-media-category.lo: gdata/media/gdata-media-category.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/media/gdata_libgdata_la-gdata-media-category.lo -MD -MP -MF gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-category.Tpo -c -o gdata/media/gdata_libgdata_la-gdata-media-category.lo `test -f 'gdata/media/gdata-media-category.c' || echo '$(srcdir)/'`gdata/media/gdata-media-category.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-category.Tpo gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-category.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/media/gdata-media-category.c' object='gdata/media/gdata_libgdata_la-gdata-media-category.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/media/gdata_libgdata_la-gdata-media-category.lo `test -f 'gdata/media/gdata-media-category.c' || echo '$(srcdir)/'`gdata/media/gdata-media-category.c + +gdata/media/gdata_libgdata_la-gdata-media-content.lo: gdata/media/gdata-media-content.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/media/gdata_libgdata_la-gdata-media-content.lo -MD -MP -MF gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-content.Tpo -c -o gdata/media/gdata_libgdata_la-gdata-media-content.lo `test -f 'gdata/media/gdata-media-content.c' || echo '$(srcdir)/'`gdata/media/gdata-media-content.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-content.Tpo gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-content.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/media/gdata-media-content.c' object='gdata/media/gdata_libgdata_la-gdata-media-content.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/media/gdata_libgdata_la-gdata-media-content.lo `test -f 'gdata/media/gdata-media-content.c' || echo '$(srcdir)/'`gdata/media/gdata-media-content.c + +gdata/media/gdata_libgdata_la-gdata-media-credit.lo: gdata/media/gdata-media-credit.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/media/gdata_libgdata_la-gdata-media-credit.lo -MD -MP -MF gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-credit.Tpo -c -o gdata/media/gdata_libgdata_la-gdata-media-credit.lo `test -f 'gdata/media/gdata-media-credit.c' || echo '$(srcdir)/'`gdata/media/gdata-media-credit.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-credit.Tpo gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-credit.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/media/gdata-media-credit.c' object='gdata/media/gdata_libgdata_la-gdata-media-credit.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/media/gdata_libgdata_la-gdata-media-credit.lo `test -f 'gdata/media/gdata-media-credit.c' || echo '$(srcdir)/'`gdata/media/gdata-media-credit.c + +gdata/media/gdata_libgdata_la-gdata-media-thumbnail.lo: gdata/media/gdata-media-thumbnail.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/media/gdata_libgdata_la-gdata-media-thumbnail.lo -MD -MP -MF gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-thumbnail.Tpo -c -o gdata/media/gdata_libgdata_la-gdata-media-thumbnail.lo `test -f 'gdata/media/gdata-media-thumbnail.c' || echo '$(srcdir)/'`gdata/media/gdata-media-thumbnail.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-thumbnail.Tpo gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-thumbnail.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/media/gdata-media-thumbnail.c' object='gdata/media/gdata_libgdata_la-gdata-media-thumbnail.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/media/gdata_libgdata_la-gdata-media-thumbnail.lo `test -f 'gdata/media/gdata-media-thumbnail.c' || echo '$(srcdir)/'`gdata/media/gdata-media-thumbnail.c + +gdata/media/gdata_libgdata_la-gdata-media-group.lo: gdata/media/gdata-media-group.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/media/gdata_libgdata_la-gdata-media-group.lo -MD -MP -MF gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-group.Tpo -c -o gdata/media/gdata_libgdata_la-gdata-media-group.lo `test -f 'gdata/media/gdata-media-group.c' || echo '$(srcdir)/'`gdata/media/gdata-media-group.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-group.Tpo gdata/media/$(DEPDIR)/gdata_libgdata_la-gdata-media-group.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/media/gdata-media-group.c' object='gdata/media/gdata_libgdata_la-gdata-media-group.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/media/gdata_libgdata_la-gdata-media-group.lo `test -f 'gdata/media/gdata-media-group.c' || echo '$(srcdir)/'`gdata/media/gdata-media-group.c + +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-service.lo: gdata/services/calendar/gdata-calendar-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/calendar/gdata_libgdata_la-gdata-calendar-service.lo -MD -MP -MF gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-service.Tpo -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-service.lo `test -f 'gdata/services/calendar/gdata-calendar-service.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-service.Tpo gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/calendar/gdata-calendar-service.c' object='gdata/services/calendar/gdata_libgdata_la-gdata-calendar-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-service.lo `test -f 'gdata/services/calendar/gdata-calendar-service.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-service.c + +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-calendar.lo: gdata/services/calendar/gdata-calendar-calendar.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/calendar/gdata_libgdata_la-gdata-calendar-calendar.lo -MD -MP -MF gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-calendar.Tpo -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-calendar.lo `test -f 'gdata/services/calendar/gdata-calendar-calendar.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-calendar.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-calendar.Tpo gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-calendar.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/calendar/gdata-calendar-calendar.c' object='gdata/services/calendar/gdata_libgdata_la-gdata-calendar-calendar.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-calendar.lo `test -f 'gdata/services/calendar/gdata-calendar-calendar.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-calendar.c + +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-event.lo: gdata/services/calendar/gdata-calendar-event.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/calendar/gdata_libgdata_la-gdata-calendar-event.lo -MD -MP -MF gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-event.Tpo -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-event.lo `test -f 'gdata/services/calendar/gdata-calendar-event.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-event.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-event.Tpo gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-event.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/calendar/gdata-calendar-event.c' object='gdata/services/calendar/gdata_libgdata_la-gdata-calendar-event.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-event.lo `test -f 'gdata/services/calendar/gdata-calendar-event.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-event.c + +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-query.lo: gdata/services/calendar/gdata-calendar-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/calendar/gdata_libgdata_la-gdata-calendar-query.lo -MD -MP -MF gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-query.Tpo -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-query.lo `test -f 'gdata/services/calendar/gdata-calendar-query.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-query.Tpo gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/calendar/gdata-calendar-query.c' object='gdata/services/calendar/gdata_libgdata_la-gdata-calendar-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-query.lo `test -f 'gdata/services/calendar/gdata-calendar-query.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-query.c + +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-feed.lo: gdata/services/calendar/gdata-calendar-feed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/calendar/gdata_libgdata_la-gdata-calendar-feed.lo -MD -MP -MF gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-feed.Tpo -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-feed.lo `test -f 'gdata/services/calendar/gdata-calendar-feed.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-feed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-feed.Tpo gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-feed.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/calendar/gdata-calendar-feed.c' object='gdata/services/calendar/gdata_libgdata_la-gdata-calendar-feed.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-feed.lo `test -f 'gdata/services/calendar/gdata-calendar-feed.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-feed.c + +gdata/services/calendar/gdata_libgdata_la-gdata-calendar-access-rule.lo: gdata/services/calendar/gdata-calendar-access-rule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/calendar/gdata_libgdata_la-gdata-calendar-access-rule.lo -MD -MP -MF gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-access-rule.Tpo -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-access-rule.lo `test -f 'gdata/services/calendar/gdata-calendar-access-rule.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-access-rule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-access-rule.Tpo gdata/services/calendar/$(DEPDIR)/gdata_libgdata_la-gdata-calendar-access-rule.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/calendar/gdata-calendar-access-rule.c' object='gdata/services/calendar/gdata_libgdata_la-gdata-calendar-access-rule.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/calendar/gdata_libgdata_la-gdata-calendar-access-rule.lo `test -f 'gdata/services/calendar/gdata-calendar-access-rule.c' || echo '$(srcdir)/'`gdata/services/calendar/gdata-calendar-access-rule.c + +gdata/services/contacts/gdata_libgdata_la-gdata-contacts-service.lo: gdata/services/contacts/gdata-contacts-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/contacts/gdata_libgdata_la-gdata-contacts-service.lo -MD -MP -MF gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-service.Tpo -c -o gdata/services/contacts/gdata_libgdata_la-gdata-contacts-service.lo `test -f 'gdata/services/contacts/gdata-contacts-service.c' || echo '$(srcdir)/'`gdata/services/contacts/gdata-contacts-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-service.Tpo gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/contacts/gdata-contacts-service.c' object='gdata/services/contacts/gdata_libgdata_la-gdata-contacts-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/contacts/gdata_libgdata_la-gdata-contacts-service.lo `test -f 'gdata/services/contacts/gdata-contacts-service.c' || echo '$(srcdir)/'`gdata/services/contacts/gdata-contacts-service.c + +gdata/services/contacts/gdata_libgdata_la-gdata-contacts-contact.lo: gdata/services/contacts/gdata-contacts-contact.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/contacts/gdata_libgdata_la-gdata-contacts-contact.lo -MD -MP -MF gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-contact.Tpo -c -o gdata/services/contacts/gdata_libgdata_la-gdata-contacts-contact.lo `test -f 'gdata/services/contacts/gdata-contacts-contact.c' || echo '$(srcdir)/'`gdata/services/contacts/gdata-contacts-contact.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-contact.Tpo gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-contact.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/contacts/gdata-contacts-contact.c' object='gdata/services/contacts/gdata_libgdata_la-gdata-contacts-contact.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/contacts/gdata_libgdata_la-gdata-contacts-contact.lo `test -f 'gdata/services/contacts/gdata-contacts-contact.c' || echo '$(srcdir)/'`gdata/services/contacts/gdata-contacts-contact.c + +gdata/services/contacts/gdata_libgdata_la-gdata-contacts-group.lo: gdata/services/contacts/gdata-contacts-group.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/contacts/gdata_libgdata_la-gdata-contacts-group.lo -MD -MP -MF gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-group.Tpo -c -o gdata/services/contacts/gdata_libgdata_la-gdata-contacts-group.lo `test -f 'gdata/services/contacts/gdata-contacts-group.c' || echo '$(srcdir)/'`gdata/services/contacts/gdata-contacts-group.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-group.Tpo gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-group.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/contacts/gdata-contacts-group.c' object='gdata/services/contacts/gdata_libgdata_la-gdata-contacts-group.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/contacts/gdata_libgdata_la-gdata-contacts-group.lo `test -f 'gdata/services/contacts/gdata-contacts-group.c' || echo '$(srcdir)/'`gdata/services/contacts/gdata-contacts-group.c + +gdata/services/contacts/gdata_libgdata_la-gdata-contacts-query.lo: gdata/services/contacts/gdata-contacts-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/contacts/gdata_libgdata_la-gdata-contacts-query.lo -MD -MP -MF gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-query.Tpo -c -o gdata/services/contacts/gdata_libgdata_la-gdata-contacts-query.lo `test -f 'gdata/services/contacts/gdata-contacts-query.c' || echo '$(srcdir)/'`gdata/services/contacts/gdata-contacts-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-query.Tpo gdata/services/contacts/$(DEPDIR)/gdata_libgdata_la-gdata-contacts-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/contacts/gdata-contacts-query.c' object='gdata/services/contacts/gdata_libgdata_la-gdata-contacts-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/contacts/gdata_libgdata_la-gdata-contacts-query.lo `test -f 'gdata/services/contacts/gdata-contacts-query.c' || echo '$(srcdir)/'`gdata/services/contacts/gdata-contacts-query.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-service.lo: gdata/services/documents/gdata-documents-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-service.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-service.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-service.lo `test -f 'gdata/services/documents/gdata-documents-service.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-service.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-service.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-service.lo `test -f 'gdata/services/documents/gdata-documents-service.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-service.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-metadata.lo: gdata/services/documents/gdata-documents-metadata.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-metadata.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-metadata.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-metadata.lo `test -f 'gdata/services/documents/gdata-documents-metadata.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-metadata.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-metadata.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-metadata.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-metadata.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-metadata.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-metadata.lo `test -f 'gdata/services/documents/gdata-documents-metadata.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-metadata.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-feed.lo: gdata/services/documents/gdata-documents-feed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-feed.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-feed.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-feed.lo `test -f 'gdata/services/documents/gdata-documents-feed.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-feed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-feed.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-feed.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-feed.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-feed.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-feed.lo `test -f 'gdata/services/documents/gdata-documents-feed.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-feed.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-entry.lo: gdata/services/documents/gdata-documents-entry.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-entry.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-entry.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-entry.lo `test -f 'gdata/services/documents/gdata-documents-entry.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-entry.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-entry.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-entry.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-entry.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-entry.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-entry.lo `test -f 'gdata/services/documents/gdata-documents-entry.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-entry.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-document.lo: gdata/services/documents/gdata-documents-document.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-document.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-document.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-document.lo `test -f 'gdata/services/documents/gdata-documents-document.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-document.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-document.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-document.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-document.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-document.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-document.lo `test -f 'gdata/services/documents/gdata-documents-document.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-document.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-text.lo: gdata/services/documents/gdata-documents-text.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-text.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-text.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-text.lo `test -f 'gdata/services/documents/gdata-documents-text.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-text.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-text.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-text.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-text.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-text.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-text.lo `test -f 'gdata/services/documents/gdata-documents-text.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-text.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-presentation.lo: gdata/services/documents/gdata-documents-presentation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-presentation.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-presentation.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-presentation.lo `test -f 'gdata/services/documents/gdata-documents-presentation.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-presentation.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-presentation.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-presentation.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-presentation.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-presentation.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-presentation.lo `test -f 'gdata/services/documents/gdata-documents-presentation.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-presentation.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-spreadsheet.lo: gdata/services/documents/gdata-documents-spreadsheet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-spreadsheet.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-spreadsheet.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-spreadsheet.lo `test -f 'gdata/services/documents/gdata-documents-spreadsheet.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-spreadsheet.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-spreadsheet.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-spreadsheet.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-spreadsheet.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-spreadsheet.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-spreadsheet.lo `test -f 'gdata/services/documents/gdata-documents-spreadsheet.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-spreadsheet.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-folder.lo: gdata/services/documents/gdata-documents-folder.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-folder.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-folder.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-folder.lo `test -f 'gdata/services/documents/gdata-documents-folder.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-folder.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-folder.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-folder.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-folder.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-folder.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-folder.lo `test -f 'gdata/services/documents/gdata-documents-folder.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-folder.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-drawing.lo: gdata/services/documents/gdata-documents-drawing.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-drawing.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-drawing.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-drawing.lo `test -f 'gdata/services/documents/gdata-documents-drawing.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-drawing.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-drawing.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-drawing.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-drawing.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-drawing.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-drawing.lo `test -f 'gdata/services/documents/gdata-documents-drawing.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-drawing.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-pdf.lo: gdata/services/documents/gdata-documents-pdf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-pdf.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-pdf.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-pdf.lo `test -f 'gdata/services/documents/gdata-documents-pdf.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-pdf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-pdf.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-pdf.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-pdf.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-pdf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-pdf.lo `test -f 'gdata/services/documents/gdata-documents-pdf.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-pdf.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-query.lo: gdata/services/documents/gdata-documents-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-query.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-query.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-query.lo `test -f 'gdata/services/documents/gdata-documents-query.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-query.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-query.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-query.lo `test -f 'gdata/services/documents/gdata-documents-query.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-query.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-upload-query.lo: gdata/services/documents/gdata-documents-upload-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-upload-query.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-upload-query.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-upload-query.lo `test -f 'gdata/services/documents/gdata-documents-upload-query.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-upload-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-upload-query.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-upload-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-upload-query.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-upload-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-upload-query.lo `test -f 'gdata/services/documents/gdata-documents-upload-query.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-upload-query.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-access-rule.lo: gdata/services/documents/gdata-documents-access-rule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-access-rule.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-access-rule.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-access-rule.lo `test -f 'gdata/services/documents/gdata-documents-access-rule.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-access-rule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-access-rule.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-access-rule.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-access-rule.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-access-rule.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-access-rule.lo `test -f 'gdata/services/documents/gdata-documents-access-rule.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-access-rule.c + +gdata/services/documents/gdata_libgdata_la-gdata-documents-utils.lo: gdata/services/documents/gdata-documents-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/documents/gdata_libgdata_la-gdata-documents-utils.lo -MD -MP -MF gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-utils.Tpo -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-utils.lo `test -f 'gdata/services/documents/gdata-documents-utils.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-utils.Tpo gdata/services/documents/$(DEPDIR)/gdata_libgdata_la-gdata-documents-utils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/documents/gdata-documents-utils.c' object='gdata/services/documents/gdata_libgdata_la-gdata-documents-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/documents/gdata_libgdata_la-gdata-documents-utils.lo `test -f 'gdata/services/documents/gdata-documents-utils.c' || echo '$(srcdir)/'`gdata/services/documents/gdata-documents-utils.c + +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-album.lo: gdata/services/picasaweb/gdata-picasaweb-album.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-album.lo -MD -MP -MF gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-album.Tpo -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-album.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-album.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-album.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-album.Tpo gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-album.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/picasaweb/gdata-picasaweb-album.c' object='gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-album.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-album.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-album.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-album.c + +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-query.lo: gdata/services/picasaweb/gdata-picasaweb-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-query.lo -MD -MP -MF gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-query.Tpo -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-query.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-query.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-query.Tpo gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/picasaweb/gdata-picasaweb-query.c' object='gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-query.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-query.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-query.c + +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-file.lo: gdata/services/picasaweb/gdata-picasaweb-file.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-file.lo -MD -MP -MF gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-file.Tpo -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-file.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-file.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-file.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-file.Tpo gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-file.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/picasaweb/gdata-picasaweb-file.c' object='gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-file.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-file.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-file.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-file.c + +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-service.lo: gdata/services/picasaweb/gdata-picasaweb-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-service.lo -MD -MP -MF gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-service.Tpo -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-service.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-service.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-service.Tpo gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/picasaweb/gdata-picasaweb-service.c' object='gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-service.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-service.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-service.c + +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-user.lo: gdata/services/picasaweb/gdata-picasaweb-user.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-user.lo -MD -MP -MF gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-user.Tpo -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-user.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-user.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-user.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-user.Tpo gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-user.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/picasaweb/gdata-picasaweb-user.c' object='gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-user.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-user.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-user.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-user.c + +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-feed.lo: gdata/services/picasaweb/gdata-picasaweb-feed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-feed.lo -MD -MP -MF gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-feed.Tpo -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-feed.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-feed.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-feed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-feed.Tpo gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-feed.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/picasaweb/gdata-picasaweb-feed.c' object='gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-feed.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-feed.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-feed.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-feed.c + +gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-comment.lo: gdata/services/picasaweb/gdata-picasaweb-comment.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-comment.lo -MD -MP -MF gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-comment.Tpo -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-comment.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-comment.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-comment.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-comment.Tpo gdata/services/picasaweb/$(DEPDIR)/gdata_libgdata_la-gdata-picasaweb-comment.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/picasaweb/gdata-picasaweb-comment.c' object='gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-comment.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/picasaweb/gdata_libgdata_la-gdata-picasaweb-comment.lo `test -f 'gdata/services/picasaweb/gdata-picasaweb-comment.c' || echo '$(srcdir)/'`gdata/services/picasaweb/gdata-picasaweb-comment.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-service.lo: gdata/services/youtube/gdata-youtube-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-service.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-service.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-service.lo `test -f 'gdata/services/youtube/gdata-youtube-service.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-service.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-service.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-service.lo `test -f 'gdata/services/youtube/gdata-youtube-service.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-service.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-video.lo: gdata/services/youtube/gdata-youtube-video.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-video.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-video.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-video.lo `test -f 'gdata/services/youtube/gdata-youtube-video.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-video.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-video.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-video.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-video.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-video.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-video.lo `test -f 'gdata/services/youtube/gdata-youtube-video.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-video.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-content.lo: gdata/services/youtube/gdata-youtube-content.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-content.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-content.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-content.lo `test -f 'gdata/services/youtube/gdata-youtube-content.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-content.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-content.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-content.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-content.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-content.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-content.lo `test -f 'gdata/services/youtube/gdata-youtube-content.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-content.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-credit.lo: gdata/services/youtube/gdata-youtube-credit.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-credit.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-credit.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-credit.lo `test -f 'gdata/services/youtube/gdata-youtube-credit.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-credit.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-credit.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-credit.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-credit.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-credit.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-credit.lo `test -f 'gdata/services/youtube/gdata-youtube-credit.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-credit.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-query.lo: gdata/services/youtube/gdata-youtube-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-query.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-query.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-query.lo `test -f 'gdata/services/youtube/gdata-youtube-query.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-query.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-query.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-query.lo `test -f 'gdata/services/youtube/gdata-youtube-query.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-query.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-state.lo: gdata/services/youtube/gdata-youtube-state.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-state.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-state.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-state.lo `test -f 'gdata/services/youtube/gdata-youtube-state.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-state.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-state.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-state.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-state.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-state.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-state.lo `test -f 'gdata/services/youtube/gdata-youtube-state.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-state.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-category.lo: gdata/services/youtube/gdata-youtube-category.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-category.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-category.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-category.lo `test -f 'gdata/services/youtube/gdata-youtube-category.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-category.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-category.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-category.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-category.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-category.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-category.lo `test -f 'gdata/services/youtube/gdata-youtube-category.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-category.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-comment.lo: gdata/services/youtube/gdata-youtube-comment.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-comment.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-comment.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-comment.lo `test -f 'gdata/services/youtube/gdata-youtube-comment.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-comment.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-comment.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-comment.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-comment.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-comment.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-comment.lo `test -f 'gdata/services/youtube/gdata-youtube-comment.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-comment.c + +gdata/services/youtube/gdata_libgdata_la-gdata-youtube-feed.lo: gdata/services/youtube/gdata-youtube-feed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/youtube/gdata_libgdata_la-gdata-youtube-feed.lo -MD -MP -MF gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-feed.Tpo -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-feed.lo `test -f 'gdata/services/youtube/gdata-youtube-feed.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-feed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-feed.Tpo gdata/services/youtube/$(DEPDIR)/gdata_libgdata_la-gdata-youtube-feed.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/youtube/gdata-youtube-feed.c' object='gdata/services/youtube/gdata_libgdata_la-gdata-youtube-feed.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/youtube/gdata_libgdata_la-gdata-youtube-feed.lo `test -f 'gdata/services/youtube/gdata-youtube-feed.c' || echo '$(srcdir)/'`gdata/services/youtube/gdata-youtube-feed.c + +gdata/services/tasks/gdata_libgdata_la-gdata-tasks-service.lo: gdata/services/tasks/gdata-tasks-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/tasks/gdata_libgdata_la-gdata-tasks-service.lo -MD -MP -MF gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-service.Tpo -c -o gdata/services/tasks/gdata_libgdata_la-gdata-tasks-service.lo `test -f 'gdata/services/tasks/gdata-tasks-service.c' || echo '$(srcdir)/'`gdata/services/tasks/gdata-tasks-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-service.Tpo gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/tasks/gdata-tasks-service.c' object='gdata/services/tasks/gdata_libgdata_la-gdata-tasks-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/tasks/gdata_libgdata_la-gdata-tasks-service.lo `test -f 'gdata/services/tasks/gdata-tasks-service.c' || echo '$(srcdir)/'`gdata/services/tasks/gdata-tasks-service.c + +gdata/services/tasks/gdata_libgdata_la-gdata-tasks-tasklist.lo: gdata/services/tasks/gdata-tasks-tasklist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/tasks/gdata_libgdata_la-gdata-tasks-tasklist.lo -MD -MP -MF gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-tasklist.Tpo -c -o gdata/services/tasks/gdata_libgdata_la-gdata-tasks-tasklist.lo `test -f 'gdata/services/tasks/gdata-tasks-tasklist.c' || echo '$(srcdir)/'`gdata/services/tasks/gdata-tasks-tasklist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-tasklist.Tpo gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-tasklist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/tasks/gdata-tasks-tasklist.c' object='gdata/services/tasks/gdata_libgdata_la-gdata-tasks-tasklist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/tasks/gdata_libgdata_la-gdata-tasks-tasklist.lo `test -f 'gdata/services/tasks/gdata-tasks-tasklist.c' || echo '$(srcdir)/'`gdata/services/tasks/gdata-tasks-tasklist.c + +gdata/services/tasks/gdata_libgdata_la-gdata-tasks-task.lo: gdata/services/tasks/gdata-tasks-task.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/tasks/gdata_libgdata_la-gdata-tasks-task.lo -MD -MP -MF gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-task.Tpo -c -o gdata/services/tasks/gdata_libgdata_la-gdata-tasks-task.lo `test -f 'gdata/services/tasks/gdata-tasks-task.c' || echo '$(srcdir)/'`gdata/services/tasks/gdata-tasks-task.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-task.Tpo gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-task.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/tasks/gdata-tasks-task.c' object='gdata/services/tasks/gdata_libgdata_la-gdata-tasks-task.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/tasks/gdata_libgdata_la-gdata-tasks-task.lo `test -f 'gdata/services/tasks/gdata-tasks-task.c' || echo '$(srcdir)/'`gdata/services/tasks/gdata-tasks-task.c + +gdata/services/tasks/gdata_libgdata_la-gdata-tasks-query.lo: gdata/services/tasks/gdata-tasks-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/tasks/gdata_libgdata_la-gdata-tasks-query.lo -MD -MP -MF gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-query.Tpo -c -o gdata/services/tasks/gdata_libgdata_la-gdata-tasks-query.lo `test -f 'gdata/services/tasks/gdata-tasks-query.c' || echo '$(srcdir)/'`gdata/services/tasks/gdata-tasks-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-query.Tpo gdata/services/tasks/$(DEPDIR)/gdata_libgdata_la-gdata-tasks-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/tasks/gdata-tasks-query.c' object='gdata/services/tasks/gdata_libgdata_la-gdata-tasks-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/tasks/gdata_libgdata_la-gdata-tasks-query.lo `test -f 'gdata/services/tasks/gdata-tasks-query.c' || echo '$(srcdir)/'`gdata/services/tasks/gdata-tasks-query.c + +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-service.lo: gdata/services/freebase/gdata-freebase-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/freebase/gdata_libgdata_la-gdata-freebase-service.lo -MD -MP -MF gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-service.Tpo -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-service.lo `test -f 'gdata/services/freebase/gdata-freebase-service.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-service.Tpo gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/freebase/gdata-freebase-service.c' object='gdata/services/freebase/gdata_libgdata_la-gdata-freebase-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-service.lo `test -f 'gdata/services/freebase/gdata-freebase-service.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-service.c + +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-result.lo: gdata/services/freebase/gdata-freebase-result.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/freebase/gdata_libgdata_la-gdata-freebase-result.lo -MD -MP -MF gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-result.Tpo -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-result.lo `test -f 'gdata/services/freebase/gdata-freebase-result.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-result.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-result.Tpo gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-result.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/freebase/gdata-freebase-result.c' object='gdata/services/freebase/gdata_libgdata_la-gdata-freebase-result.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-result.lo `test -f 'gdata/services/freebase/gdata-freebase-result.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-result.c + +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-query.lo: gdata/services/freebase/gdata-freebase-search-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-query.lo -MD -MP -MF gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-search-query.Tpo -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-query.lo `test -f 'gdata/services/freebase/gdata-freebase-search-query.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-search-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-search-query.Tpo gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-search-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/freebase/gdata-freebase-search-query.c' object='gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-query.lo `test -f 'gdata/services/freebase/gdata-freebase-search-query.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-search-query.c + +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-result.lo: gdata/services/freebase/gdata-freebase-search-result.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-result.lo -MD -MP -MF gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-search-result.Tpo -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-result.lo `test -f 'gdata/services/freebase/gdata-freebase-search-result.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-search-result.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-search-result.Tpo gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-search-result.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/freebase/gdata-freebase-search-result.c' object='gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-result.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-search-result.lo `test -f 'gdata/services/freebase/gdata-freebase-search-result.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-search-result.c + +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-query.lo: gdata/services/freebase/gdata-freebase-topic-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-query.lo -MD -MP -MF gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-topic-query.Tpo -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-query.lo `test -f 'gdata/services/freebase/gdata-freebase-topic-query.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-topic-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-topic-query.Tpo gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-topic-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/freebase/gdata-freebase-topic-query.c' object='gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-query.lo `test -f 'gdata/services/freebase/gdata-freebase-topic-query.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-topic-query.c + +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-result.lo: gdata/services/freebase/gdata-freebase-topic-result.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-result.lo -MD -MP -MF gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-topic-result.Tpo -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-result.lo `test -f 'gdata/services/freebase/gdata-freebase-topic-result.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-topic-result.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-topic-result.Tpo gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-topic-result.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/freebase/gdata-freebase-topic-result.c' object='gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-result.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-topic-result.lo `test -f 'gdata/services/freebase/gdata-freebase-topic-result.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-topic-result.c + +gdata/services/freebase/gdata_libgdata_la-gdata-freebase-query.lo: gdata/services/freebase/gdata-freebase-query.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/services/freebase/gdata_libgdata_la-gdata-freebase-query.lo -MD -MP -MF gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-query.Tpo -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-query.lo `test -f 'gdata/services/freebase/gdata-freebase-query.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-query.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-query.Tpo gdata/services/freebase/$(DEPDIR)/gdata_libgdata_la-gdata-freebase-query.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/services/freebase/gdata-freebase-query.c' object='gdata/services/freebase/gdata_libgdata_la-gdata-freebase-query.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/services/freebase/gdata_libgdata_la-gdata-freebase-query.lo `test -f 'gdata/services/freebase/gdata-freebase-query.c' || echo '$(srcdir)/'`gdata/services/freebase/gdata-freebase-query.c + +gdata/gdata_libgdata_la-gdata-goa-authorizer.lo: gdata/gdata-goa-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -MT gdata/gdata_libgdata_la-gdata-goa-authorizer.lo -MD -MP -MF gdata/$(DEPDIR)/gdata_libgdata_la-gdata-goa-authorizer.Tpo -c -o gdata/gdata_libgdata_la-gdata-goa-authorizer.lo `test -f 'gdata/gdata-goa-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-goa-authorizer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gdata/$(DEPDIR)/gdata_libgdata_la-gdata-goa-authorizer.Tpo gdata/$(DEPDIR)/gdata_libgdata_la-gdata-goa-authorizer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdata/gdata-goa-authorizer.c' object='gdata/gdata_libgdata_la-gdata-goa-authorizer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gdata_libgdata_la_CPPFLAGS) $(CPPFLAGS) $(gdata_libgdata_la_CFLAGS) $(CFLAGS) -c -o gdata/gdata_libgdata_la-gdata-goa-authorizer.lo `test -f 'gdata/gdata-goa-authorizer.c' || echo '$(srcdir)/'`gdata/gdata-goa-authorizer.c + +demos/calendar/demos_calendar_calendar_cli-calendar-cli.o: demos/calendar/calendar-cli.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_calendar_calendar_cli_CPPFLAGS) $(CPPFLAGS) $(demos_calendar_calendar_cli_CFLAGS) $(CFLAGS) -MT demos/calendar/demos_calendar_calendar_cli-calendar-cli.o -MD -MP -MF demos/calendar/$(DEPDIR)/demos_calendar_calendar_cli-calendar-cli.Tpo -c -o demos/calendar/demos_calendar_calendar_cli-calendar-cli.o `test -f 'demos/calendar/calendar-cli.c' || echo '$(srcdir)/'`demos/calendar/calendar-cli.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/calendar/$(DEPDIR)/demos_calendar_calendar_cli-calendar-cli.Tpo demos/calendar/$(DEPDIR)/demos_calendar_calendar_cli-calendar-cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/calendar/calendar-cli.c' object='demos/calendar/demos_calendar_calendar_cli-calendar-cli.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_calendar_calendar_cli_CPPFLAGS) $(CPPFLAGS) $(demos_calendar_calendar_cli_CFLAGS) $(CFLAGS) -c -o demos/calendar/demos_calendar_calendar_cli-calendar-cli.o `test -f 'demos/calendar/calendar-cli.c' || echo '$(srcdir)/'`demos/calendar/calendar-cli.c + +demos/calendar/demos_calendar_calendar_cli-calendar-cli.obj: demos/calendar/calendar-cli.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_calendar_calendar_cli_CPPFLAGS) $(CPPFLAGS) $(demos_calendar_calendar_cli_CFLAGS) $(CFLAGS) -MT demos/calendar/demos_calendar_calendar_cli-calendar-cli.obj -MD -MP -MF demos/calendar/$(DEPDIR)/demos_calendar_calendar_cli-calendar-cli.Tpo -c -o demos/calendar/demos_calendar_calendar_cli-calendar-cli.obj `if test -f 'demos/calendar/calendar-cli.c'; then $(CYGPATH_W) 'demos/calendar/calendar-cli.c'; else $(CYGPATH_W) '$(srcdir)/demos/calendar/calendar-cli.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/calendar/$(DEPDIR)/demos_calendar_calendar_cli-calendar-cli.Tpo demos/calendar/$(DEPDIR)/demos_calendar_calendar_cli-calendar-cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/calendar/calendar-cli.c' object='demos/calendar/demos_calendar_calendar_cli-calendar-cli.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_calendar_calendar_cli_CPPFLAGS) $(CPPFLAGS) $(demos_calendar_calendar_cli_CFLAGS) $(CFLAGS) -c -o demos/calendar/demos_calendar_calendar_cli-calendar-cli.obj `if test -f 'demos/calendar/calendar-cli.c'; then $(CYGPATH_W) 'demos/calendar/calendar-cli.c'; else $(CYGPATH_W) '$(srcdir)/demos/calendar/calendar-cli.c'; fi` + +demos/docs-list/demos_docs_list_docs_list-docs-list.o: demos/docs-list/docs-list.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_docs_list_docs_list_CPPFLAGS) $(CPPFLAGS) $(demos_docs_list_docs_list_CFLAGS) $(CFLAGS) -MT demos/docs-list/demos_docs_list_docs_list-docs-list.o -MD -MP -MF demos/docs-list/$(DEPDIR)/demos_docs_list_docs_list-docs-list.Tpo -c -o demos/docs-list/demos_docs_list_docs_list-docs-list.o `test -f 'demos/docs-list/docs-list.c' || echo '$(srcdir)/'`demos/docs-list/docs-list.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/docs-list/$(DEPDIR)/demos_docs_list_docs_list-docs-list.Tpo demos/docs-list/$(DEPDIR)/demos_docs_list_docs_list-docs-list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/docs-list/docs-list.c' object='demos/docs-list/demos_docs_list_docs_list-docs-list.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_docs_list_docs_list_CPPFLAGS) $(CPPFLAGS) $(demos_docs_list_docs_list_CFLAGS) $(CFLAGS) -c -o demos/docs-list/demos_docs_list_docs_list-docs-list.o `test -f 'demos/docs-list/docs-list.c' || echo '$(srcdir)/'`demos/docs-list/docs-list.c + +demos/docs-list/demos_docs_list_docs_list-docs-list.obj: demos/docs-list/docs-list.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_docs_list_docs_list_CPPFLAGS) $(CPPFLAGS) $(demos_docs_list_docs_list_CFLAGS) $(CFLAGS) -MT demos/docs-list/demos_docs_list_docs_list-docs-list.obj -MD -MP -MF demos/docs-list/$(DEPDIR)/demos_docs_list_docs_list-docs-list.Tpo -c -o demos/docs-list/demos_docs_list_docs_list-docs-list.obj `if test -f 'demos/docs-list/docs-list.c'; then $(CYGPATH_W) 'demos/docs-list/docs-list.c'; else $(CYGPATH_W) '$(srcdir)/demos/docs-list/docs-list.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/docs-list/$(DEPDIR)/demos_docs_list_docs_list-docs-list.Tpo demos/docs-list/$(DEPDIR)/demos_docs_list_docs_list-docs-list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/docs-list/docs-list.c' object='demos/docs-list/demos_docs_list_docs_list-docs-list.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_docs_list_docs_list_CPPFLAGS) $(CPPFLAGS) $(demos_docs_list_docs_list_CFLAGS) $(CFLAGS) -c -o demos/docs-list/demos_docs_list_docs_list-docs-list.obj `if test -f 'demos/docs-list/docs-list.c'; then $(CYGPATH_W) 'demos/docs-list/docs-list.c'; else $(CYGPATH_W) '$(srcdir)/demos/docs-list/docs-list.c'; fi` + +demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.o: demos/scrapbook/scrapbook.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_scrapbook_scrapbook_CPPFLAGS) $(CPPFLAGS) $(demos_scrapbook_scrapbook_CFLAGS) $(CFLAGS) -MT demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.o -MD -MP -MF demos/scrapbook/$(DEPDIR)/demos_scrapbook_scrapbook-scrapbook.Tpo -c -o demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.o `test -f 'demos/scrapbook/scrapbook.c' || echo '$(srcdir)/'`demos/scrapbook/scrapbook.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/scrapbook/$(DEPDIR)/demos_scrapbook_scrapbook-scrapbook.Tpo demos/scrapbook/$(DEPDIR)/demos_scrapbook_scrapbook-scrapbook.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/scrapbook/scrapbook.c' object='demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_scrapbook_scrapbook_CPPFLAGS) $(CPPFLAGS) $(demos_scrapbook_scrapbook_CFLAGS) $(CFLAGS) -c -o demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.o `test -f 'demos/scrapbook/scrapbook.c' || echo '$(srcdir)/'`demos/scrapbook/scrapbook.c + +demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.obj: demos/scrapbook/scrapbook.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_scrapbook_scrapbook_CPPFLAGS) $(CPPFLAGS) $(demos_scrapbook_scrapbook_CFLAGS) $(CFLAGS) -MT demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.obj -MD -MP -MF demos/scrapbook/$(DEPDIR)/demos_scrapbook_scrapbook-scrapbook.Tpo -c -o demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.obj `if test -f 'demos/scrapbook/scrapbook.c'; then $(CYGPATH_W) 'demos/scrapbook/scrapbook.c'; else $(CYGPATH_W) '$(srcdir)/demos/scrapbook/scrapbook.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/scrapbook/$(DEPDIR)/demos_scrapbook_scrapbook-scrapbook.Tpo demos/scrapbook/$(DEPDIR)/demos_scrapbook_scrapbook-scrapbook.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/scrapbook/scrapbook.c' object='demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_scrapbook_scrapbook_CPPFLAGS) $(CPPFLAGS) $(demos_scrapbook_scrapbook_CFLAGS) $(CFLAGS) -c -o demos/scrapbook/demos_scrapbook_scrapbook-scrapbook.obj `if test -f 'demos/scrapbook/scrapbook.c'; then $(CYGPATH_W) 'demos/scrapbook/scrapbook.c'; else $(CYGPATH_W) '$(srcdir)/demos/scrapbook/scrapbook.c'; fi` + +demos/tasks/demos_tasks_tasks_cli-tasks-cli.o: demos/tasks/tasks-cli.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_tasks_tasks_cli_CPPFLAGS) $(CPPFLAGS) $(demos_tasks_tasks_cli_CFLAGS) $(CFLAGS) -MT demos/tasks/demos_tasks_tasks_cli-tasks-cli.o -MD -MP -MF demos/tasks/$(DEPDIR)/demos_tasks_tasks_cli-tasks-cli.Tpo -c -o demos/tasks/demos_tasks_tasks_cli-tasks-cli.o `test -f 'demos/tasks/tasks-cli.c' || echo '$(srcdir)/'`demos/tasks/tasks-cli.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/tasks/$(DEPDIR)/demos_tasks_tasks_cli-tasks-cli.Tpo demos/tasks/$(DEPDIR)/demos_tasks_tasks_cli-tasks-cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/tasks/tasks-cli.c' object='demos/tasks/demos_tasks_tasks_cli-tasks-cli.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_tasks_tasks_cli_CPPFLAGS) $(CPPFLAGS) $(demos_tasks_tasks_cli_CFLAGS) $(CFLAGS) -c -o demos/tasks/demos_tasks_tasks_cli-tasks-cli.o `test -f 'demos/tasks/tasks-cli.c' || echo '$(srcdir)/'`demos/tasks/tasks-cli.c + +demos/tasks/demos_tasks_tasks_cli-tasks-cli.obj: demos/tasks/tasks-cli.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_tasks_tasks_cli_CPPFLAGS) $(CPPFLAGS) $(demos_tasks_tasks_cli_CFLAGS) $(CFLAGS) -MT demos/tasks/demos_tasks_tasks_cli-tasks-cli.obj -MD -MP -MF demos/tasks/$(DEPDIR)/demos_tasks_tasks_cli-tasks-cli.Tpo -c -o demos/tasks/demos_tasks_tasks_cli-tasks-cli.obj `if test -f 'demos/tasks/tasks-cli.c'; then $(CYGPATH_W) 'demos/tasks/tasks-cli.c'; else $(CYGPATH_W) '$(srcdir)/demos/tasks/tasks-cli.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/tasks/$(DEPDIR)/demos_tasks_tasks_cli-tasks-cli.Tpo demos/tasks/$(DEPDIR)/demos_tasks_tasks_cli-tasks-cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/tasks/tasks-cli.c' object='demos/tasks/demos_tasks_tasks_cli-tasks-cli.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_tasks_tasks_cli_CPPFLAGS) $(CPPFLAGS) $(demos_tasks_tasks_cli_CFLAGS) $(CFLAGS) -c -o demos/tasks/demos_tasks_tasks_cli-tasks-cli.obj `if test -f 'demos/tasks/tasks-cli.c'; then $(CYGPATH_W) 'demos/tasks/tasks-cli.c'; else $(CYGPATH_W) '$(srcdir)/demos/tasks/tasks-cli.c'; fi` + +demos/youtube/demos_youtube_youtube_cli-youtube-cli.o: demos/youtube/youtube-cli.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_youtube_youtube_cli_CPPFLAGS) $(CPPFLAGS) $(demos_youtube_youtube_cli_CFLAGS) $(CFLAGS) -MT demos/youtube/demos_youtube_youtube_cli-youtube-cli.o -MD -MP -MF demos/youtube/$(DEPDIR)/demos_youtube_youtube_cli-youtube-cli.Tpo -c -o demos/youtube/demos_youtube_youtube_cli-youtube-cli.o `test -f 'demos/youtube/youtube-cli.c' || echo '$(srcdir)/'`demos/youtube/youtube-cli.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/youtube/$(DEPDIR)/demos_youtube_youtube_cli-youtube-cli.Tpo demos/youtube/$(DEPDIR)/demos_youtube_youtube_cli-youtube-cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/youtube/youtube-cli.c' object='demos/youtube/demos_youtube_youtube_cli-youtube-cli.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_youtube_youtube_cli_CPPFLAGS) $(CPPFLAGS) $(demos_youtube_youtube_cli_CFLAGS) $(CFLAGS) -c -o demos/youtube/demos_youtube_youtube_cli-youtube-cli.o `test -f 'demos/youtube/youtube-cli.c' || echo '$(srcdir)/'`demos/youtube/youtube-cli.c + +demos/youtube/demos_youtube_youtube_cli-youtube-cli.obj: demos/youtube/youtube-cli.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_youtube_youtube_cli_CPPFLAGS) $(CPPFLAGS) $(demos_youtube_youtube_cli_CFLAGS) $(CFLAGS) -MT demos/youtube/demos_youtube_youtube_cli-youtube-cli.obj -MD -MP -MF demos/youtube/$(DEPDIR)/demos_youtube_youtube_cli-youtube-cli.Tpo -c -o demos/youtube/demos_youtube_youtube_cli-youtube-cli.obj `if test -f 'demos/youtube/youtube-cli.c'; then $(CYGPATH_W) 'demos/youtube/youtube-cli.c'; else $(CYGPATH_W) '$(srcdir)/demos/youtube/youtube-cli.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) demos/youtube/$(DEPDIR)/demos_youtube_youtube_cli-youtube-cli.Tpo demos/youtube/$(DEPDIR)/demos_youtube_youtube_cli-youtube-cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='demos/youtube/youtube-cli.c' object='demos/youtube/demos_youtube_youtube_cli-youtube-cli.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(demos_youtube_youtube_cli_CPPFLAGS) $(CPPFLAGS) $(demos_youtube_youtube_cli_CFLAGS) $(CFLAGS) -c -o demos/youtube/demos_youtube_youtube_cli-youtube-cli.obj `if test -f 'demos/youtube/youtube-cli.c'; then $(CYGPATH_W) 'demos/youtube/youtube-cli.c'; else $(CYGPATH_W) '$(srcdir)/demos/youtube/youtube-cli.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf demos/calendar/.libs demos/calendar/_libs + -rm -rf demos/docs-list/.libs demos/docs-list/_libs + -rm -rf demos/scrapbook/.libs demos/scrapbook/_libs + -rm -rf demos/tasks/.libs demos/tasks/_libs + -rm -rf demos/youtube/.libs demos/youtube/_libs + -rm -rf gdata/.libs gdata/_libs + -rm -rf gdata/app/.libs gdata/app/_libs + -rm -rf gdata/atom/.libs gdata/atom/_libs + -rm -rf gdata/exif/.libs gdata/exif/_libs + -rm -rf gdata/gcontact/.libs gdata/gcontact/_libs + -rm -rf gdata/gd/.libs gdata/gd/_libs + -rm -rf gdata/georss/.libs gdata/georss/_libs + -rm -rf gdata/media/.libs gdata/media/_libs + -rm -rf gdata/services/calendar/.libs gdata/services/calendar/_libs + -rm -rf gdata/services/contacts/.libs gdata/services/contacts/_libs + -rm -rf gdata/services/documents/.libs gdata/services/documents/_libs + -rm -rf gdata/services/freebase/.libs gdata/services/freebase/_libs + -rm -rf gdata/services/picasaweb/.libs gdata/services/picasaweb/_libs + -rm -rf gdata/services/tasks/.libs gdata/services/tasks/_libs + -rm -rf gdata/services/youtube/.libs gdata/services/youtube/_libs + +distclean-libtool: + -rm -f libtool config.lt +install-girDATA: $(gir_DATA) + @$(NORMAL_INSTALL) + @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(girdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(girdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(girdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(girdir)" || exit $$?; \ + done + +uninstall-girDATA: + @$(NORMAL_UNINSTALL) + @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(girdir)'; $(am__uninstall_files_from_dir) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-typelibDATA: $(typelib_DATA) + @$(NORMAL_INSTALL) + @list='$(typelib_DATA)'; test -n "$(typelibdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(typelibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(typelibdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(typelibdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(typelibdir)" || exit $$?; \ + done + +uninstall-typelibDATA: + @$(NORMAL_UNINSTALL) + @list='$(typelib_DATA)'; test -n "$(typelibdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(typelibdir)'; $(am__uninstall_files_from_dir) +install-vapiDATA: $(vapi_DATA) + @$(NORMAL_INSTALL) + @list='$(vapi_DATA)'; test -n "$(vapidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(vapidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(vapidir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(vapidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(vapidir)" || exit $$?; \ + done + +uninstall-vapiDATA: + @$(NORMAL_UNINSTALL) + @list='$(vapi_DATA)'; test -n "$(vapidir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(vapidir)'; $(am__uninstall_files_from_dir) +install-gdataappincludeHEADERS: $(gdataappinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdataappinclude_HEADERS)'; test -n "$(gdataappincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdataappincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdataappincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdataappincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdataappincludedir)" || exit $$?; \ + done + +uninstall-gdataappincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdataappinclude_HEADERS)'; test -n "$(gdataappincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdataappincludedir)'; $(am__uninstall_files_from_dir) +install-gdataatomincludeHEADERS: $(gdataatominclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdataatominclude_HEADERS)'; test -n "$(gdataatomincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdataatomincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdataatomincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdataatomincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdataatomincludedir)" || exit $$?; \ + done + +uninstall-gdataatomincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdataatominclude_HEADERS)'; test -n "$(gdataatomincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdataatomincludedir)'; $(am__uninstall_files_from_dir) +install-gdatacalendarincludeHEADERS: $(gdatacalendarinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatacalendarinclude_HEADERS)'; test -n "$(gdatacalendarincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatacalendarincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatacalendarincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatacalendarincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatacalendarincludedir)" || exit $$?; \ + done + +uninstall-gdatacalendarincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatacalendarinclude_HEADERS)'; test -n "$(gdatacalendarincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatacalendarincludedir)'; $(am__uninstall_files_from_dir) +install-gdatacontactsincludeHEADERS: $(gdatacontactsinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatacontactsinclude_HEADERS)'; test -n "$(gdatacontactsincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatacontactsincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatacontactsincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatacontactsincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatacontactsincludedir)" || exit $$?; \ + done + +uninstall-gdatacontactsincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatacontactsinclude_HEADERS)'; test -n "$(gdatacontactsincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatacontactsincludedir)'; $(am__uninstall_files_from_dir) +install-gdatadocumentsincludeHEADERS: $(gdatadocumentsinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatadocumentsinclude_HEADERS)'; test -n "$(gdatadocumentsincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatadocumentsincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatadocumentsincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatadocumentsincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatadocumentsincludedir)" || exit $$?; \ + done + +uninstall-gdatadocumentsincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatadocumentsinclude_HEADERS)'; test -n "$(gdatadocumentsincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatadocumentsincludedir)'; $(am__uninstall_files_from_dir) +install-gdatafreebaseincludeHEADERS: $(gdatafreebaseinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatafreebaseinclude_HEADERS)'; test -n "$(gdatafreebaseincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatafreebaseincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatafreebaseincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatafreebaseincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatafreebaseincludedir)" || exit $$?; \ + done + +uninstall-gdatafreebaseincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatafreebaseinclude_HEADERS)'; test -n "$(gdatafreebaseincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatafreebaseincludedir)'; $(am__uninstall_files_from_dir) +install-gdatagcontactincludeHEADERS: $(gdatagcontactinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatagcontactinclude_HEADERS)'; test -n "$(gdatagcontactincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatagcontactincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatagcontactincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatagcontactincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatagcontactincludedir)" || exit $$?; \ + done + +uninstall-gdatagcontactincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatagcontactinclude_HEADERS)'; test -n "$(gdatagcontactincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatagcontactincludedir)'; $(am__uninstall_files_from_dir) +install-gdatagdincludeHEADERS: $(gdatagdinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatagdinclude_HEADERS)'; test -n "$(gdatagdincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatagdincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatagdincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatagdincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatagdincludedir)" || exit $$?; \ + done + +uninstall-gdatagdincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatagdinclude_HEADERS)'; test -n "$(gdatagdincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatagdincludedir)'; $(am__uninstall_files_from_dir) +install-gdataincludeHEADERS: $(gdatainclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatainclude_HEADERS)'; test -n "$(gdataincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdataincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdataincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdataincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdataincludedir)" || exit $$?; \ + done + +uninstall-gdataincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatainclude_HEADERS)'; test -n "$(gdataincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdataincludedir)'; $(am__uninstall_files_from_dir) +install-gdatamediaincludeHEADERS: $(gdatamediainclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatamediainclude_HEADERS)'; test -n "$(gdatamediaincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatamediaincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatamediaincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatamediaincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatamediaincludedir)" || exit $$?; \ + done + +uninstall-gdatamediaincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatamediainclude_HEADERS)'; test -n "$(gdatamediaincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatamediaincludedir)'; $(am__uninstall_files_from_dir) +install-gdatapicasawebincludeHEADERS: $(gdatapicasawebinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatapicasawebinclude_HEADERS)'; test -n "$(gdatapicasawebincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatapicasawebincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatapicasawebincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatapicasawebincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatapicasawebincludedir)" || exit $$?; \ + done + +uninstall-gdatapicasawebincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatapicasawebinclude_HEADERS)'; test -n "$(gdatapicasawebincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatapicasawebincludedir)'; $(am__uninstall_files_from_dir) +install-gdatatasksincludeHEADERS: $(gdatatasksinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatatasksinclude_HEADERS)'; test -n "$(gdatatasksincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatatasksincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatatasksincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatatasksincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatatasksincludedir)" || exit $$?; \ + done + +uninstall-gdatatasksincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatatasksinclude_HEADERS)'; test -n "$(gdatatasksincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatatasksincludedir)'; $(am__uninstall_files_from_dir) +install-gdatayoutubeincludeHEADERS: $(gdatayoutubeinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(gdatayoutubeinclude_HEADERS)'; test -n "$(gdatayoutubeincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(gdatayoutubeincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(gdatayoutubeincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(gdatayoutubeincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(gdatayoutubeincludedir)" || exit $$?; \ + done + +uninstall-gdatayoutubeincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(gdatayoutubeinclude_HEADERS)'; test -n "$(gdatayoutubeincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(gdatayoutubeincludedir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + @case `sed 15q $(srcdir)/NEWS` in \ + *"$(VERSION)"*) : ;; \ + *) \ + echo "NEWS not updated; not releasing" 1>&2; \ + exit 1;; \ + esac + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \ + config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(gdataappincludedir)" "$(DESTDIR)$(gdataatomincludedir)" "$(DESTDIR)$(gdatacalendarincludedir)" "$(DESTDIR)$(gdatacontactsincludedir)" "$(DESTDIR)$(gdatadocumentsincludedir)" "$(DESTDIR)$(gdatafreebaseincludedir)" "$(DESTDIR)$(gdatagcontactincludedir)" "$(DESTDIR)$(gdatagdincludedir)" "$(DESTDIR)$(gdataincludedir)" "$(DESTDIR)$(gdatamediaincludedir)" "$(DESTDIR)$(gdatapicasawebincludedir)" "$(DESTDIR)$(gdatatasksincludedir)" "$(DESTDIR)$(gdatayoutubeincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f demos/calendar/$(DEPDIR)/$(am__dirstamp) + -rm -f demos/calendar/$(am__dirstamp) + -rm -f demos/docs-list/$(DEPDIR)/$(am__dirstamp) + -rm -f demos/docs-list/$(am__dirstamp) + -rm -f demos/scrapbook/$(DEPDIR)/$(am__dirstamp) + -rm -f demos/scrapbook/$(am__dirstamp) + -rm -f demos/tasks/$(DEPDIR)/$(am__dirstamp) + -rm -f demos/tasks/$(am__dirstamp) + -rm -f demos/youtube/$(DEPDIR)/$(am__dirstamp) + -rm -f demos/youtube/$(am__dirstamp) + -rm -f gdata/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/$(am__dirstamp) + -rm -f gdata/app/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/app/$(am__dirstamp) + -rm -f gdata/atom/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/atom/$(am__dirstamp) + -rm -f gdata/exif/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/exif/$(am__dirstamp) + -rm -f gdata/gcontact/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/gcontact/$(am__dirstamp) + -rm -f gdata/gd/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/gd/$(am__dirstamp) + -rm -f gdata/georss/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/georss/$(am__dirstamp) + -rm -f gdata/media/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/media/$(am__dirstamp) + -rm -f gdata/services/calendar/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/services/calendar/$(am__dirstamp) + -rm -f gdata/services/contacts/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/services/contacts/$(am__dirstamp) + -rm -f gdata/services/documents/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/services/documents/$(am__dirstamp) + -rm -f gdata/services/freebase/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/services/freebase/$(am__dirstamp) + -rm -f gdata/services/picasaweb/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/services/picasaweb/$(am__dirstamp) + -rm -f gdata/services/tasks/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/services/tasks/$(am__dirstamp) + -rm -f gdata/services/youtube/$(DEPDIR)/$(am__dirstamp) + -rm -f gdata/services/youtube/$(am__dirstamp) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf demos/calendar/$(DEPDIR) demos/docs-list/$(DEPDIR) demos/scrapbook/$(DEPDIR) demos/tasks/$(DEPDIR) demos/youtube/$(DEPDIR) gdata/$(DEPDIR) gdata/app/$(DEPDIR) gdata/atom/$(DEPDIR) gdata/exif/$(DEPDIR) gdata/gcontact/$(DEPDIR) gdata/gd/$(DEPDIR) gdata/georss/$(DEPDIR) gdata/media/$(DEPDIR) gdata/services/calendar/$(DEPDIR) gdata/services/contacts/$(DEPDIR) gdata/services/documents/$(DEPDIR) gdata/services/freebase/$(DEPDIR) gdata/services/picasaweb/$(DEPDIR) gdata/services/tasks/$(DEPDIR) gdata/services/youtube/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-gdataappincludeHEADERS \ + install-gdataatomincludeHEADERS \ + install-gdatacalendarincludeHEADERS \ + install-gdatacontactsincludeHEADERS \ + install-gdatadocumentsincludeHEADERS \ + install-gdatafreebaseincludeHEADERS \ + install-gdatagcontactincludeHEADERS \ + install-gdatagdincludeHEADERS install-gdataincludeHEADERS \ + install-gdatamediaincludeHEADERS \ + install-gdatapicasawebincludeHEADERS \ + install-gdatatasksincludeHEADERS \ + install-gdatayoutubeincludeHEADERS install-girDATA \ + install-pkgconfigDATA install-typelibDATA install-vapiDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf demos/calendar/$(DEPDIR) demos/docs-list/$(DEPDIR) demos/scrapbook/$(DEPDIR) demos/tasks/$(DEPDIR) demos/youtube/$(DEPDIR) gdata/$(DEPDIR) gdata/app/$(DEPDIR) gdata/atom/$(DEPDIR) gdata/exif/$(DEPDIR) gdata/gcontact/$(DEPDIR) gdata/gd/$(DEPDIR) gdata/georss/$(DEPDIR) gdata/media/$(DEPDIR) gdata/services/calendar/$(DEPDIR) gdata/services/contacts/$(DEPDIR) gdata/services/documents/$(DEPDIR) gdata/services/freebase/$(DEPDIR) gdata/services/picasaweb/$(DEPDIR) gdata/services/tasks/$(DEPDIR) gdata/services/youtube/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-gdataappincludeHEADERS \ + uninstall-gdataatomincludeHEADERS \ + uninstall-gdatacalendarincludeHEADERS \ + uninstall-gdatacontactsincludeHEADERS \ + uninstall-gdatadocumentsincludeHEADERS \ + uninstall-gdatafreebaseincludeHEADERS \ + uninstall-gdatagcontactincludeHEADERS \ + uninstall-gdatagdincludeHEADERS uninstall-gdataincludeHEADERS \ + uninstall-gdatamediaincludeHEADERS \ + uninstall-gdatapicasawebincludeHEADERS \ + uninstall-gdatatasksincludeHEADERS \ + uninstall-gdatayoutubeincludeHEADERS uninstall-girDATA \ + uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ + uninstall-typelibDATA uninstall-vapiDATA + +.MAKE: $(am__recursive_targets) all check check-am install install-am \ + install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am check-local clean clean-cscope \ + clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ + dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am \ + install-gdataappincludeHEADERS install-gdataatomincludeHEADERS \ + install-gdatacalendarincludeHEADERS \ + install-gdatacontactsincludeHEADERS \ + install-gdatadocumentsincludeHEADERS \ + install-gdatafreebaseincludeHEADERS \ + install-gdatagcontactincludeHEADERS \ + install-gdatagdincludeHEADERS install-gdataincludeHEADERS \ + install-gdatamediaincludeHEADERS \ + install-gdatapicasawebincludeHEADERS \ + install-gdatatasksincludeHEADERS \ + install-gdatayoutubeincludeHEADERS install-girDATA \ + install-html install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + install-typelibDATA install-vapiDATA installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am \ + uninstall-gdataappincludeHEADERS \ + uninstall-gdataatomincludeHEADERS \ + uninstall-gdatacalendarincludeHEADERS \ + uninstall-gdatacontactsincludeHEADERS \ + uninstall-gdatadocumentsincludeHEADERS \ + uninstall-gdatafreebaseincludeHEADERS \ + uninstall-gdatagcontactincludeHEADERS \ + uninstall-gdatagdincludeHEADERS uninstall-gdataincludeHEADERS \ + uninstall-gdatamediaincludeHEADERS \ + uninstall-gdatapicasawebincludeHEADERS \ + uninstall-gdatatasksincludeHEADERS \ + uninstall-gdatayoutubeincludeHEADERS uninstall-girDATA \ + uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ + uninstall-typelibDATA uninstall-vapiDATA + +.PRECIOUS: Makefile + + +gdata/gdata-marshal.h: $(top_srcdir)/gdata/gdata-marshal.list + $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=gdata_marshal --header $< > $@ +gdata/gdata-marshal.c: $(top_srcdir)/gdata/gdata-marshal.list gdata/gdata-marshal.h + $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=gdata_marshal --header --body $< > $@ + +gdata/gdata-enums.h: $(gdata_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_ENUMS_H\n#define GDATA_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_ENUMS_H */" $(addprefix $(srcdir)/,$(gdata_headers)) > gdata/gdata-enums.h.tmp \ + && sed "s/g_data/gdata/" gdata/gdata-enums.h.tmp > gdata/gdata-enums.h \ + && rm -f gdata/gdata-enums.h.tmp) + +gdata/gdata-enums.c: $(gdata_headers) Makefile gdata/gdata-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-service.h\"\n#include \"gdata-parsable.h\"\n#include \"gdata-batch-operation.h\"\n#include \"gdata-enums.h\"\n#include \"gdata-client-login-authorizer.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_headers)) > gdata/gdata-enums.c.tmp \ + && sed "s/g_data/gdata/" gdata/gdata-enums.c.tmp > gdata/gdata-enums.c \ + && rm -f gdata/gdata-enums.c.tmp) + +gdata/media/gdata-media-enums.h: $(gdata_media_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_MEDIA_ENUMS_H\n#define GDATA_MEDIA_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_MEDIA_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_media_headers)) > gdata/media/gdata-media-enums.h.tmp \ + && sed "s/g_data/gdata/" gdata/media/gdata-media-enums.h.tmp > gdata/media/gdata-media-enums.h.tmp2 \ + && sed "s/GDATA_TYPE_DATA/GDATA_TYPE/" gdata/media/gdata-media-enums.h.tmp2 > gdata/media/gdata-media-enums.h \ + && rm -f gdata/media/gdata-media-enums.h.tmp \ + && rm -f gdata/media/gdata-media-enums.h.tmp2) + +gdata/media/gdata-media-enums.c: $(gdata_media_headers) Makefile gdata/media/gdata-media-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-media-content.h\"\n#include \"gdata-media-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_media_headers)) > gdata/media/gdata-media-enums.c.tmp \ + && sed "s/g_data/gdata/" gdata/media/gdata-media-enums.c.tmp > gdata/media/gdata-media-enums.c \ + && rm -f gdata/media/gdata-media-enums.c.tmp) + +gdata/services/documents/gdata-documents-enums.h: $(gdata_documents_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_DOCUMENTS_ENUMS_H\n#define GDATA_DOCUMENTS_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_DOCUMENTS_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_documents_headers)) > gdata/services/documents/gdata-documents-enums.h.tmp \ + && sed "s/g_data/gdata/" gdata/services/documents/gdata-documents-enums.h.tmp > gdata/services/documents/gdata-documents-enums.h \ + && rm -f gdata/services/documents/gdata-documents-enums.h.tmp) + +gdata/services/documents/gdata-documents-enums.c: $(gdata_documents_headers) Makefile gdata/services/documents/gdata-documents-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-documents-service.h\"\n#include \"gdata-documents-text.h\"\n#include \"gdata-documents-spreadsheet.h\"\n#include \"gdata-documents-drawing.h\"\n#include \"gdata-documents-pdf.h\"\n#include \"gdata-documents-presentation.h\"\n#include \"gdata-documents-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_documents_headers)) > gdata/services/documents/gdata-documents-enums.c.tmp \ + && sed "s/g_data/gdata/" gdata/services/documents/gdata-documents-enums.c.tmp > gdata/services/documents/gdata-documents-enums.c \ + && rm -f gdata/services/documents/gdata-documents-enums.c.tmp) + +gdata/services/freebase/gdata-freebase-enums.h: $(gdata_freebase_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_FREEBASE_ENUMS_H\n#define GDATA_FREEBASE_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_FREEBASE_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_freebase_headers)) > gdata/services/freebase/gdata-freebase-enums.h.tmp \ + && sed "s/g_data_freebase/gdata_freebase/" gdata/services/freebase/gdata-freebase-enums.h.tmp > gdata/services/freebase/gdata-freebase-enums.h.tmp2 \ + && sed "s/GDATA_TYPE_DATA_FREEBASE/GDATA_TYPE_FREEBASE/" gdata/services/freebase/gdata-freebase-enums.h.tmp2 > gdata/services/freebase/gdata-freebase-enums.h \ + && rm -f gdata/services/freebase/gdata-freebase-enums.h.tmp \ + && rm -f gdata/services/freebase/gdata-freebase-enums.h.tmp2) + +gdata/services/freebase/gdata-freebase-enums.c: $(gdata_freebase_headers) Makefile gdata/services/freebase/gdata-freebase-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-freebase-service.h\"\n#include \"gdata-freebase-search-query.h\"\n#include \"gdata-freebase-result.h\"\n#include \"gdata-freebase-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_freebase_headers)) > gdata/services/freebase/gdata-freebase-enums.c.tmp \ + && sed "s/g_data_freebase/gdata_freebase/" gdata/services/freebase/gdata-freebase-enums.c.tmp > gdata/services/freebase/gdata-freebase-enums.c \ + && rm -f gdata/services/freebase/gdata-freebase-enums.c.tmp) + +gdata/services/picasaweb/gdata-picasaweb-enums.h: $(gdata_picasaweb_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_PICASAWEB_ENUMS_H\n#define GDATA_PICASAWEB_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_PICASAWEB_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_picasaweb_headers)) > gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp \ + && sed "s/g_data_picasa_web/gdata_picasaweb/" gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp > gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp2 \ + && sed "s/GDATA_TYPE_DATA_PICASA_WEB/GDATA_TYPE_PICASAWEB/" gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp2 > gdata/services/picasaweb/gdata-picasaweb-enums.h \ + && rm -f gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp \ + && rm -f gdata/services/picasaweb/gdata-picasaweb-enums.h.tmp2) + +gdata/services/picasaweb/gdata-picasaweb-enums.c: $(gdata_picasaweb_headers) Makefile gdata/services/picasaweb/gdata-picasaweb-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-picasaweb-album.h\"\n#include \"gdata-picasaweb-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_picasaweb_headers)) > gdata/services/picasaweb/gdata-picasaweb-enums.c.tmp \ + && sed "s/g_data_picasa_web/gdata_picasaweb/" gdata/services/picasaweb/gdata-picasaweb-enums.c.tmp > gdata/services/picasaweb/gdata-picasaweb-enums.c \ + && rm -f gdata/services/picasaweb/gdata-picasaweb-enums.c.tmp) + +gdata/services/youtube/gdata-youtube-enums.h: $(gdata_youtube_headers) Makefile + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#ifndef GDATA_YOUTUBE_ENUMS_H\n#define GDATA_YOUTUBE_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDATA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* !GDATA_YOUTUBE_ENUMS_H */" \ + $(addprefix $(srcdir)/,$(gdata_youtube_headers)) > gdata/services/youtube/gdata-youtube-enums.h.tmp \ + && sed "s/g_data_you_tube/gdata_youtube/" gdata/services/youtube/gdata-youtube-enums.h.tmp > gdata/services/youtube/gdata-youtube-enums.h.tmp2 \ + && sed "s/GDATA_TYPE_DATA_YOU_TUBE/GDATA_TYPE_YOUTUBE/" gdata/services/youtube/gdata-youtube-enums.h.tmp2 > gdata/services/youtube/gdata-youtube-enums.h \ + && rm -f gdata/services/youtube/gdata-youtube-enums.h.tmp \ + && rm -f gdata/services/youtube/gdata-youtube-enums.h.tmp2) + +gdata/services/youtube/gdata-youtube-enums.c: $(gdata_youtube_headers) Makefile gdata/services/youtube/gdata-youtube-enums.h + $(AM_V_GEN)($(GLIB_MKENUMS) \ + --fhead "#include \"gdata-youtube-service.h\"\n#include \"gdata-youtube-query.h\"\n#include \"gdata-youtube-enums.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(addprefix $(srcdir)/,$(gdata_youtube_headers)) > gdata/services/youtube/gdata-youtube-enums.c.tmp \ + && sed "s/g_data_you_tube/gdata_youtube/" gdata/services/youtube/gdata-youtube-enums.c.tmp > gdata/services/youtube/gdata-youtube-enums.c \ + && rm -f gdata/services/youtube/gdata-youtube-enums.c.tmp) + +# Symbols file +gdata/gdata.symbols: $(top_srcdir)/gdata/gdata-core.symbols $(top_srcdir)/gdata/gdata-goa.symbols +@ENABLE_GOA_TRUE@ $(AM_V_GEN)cat $(top_srcdir)/gdata/gdata-core.symbols $(top_srcdir)/gdata/gdata-goa.symbols > $@ +@ENABLE_GOA_FALSE@ $(AM_V_GEN)cat $(top_srcdir)/gdata/gdata-core.symbols > $@ + +# Check if gdata.h includes all the public headers +check-local: check-headers +check-headers: + @any_missing=0; for header_file in $(public_headers); do \ + if test "x$$header_file" != "x$(main_header)"; then \ + if ! grep "#include <$$header_file>" $(top_srcdir)/$(main_header) >/dev/null; then \ + echo "$(main_header) doesn't appear to include \"$$header_file\""; \ + any_missing=1; \ + fi; \ + fi; \ + done; exit "$$any_missing" + +# Introspection +-include $(INTROSPECTION_MAKEFILE) + +@HAVE_INTROSPECTION_TRUE@gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.gir: gdata/libgdata.la + +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@-include $(VAPIGEN_MAKEFILE) + +# Note: The VAPI file name has to match the pkg-config file name. +# If we break API and add a version number to the pkg-config file name, the VAPI can be changed to match. +# See: https://bugzilla.gnome.org/show_bug.cgi?id=693865 +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@gdata/libgdata.vapi: gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.gir gdata/GData-@GDATA_API_VERSION_MAJOR@.@GDATA_API_VERSION_MINOR@.metadata + +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@gdata/libgdata.deps: +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@ $(AM_V_GEN) for pkg in $(gdata_libgdata_vapi_DEPS); do \ +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@ echo $$pkg >> $@; \ +@ENABLE_VAPIGEN_TRUE@@HAVE_INTROSPECTION_TRUE@ done + +# Code coverage +@CODE_COVERAGE_RULES@ + +# ChangeLog +@GENERATE_CHANGELOG_RULES@ +dist-hook: dist-ChangeLog + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..83fab2b --- /dev/null +++ b/NEWS @@ -0,0 +1,1558 @@ +Overview of changes from libgdata 0.17.8 to libgdata 0.17.9 +=========================================================== + +Major changes: + • Support reporting quotas for Drive usage (thanks to Michael Terry) + • Bump GLib dependency to 2.44 for g_autoptr() support + • Add g_autoptr() support for some core classes + • Port from GSimpleAsyncResult to GTask + • More porting to the Google Drive v2 API + (ongoing thanks to Debarshi Ray for working on and maintaining this) + +API changes: + • Add GDataDocumentsMetadata + • Add gdata_documents_service_get_metadata(), + gdata_documents_service_get_metadata_async(), + gdata_documents_service_get_metadata_finish() + • Initial g_autoptr() support for core classes + +Bugs fixed: + • Bug 783046 — Invalid URIs are generated when q and q_internal properties are set + • GitHub PR #1 — added initial .travis.yml + • Bug 785885 — Expose information about quota usage + • Bug 684920 — Port to Google Drive API v2 + + +Overview of changes from libgdata 0.17.7 to libgdata 0.17.8 +=========================================================== + +Major changes: + • Bump GLib dependency to 2.38.0 for G_TEST_DIST + • Bump libsoup dependency for tests to 2.55.90; the dependency if building + libgdata without tests is still 2.42.0 + • Fix use of deprecated GTK+ API in the demos + +Bugs fixed: + • Bug 779641 — test_query_properties broken on i686 + • Bug 780067 — Unable to sync Google Contacts + • Bug 780081 — libgdata 0.17.7 fails streams tests (unable to set up SSL cert) + +Updated translations: + • be (Yuras Shumovich) + • da (Alan Mortensen) + • el (Tom Tryfonidis) + • fi (Jiri Grönroos) + • gl (Fran Dieguez) + • oc (Cédric Valmary) + • ru (Yuri Myasoedov) + + +Overview of changes from libgdata 0.17.6 to libgdata 0.17.7 +=========================================================== + +Major changes: + • Fix licensing in OAuth2 files (they were mistakenly declared as GPLv3+; they’re actually LGPLv2.1+) + • More Google Drive fixes and tests + • Documentation improvements (including bumping the gtk-doc dependency to 1.25) + • Google Calendar parsing fixes + • Pagination fixes for more modern APIs (Calendar, Documents, Tasks, YouTube) + • Pagination support in demo programs + • Add a demo program for Google Tasks + • Fix Google Calendar query parameters for v3 of the API + • Disable PicasaWeb tests as PicasaWeb server is now mostly read-only + • Deprecate Freebase service as Freebase server is now shutdown + +API changes: + • Add GDataDocumentsEntry:file-size + • Add gdata_parsable_get_content_type() + • Add GDataFeed:next-page-token + • Deprecate GDataCalendarQuery:recurrence-expansion-start + • Deprecate GDataCalendarQuery:recurrence-expansion-end + • Deprecate GDataCalendarQuery:sort-order + • Deprecate everything to do with GDataFreebase* + +Bugs fixed: + • Bug 684920 — Port to Google Drive API v2 + • Bug 772756 — Take advantage of Unicode + • Bug 773057 — Provide document file size + • Bug 774179 — Fails to build VAPI file with GOA enabled + • Bug 777980 — Add a public wrapper for GDataParsable:get_content_type + • Bug 775813 — GTasks pagination doesn't work + +Updated translations: + • cs (Marek Černocký) + • da (Ask Hjorth Larsen) + • de (Mario Blättermann) + • es (Daniel Mustieles) + • eu (Inaki Larranaga Murgoitio) + • fi (Jiri Grönroos) + • fr (Claude Paroz) + • fur (Fabio Tomat) + • hu (Gábor Kelemen) + • id (Kukuh Syafaat) + • it (Gianvito Cavasoli) + • ko (Changwoo Ryu) + • lt (Aurimas Černius) + • lv (Rūdolfs Mazurs) + • nb (Kjartan Maraas) + • pl (Piotr Drąg) + • pt (Tiago Santos) + • pt_BR (Rafael Fontenelle) + • sk (Dušan Kazik) + • sl (Matej Urbančič) + • sr (Марко М. Костић) + • sv (Anders Jonsson) + • zh_CN (Qizhi Zhou) + • zh_TW (Chao-Hsiung Liao) + + +Overview of changes from libgdata 0.17.5 to libgdata 0.17.6 +=========================================================== + +Major changes: + • Minor test case fixes + • Fix a download crash on zero-length files (thanks Ondrej Holy) + +Bugs fixed: + • Bug 768278 — release tarball 0.17.5 contains empty ChangeLog + • Bug 768363 — dev-libs/libgdata-0.17.5 fails tests (on the alpha architecture, possibly elsewhere) + • Bug 768282 — test-suite failure: ERROR: general - too few tests run (expected 98, got 2) + • Bug 769727 — Crashes on zero-length files + +Updated translations: + • en_GB (David King) + • he (Yosef Or Boczko) + • pl (Piotr Drąg) + • th (Akom Chotiphantawanon) + + +Overview of changes from libgdata 0.17.4 to libgdata 0.17.5 +=========================================================== + +Major changes: + • Google Drive documentation and test fixes + • Minor memory leak fixes + • Update autogen.sh to latest GNOME recommendations, fixing builddir ≠ srcdir + +Bugs fixed: + • Bug 684920 — Port to Google Drive API v2 + • Bug 759180 — Can't open PDF file shared in Google Drive + • Bug 767784 — picasaweb: Clarify how to handle authentication failures during upload + • Bug 767785 — Mention that GDataGoaAuthorizer uses OAuth 2.0 + +Updated translations: + • cs (Marek Černocký) + • da (Ask Hjorth Larsen) + • de (Mario Blättermann) + • el (Tom Tryfonidis) + • es (Daniel Mustieles) + • eu (Inaki Larranaga Murgoitio) + • fr (Alexandre Franke) + • fur (Fabio Tomat) + • gl (Fran Dieguez) + • id (Andika Triwidada) + • it (Milo Casagrande) + • ko (Changwoo Ryu) + • lt (Aurimas Černius) + • lv (Rūdolfs Mazurs) + • hu (Balázs Meskó) + • nb (Kjartan Maraas) + • oc (Cédric Valmary) + • pl (Piotr Drąg) + • pt (Sérgio Cardeira) + • pt_BR (Enrico Nicoletto, Rafael Fontenelle) + • ru (Stas Solovey) + • sk (Dušan Kazik) + • sl (Matej Urbančič) + • sr (Мирослав Николић) + • sv (Anders Jonsson) + • th (Akom Chotiphantawanon) + • vi (Trần Ngọc Quân) + • zh_CN (Jeff Bai) + • zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.17.3 to libgdata 0.17.4 +=========================================================== + +Major changes: + • Download stream data corruption fixes and fixes to content length + calculation + • Fix symbol exporting on OS X + • Fix copying and deleting documents in Google Drive + • Fix folder creation in Google Drive + • Fix metadata-only uploads in Google Drive + • Fix searching by title in Google Drive + +API changes: + • Remove a couple of incorrect GIR annotations + +Bugs fixed: + • Bug 755976 — Seeking with GDataDownloadStream can be broken if a range was + set in the HTTP request + • Bug 754821 — Compilation issues on Mac OS X + • Bug 758119 — make check fails in git master (3.19.x) + • Bug 684920 — Port to Google Drive API v2 + • Bug 758524 — Cannot search documents by title + +Updated translations: + • cs (Marek Černocký) + • da (Ask Hjorth Larsen) + • de (Wolfgang Stöggl) + • es (Daniel Mustieles) + • eu (Iñaki Larrañaga Murgoitio) + • hu (Balázs Meskó) + • lt (Aurimas Černius) + • lv (Rūdolfs Mazurs) + • pl (Piotr Drąg) + • pt (Pedro Albuquerque) + • pt_BR (Enrico Nicoletto) + • ru (Stas Solovey) + • sk (Dušan Kazik) + • sr (Марко Костић, Милош Поповић) + • tr (Muhammet Kara) + +Overview of changes from libgdata 0.17.2 to libgdata 0.17.3 +=========================================================== + +Major changes: + • More Google Drive improvements + • A few memory leak fixes and improvements in the unit tests + +API changes: + • Soft API break for gdata_service_insert_entry() when creating Google Drive + folders — you must now use gdata_documents_service_add_entry_to_folder() due + to changes on the server API + (see https://bugzilla.gnome.org/show_bug.cgi?id=684920) + • Remove two unused symbols from the export list; these were never intended + to be public API: gdata_freebase_result_error_get_type, + gdata_freebase_result_error_quark + +Bugs fixed: + • Bug 684920 — Port to Google Drive API v2 + • Bug 754821 — Compilation issues on Mac OS X + +Updated translations: + • cs (Marek Černocký) + • de (Paul Seyfert) + • el (Tom Tryfonidis) + • es (Daniel Mustieles) + • fr (Bruno Brouard) + • gl (Fran Dieguez) + • hu (Balázs Úr) + • id (Andika Triwidada) + • it (Claudio Arseni) + • ko (Changwoo Ryu) + • lt (Aurimas Černius) + • nb (Kjartan Maraas) + • pl (Piotr Drąg) + • pt (Pedro Albuquerque) + • sk (Dušan Kazik) + • sl (Matej Urbančič) + • sv (Anders Jonsson, Mattias Eriksson) + • th (Akom Chotiphantawanon) + • zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.17.1 to libgdata 0.17.2 +=========================================================== + +Major changes: + • More Google Drive API porting + • Port from v2 to v3 of the Calendar API + • Update and re-enable a lot of unit tests + (streams, youtube, freebase, calendar). + • Add calendar-cli demo + • Port to use installed-tests; this adds --enable-always-build-tests and + --enable-installed-tests configure options + • Port to autoconf-archive macros and add an implicit build-time dependency + on autoconf-archive + • Allow applications to store and restore the refresh token for a + GDataOAuth2Authorizer to avoid re-authenticating on each startup + • Bump libuhttpmock dependency to 0.5.0 + +API changes: + • Add gdata_calendar_service_insert_calendar_event(), + gdata_calendar_service_insert_calendar_event_async() + • Deprecate GDataCalendarCalendar:times-cleaned, + gdata_calendar_calendar_get_times_cleaned(), GDataCalendarCalendar:edited, + gdata_calendar_calendar_get_edited() + • Deprecate GDataCalendarFeed:timezone, gdata_calendar_feed_get_timezone(), + GDataCalendarFeed:times-cleaned, gdata_calendar_feed_get_times_cleaned() + • Add GDataAccessHandlerIface.get_rules as a virtual method backing + gdata_access_handler_get_rules() + • Add GDataCalendarAccessRule + • Add GDataDocumentsAccessRule + • Add gdata_oauth2_authorizer_dup_refresh_token(), + gdata_oauth2_authorizer_set_refresh_token() + • Add GDataBatchable.is_supported virtual function + +Bugs fixed: + • Bug 684920 — Port to Google Drive API v2 + • Bug 664353 — Upgrade to Calendar API version 3 + • Bug 750335 — Silence a bunch of warnings + • Bug 750480 — Fix -Werror build for clang + • Bug 750395 — Fix the GDataAccessRule example + • Bug 750746 — Cold start OAuth2 authorization + • Bug 751782 — Enable Drive authorization domains if a GOA account has "files" enabled + • Bug 750914 — Build fails because -Werror=unused-function + +Updated translations: + • oc (Cédric Valmary (Tot en òc)) + • pl (Piotr Drąg) + • pt (Pedro Albuquerque) + • th (Akom Chotiphantawanon) + +Overview of changes from libgdata 0.17.0 to libgdata 0.17.1 +=========================================================== + +Major changes: + • Correctly increment LT version; this release should always be used instead + of 0.17.0 + +Overview of changes from libgdata 0.16.0 to libgdata 0.17.0 +=========================================================== + +Major changes: + • Port from v2 to v3 of the YouTube API — your client’s developer key may stop + working due to never being conigured for v3; refresh it here: + https://developers.google.com/youtube/registering_an_application + • Port from the Google Docs API to the Google Drive API (v2) — the same + libgdata APIs should continue to work unchanged + • Both the YouTube and Drive API ports are not thoroughly tested, and a number + of unit tests have been disabled temporarily; code quality will be ramped up + again in subsequent releases + • Add support for OAuth 2.0 authorisation + • Commit to API and ABI stability + • Add --disable-tests configure flag to skip building tests + • Various improvements to the unit tests + • Fix pagination handling in Google Docs + • Add demo applications for Google Docs and YouTube + • Various Freebase fixes, including a huge number of new tests and + authentication fixes + • Various JSON parser fixes + • Note that the Calendar v2 API has now been withdrawn; there has not been + enough time to port libgdata to version 3 (ongoing: + https://bugzilla.gnome.org/show_bug.cgi?id=664353), but clients can (and + should, regardless) use the CalDAV API provided by Google Calendar + +API changes: + • Add GDATA_OAUTH2_REDIRECT_URI_OOB + • Add GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO + • Add GDataOAuth2Authorizer + • Add API padding and commit to API stability + • Add GDataServiceClass.parse_feed + • Add gdata_freebase_search_result_item_get_type(), + GDATA_TYPE_FREEBASE_SEARCH_RESULT_ITEM + • Add GDATA_CATEGORY_SCHEMA_LABELS_SHARED + • Add GDATA_CATEGORY_SCHEMA_LABELS_VIEWED + • Add GDataYouTubeFeed + • Deprecate GDataYouTubeQuery:format, gdata_youtube_query_get_format(), + gdata_youtube_query_set_format() + • Deprecate GDataYouTubeQuery:has-location + • Deprecate GDataYouTubeQuery:language, gdata_youtube_query_get_language(), + gdata_youtube_query_set_language() + • Deprecate GDataYouTubeQuery:sort-order, gdata_youtube_query_get_sort_order(), + gdata_youtube_query_set_sort_order() + • Deprecate GDataYouTubeQuery:uploader, gdata_youtube_query_get_uploader(), + gdata_youtube_query_set_uploader() + • Deprecate GDataYouTubeSortOrder + • Deprecate GDataYouTubeUploader + • Deprecate GDataYouTubeContent + • Deprecate GDataYouTubeFormat + • Deprecate GDataYouTubeVideo:video-id, gdata_youtube_video_get_video_id() + • Deprecate gdata_youtube_video_look_up_content() + (use gdata_youtube_video_get_player_uri() instead) + • Deprecate GDATA_YOUTUBE_RATING_TYPE_SIMPLE + • Deprecate GDataYouTubeCredit, GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER + • Deprecate GDataYouTubeVideo:credit, gdata_youtube_video_get_credit() + • Deprecate GDataYouTubeVideo:is-draft, gdata_youtube_video_is_draft(), + gdata_youtube_video_set_is_draft() + • Deprecate GDATA_YOUTUBE_*_FEED except GDATA_YOUTUBE_MOST_POPULAR_FEED (all + others have been deprecated online and will transparently return the + most popular videos from the past 24 hours) + • GDataYouTubeQuery:restriction no longer accepts IP addresses + • All GDataCommentable functionality on GDataYouTubeVideo is disabled + at runtime until the v3 YouTube API for comments is finished online + • Not all properties of a GDataYouTubeVideo may be retrieved when doing + searches, retrieving related videos, or listing standard feeds — to + guarantee getting all properties, use gdata_service_query_single_entry() for + the video in question; common properties such as title, description, player + URI and thumbnails will always be retrieved + • Deprecate GDataDocumentsEntry:edited + +Bugs fixed: + • Bug 646285 — Add OAuth 2 support + • Bug 657539 — Add support for Google Tasks + • Bug 739395 — Add an option to build without uhttpmock + • Bug 737799 — Error while updating google address book + • Bug 739956 — libgdata-0.16.1: tests fail + • Bug 741345 — Paging does not work + • Bug 737539 — Freebase: topic results are shallower than expected + • Bug 737936 — Freebase: Add GType for GDataFreebaseSearchResultItem + • Bug 737540 — Freebase: async topic queries use the wrong result gtype + • Bug 737541 — freebase: search query buglets + • Bug 742472 — Freebase: Pass API key on all service requests + • Bug 742473 — Small freebase oauth2 access bugs + • Bug 687597 — Update to YouTube API v3 + • Bug 684920 — Port to Google Drive API v2 + +Updated translations: + • bg (Alexander Shopov) + • bs (Samir Ribić) + • da (Aputsiaq Niels Janussen) + • de (Bernd Homuth) + • et (Mattias Põldaru) + • pa (A S Alam) + • sk (Dušan Kazik) + • sr (Мирослав Николић) + • sv (Mattias Eriksson) + • tr (Muhammet Kara) + • zh_CN (Iris Gou) + +Overview of changes from libgdata 0.15.2 to libgdata 0.16.0 +=========================================================== + +Major changes: + • Update date parsing to handle recent changes in Google’s servers + • Support ACLs with keys (e.g. for link-only sharing of documents) + • Add gzip encoding support for network packet compression + • Support for libsoup ≥ 2.47.3 (but the dependency has not been bumped) + • Basic test suite for the Google Tasks service + • Fix mutex warnings with new GLib versions + +API changes: + • Add GDataAccessRule:key + • Add gdata_access_rule_get_key() + • Add GDATA_TASKS_STATUS_NEEDS_ACTION + • Add GDATA_TASKS_STATUS_COMPLETED + • Deprecate the ‘q’ parameter of gdata_tasks_query_new() + • Add GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED + +Bugs fixed: + • Bug 732809 — evolution-3.12.3: cannot edit google contact due to invalid + format of timestamp + • Bug 734863 — Google contacts without email address block search/autocomplete + • Bug 690628 — <gAcl:withKey/> element Not Handled by libgdata + • Bug 703192 — The global log handler interferes with other application + • Bug 666623 — Add gzip encoding support + +Updated translations: + • as (Nilamdyuti Goswami) + • ca (Gil Forcada) + • cs (Marek Černocký) + • fr (Bruno Brouard) + • gu (Sweta Kothari) + • he (Yosef Or Boczko) + • hu (Balázs Úr) + • id (Andika Triwidada) + • it (Claudio Arseni) + • ko (Changwoo Ryu) + • lv (Rūdolfs Mazurs) + • nb (Kjartan Maraas) + • ru (Yuri Myasoedov) + • sl (Matej Urbančič) + • zh_HK (Chao-Hsiung Liao) + • zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.15.1 to libgdata 0.15.2 +=========================================================== + +Major changes: + • Support PicasaWeb in the GOA authoriser (thanks to Saurav Agarwalla) + • Fix a data corruption bug in the downloads/uploads code + +Bugs fixed: + • Bug 731269 — Wrong scope information in authorization domain + • Bug 731949 — Memory leak from gdata_parser_int64_to_iso8601() + • Bug 731946 — Removing a task result in error, but succeeds + • Bug 732890 — Refresh authoriser on receiving SOUP_STATUS_NOT_FOUND + +Updated translations: + • el (Tom Tryfonidis) + • en_GB (Philip Withnall) + • es (Daniel Mustieles) + • eu (Iñaki Larrañaga Murgoitio) + • gl (Fran Dieguez) + • lt (Aurimas Černius) + • pt_BR (Enrico Nicoletto) + • sv (Anders Jonsson) + +Overview of changes from libgdata 0.15.0 to libgdata 0.15.1 +=========================================================== + +Major changes: + • Add a Freebase service and demo (thanks to Carlos Garnacho) + • Various minor fixes to make libgdata compile without Coverity errors + +API changes: + • Add GDATA_LINK_PARENT + • Add GDataFreebase* + +Bugs fixed: + • Bug 707477 — Fill in GDataCategory::label for GDataDocumentsDocument + instances + • Bug 725827 — Define GDATA_LINK_PARENT + • Bug 726486 — Add support for the Freebase service + +Updated translations: + • ca (Gil Forcada) + • da (Aputsiaq Niels Janussen) + • de (Benjamin Steinwender) + • eu (Iñaki Larrañaga Murgoitio) + • fr (Bruno Brouard) + • he (Yosef Or Boczko) + • ko (Changwoo Ryu) + • lv (Rūdolfs Mazurs) + • nb (Kjartan Maraas) + • pl (Piotr Drąg, Aviary.pl) + • pt (Tiago S.) + • ru (Yuri Myasoedov) + • zh_HK (Chao-Hsiung Liao) + • zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.14.0 to libgdata 0.15.0 +=========================================================== + +Major changes: + • Add JSON support and a Google Tasks service (thanks to Pēteris Krišjānis) + - This adds a dependency on json-glib ≥ 0.15 and breaks ABI (but not API) + • Add support for GProxyResolver proxies (thanks to Matthew Barnes) + • Fix build with recent gnome-common versions + • Fix build and installed header files for C++ + • Remove deprecated function calls + • Fix compilation with -fstrict-aliasing + • Port local tests to use libuhttpmock (which is a new dependency) + +API changes: + • Add gdata_parsable_new_from_json() + • Add gdata_parsable_get_json() + • Add GDataParsable->get_content_type + • Add GDataService:proxy-resolver, gdata_service_get_proxy_resolver(), + gdata_service_set_proxy_resolver() + • Add GDataClientLoginAuthorizer:proxy-resolver, + gdata_client_login_authorizer_get_proxy_resolver(), + gdata_client_login_authorizer_set_proxy_resolver() + • Add GDataOAuth1Authorizer:proxy-resolver, + gdata_oauth1_authorizer_get_proxy_resolver(), + gdata_oauth1_authorizer_set_proxy_resolver() + • Add Google Tasks service: GDataTasksService, GDataTasksQuery, + GDataTasksTasklist, GDataTasksTask + +Bugs fixed: + • Bug 712565 — Fix compilation's warnings + • Bug 719647 — gdata-goa-authorizer.h broken for C++ + +Updated translations: + • as (Nilamdyuti Goswami) + • be (Ihar Hrachyshka) + • ca (Gil Forcada) + • cs (Marek Černocký) + • da (Aputsiaq Niels Janussen) + • de (Christian Kirbach) + • el (Dimitris Spingos, Efstathios Iosifidis) + • es (Daniel Mustieles) + • et (Mattias Põldaru) + • fi (Jiri Grönroos) + • fr (Bruno Brouard) + • gl (Fran Dieguez) + • hu (Gabor Kelemen) + • id (Andika Triwidada) + • it (Claudio Arseni, Milo Casagrande) + • ja (Jiro Matsuzawa) + • ko (Changwoo Ryu) + • lt (Aurimas Černius) + • lv (Rūdolfs Mazurs) + • nb (Kjartan Maraas) + • pa (A S Alam) + • pl (Piotr Drąg) + • pt (António Lima) + • pt_BR (Enrico Nicoletto) + • ru (Yuri Myasoedov) + • sk (Ján Kyselica) + • sl (Matej Urbančič) + • sr (Мирослав Николић) + • th (Akom Chotiphantawanon) + • zh_CN (甘露) + • zh_HK (Chao-Hsiung Liao) + • zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.13.4 to libgdata 0.14.0 +=========================================================== + +Updated translations: + • ca (Gil Forcada) + • cs (Marek Černocký) + • de (Christian Kirbach) + • el (Dimitris Spingos) + • es (Daniel Mustieles) + • fr (Alexandre Franke) + • he (Yaron Shahrabani) + • it (Claudio Arseni) + • lt (Aurimas Černius) + • nb (Kjartan Maraas) + • nl (Reinout van Schouwen) + • pt_BR (Rafael Ferreira) + • sl (Matej Urbančič) + • th (Akom Chotiphantawanon) + • zh_HK (Chao-Hsiung Liao) + • zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.13.3 to libgdata 0.13.4 +=========================================================== + +Major changes: + • Fixes to request cancellation and progress notification + • Fix tests to be more reliable in the face of distributed system + non-synchronisation + • Add support for running tests offline using stored HTTP request traces + +API changes: + • Added GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED + +Bugs fixed: + • Bug 627895 — Pretty-print XML in test output + • Bug 703192 — The global log handler interferes with other application + • Bug 705266 — make check fails + +Updated translations: + • eu (Iñaki Larrañaga Murgoitio) + • gl (Fran Diéguez) + • pl (Piotr Drąg) + • pt (António Lima) + • tg (Victor Ibragimov) + +Overview of changes from libgdata 0.13.2 to libgdata 0.13.3 +=========================================================== + +Major changes: + • Fix dependencies in pkg-config file + • Add OAuth 2.0 support to the GOA authoriser + • Fix some licencing inconsistencies (libgdata is entirely licenced under + LGPLv2.1+) + • Add support for PDF documents in Google Documents + • Add in-tree Vala bindings (they were previously in Vala’s tree) + +Bugs fixed: + • Bug 685464 — [PATCH] Package config file depends on too much + • Bug 685289 — GOA now uses OAuth 2.0 for Calendar, Contacts and Documents + • Bug 690281 — do not add unused gnome dependencies to libgdata.pc when + configured with --disable-gnome + • Bug 690225 — [patch] Make GOA optional + • Bug 690656 — unhandled XML warnings from totem youtube plugin + • Bug 693855 — Port introspection fixes from Vala bindings + • Bug 693958 — Add PDF support + • Bug 693865 — Add Vala bindings + • Bug 694415 — Don't require introspection.m4 to be installed system-wide + +Updated translations: + • et (Mattias Põldaru) + • sk (Ján Kyselica) + • ug (Gheyret Kenji) + +Overview of changes from libgdata 0.13.1 to libgdata 0.13.2 +=========================================================== + +Major changes: + • Expand the documentation and add more examples + • Explicitly check for libxml2 in configure + • Port code coverage support to use gnome-common + +Bugs fixed: + • Bug 683209 — Port to gnome-common code coverage macros + +Updated translations: + • as (Nilamdyuti Goswami) + • bg (Alexander Shopov) + • ca (Joan Duran) + • cs (Marek Černocký) + • da (Ask H. Larsen) + • de (Mario Blättermann) + • el (Tom Tryfonidis) + • es (Daniel Mustieles) + • fr (Alexandre Franke) + • gl (Fran Dieguez, Leandro Regueiro) + • hi (Rajesh Ranjan) + • hu (Gabor Kelemen) + • it (Milo Casagrande) + • ko (Changwoo Ryu) + • lt (Aurimas Černius) + • lv (Rūdolfs Mazurs) + • ml (Anish A) + • pa (A S Alam) + • pl (Piotr Drąg) + • pt (António Lima) + • pt_BR (Rafael Ferreira) + • ru (Yuri Kozlov) + • te (Krishnababu Krothapalli) + • th (Akom Chotiphantawanon) + • tr (Muhammet Kara) + • vi (Nguyễn Thái Ngọc Duy) + • zh_HK (Chao-Hsiung Liao) + • zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.13.0 to libgdata 0.13.1 +=========================================================== + +Major changes: + • Add support for Google Drawings + • Fix some of the test suite + • Add support for copying Google documents + • Moved GOA authoriser from EDS/GNOME Documents into libgdata (adding a GOA dependency) + • Remove libgnome-keyring dependency in favour of libgcr-base + +API changes: + • Added GDataDocumentsDrawing + • Added gdata_documents_service_copy_document(), gdata_documents_service_copy_document_async(), gdata_documents_service_copy_document_finish() + • Added GDataGoaAuthorizer + • Added gdata_documents_document_get_download_uri() + +Bugs fixed: + • Bug 633548 — Add Google Drawings support + • Bug 679072 — Tests for all Google services fail + • Bug 607270 — Support copying documents + • Bug 656976 — Merge eds and GNOME Documents GOA authorisers + • Bug 679867 — Use libgcr-base instead of libgnome-keyring for secure memory + • Bug 656970 — Add thumbnail support + +Updated translations: + • be (Ihar Hrachyshka) + • bg (Alexander Shopov) + • el (Γιώργος Στεφανάκης, Tom Tryfonidis) + • en_GB (Philip Withnall) + • es (Daniel Mustieles) + • gl (Fran Dieguez) + • he (Yaron Shahrabani) + • id (Andika Triwidada) + • nb (Kjartan Maraas) + • nl (Willem Heppe, Wouter Bolsterlee) + • sl (Matej Urbančič) + • sr (Мирослав Николић) + • te (Sasi Bhushan Boddepalli) + • zh_HK (Chao-Hsiung Liao) + • zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.12.0 to libgdata 0.13.0 +=========================================================== + +Major changes: + • Bump GLib dependency to 2.31.0 in order to use its new threading primitives + • Add basic support for resumable uploads to GDataUploadStream (bug #607272) + • Update support for Google Documents to v3 of the API + • Add support for arbitrary file uploads to Google Documents (using GDataDocumentsDocuemtn), + and document conversion on upload (using GDataDocumentsUploadQuery) + +API changes: + • Added gdata_upload_stream_new_resumable() + • Added GDataUploadStream:content-length, gdata_upload_stream_get_content_length() + • Added gdata_documents_service_upload_document_resumable() + • Added gdata_documents_service_update_document_resumable() + • Added GDataDocumentsUploadQuery + • Made GDataDocumentsDocument instantiable (this isn’t a real API break, though) + • Added GDATA_DOCUMENTS_TEXT_JPEG + • GDataDocumentsEntry:quota-used, gdata_documents_entry_get_quota_used() + +Bugs fixed: + • Bug 593537 — Upgrade Documents service to version 3.0 + • Bug 607616 — Permit the uploading of documents of any type + • Bug 656971 — Deprecate GDataDocumentsDocument subclasses + • Bug 588714 — <gd:quotaBytesUsed> handling in GDataDocumentsEntry + +Updated translations: + • ca (Jordi Serratosa) + • en_GB (Philip Withnall) + • es (Daniel Mustieles) + • he (Yaron Shahrabani) + • sv (Daniel Nylander) + +Overview of changes from libgdata 0.11.0 to libgdata 0.11.1 +=========================================================== + +Major changes: +* Bump libsoup dependency to 2.37.91 in order to ensure it checks the validity of TLS certificates before accepting them + (Note that this was implemented in 0.10.2 using a --with-ca-certs configure argument. This argument isn't necessary with 0.11.1, since the newer + libsoup version which 0.11.1 requires already knows where the system CA cert file is.) + +Bugs fixed: +* Bug 667577 — fix introspection for srcdir != builddir builds +* Bug 668365 — libgdata 0.10.x link error because of exported symbols that don't exist +* Bug 671535 — Security issue in libgdata + +Updated translations: +* be (Kasia Bondarava) +* te (Praveen Illa) +* uk (Korostil Daniel) + +Overview of changes from libgdata 0.10.0 to libgdata 0.11.0 +=========================================================== + +Major changes: +* Added version checking macros (thanks to Holger Berndt) +* Ported scrapbook demo to GtkGrid; this sets our GTK+ dependency to 2.91.2 +* Added a LIBGDATA_DISABLE_DEPRECATED macro for disabling deprecated API in headers +* Sensitive details (passwords, auth. tokens, etc.) are now redacted from logs unless LIBGDATA_DEBUG=4 is set (which is a new logging level) +* Sensitive details are also now stored in non-pageable memory as much as possible to reduce the risk of them being leaked + NOTE: This has not been formally certified or reviewed, and is a precaution rather than a guarantee of security + This adds a dependency on libgnome-keyring when libgdata is configured with --enable-gnome (and is disabled otherwise) +* Use GHmac instead of liboauth's HMAC; this bumps our GLib dependency to 2.30.0 +* Use the new GLib threading API iff compiled with GLib ≥ 2.31.0 (this doesn't bump the hard dependency, though) + +API changes: +* Added GDATA_MAJOR_VERSION, GDATA_MINOR_VERSION, GDATA_MICRO_VERSION, GDATA_CHECK_VERSION +* Added GDataDocumentsEntry:resource-id, gdata_documents_entry_get_resource_id() +* Deprecated GDataDocumentsEntry:document-id, gdata_documents_entry_get_document_id() +* Added GDataYouTubeQuery:license, gdata_youtube_query_get_license(), gdata_youtube_query_set_license() +* Deprecated GDATA_DOCUMENTS_PRESENTATION_SWF +* Added GDATA_CATEGORY_SCHEMA_LABELS, GDATA_CATEGORY_SCHEMA_LABELS_STARRED +* Added GDataContactsContact:file-as, gdata_contacts_contact_get_file_as(), gdata_contacts_contact_set_file_as() + +Bugs fixed: +* Bug 659016 — @rel not mandatory in website references +* Bug 660038 — Add preprocessor macro for version checking +* Bug 656972 — Tidy up document IDs +* Bug 658865 — Add support for the license query parameter +* Bug 660174 — Deprecate SWF export of presentations +* Bug 659148 — Add search-term query example to documentation +* Bug 656973 — Add an example of starring a document +* Bug 656783 — Review security of memory storing authentication details +* Bug 662290 — Can't update contact that has no full name + +Updated translations: +* as (Nilamdyuti Goswami) +* da (Aputsiaq Niels Janussen) +* eu (Iñaki Larrañaga Murgoitio) +* fi (Tommi Vainikainen) +* hu (Gabor Kelemen) +* it (Claudio Arseni) +* ja (Jiro Matsuzawa) +* kn (Shankar Prasad) +* ko (Changwoo Ryu) +* lt (Žygimantas Beručka) +* lv (Rūdofls Mazurs) +* or (Manoj Kumar Giri) +* pa (A S Alam) +* pl (Piotr Drąg) +* pt (António Lima) +* pt_BR (Flamarion Jorge) +* sr (Мирослав Николић) +* ta (I Felix) +* vi (Nguyễn Thái Ngọc Duy) +* zh_CN (YunQiang Su) +* zh_HK (Chao-Hsiung Liao) +* zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.9.1 to libgdata 0.10.0 +========================================================== + +Major changes: +* Added support for comments to YouTube and PicasaWeb (thanks to Richard Schwarting) +* Added a “scrapbook” demo application (thanks to Joe Cortes) +* Added lots of cancellation tests + +API changes: +* Added GDataCommentable +* Added GDataComment, GDataYouTubeComment, GDataPicasaWebComment +* Added gdata_entry_remove_link() +* Added gdata_youtube_video_get_media_rating(), GDATA_YOUTUBE_RATING_TYPE_SIMPLE, GDATA_YOUTUBE_RATING_TYPE_MPAA, GDATA_YOUTUBE_RATING_TYPE_V_CHIP + +Bugs fixed: +* Bug 618587 — Implement GDataGDFeedLink +* Bug 598752 — Support comments +* Bug 647882 — Support rating schemes +* Bug 628069 — Add some demo applications +* Bug 656529 — undefined references trying to compile/build libgdata +* Bug 633364 — Add cancellation tests + +Updated translations: +* bg (Alexander Shopov) +* ca, ca@valencia (Gil Forcada) +* cs (Andre Klapper) +* de (Mario Blättermann) +* eo (Kristjan SCHMIDT) +* es (Jorge González) +* fr (Bruno Brouard) +* gl (Fran Diéguez) +* he (Yaron Shahrabani) +* id (Andika Triwidada) +* lt (Aurimas Černius) +* lv (Rūdofls Mazurs) +* nb (Kjartan Maraas) +* ru (Yuri Kozlov) +* sl (Matej Urbančič) +* sv (Daniel Nylander) +* th (Akom Chotiphantawanon) +* ug (Gheyret Kenji) + +Overview of changes from libgdata 0.9.0 to libgdata 0.9.1 +========================================================= + +Major changes: +* Added GDestroyNotify parameters to query-type methods so that they're properly introspectable, breaking API (see below) +* Fixed seeking in GDataDownloadStream +* Made the tests individually idempotent, so the test suites should be less of a tangled mess now +* Fixed uploading to non-default PicasaWeb albums +* Fixed GDataAuthorizer to re-process requests after refreshing, involving a slight change to the semantics of GDataAuthorizer (see bgo#653535) +* Ensure that Google Contacts uses HTTPS for everything +* Fixed the IDs used for Google Documents so that deleting documents now consistently works, even when they're in folders + +API changes: +* Changed the following methods, adding GDestroyNotify parameters for their progress user data parameters: + - gdata_access_handler_get_rules_async() + - gdata_service_query_async() + - gdata_calendar_service_query_all_calendars_async() + - gdata_calendar_service_query_own_calendars_async() + - gdata_calendar_service_query_events_async() + - gdata_contacts_service_query_contacts_async() + - gdata_contacts_service_query_groups_async() + - gdata_documents_service_query_documents_async() + - gdata_picasaweb_service_query_all_albums_async() + - gdata_picasaweb_service_query_files_async() + - gdata_youtube_service_query_standard_feed_async() + - gdata_youtube_service_query_videos_async() + - gdata_youtube_service_query_related_async() +* Added GDataCalendarQuery:max-attendees, gdata_calendar_query_get_max_attendees(), gdata_calendar_query_set_max_attendees() +* Added GDataCalendarQuery:show-deleted, gdata_calendar_query_show_deleted(), gdata_calendar_query_set_show_deleted() +* Added gdata_picasaweb_service_get_user_async(), gdata_picasaweb_service_get_user_finish() + +Bugs fixed: +* Bug 649728 — Add introspection annotations for documents_service_query(_async) +* Bug 639405 — Add max-attendees query parameter +* Bug 637664 — Fix GSeekable interface implementation in GDataDownloadStream +* Bug 633359 — Make tests individually idempotent +* Bug 653535 — Let GDataAuthorizer re-process request after refreshing +* Bug 653530 — Bogus run-time warnings +* Bug 653224 — Add gdata_picasaweb_service_get_user_async() + +Updated translations: +* ca, ca@valencia (Joan Duran) +* cs (Andre Klapper) +* de (Mario Blättermann) +* es (Daniel Mustieles) +* fi (Tommi Vainikainen) +* gl (Fran Diéguez) +* he (Yaron Shahrabani) +* lt (Aurimas Černius) +* ru (Yuri Kozlov) +* sl (Matej Urbančič) +* sr (Мирослав Николић) +* sv (Daniel Nylander) +* tr (Muhammet Kara) + +Overview of changes from libgdata 0.8.0 to libgdata 0.9.0 +========================================================= + +Major changes: +* Switched to even–odd/stable–unstable versioning (so 0.9.0 is an *unstable* release) +* Use HTTPS for all requests +* Some minor parsing fixes +* Fixed some nasty threading/cancellation problems +* Removed the old authentication API in favour of a more extensible, flexible one based on a GDataAuthorizer interface: + - ClientLogin is now handled by GDataClientLoginAuthorizer + - OAuth 1.0 support has been added with GDataOAuth1Authorizer +* Added a dependency on liboauth ≥ 0.9.4 +* Introspection annotation improvements by Philip Chimento <philip.chimento@gmail.com> +* Removed some outdated contact photo API + +API changes: +* Added GDATA_AUTHENTICATION_ERROR_INVALID_SECOND_FACTOR (later renamed to GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_INVALID_SECOND_FACTOR as below). +* Rename GDataAuthenticationError to GDataClientLoginAuthorizerError +* Rename GDATA_AUTHENTICATION_ERROR and gdata_authentication_error_quark() similarly. +* Remove gdata_service_authenticate() in favour of using GDataClientLoginAuthorizer with GDataService::authorizer: + - Remove gdata_service_authenticate(), gdata_service_authenticate_async() and gdata_service_authenticate_finish(). + - Replace gdata_service_is_authenticated() by gdata_service_is_authorized() with much the same functionality. + - Add GDataService::authorizer, gdata_service_get_authorizer(), gdata_service_set_authorizer() and gdata_service_get_authorization_domains(). + - Remove gdata_service_get_client_id() in favour of GDataClientLoginAuthorizer::client-id. + - Remove gdata_service_get_username() in favour of GDataClientLoginAuthorizer::username. + - Remove gdata_service_get_password() in favour of GDataClientLoginAuthorizer::password. + - Remove GDataServiceClass->service_name in favour of GDataAuthorizationDomain::service-name. + - Remove GDataServiceClass->authentication_uri and GDataServiceClass->parse_authentication_response in favour of different GDataAuthorizer + implementations. + - Add GDataAuthorizer parameters to and remove client_id parameters from: gdata_calendar_service_new(), gdata_contacts_service_new(), + gdata_documents_service_new(), gdata_picasaweb_service_new() and gdata_youtube_service_new(). +* Add GDataAuthorizationDomain. + - Add GDataServiceClass->get_authorization_domains and gdata_service_get_authorization_domains(). + - Add auth. domain getters to various GDataService subclasses: gdata_youtube_service_get_primary_authorization_domain(), + gdata_contacts_service_get_primary_authorization_domain(), gdata_calendar_service_get_primary_authorization_domain(), + gdata_picasaweb_service_get_primary_authorization_domain(), gdata_documents_service_get_primary_authorization_domain() and + gdata_documents_service_get_spreadsheet_authorization_domain(). + - Add auth. domain properties to various standalone request objects: GDataDownloadStream::authorization-domain with + gdata_download_stream_get_authorization_domain(), GDataUploadStream::authorization-domain with gdata_upload_stream_get_authorization_domain() and + GDataBatchOperation::authorization-domain with gdata_batch_operation_get_authorization_domain(). + - Add GDataAccessHandlerIface->get_authorization_domain. This doesn't have to be implemented by existing GDataAccessHandlers, but it's + highly recommended. + - Add a GDataAuthorizationDomain parameter to GDataServiceClass->append_query_headers, gdata_service_query(), gdata_service_query_async(), + gdata_service_query_single_entry(), gdata_service_query_single_entry_async(), gdata_service_insert_entry(), gdata_service_insert_entry_async(), + gdata_service_update_entry(), gdata_service_update_entry_async(), gdata_service_delete_entry(), gdata_service_delete_entry_async(), + gdata_batchable_create_operation(), gdata_download_stream_new() and gdata_upload_stream_new(). +* Add GDataAuthorizer as described above, implemented by GDataClientLoginAuthorizer. +* Add GDataOAuth1Authorizer and all its properties and methods. +* Remove gdata_contacts_contact_has_photo() and GDataContactsContact:has-photo (use gdata_contacts_contact_get_photo_etag() instead). + +Bugs fixed: +* Bug 642983 — libgdata-0.8.0: test fail with --enable-gtk-doc +* Bug 644940 — Use HTTPS only +* Bug 644946 — Support two-factor authentication +* Bug 639610 — Allow access to a contact's photo ETag +* Bug 648058 — Doesn't allow empty names for user defined fields +* Bug 650835 — [abrt] evolution-data-server-3.0.1-1.fc15: Process /usr/libexec/e-addressbook-factory was killed by signal 6 (SIGABRT) + +Updated translations: +* as (Nilamdyuti Goswami) +* da (Kris Thomsen) +* de (Wolfgang Stöggl) +* bg (Ivaylo Valkov) +* bn_IN (Runa Bhattacharjee) +* ca (Joan Duran) +* cs (Marek Černocký) +* de (Mario Blättermann) +* el (Γιώργος Στεφανάκης, Michael Kotsarinis) +* en_GB (Bruce Cowan) +* eo (Kristjan SCHMIDT) +* es (Daniel Mustieles, Jorge González) +* eu (Iñaki Larrañaga Murgoitio) +* fr (Bruno Brouard) +* gl (Leandro Regueiro, Fran Diéguez) +* gu (Sweta Kothari) +* he (Yaron Shahrabani) +* hi (Rajesh Ranjan) +* hu (Gabor Kelemen) +* id (Andika Triwidada) +* it (Claudio Arseni) +* kn (Shankar Prasad) +* ko (Changwoo Ryu) +* lv (Rudolfs) +* mr (Sandeep Shedmake) +* nb (Kjartan Maraas) +* or (Manoj Kumar Giri) +* pa (A S Alam) +* pl (Piotr Drąg) +* pt (António Lima) +* pt_BR (Rodrigo Padula de Oliveira) +* ro (Lucian Adrian Grijincu) +* ru (Yuri Kozlov) +* sl (Matej Urbančič) +* sr, sr@latin (Мирослав Николић) +* sv (Daniel Nylander) +* th (Akom Chotiphantawanon) +* tr (Senol Korkmaz) +* ug (Gheyret Kenji) +* uk (Korostil Daniel) +* zh_CN (ben) +* zh_HK (Chao-Hsiung Liao) +* zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.7.0 to libgdata 0.8.0 +========================================================= + +Major changes: +* Added async counterparts to all remaining blocking methods +* Added various cancellation tests to the test suite +* Many fixes and improvements for cancellation of various operations +* Fixed many race conditions in authentication and cancellation of operations +* Removed the separate youtube-user property for YouTube authentication +* Fixed attribute escaping across all of libgdata +* Removed some deprecated PicasaWeb properties (file clients and positions) +* Switched to stream-based downloading for all download operations +* Tidied up (i.e. broke) the Documents service API a lot +* Tidied up a few test cases and made them idempotent +* Fixed several minor and major memory leaks +* Ensured that batch operations' callbacks are always called, even if the entire batch operation errors out +* Bumped our gdk-pixbuf dependency to 2.14 +* Fixed all the XML comparison tests in light of an invalid assumption we made about hash table ordering being broken +* Added GeoRSS support to YouTube videos +* Overhauled download and upload streams, fixing many race conditions and deadlocks and adding some test cases +* Added support for flushing GDataUploadStream instances +* Added many code examples to the documentation and expanded a few other bits of the documentation + +API changes: +* Added gdata_picasaweb_service_insert_album_async() +* Added gdata_picasaweb_service_query_files_async() +* Removed GDataYouTubeService:youtube-user, gdata_youtube_service_get_youtube_user() +* Removed GDataPicasaWebFile:client, gdata_picasaweb_file_get_client(), gdata_picasaweb_file_set_client() +* Removed GDataPicasaWebFile:position, gdata_picasaweb_file_get_position(), gdata_picasaweb_file_set_position() +* Changed gdata_documents_document_download() to be stream-based +* Changed gdata_documents_service_upload_document(), gdata_documents_service_update_document() to be stream-based +* Added gdata_documents_service_finish_upload() +* Renamed gdata_documents_service_move_document_to_folder() to gdata_documents_service_add_entry_to_folder() +* Renamed gdata_documents_service_remove_document_from_folder() to gdata_documents_service_remove_entry_from_folder() +* Added gdata_documents_service_add_entry_to_folder_async(), gdata_documents_service_add_entry_to_folder_finish() +* Added gdata_documents_service_from_entry_from_folder_async(), gdata_documents_service_from_entry_from_folder_finish() +* Changed GDataDownloadStream::content-length, GDataDownloadStream::content-type to be emitted in the download thread rather than the main thread +* Changed gdata_picasaweb_service_upload_file() to be stream-based +* Removed gdata_picasaweb_service_upload_file_async(), gdata_picasaweb_service_upload_file_finish() +* Added gdata_picasaweb_service_finish_file_upload() +* Changed gdata_media_content_download() to be stream-based +* Changed gdata_media_thumbnail_download() to be stream-based +* Changed gdata_youtube_service_upload_video() to be stream-based +* Added gdata_youtube_service_finish_video_upload() +* Added gdata_calendar_service_query_events_async() +* Added gdata_calendar_service_insert_event_async() +* Changed gdata_contacts_contact_get_photo(), gdata_contacts_contact_set_photo() to use guint8 instead of gchar for image data +* Added gdata_contacts_contact_get_photo_async(), gdata_contacts_contact_get_photo_finish() +* Changed gdata_contacts_contact_set_photo() to require a content type to be passed in +* Added gdata_contacts_contact_set_photo_async(), gdata_contacts_contact_set_photo_finish() +* Added GDataYouTubeVideo:latitude, GDataYouTubeVideo:longitude, gdata_youtube_video_get_coordinates(), gdata_youtube_video_set_coordinates() +* Changed gdata_upload_stream_new() to take a GCancellable +* Added GDataUploadStream:cancellable, gdata_upload_stream_get_cancellable() +* Changed gdata_download_stream_new() to take a GCancellable +* Added GDataDownloadStream:cancellable, gdata_download_stream_get_cancellable() + +Bugs fixed: +* Bug 607620 — Cancelled uploads appear partially complete in PicasaWeb +* Bug 635959 — Proper cancellation support for GDataUploadStream +* Bug 635736 — Asynchronous authentication tests broken +* Bug 634033 — Use standard login URI for YouTube +* Bug 635335 — GIR missing exported packages information +* Bug 631033 — Fix escaping and add tests +* Bug 633363 — Add missing *_async() methods +* Bug 594814 — Handle GeoRSS for YouTube videos +* Bug 637036 — Overhaul cancellation support +* Bug 579885 — Add code examples to documentation + +Updated translations: +* ca@valencia (Joan Duran) +* cs (Marek Černocký) +* da (Kris Thomsen) +* de (Mario Blättermann) +* en_GB (Philip Withnall) +* es (Jorge González) +* eu (Iñaki Larrañaga Murgoitio) +* fr (Bruno Brouard) +* hu (Gabor Kelemen) +* sl (Matej Urbančič) +* sv (Daniel Nylander) +* zh_CN (Eleanor Chen) + +Overview of changes from libgdata 0.6.0 to libgdata 0.7.0 +========================================================= + +Major changes: +* Improved and updated introspection support and annotations for gobject-introspection >= 0.9.7 (which we now depend on) +* Added more code examples to documentation +* Added support for service localisation using gdata_service_set_locale() +* Added support for listing video categories from YouTube +* Tidied up object comparison using a new GDataComparable interface instead of lots of *_compare() methods +* Added batch operation support and implemented it for the Contacts, YouTube, Calendar and Documents services +* Fixed ID projection issues with Contact entries +* Added support for alerting the user of account migration with GDATA_AUTHENTICATION_ERROR_ACCOUNT_MIGRATED +* Added support for a --no-internet option to the tests, so that more of the test suite can be run automatically without an internet connection +* Split handling of entries with inline content from external content (using the new gdata_entry_get_content_uri()) +* Rearranged Documents classes so that instantiable entries are now subclasses of a new GDataDocumentsDocument, which handles downloading of document + files +* Use gtk-doc's no-tmpl flavour, bumping our gtk-doc requirement to 1.14 +* Tightened up URI escaping +* Switched to depending on only gdk-pixbuf instead of the whole of GDK, since we only (optionally) use GdkPixbuf for the test suite +* Tightened up attribute escaping +* Switched from GTimeVal to gint64 for representing UNIX timestamps +* Switched to using upstream gettext instead of glib-gettext +* Added support for manipulating Contact groups + +API changes: +* Added gdata_entry_get_authors +* Added gdata_service_get_locale, gdata_service_set_locale +* Added GDataYouTubeCategory, GDataAPPCategories +* Added gdata_youtube_service_get_categories, gdata_youtube_service_get_categories_async, gdata_youtube_service_get_categories_finish +* Added GDataComparable +* Removed *_compare() functions in favour of implementing the GDataComparable interface +* Added GDataEntryClass->kind_term +* Added GDataBatchable, GDataBatchOperation +* Added GDATA_AUTHENTICATION_ERROR_ACCOUNT_MIGRATED +* Added GDATA_DOCUMENTS_PRESENTATION_PDF, GDATA_DOCUMENTS_PRESENTATION_PNG, GDATA_DOCUMENTS_PRESENTATION_PPT, GDATA_DOCUMENTS_PRESENTATION_SWF + GDATA_DOCUMENTS_PRESENTATION_TXT, GDATA_DOCUMENTS_SPREADSHEET_CSV, GDATA_DOCUMENTS_SPREADSHEET_HTML, GDATA_DOCUMENTS_SPREADSHEET_ODS, + GDATA_DOCUMENTS_SPREADSHEET_PDF, GDATA_DOCUMENTS_SPREADSHEET_TSV, GDATA_DOCUMENTS_SPREADSHEET_XLS, GDATA_DOCUMENTS_TEXT_DOC, + GDATA_DOCUMENTS_TEXT_HTML, GDATA_DOCUMENTS_TEXT_ODT, GDATA_DOCUMENTS_TEXT_PDF, GDATA_DOCUMENTS_TEXT_PNG, GDATA_DOCUMENTS_TEXT_RTF, + GDATA_DOCUMENTS_TEXT_TXT, GDATA_DOCUMENTS_TEXT_ZIP +* Removed GDataDocumentsPresentationFormat, GDataDocumentsSpreadsheetFormat, GDataDocumentsTextFormat and made the appropriate changes to the relevant + Documents functions which took them +* Added gdata_entry_get_content_uri, gdata_entry_set_content_uri and changed the behaviour of gdata_entry_get_content as appropriate +* Added GDataDocumentsDocument as a subclass of GDataDocumentsEntry and the parent of GDataDocumentsPresentation, GDataDocumentsSpreadsheet and + GDataDocumentsText +* Added gdata_documents_document_download, gdata_documents_document_get_download_uri +* Removed gdata_documents_presentation_download_document, gdata_documents_presentation_get_download_uri, + gdata_documents_spreadsheet_download_document, gdata_documents_text_download_document, gdata_documents_text_get_download_uri (moved to + GDataDocumentsDocument) +* Made GDataDocumentsEntry abstract +* Removed gdata_contacts_service_update_contact (use gdata_service_update_entry instead) +* Removed GDataTimeVal (boxed type) +* Removed GTimeVal from the public API, in favour of gint64 +* Added GDATA_LINK_ACCESS_CONTROL_LIST +* Removed gdata_access_handler_insert_rule (use gdata_service_insert_entry instead), gdata_access_handler_update_rule (use gdata_service_update_entry + instead), gdata_access_handler_delete_rule (use gdata_service_delete_entry instead) +* Added gdata_access_handler_get_rules_async +* Added gdata_contacts_service_insert_contact_async +* Added GDataContactsGroup +* Added gdata_contacts_service_query_groups, gdata_contacts_service_query_groups_async, gdata_contacts_service_insert_group, + gdata_contacts_service_insert_group_async + +Bugs fixed: +* Bug 616222 — libgdata fails to build from a remote directory +* Bug 579885 — Add code examples to documentation +* Bug 618584 — Implement gdata_entry_get_authors() +* Bug 615721 — Support listing video categories +* Bug 618586 — gdata_service_query_single_entry() encounters NULL type class +* Bug 579169 — Add batch processing support +* Bug 624142 — Add batch operation support to Calendar service +* Bug 624141 — Add batch operation support to Documents service +* Bug 630350 — Email address cannot contain name + +Updated translations: +* ca (Gil Forcada) +* cs (Marek Cernocky) +* da (Kris Thomsen) +* de (Mario Blättermann, Christian Kirbach) +* en_GB (Philip Withnall) +* es (Jorge González) +* fr (Claude Paroz) +* gl (Fran Diéguez) +* hu (Gabor Kelemen) +* id (Andika Triwidada) +* it (Milo Casagrande) +* lt (Aurimas Černius) +* pl (Piotr Drąg) +* pt (António Lima) +* pt_BR (Djavan Fagundes) +* ro (Daniel Șerbănescu, Lucian Adrian Grijincu) +* sl (Matej Urbančič) +* sv (Daniel Nylander) +* zh_CN (Yinghua Wang, Eleanor Chen, YunQiang Su) + +Overview of changes from libgdata 0.5.0 to libgdata 0.6.0 +========================================================= + +Major changes: +* Added feed icon support +* Added support for querying for user information on the PicasaWeb service +* Added some code examples to the documentation +* Ensured UTF-8 is supported correctly everywhere +* Added GObject introspection support (GData-0.0.gir) +* Added a download API for PicasaWeb images and thumbnails +* Added an asynchronous PicasaWeb upload API +* Reorganised the build system to use non-recursive automake +* Added gcov support and consequently improved test coverage somewhat +* Ensured HTTPS requests are used wherever possible, unless the LIBGDATA_FORCE_HTTP environment variable is set +* Modified memory management to consistently use the GLib memory manager, eliminating 53 calls to g_strdup() on an average test run +* Consolidated generic API errors to GDATA_SERVICE_ERROR_PROTOCOL_ERROR + +API changes: +* Added gdata_picasaweb_query_new_with_limits +* Added gdata_feed_get_icon +* Added GDataPicasaWebUser, gdata_picasaweb_service_get_user +* Removed gdata_picasaweb_album_get_name, gdata_picasaweb_album_get_description, gdata_picasaweb_album_set_description and corresponding properties +* Added GDataPicasaWebFeed +* Removed gdata_youtube_video_get_title, gdata_youtube_video_set_title +* Added gdata_media_content_download, gdata_media_thumbnail_download +* Added gdata_picasaweb_service_insert_album +* Added gdata_picasaweb_service_upload_file_async, gdata_picasaweb_service_upload_file_finish +* Added gdata_gd_organization_get_location, gdata_gd_organization_set_location, + gdata_gd_email_address_get_display_name, gdata_gd_email_address_set_display_name +* Added GDataOperationType +* Removed GDATA_SERVICE_ERROR_WITH_*; GDATA_SERVICE_ERROR_PROTOCOL_ERROR is now returned instead + +Bugs fixed: +* Bug 597248 — Add gdata_picasaweb_query_new_with_limits +* Bug 598746 — gdata_picasaweb_query_set_image_size documentation fix +* Bug 598910 — Timestamp bug +* Bug 598912 — Test data was changed by my mucking around with comments +* Bug 598893 — gdata_picasaweb_album_new doesn't set a valid visibility +* Bug 599140 — Have albums initialise date to now by default +* Bug 589858 — Handle gphoto XML elements found in 'GDataFeed' +* Bug 598913 — Add gdata_picasaweb_service_insert_album() +* Bug 602156 — GDataUploadStream should close GOutputStream on dispose +* Bug 598649 — Download API for PicasaWeb images and thumbnails +* Bug 600262 — Add async PicasaWeb upload API +* Bug 604313 — Test failures in 0.5.1 +* Bug 601919 — Expand a comment, organise some media tests +* Bug 598748 — *_download_document prevents non-overwriting saving into directories +* Bug 607607 — Undefined symbol with introspection + +Updated translations: +* cs (Marek Cernocky, Petr Kovar) +* de (Mario Blättermann) +* es (Jorge González) +* fr (Claude Paroz, Julien Hardelin) +* gl (Fran Dieguez) +* hu (Gabor Kelemen) +* it (Rita Bandiera) +* ja (Takeshi AIHANA) +* pt (António Lima) +* pt_BR (Djavan Fagundes, Og Maciel) +* sl (Matej Urbančič) +* sv (Daniel Nylander) +* zh_CN (Aron Xu) + +Overview of changes from libgdata 0.4.0 to libgdata 0.5.0 +========================================================= + +Major changes: +* Added Exif support for PicasaWeb files +* Added the ability to query single Google Documents files +* Errors are now logged in the "libgdata" domain +* Added GeoRSS support for PicasaWeb files and albums +* Optimisation to the XML output functions +* Added streaming download and upload support using GDataDownloadStream and GDataUploadStream +* Added support for silent building with AM_SILENT_RULES +* Updated the GData namespace to version 3, improving name and address support + +API changes: +* Changed gdata_documents_*_download_document to accept a destination file, rather than a directory +* Added gdata_picasaweb_file_get_distance, gdata_picasaweb_file_get_exposure, gdata_picasaweb_file_get_flash, gdata_picasaweb_file_get_focal_length + gdata_picasaweb_file_get_fstop, gdata_picasaweb_file_get_image_unique_id, gdata_picasaweb_file_get_iso, gdata_picasaweb_file_get_make + gdata_picasaweb_file_get_model and corresponding properties +* Added GDataExifTags +* Added gdata_documents_entry_is_deleted +* Added GDataEntry:rights, gdata_entry_get_rights, gdata_entry_set_rights +* Added gdata_documents_service_query_single_document +* Added GDataPicasaWebAlbum:latitude, GDataPicasaWebAlbum:longitude, gdata_picasaweb_album_get_coordinates, gdata_picasaweb_album_set_coordinates, + GDataPicasaWebFile:latitude, GDataPicasaWebFile:longitude, gdata_picasaweb_file_get_coordinates, gdata_picasaweb_file_set_coordinates +* Added GDataGeoRSSWhere +* Added GDataDownloadStream +* Added GDATA_SERVICE_ERROR_WITH_DOWNLOAD, GDATA_SERVICE_ERROR_WITH_UPLOAD service errors +* Added gdata_documents_*_get_download_uri +* Added GDataUploadStream +* Added GDataGDName +* Added GDataGDOrganization:department, gdata_gd_organization_get_department, gdata_gd_organization_set_department, GDataGDOrganization:job-description, + gdata_gd_organization_get_job_description, gdata_gd_organization_set_job_description, GDataGDOrganization:symbol, gdata_gd_organization_get_symbol, + gdata_gd_organization_set_symbol +* Added GDATA_GD_MAIL_CLASS_*, GDATA_GD_ADDRESS_USAGE_* +* Removed the address parameter from gdata_gd_postal_address_new +* Added GDataGDPostalAddress:mail-class, gdata_gd_postal_address_get_mail_class, gdata_gd_postal_address_set_mail_class, GDataGDPostalAddress:usage, + gdata_gd_postal_address_get_usage, gdata_gd_postal_address_set_usage, GDataGDPostalAddress:agent, gdata_gd_postal_address_get_agent, + gdata_gd_postal_address_set_agent, GDataGDPostalAddress:house-name, gdata_gd_postal_address_get_house_name, gdata_gd_postal_address_set_house_name, + GDataGDPostalAddress:street, gdata_gd_postal_address_get_street, gdata_gd_postal_address_set_street, GDataGDPostalAddress:po-box, + gdata_gd_postal_address_get_po_box, gdata_gd_postal_address_set_po_box, GDataGDPostalAddress:neighborhood, gdata_gd_postal_address_get_neighborhood, + gdata_gd_postal_address_set_neighborhood, GDataGDPostalAddress:city, gdata_gd_postal_address_get_city, gdata_gd_postal_address_set_city, + GDataGDPostalAddress:subregion, gdata_gd_postal_address_get_subregion, gdata_gd_postal_address_set_subregion, GDataGDPostalAddress:region, + gdata_gd_postal_address_get_region, gdata_gd_postal_address_set_region, GDataGDPostalAddress:postcode, gdata_gd_postal_address_get_postcode, + gdata_gd_postal_address_set_postcode, GDataGDPostalAddress:country, GDataGDPostalAddress:country-code, gdata_gd_postal_address_get_country, + gdata_gd_postal_address_get_country_code, gdata_gd_postal_address_set_country +* Added GDataContactsContact:name, gdata_contacts_contact_get_name +* Added gdata_documents_service_get_upload_uri + +Bugs fixed: +* Bug 589265 – Crash on query error +* Bug 589545 – *_download_document(): let the client decide where to download +* Bug 589201 – Add EXIF support for PicasaWeb image files +* Bug 589850 – gdata_picasaweb_album_get_timestamp() returns date in 1970! +* Bug 590345 – <gd:deleted> handling in GDataDocumentsEntry +* Bug 589855 – Obsolete <rights> not handled in GDataPicasaWebAlbum parse_xml() +* Bug 590341 – Allow querying of single documents +* Bug 590132 – Unhandled XML for georss +* Bug 590568 – Crash on querying inside a folder +* Bug 591966 — Can't query single spreadsheets +* Bug 591974 — remove_document_from_folder moves documents to the trash +* Bug 591691 — Getting a feed containing PDF documents returns NULL +* Bug 592124 — G_LOG_DOMAIN not set for subdirectories +* Bug 592845 — Undefined symbol: gdata_picasaweb_query_new_with_limits +* Bug 593239 — Use GDataUploadStream for uploading files +* Bug 593336 — Query parameter "q=..." isn't valid for album kinds + +Updated translations: +* de (Mario Blättermann) +* en_GB (Philip Withnall) +* es (Jorge González) +* eu (Iñaki Larrañaga Murgoitio) +* fr (Nicolas Repentin) +* gl (Fran Dieguez) +* hu (Gabor Kelemen) +* nb (Kjartan Maraas) +* po (Piotr Drąg) +* pt (António Lima) +* pt_BR (Flamarion Jorge) +* sv (Daniel Nylander) +* zh_HK (Chao-Hsiung Liao) +* zh_TW (Chao-Hsiung Liao) + +Overview of changes from libgdata 0.3.0 to libgdata 0.4.0 +========================================================= + +Major changes: +* Added comparison functions for all small XML elements (such as GDataLink and friends) +* Added GDataContactsContact photo support +* Translatable strings are now even clearer, and all have translator comments +* Fixed a number of locale-dependent bugs +* Converted small XML element structs to full GObjects +* Added a PicasaWeb service by Richard Schwarting <aquarichy@gmail.com> +* Fixed more licencing issues (libgdata is licenced under LGPLv2.1+) +* Required link relation types to be full URIs +* Added a Google Documents service by Thibault Saunier <saunierthibault@gmail.com> + +API changes: +* Added gdata_contacts_contact_get_extended_properties +* Added *_compare +* Added GDataContactsContact:has-photo, gdata_contacts_contact_has_photo, gdata_contacts_contact_get_photo, gdata_contacts_contact_set_photo +* Converted GDataAuthor, GDataCategory, GDataLink, GDataGenerator to GObjects (removed *_free functions and added mandatory field accessors) +* Converted GDataGDEmailAddress, GDataGDFeedLink, GDataGDIMAddress, GDataGDOrganization, GDataGDPhoneNumber, GDataGDPostalAddress, GDataGDRating, + GDataGDWhen, GDataGDReminder, GDataGDWhere, GDataGDWho to GObjects (removed *_free functions and added mandatory field accessors) +* Converted GDataMediaCategory, GDataMediaContent, GDataMediaCredit, GDataMediaRating, GDataMediaRestriction, GDataMediaThumbnail to GObjects + (removed *_free functions and added mandatory field accessors) +* Removed gdata_media_thumbnail_parse_time, gdata_media_thumbnail_build_time +* Converted GDataYouTubeState to GObject (removed gdata_youtube_state_free and added mandatory field accessors) +* Added GDataYouTubeControl +* Added PicasaWeb service API +* Removed gdata_entry_new_from_xml, other *_new_from_xml functions, gdata_entry_get_xml +* Added gdata_parsable_new_from_xml, gdata_parsable_get_xml +* Removed GDATA_PARSER_ERROR_UNHANDLED_XML_ELEMENT parser error +* Added GDataParsableClass->element_name, GDataParsableClass->element_namespace +* Added GDATA_LINK_ALTERNATE, GDATA_LINK_EDIT, GDATA_LINK_EDIT_MEDIA, GDATA_LINK_ENCLOSURE, GDATA_LINK_RELATED, GDATA_LINK_SELF, GDATA_LINK_VIA + for use with gdata_entry_look_up_link +* Added gdata_contacts_service_update_contact +* Added gdata_youtube_service_query_single_video, gdata_youtube_service_query_single_video_async, gdata_youtube_service_query_single_video_finish +* Added gdata_youtube_video_get_video_id_from_uri +* Added GDataYouTubeAspectRatio, gdata_youtube_video_get_aspect_ratio, gdata_youtube_video_set_aspect_ratio +* Added Google Documents service API +* Added gdata_contacts_contact_remove_all_email_addresses, gdata_contacts_contact_remove_all_im_addresses, + gdata_contacts_contact_remove_all_postal_addresses, gdata_contacts_contact_remove_all_phone_numbers, gdata_contacts_contact_remove_all_organizations + +Bugs fixed: +* Bug 584417 – Strings are not properly formed for localisation +* Bug 584737 – String parsing is locale-sensitive +* Bug 579170 – Eliminate gdata_parser_error_unhandled_element +* Bug 587277 – Some files are GPLv3 but license is LGPLv2.1? +* Bug 588052 – Parse the yt:aspectratio tag +* Bug 587073 – Add Google Documents service +* Bug 588995 – float radix character depends on LC_NUMERIC, but Google wants "." + +Updated translations: +* ca (Joan Duran) +* de (Mario Blättermann) +* en_GB (Philip Withnall) +* es (Jorge González) +* nb (Kjartan Maraas) +* pa (A S Alam) +* sv (Daniel Nylander) +* uk (Maxim Dziumanenko) + +Overview of changes from libgdata 0.2.0 to libgdata 0.3.0 +========================================================= + +Major changes: +* Empty (but present) entry titles are now set to an empty string, rather than NULL +* GDataCalendarEvent has basic recurrence support +* Optional GNOME support has been added for automagic proxy configuration (depends on libsoup-gnome-2.4) +* Deprecated libsoup API has been removed, bumping the requirement to 2.26.1 +* Translation comments and some translatable strings have been made clearer +* Default error handling has been improved +* More async versions of functions have been added +* The XML output of GDataCalendarCalendar has been completed +* GDataYouTubeVideo now has support for recorded times and comment feed links +* Added a GDataYouTubeQuery class +* Access control list (ACL) support, implemented on GDataCalendarCalendar +* Abstract XML parsing into GDataParsable to allow GDataFeed to be overridden +* Added a GDataCalendarFeed class to deal with calendar-specific properties + +API changes: +* Added GDataCalendarEvent:recurrence, gdata_calendar_event_get_recurrence, gdata_calendar_event_set_recurrence +* Added GDataCalendarEvent:original-event-id, GDataCalendarEvent:original-event-uri, gdata_calendar_event_get_original_event_details +* Added gdata_calendar_event_is_exception +* Added GDATA_SERVICE_ERROR_NOT_FOUND, GDATA_SERVICE_ERROR_CONFLICT +* Changed GDataServiceClass->parse_error_response +* Added gdata_service_insert_entry_async, gdata_service_insert_entry_finish +* Added gdata_service_update_entry_async, gdata_service_update_entry_finish +* Added gdata_service_delete_entry_async, gdata_service_delete_entry_finish +* Added gdata_color_to_hexadecimal +* Added GDataYouTubeVideo:comments-feed-link, gdata_youtube_video_get_comments_feed_link +* Added GDataYouTubeVideo:recorded, gdata_youtube_video_get_recorded, gdata_youtube_video_set_recorded +* Added read_only parameter to gdata_gd_feed_link_new and member to GDataGDFeedLink +* Added GDataYouTubeQuery +* Added GDataAccessHandler, GDataAccessRule +* Added GDATA_SERVICE_ERROR_FORBIDDEN +* Added GDataParsable +* Changed GDataEntry to extend GDataParsable, rather than GObject +* Removed GDataEntry->parse_xml +* Changed GDataFeed to extend GDataParsable, rather than GObject +* Added GDataCalendarFeed +* Added GDataServiceClass->feed_type + +Bugs fixed: +* Bug 582026 – Access Control List functionality +* Bug 578367 – Add support for YouTube-specific query parameters +* Bug 581706 – translation issues +* Bug 580330 – Rejects empty entry titles + +Updated translations: +* de (Mario Blättermann) +* el (Giannis Katsampirhs) +* en_GB (Philip Withnall) +* es (Jorge González) +* gl (Fran Diéguez, Antón Méixome) + +Overview of changes from libgdata 0.1.0 to libgdata 0.2.0 +========================================================= + +Major changes: +* The updated entry is now returned when inserting an entry +* Entries can be updated with gdata_service_update_entry +* Entries can be deleted with gdata_service_delete_entry +* GDataService has proxy support with the proxy-uri property +* Redirects from the server are now handled correctly +* API documentation is now complete +* Unknown XML elements are stored and returned when building the XML for an entry +* ETag support for entries and feeds +* Added a Google Contacts service + +API changes: +* Added GDataEntry:etag, gdata_entry_get_etag +* Added gdata_entry_get_categories +* Added GDataFeed:etag, gdata_feed_get_etag +* Added gdata_feed_look_up_entry +* Added GDataGDWhen, gdata_gd_when_new, gdata_gd_when_free +* Added GDataGDEmailAddress, gdata_gd_email_address_new, gdata_gd_email_address_free +* Added GDataGDIMAddress, gdata_gd_im_address_new, gdata_gd_im_address_free +* Added GDataGDPhoneNumber, gdata_gd_phone_number_new, gdata_gd_phone_number_free +* Added GDataGDPostalAddress, gdata_gd_postal_address_new, gdata_gd_postal_address_free +* Added GDataGDOrganization, gdata_gd_organization_new, gdata_gd_organization_free +* Added GDataGDReminder, gdata_gd_reminder_new, gdata_gd_reminder_free +* Renamed GDataQuery:strict to GDataQuery:is-strict, gdata_query_get_strict to gdata_query_is_strict, gdata_query_set_strict to gdata_query_set_is_strict +* Added GDataQuery:etag, gdata_query_get_etag, gdata_query_set_etag +* Added GDataService:proxy-uri, gdata_service_get_proxy_uri, gdata_service_set_proxy_uri +* Added gdata_service_update_entry +* Added gdata_service_update_entry +* Removed gdata_service_get_session +* Renamed GDataCalendarCalendar:hidden to GDataCalendarCalendar:is-hidden, gdata_calendar_calendar_get_hidden to gdata_calendar_calendar_is_hidden, + gdata_calendar_calendar_set_hidden to gdata_calendar_calendar_set_is_hidden +* Renamed GDataCalendarCalendar:selected to GDataCalendarCalendar:is-selected, + gdata_calendar_calendar_get_selected to gdata_calendar_calendar_is_selected, + gdata_calendar_calendar_set_selected to gdata_calendar_calendar_set_is_selected +* Renamed GDataCalendarEvent:event-status to GDataCalendarEvent:status, gdata_calendar_event_get_event_status to gdata_calendar_event_get_status, + gdata_calendar_event_set_event_status to gdata_calendar_event_set_status +* Added gdata_calendar_event_get_people +* Added gdata_calendar_event_get_places +* Added gdata_calendar_event_add_time, gdata_calendar_event_get_times, gdata_calendar_event_get_primary_time +* Removed gdata_calendar_event_set_edited +* Made GDataCalendarEvent:edited read-only +* Removed gdata_calendar_event_get_start_time, gdata_calendar_event_set_start_time, gdata_calendar_event_get_end_time, gdata_calendar_event_set_end_time, + gdata_calendar_event_get_when_value, gdata_calendar_event_set_when_value +* Renamed GDataCalendarQuery:ctz to GDataCalendarQuery:timezone, gdata_calendar_query_get_ctz to gdata_calendar_query_get_timezone, + gdata_calendar_query_set_ctz to gdata_calendar_query_set_timezone +* Added gdata_calendar_service_insert_event +* Renamed g_time_val_get_type to gdata_g_time_val_get_type +* Added Google Contacts service API + +Bugs fixed: +* Bug 579631 – Add G_GNUC_WARN_UNUSED_RESULT to functions +* Bug 578661 – ETag support +* Bug 578662 – Support unknown XML elements +* Bug 578653 – self-test fails to build on glib-2.18.x +* Bug 578652 – Build failure: missing symbol: gdata_query_param_get_type + +Updated translations: +* de (Mario Blättermann) +* en_GB (Philip Withnall) +* sv (Daniel Nylander) + +Overview of changes from libgdata 0.1.0 to libgdata 0.1.1 +========================================================= + +Major changes: +* Fixed licencing issues +* Changed website to http://live.gnome.org/libgdata + +API changes: +* Renamed gdata_entry_lookup_link to gdata_entry_look_up_link +* Renamed gdata_feed_lookup_link to gdata_feed_look_up_link + +Initial release of libgdata 0.1.0 +================================= + +Major changes: +* Create project +* Add mostly-complete support for YouTube queries and video uploads +* Add basic and incomplete support for Google Calendar queries diff --git a/README b/README new file mode 100644 index 0000000..b0f38c3 --- /dev/null +++ b/README @@ -0,0 +1,64 @@ +libgdata +======== + +libgdata is a GLib-based library for accessing online service APIs using the +GData protocol --- most notably, Google's services. It provides APIs to access +the common Google services, and has full asynchronous support. + +See the test programs in gdata/tests/ for simple examples of how to use the +code. + +libgdata is API and ABI stable. + +Dependencies +============ + + • glib-2.0 ≥ 2.44.0 + • libxml-2.0 + • gio-2.0 ≥ 2.44.0 + • libsoup-2.4 ≥ 2.42.0 + • liboauth ≥ 0.9.4 + • json-glib ≥ 0.15.0 + +If compiling with --enable-gnome (for GNOME support): + • gcr-base-3 + • goa-1.0 ≥ 3.8 + +If compiling the demos: + • gtk+-3.0 ≥ 2.91.2 + +Environment variables +===================== + +If the environment variable LIBGDATA_DEBUG is set to one of the following +values, libgdata will give debug output (at various levels): + 0: Output no debug messages or network logs + 1: Output debug messages, but not network logs + 2: Output debug messages and network traffic headers + 3: Output debug messages and full network traffic logs, redacting usernames, + passwords and auth. tokens + 4: Output debug messages and full network traffic logs, and don't redact + usernames, passwords and auth. tokens +If LIBGDATA_DEBUG is unset, no debug output will be produced. + +So, to debug a program which uses libgdata, run it from a terminal with the +following command: + +$ LIBGDATA_DEBUG=3 ./my-program-name &> libgdata.log + +Deprecation guards +================== + +If LIBGDATA_DISABLE_DEPRECATED is defined when compiling against libgdata, all +deprecated API will be removed from included headers. + +Licensing +========= + +libgdata is licensed under the LGPL; see COPYING for more details. + +Contact +======= + +Philip Withnall <philip@tecnocode.co.uk> +https://wiki.gnome.org/Projects/libgdata diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..7df50ad --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1177 @@ +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.15' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.15], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.15])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: <http://www.gnu.org/software/coreutils/>. + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + AM_RUN_LOG([cat conftest.dir/file]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/ax_append_compile_flags.m4]) +m4_include([m4/ax_append_flag.m4]) +m4_include([m4/ax_append_link_flags.m4]) +m4_include([m4/ax_check_compile_flag.m4]) +m4_include([m4/ax_check_link_flag.m4]) +m4_include([m4/ax_code_coverage.m4]) +m4_include([m4/ax_compiler_flags.m4]) +m4_include([m4/ax_compiler_flags_cflags.m4]) +m4_include([m4/ax_compiler_flags_cxxflags.m4]) +m4_include([m4/ax_compiler_flags_gir.m4]) +m4_include([m4/ax_compiler_flags_ldflags.m4]) +m4_include([m4/ax_generate_changelog.m4]) +m4_include([m4/ax_is_release.m4]) +m4_include([m4/ax_require_defined.m4]) +m4_include([m4/gtk-doc.m4]) +m4_include([m4/intltool.m4]) +m4_include([m4/introspection.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) +m4_include([m4/nls.m4]) +m4_include([m4/pkg.m4]) +m4_include([m4/vapigen.m4]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..9bf7673 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. +test -n "$srcdir" || srcdir=$(dirname "$0") +test -n "$srcdir" || srcdir=. + +olddir=$(pwd) + +cd $srcdir + +(test -f configure.ac) || { + echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***" + exit 1 +} + +# shellcheck disable=SC2016 +PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac) + +if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then + echo "*** WARNING: I am going to run 'configure' with no arguments." >&2 + echo "*** If you wish to pass any to it, please specify them on the" >&2 + echo "*** '$0' command line." >&2 + echo "" >&2 +fi + +aclocal --install || exit 1 +gtkdocize --copy || exit 1 +intltoolize --force --copy --automake || exit 1 +autoreconf --verbose --force --install || exit 1 + +cd "$olddir" +if [ "$NOCONFIGURE" = "" ]; then + $srcdir/configure "$@" || exit 1 + + if [ "$1" = "--help" ]; then exit 0 else + echo "Now type 'make' to compile $PKG_NAME" || exit 1 + fi +else + echo "Skipping configure process." +fi diff --git a/build-aux/compile b/build-aux/compile new file mode 100755 index 0000000..a85b723 --- /dev/null +++ b/build-aux/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Written by Tom Tromey <tromey@cygnus.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/config.guess b/build-aux/config.guess new file mode 100755 index 0000000..2e9ad7f --- /dev/null +++ b/build-aux/config.guess @@ -0,0 +1,1462 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-10-02' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to <config-patches@gnu.org>. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include <features.h> + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = hppa2.0w ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&2 <<EOF +$0: unable to guess system type + +This script (version $timestamp), has failed to recognize the +operating system you are using. If your script is old, overwrite +config.guess and config.sub with the latest versions from: + + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +and + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build-aux/config.sub b/build-aux/config.sub new file mode 100755 index 0000000..7b334f9 --- /dev/null +++ b/build-aux/config.sub @@ -0,0 +1,1823 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-09-05' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to <config-patches@gnu.org>. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build-aux/depcomp b/build-aux/depcomp new file mode 100755 index 0000000..fc98710 --- /dev/null +++ b/build-aux/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/install-sh b/build-aux/install-sh new file mode 100755 index 0000000..0b0fdcb --- /dev/null +++ b/build-aux/install-sh @@ -0,0 +1,501 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2013-12-25.23; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh new file mode 100644 index 0000000..0f0a2da --- /dev/null +++ b/build-aux/ltmain.sh @@ -0,0 +1,11147 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 + +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 + +# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.6 +package_revision=2.4.6 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# func_quote_for_expand ARG +# ------------------------- +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + $debug_cmd + + case $1 in + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) + _G_arg=$1 ;; + esac + + case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_arg=\"$_G_arg\" + ;; + esac + + func_quote_for_expand_result=$_G_arg +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '<hooked_function_name>_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + func_parse_options_result= + + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + $debug_cmd + + $warning_func ${1+"$@"} +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname (GNU libtool) 2.4.6 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to <bug-libtool@gnu.org>. +GNU libtool home page: <http://www.gnu.org/software/libtool/>. +General help using GNU software: <http://www.gnu.org/gethelp/>." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." +} + + +# func_config +# ----------- +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + + +# func_features +# ------------- +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + + +# func_enable_tag TAGNAME +# ----------------------- +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=$1 + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + + +# func_check_version_match +# ------------------------ +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + + nonopt= + preserve_args= + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if 'file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test yes = "$lalib_p" +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# 'FILE.' does not work on cygwin managed mounts. +func_source () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with '--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <<EOF +# $write_libobj - a libtool object file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object=$write_lobj + +# Name of the non-PIC object +non_pic_object=$write_oldobj + +EOF + $MV "${write_libobj}T" "$write_libobj" + } +} + + +################################################## +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # +################################################## + +# func_convert_core_file_wine_to_w32 ARG +# Helper function used by file name conversion functions when $build is *nix, +# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. +# +# ARG is the $build file name to be converted to w32 format. +# Result is available in $func_convert_core_file_wine_to_w32_result, and will +# be empty on error (or when ARG is empty) +func_convert_core_file_wine_to_w32 () +{ + $debug_cmd + + func_convert_core_file_wine_to_w32_result=$1 + if test -n "$1"; then + # Unfortunately, winepath does not exit with a non-zero error code, so we + # are forced to check the contents of stdout. On the other hand, if the + # command is not found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both error code of + # zero AND non-empty stdout, which explains the odd construction: + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # Get the compilation command and the source file. + base_compile= + srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=$arg + arg_mode=normal + ;; + + target ) + libobj=$arg + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs=$IFS; IFS=, + for arg in $args; do + IFS=$save_ifs + func_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=$srcfile + srcfile=$arg + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=$func_basename_result + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a 'standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to '-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the '--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the 'install' or 'cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with '-') are ignored. + +Every other argument is treated as a filename. Files ending in '.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. + +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # The first argument is the command name. + cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=$func_dirname_result + ;; + + *) + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=$progdir/$program + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=\$cmd$args + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir=$func_dirname_result + destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking '$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=$1 + shift + + srcname=$realname + test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=$func_basename_result + instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest=$destfile + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=.exe + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script '$wrapper'" + + finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=$outputname + else + func_warning "cannot relink '$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=$func_basename_result + + # Set up the ranlib parameters. + oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test install = "$opt_mode" && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" + name=$func_basename_result + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen <import library>. + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 </dev/null >/dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. + symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $debug_cmd + + my_gentop=$1; shift + my_oldlibs=${1+"$@"} + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory where it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + \$ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat <<EOF + +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname + Generated by $PROGRAM (GNU $PACKAGE) $VERSION + + The $output program cannot be directly executed until all the libtool + libraries that it depends on are installed. + + This wrapper executable should never be moved out of the build directory. + If it is, it will not operate correctly. +*/ +EOF + cat <<"EOF" +#ifdef _MSC_VER +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif +#include <stdio.h> +#include <stdlib.h> +#ifdef _MSC_VER +# include <direct.h> +# include <process.h> +# include <io.h> +#else +# include <unistd.h> +# include <stdint.h> +# ifdef __CYGWIN__ +# include <io.h> +# endif +#endif +#include <malloc.h> +#include <stdarg.h> +#include <assert.h> +#include <string.h> +#include <ctype.h> +#include <errno.h> +#include <fcntl.h> +#include <sys/stat.h> + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#if defined PATH_MAX +# define LT_PATHMAX PATH_MAX +#elif defined MAXPATHLEN +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <<EOF +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) +# define externally_visible volatile +#else +# define externally_visible __attribute__((externally_visible)) volatile +#endif +externally_visible const char * MAGIC_EXE = "$magic_exe"; +const char * LIB_PATH_VARNAME = "$shlibpath_var"; +EOF + + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + func_to_host_path "$temp_rpath" + cat <<EOF +const char * LIB_PATH_VALUE = "$func_to_host_path_result"; +EOF + else + cat <<"EOF" +const char * LIB_PATH_VALUE = ""; +EOF + fi + + if test -n "$dllsearchpath"; then + func_to_host_path "$dllsearchpath:" + cat <<EOF +const char * EXE_PATH_VARNAME = "PATH"; +const char * EXE_PATH_VALUE = "$func_to_host_path_result"; +EOF + else + cat <<"EOF" +const char * EXE_PATH_VARNAME = ""; +const char * EXE_PATH_VALUE = ""; +EOF + fi + + if test yes = "$fast_install"; then + cat <<EOF +const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */ +EOF + else + cat <<EOF +const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */ +EOF + fi + + + cat <<"EOF" + +#define LTWRAPPER_OPTION_PREFIX "--lt-" + +static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX; +static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script"; +static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug"; + +int +main (int argc, char *argv[]) +{ + char **newargz; + int newargc; + char *tmp_pathspec; + char *actual_cwrapper_path; + char *actual_cwrapper_name; + char *target_name; + char *lt_argv_zero; + int rval = 127; + + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + newargz = XMALLOC (char *, (size_t) argc + 1); + + /* very simple arg parsing; don't want to rely on getopt + * also, copy all non cwrapper options to newargz, except + * argz[0], which is handled differently + */ + newargc=0; + for (i = 1; i < argc; i++) + { + if (STREQ (argv[i], dumpscript_opt)) + { +EOF + case $host in + *mingw* | *cygwin* ) + # make stdout use "unix" line endings + echo " setmode(1,_O_BINARY);" + ;; + esac + + cat <<"EOF" + lt_dump_script (stdout); + return 0; + } + if (STREQ (argv[i], debug_opt)) + { + lt_debug = 1; + continue; + } + if (STREQ (argv[i], ltwrapper_option_prefix)) + { + /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX + namespace, but it is not one of the ones we know about and + have already dealt with, above (inluding dump-script), then + report an error. Otherwise, targets might begin to believe + they are allowed to use options in the LTWRAPPER_OPTION_PREFIX + namespace. The first time any user complains about this, we'll + need to make LTWRAPPER_OPTION_PREFIX a configure-time option + or a configure.ac-settable value. + */ + lt_fatal (__FILE__, __LINE__, + "unrecognized %s option: '%s'", + ltwrapper_option_prefix, argv[i]); + } + /* otherwise ... */ + newargz[++newargc] = xstrdup (argv[i]); + } + newargz[++newargc] = NULL; + +EOF + cat <<EOF + /* The GNU banner must be the first non-error debug message */ + lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n"); +EOF + cat <<"EOF" + lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]); + lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name); + + tmp_pathspec = find_executable (argv[0]); + if (tmp_pathspec == NULL) + lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]); + lt_debugprintf (__FILE__, __LINE__, + "(main) found exe (before symlink chase) at: %s\n", + tmp_pathspec); + + actual_cwrapper_path = chase_symlinks (tmp_pathspec); + lt_debugprintf (__FILE__, __LINE__, + "(main) found exe (after symlink chase) at: %s\n", + actual_cwrapper_path); + XFREE (tmp_pathspec); + + actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path)); + strendzap (actual_cwrapper_path, actual_cwrapper_name); + + /* wrapper name transforms */ + strendzap (actual_cwrapper_name, ".exe"); + tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1); + XFREE (actual_cwrapper_name); + actual_cwrapper_name = tmp_pathspec; + tmp_pathspec = 0; + + /* target_name transforms -- use actual target program name; might have lt- prefix */ + target_name = xstrdup (base_name (TARGET_PROGRAM_NAME)); + strendzap (target_name, ".exe"); + tmp_pathspec = lt_extend_str (target_name, ".exe", 1); + XFREE (target_name); + target_name = tmp_pathspec; + tmp_pathspec = 0; + + lt_debugprintf (__FILE__, __LINE__, + "(main) libtool target name: %s\n", + target_name); +EOF + + cat <<EOF + newargz[0] = + XMALLOC (char, (strlen (actual_cwrapper_path) + + strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1)); + strcpy (newargz[0], actual_cwrapper_path); + strcat (newargz[0], "$objdir"); + strcat (newargz[0], "/"); +EOF + + cat <<"EOF" + /* stop here, and copy so we don't have to do this twice */ + tmp_pathspec = xstrdup (newargz[0]); + + /* do NOT want the lt- prefix here, so use actual_cwrapper_name */ + strcat (newargz[0], actual_cwrapper_name); + + /* DO want the lt- prefix here if it exists, so use target_name */ + lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1); + XFREE (tmp_pathspec); + tmp_pathspec = NULL; +EOF + + case $host_os in + mingw*) + cat <<"EOF" + { + char* p; + while ((p = strchr (newargz[0], '\\')) != NULL) + { + *p = '/'; + } + while ((p = strchr (lt_argv_zero, '\\')) != NULL) + { + *p = '/'; + } + } +EOF + ;; + esac + + cat <<"EOF" + XFREE (target_name); + XFREE (actual_cwrapper_path); + XFREE (actual_cwrapper_name); + + lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */ + lt_setenv ("DUALCASE", "1"); /* for MSK sh */ + /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must + be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath) + because on Windows, both *_VARNAMEs are PATH but uninstalled + libraries must come first. */ + lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); + lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE); + + lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", + nonnull (lt_argv_zero)); + for (i = 0; i < newargc; i++) + { + lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", + i, nonnull (newargz[i])); + } + +EOF + + case $host_os in + mingw*) + cat <<"EOF" + /* execv doesn't actually work on mingw as expected on unix */ + newargz = prepare_spawn (newargz); + rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + if (rval == -1) + { + /* failed to start process */ + lt_debugprintf (__FILE__, __LINE__, + "(main) failed to launch target \"%s\": %s\n", + lt_argv_zero, nonnull (strerror (errno))); + return 127; + } + return rval; +EOF + ;; + *) + cat <<"EOF" + execv (lt_argv_zero, newargz); + return rval; /* =127, but avoids unused variable warning */ +EOF + ;; + esac + + cat <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void *p = (void *) malloc (num); + if (!p) + lt_fatal (__FILE__, __LINE__, "memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), + string) : NULL; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined HAVE_DOS_BASED_FILE_SYSTEM + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char) name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable (const char *path) +{ + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined HAVE_DOS_BASED_FILE_SYSTEM + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined HAVE_DOS_BASED_FILE_SYSTEM + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = (size_t) (q - p); + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=$1 + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols=$arg + test -f "$arg" \ + || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex=$arg + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; + precious_regex) + precious_files_regex=$arg + prev= + continue + ;; + release) + release=-$arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg=$arg + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between '-L' and '$1'" + else + func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test X-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module=$wl-multi_module + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -os2dllname) + prev=os2dllname + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -stdlib=* select c++ std lib with clang + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + } + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the '$prevarg' option requires an argument" + + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname=$func_basename_result + libobjs_save=$libobjs + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + + func_dirname "$output" "/" "" + output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test lib = "$linkmode"; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=false + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test lib,link = "$linkmode,$pass"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs=$tmp_deplibs + fi + + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs + deplibs= + fi + if test prog = "$linkmode"; then + case $pass in + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=$dlprefiles + fi + if test dlopen = "$pass"; then + # Collect dlpreopened libraries + save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= + found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test lib = "$linkmode"; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib=$searchdir/lib$name$search_ext + if test -f "$lib"; then + if test .la = "$search_ext"; then + found=: + else + found=false + fi + break 2 + fi + done + done + if $found; then + # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll=$l + done + if test "X$ll" = "X$old_library"; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir=$func_dirname_result + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + *.ltframework) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=: + fi + ;; + pass_all) + valid_a_lib=: + ;; + esac + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + fi + ;; + esac + continue + ;; + prog) + if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=: + continue + ;; + esac # case $deplib + + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "'$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir=$func_dirname_result + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test conv = "$pass"; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib=$l + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + + # This library was specified with -dlopen. + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir=$ladir + fi + ;; + esac + func_basename "$lib" + laname=$func_basename_result + + # Find the relevant object directory and library name. + if test yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir + else + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir + fi + test yes = "$hardcode_automatic" && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir=$ladir + absdir=$abs_ladir + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi + case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" + elif test prog,link = "$linkmode,$pass"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if $linkalldeplibs; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + # Make sure the rpath contains only unique directories. + case $temp_rpath: in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && + { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc* | *os2*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test no = "$installed"; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule= + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule=$dlpremoduletest + break + fi + done + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + echo + if test prog = "$linkmode"; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname=$1 + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname=$dlname + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc* | *os2*) + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + esac + eval soname=\"$soname_spec\" + else + soname=$realname + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot=$soname + func_basename "$soroot" + soname=$func_basename_result + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from '$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for '$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test no = "$hardcode_direct"; then + add=$dir/$linklib + case $host in + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir=-L$dir ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we cannot + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library"; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add=$dir/$old_library + fi + elif test -n "$old_library"; then + add=$dir/$old_library + fi + fi + esac + elif test no = "$hardcode_minus_L"; then + case $host in + *-*-sunos*) add_shlibpath=$dir ;; + esac + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + relink) + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test prog = "$linkmode"; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=-l$name + elif test yes = "$hardcode_automatic"; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib + else + add=$libdir/$linklib + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir=-L$libdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + fi + + if test prog = "$linkmode"; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test prog = "$linkmode"; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test yes = "$build_libtool_libs"; then + # Not a shared library + if test pass_all != "$deplibs_check_method"; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system cannot link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test yes = "$module"; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test lib = "$linkmode"; then + if test -n "$dependency_libs" && + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + path= + fi + fi + ;; + *) + path=-L$absdir/$objdir + ;; + esac + else + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "'$deplib' seems to be moved" + + path=-L$absdir + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test link = "$pass"; then + if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test dlopen != "$pass"; then + test conv = "$pass" || { + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + } + + if test prog,link = "$linkmode,$pass"; then + vars="compile_deplibs finalize_deplibs" + else + vars=deplibs + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i= + ;; + esac + if test -n "$i"; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test prog = "$linkmode"; then + dlfiles=$newdlfiles + fi + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "'-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "'-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs=$output + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form 'libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" + + if test no != "$need_lib_prefix"; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" + + install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then + if test yes = "$build_libtool_libs"; then + # Building a libtool convenience library. + # Some compilers have problems with a '.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "'-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs=$IFS; IFS=: + set dummy $vinfo 0 0 0 + shift + IFS=$save_ifs + + test -n "$7" && \ + func_fatal_help "too many parameters to '-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major=$1 + number_minor=$2 + number_revision=$3 + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|freebsd-elf|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_revision + ;; + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_minor + lt_irix_increment=no + ;; + esac + ;; + no) + current=$1 + revision=$2 + age=$3 + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac + ;; + + freebsd-aout) + major=.$current + versuffix=.$current.$revision + ;; + + freebsd-elf) + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + irix | nonstopux) + if test no = "$lt_irix_increment"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring=$verstring_prefix$major.$revision + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test 0 -ne "$loop"; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring_prefix$major.$iface:$verstring + done + + # Before this point, $major must not contain '.'. + major=.$major + versuffix=$major.$revision + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision + + # Add in all the interfaces that we are compatible with. + loop=$age + while test 0 -ne "$loop"; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring:$iface.0 + done + + # Make executables depend on our current version. + func_append verstring ":$current.0" + ;; + + qnx) + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current + ;; + + sunos) + major=.$current + versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + + *) + func_fatal_configuration "unknown library version type '$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring=0.0 + ;; + esac + if test no = "$need_version"; then + versuffix= + else + versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided + if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= + verstring= + fi + + # Check to see if the archive will have undefined symbols. + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=$no_undefined_flag + fi + + fi + + func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" + test " " = "$libobjs" && libobjs= + + if test relink != "$opt_mode"; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles=$dlfiles + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles=$dlprefiles + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test yes = "$build_libtool_need_lc"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release= + versuffix= + major= + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c <<EOF + int main() { return 0; } +EOF + $opt_dry_run || $RM conftest + if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then + ldd_output=`ldd conftest` + for i in $deplibs; do + case $i in + -l*) + func_stripname -l '' "$i" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $i "*) + func_append newdeplibs " $i" + i= + ;; + esac + fi + if test -n "$i"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + set dummy $deplib_matches; shift + deplib_match=$1 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + func_append newdeplibs " $i" + else + droppeddeps=yes + echo + $ECHO "*** Warning: dynamic linker does not accept needed library $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." + fi + fi + ;; + *) + func_append newdeplibs " $i" + ;; + esac + done + else + # Error occurred in the first compile. Let's try to salvage + # the situation: Compile a separate program for each library. + for i in $deplibs; do + case $i in + -l*) + func_stripname -l '' "$i" + name=$func_stripname_result + $opt_dry_run || $RM conftest + if $LTCC $LTCFLAGS -o conftest conftest.c $i; then + ldd_output=`ldd conftest` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $i "*) + func_append newdeplibs " $i" + i= + ;; + esac + fi + if test -n "$i"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + set dummy $deplib_matches; shift + deplib_match=$1 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + func_append newdeplibs " $i" + else + droppeddeps=yes + echo + $ECHO "*** Warning: dynamic linker does not accept needed library $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." + fi + fi + else + droppeddeps=yes + echo + $ECHO "*** Warning! Library $i is needed by this library but I was not able to" + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." + fi + ;; + *) + func_append newdeplibs " $i" + ;; + esac + done + fi + ;; + file_magic*) + set dummy $deplibs_check_method; shift + file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + if test -n "$file_magic_glob"; then + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` + else + libnameglob=$libname + fi + test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + if test yes = "$want_nocaseglob"; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib=$potent_lib + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib=$potent_lib # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test none = "$deplibs_check_method"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test yes = "$droppeddeps"; then + if test yes = "$module"; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test no = "$allow_undefined"; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs=$new_libs + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname=$1 + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname=$realname + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib=$output_objdir/$realname + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + func_dll_def_p "$export_symbols" || { + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols=$export_symbols + export_symbols= + always_export_symbols=yes + } + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs=$IFS; IFS='~' + for cmd1 in $cmds; do + IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test yes = "$compiler_needs_object" && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test : != "$skipped_export" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-$k.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test -z "$objlist" || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-$k.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-$k.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + } + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs=$IFS; IFS='~' + for cmd in $concat_cmds; do + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + ${skipped_export-false} && { + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + } + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs=$IFS; IFS='~' + for cmd in $cmds; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. + dlname=$soname + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "'-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object '$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj=$output + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + else + gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + + output=$obj + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + test yes = "$build_libtool_libs" || { + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + } + + if test -n "$pic_flag" || test default != "$pic_mode"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output=$libobj + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "'-release' is ignored for programs" + + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath=$rpath + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath=$rpath + + if test -n "$libobjs" && test yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=false + ;; + *cygwin* | *mingw* ) + test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false + fi + ;; + esac + $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=$compile_command$compile_rpath + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + fi + + exit $exit_status + } + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test yes = "$no_install"; then + # We don't need to create a wrapper script. + link_command=$compile_var$compile_command$compile_rpath + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host"; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience + build_libtool_libs=no + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) + oldobjs="$old_deplibs $non_pic_objects" + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac + + if test -n "$addlibs"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase=$func_basename_result + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj"; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test -z "$oldobjs"; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test yes = "$build_old_libs" && old_library=$libname.$libext + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test yes = "$installed"; then + if test -z "$install_libdir"; then + break + fi + output=$output_objdir/${outputname}i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name=$func_basename_result + func_resolve_sysroot "$deplib" + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs=$newdependency_libs + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles=$newdlprefiles + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test no,yes = "$installed,$need_relink"; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $debug_cmd + + RM=$nonopt + files= + rmforce=false + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir + else + odir=$dir/$objdir + fi + func_basename "$file" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates + if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif $rmforce; then + continue + fi + + rmfiles=$file + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && test none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test clean = "$opt_mode"; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the $objdir's in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi + +test -z "$opt_mode" && { + help=$generic_help + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode '$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# where we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/build-aux/missing b/build-aux/missing new file mode 100755 index 0000000..f62bbae --- /dev/null +++ b/build-aux/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2013-10-28.13; # UTC + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to <bug-automake@gnu.org>." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/test-driver b/build-aux/test-driver new file mode 100755 index 0000000..8e575b0 --- /dev/null +++ b/build-aux/test-driver @@ -0,0 +1,148 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2013-07-13.22; # UTC + +# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <<END +Usage: + test-driver --test-name=NAME --log-file=PATH --trs-file=PATH + [--expect-failure={yes|no}] [--color-tests={yes|no}] + [--enable-hard-errors={yes|no}] [--] + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] +The '--test-name', '--log-file' and '--trs-file' options are mandatory. +END +} + +test_name= # Used for reporting. +log_file= # Where to save the output of the test script. +trs_file= # Where to save the metadata of the test run. +expect_failure=no +color_tests=no +enable_hard_errors=yes +while test $# -gt 0; do + case $1 in + --help) print_usage; exit $?;; + --version) echo "test-driver $scriptversion"; exit $?;; + --test-name) test_name=$2; shift;; + --log-file) log_file=$2; shift;; + --trs-file) trs_file=$2; shift;; + --color-tests) color_tests=$2; shift;; + --expect-failure) expect_failure=$2; shift;; + --enable-hard-errors) enable_hard_errors=$2; shift;; + --) shift; break;; + -*) usage_error "invalid option: '$1'";; + *) break;; + esac + shift +done + +missing_opts= +test x"$test_name" = x && missing_opts="$missing_opts --test-name" +test x"$log_file" = x && missing_opts="$missing_opts --log-file" +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" +if test x"$missing_opts" != x; then + usage_error "the following mandatory options are missing:$missing_opts" +fi + +if test $# -eq 0; then + usage_error "missing argument" +fi + +if test $color_tests = yes; then + # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. + red='' # Red. + grn='' # Green. + lgn='' # Light green. + blu='' # Blue. + mgn='' # Magenta. + std='' # No color. +else + red= grn= lgn= blu= mgn= std= +fi + +do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' +trap "st=129; $do_exit" 1 +trap "st=130; $do_exit" 2 +trap "st=141; $do_exit" 13 +trap "st=143; $do_exit" 15 + +# Test script is run here. +"$@" >$log_file 2>&1 +estatus=$? + +if test $enable_hard_errors = no && test $estatus -eq 99; then + tweaked_estatus=1 +else + tweaked_estatus=$estatus +fi + +case $tweaked_estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..b143496 --- /dev/null +++ b/config.h.in @@ -0,0 +1,135 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to the Gettext package name */ +#undef GETTEXT_PACKAGE + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + +/* Defined if gdk-pixbuf is installed */ +#undef HAVE_GDK_PIXBUF + +/* Defined if GNOME support is enabled */ +#undef HAVE_GNOME + +/* Define if GOA support is enabled */ +#undef HAVE_GOA + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define if the new SoupServer API is available */ +#undef HAVE_LIBSOUP_2_55_90 + +/* Define to 1 if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE diff --git a/configure b/configure new file mode 100755 index 0000000..11963bb --- /dev/null +++ b/configure @@ -0,0 +1,23120 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for libgdata 0.17.9. +# +# Report bugs to <https://bugzilla.gnome.org/enter_bug.cgi?product=libgdata>. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: https://bugzilla.gnome.org/enter_bug.cgi?product=libgdata +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libgdata' +PACKAGE_TARNAME='libgdata' +PACKAGE_VERSION='0.17.9' +PACKAGE_STRING='libgdata 0.17.9' +PACKAGE_BUGREPORT='https://bugzilla.gnome.org/enter_bug.cgi?product=libgdata' +PACKAGE_URL='https://wiki.gnome.org/Projects/libgdata' + +ac_unique_file="gdata/gdata.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +GTK_DOC_USE_REBASE_FALSE +GTK_DOC_USE_REBASE_TRUE +GTK_DOC_USE_LIBTOOL_FALSE +GTK_DOC_USE_LIBTOOL_TRUE +GTK_DOC_BUILD_PDF_FALSE +GTK_DOC_BUILD_PDF_TRUE +GTK_DOC_BUILD_HTML_FALSE +GTK_DOC_BUILD_HTML_TRUE +ENABLE_GTK_DOC_FALSE +ENABLE_GTK_DOC_TRUE +HAVE_GTK_DOC_FALSE +HAVE_GTK_DOC_TRUE +GTKDOC_DEPS_LIBS +GTKDOC_DEPS_CFLAGS +HTML_DIR +GTKDOC_MKPDF +GTKDOC_REBASE +GTKDOC_CHECK_PATH +GTKDOC_CHECK +AM_LDFLAGS +AM_CXXFLAGS +AM_CFLAGS +AM_CPPFLAGS +ENABLE_VAPIGEN_FALSE +ENABLE_VAPIGEN_TRUE +VAPIGEN_MAKEFILE +VAPIGEN_VAPIDIR +VAPIGEN +HAVE_INTROSPECTION_FALSE +HAVE_INTROSPECTION_TRUE +INTROSPECTION_MAKEFILE +INTROSPECTION_LIBS +INTROSPECTION_CFLAGS +INTROSPECTION_TYPELIBDIR +INTROSPECTION_GIRDIR +INTROSPECTION_GENERATE +INTROSPECTION_COMPILER +INTROSPECTION_SCANNER +WARN_SCANNERFLAGS +WARN_LDFLAGS +WARN_CXXFLAGS +WARN_CFLAGS +CODE_COVERAGE_RULES +CODE_COVERAGE_LDFLAGS +CODE_COVERAGE_LIBS +CODE_COVERAGE_CXXFLAGS +CODE_COVERAGE_CFLAGS +CODE_COVERAGE_CPPFLAGS +GENHTML +LCOV +GCOV +CODE_COVERAGE_ENABLED +CODE_COVERAGE_ENABLED_FALSE +CODE_COVERAGE_ENABLED_TRUE +ALL_LINGUAS +INTLTOOL_PERL +GMSGFMT +MSGFMT +MSGMERGE +XGETTEXT +INTLTOOL_POLICY_RULE +INTLTOOL_SERVICE_RULE +INTLTOOL_THEME_RULE +INTLTOOL_SCHEMAS_RULE +INTLTOOL_CAVES_RULE +INTLTOOL_XML_NOMERGE_RULE +INTLTOOL_XML_RULE +INTLTOOL_KBD_RULE +INTLTOOL_XAM_RULE +INTLTOOL_UI_RULE +INTLTOOL_SOUNDLIST_RULE +INTLTOOL_SHEET_RULE +INTLTOOL_SERVER_RULE +INTLTOOL_PONG_RULE +INTLTOOL_OAF_RULE +INTLTOOL_PROP_RULE +INTLTOOL_KEYS_RULE +INTLTOOL_DIRECTORY_RULE +INTLTOOL_DESKTOP_RULE +intltool__v_merge_options_0 +intltool__v_merge_options_ +INTLTOOL_V_MERGE_OPTIONS +INTLTOOL__v_MERGE_0 +INTLTOOL__v_MERGE_ +INTLTOOL_V_MERGE +INTLTOOL_EXTRACT +INTLTOOL_MERGE +INTLTOOL_UPDATE +USE_NLS +GETTEXT_PACKAGE +UHTTPMOCK_LIBS +UHTTPMOCK_CFLAGS +ENABLE_INSTALLED_TESTS +ENABLE_INSTALLED_TESTS_FALSE +ENABLE_INSTALLED_TESTS_TRUE +ENABLE_ALWAYS_BUILD_TESTS +ENABLE_ALWAYS_BUILD_TESTS_FALSE +ENABLE_ALWAYS_BUILD_TESTS_TRUE +GOA_ENABLED +GNOME_PACKAGES +GNOME_PACKAGES_PRIVATE +GNOME_PACKAGES_PUBLIC +GNOME_LIBS +GNOME_CFLAGS +ENABLE_GOA_FALSE +ENABLE_GOA_TRUE +ENABLE_GNOME_FALSE +ENABLE_GNOME_TRUE +HAVE_GTK_FALSE +HAVE_GTK_TRUE +GTK_LIBS +GTK_CFLAGS +GDK_PIXBUF_LIBS +GDK_PIXBUF_CFLAGS +LIBSOUP_LIBS +LIBSOUP_CFLAGS +GDATA_LIBS +GDATA_CFLAGS +GDATA_PACKAGES +GDATA_PACKAGES_PRIVATE +GDATA_PACKAGES_PUBLIC +GDATA_API_VERSION_MINOR +GDATA_API_VERSION_MAJOR +GDATA_API_VERSION +GDATA_VERSION_MICRO +GDATA_VERSION_MINOR +GDATA_VERSION_MAJOR +GDATA_LT_VERSION +GLIB_MKENUMS +GLIB_GENMARSHAL +GENERATE_CHANGELOG_RULES +GIT +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +CXXCPP +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_silent_rules +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_gnome +enable_goa +enable_always_build_tests +enable_installed_tests +enable_nls +with_gcov +enable_code_coverage +enable_compile_warnings +enable_Werror +enable_introspection +enable_vala +with_html_dir +enable_gtk_doc +enable_gtk_doc_html +enable_gtk_doc_pdf +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +LT_SYS_LIBRARY_PATH +CXXCPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +GDATA_CFLAGS +GDATA_LIBS +LIBSOUP_CFLAGS +LIBSOUP_LIBS +GDK_PIXBUF_CFLAGS +GDK_PIXBUF_LIBS +GTK_CFLAGS +GTK_LIBS +GNOME_CFLAGS +GNOME_LIBS +UHTTPMOCK_CFLAGS +UHTTPMOCK_LIBS +GTKDOC_DEPS_CFLAGS +GTKDOC_DEPS_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libgdata 0.17.9 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libgdata] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of libgdata 0.17.9:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-gnome Whether to enable GNOME support + --enable-goa Whether to enable GOA support + --enable-always-build-tests + Enable always building tests (default: yes) + --enable-installed-tests + Install test programs (default: no) + --disable-nls do not use Native Language Support + --enable-code-coverage Whether to enable code coverage support + --enable-compile-warnings=[no/yes/error] + Enable compiler warnings and errors + --disable-Werror Unconditionally make all compiler warnings non-fatal + --enable-introspection=[no/auto/yes] + Enable introspection for this build + --enable-vala=[no/auto/yes] + build Vala bindings [default=auto] + --enable-gtk-doc use gtk-doc to build documentation [[default=no]] + --enable-gtk-doc-html build documentation in html format [[default=yes]] + --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). + --with-html-dir=PATH path to installed docs + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + CXXCPP C++ preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + GDATA_CFLAGS + C compiler flags for GDATA, overriding pkg-config + GDATA_LIBS linker flags for GDATA, overriding pkg-config + LIBSOUP_CFLAGS + C compiler flags for LIBSOUP, overriding pkg-config + LIBSOUP_LIBS + linker flags for LIBSOUP, overriding pkg-config + GDK_PIXBUF_CFLAGS + C compiler flags for GDK_PIXBUF, overriding pkg-config + GDK_PIXBUF_LIBS + linker flags for GDK_PIXBUF, overriding pkg-config + GTK_CFLAGS C compiler flags for GTK, overriding pkg-config + GTK_LIBS linker flags for GTK, overriding pkg-config + GNOME_CFLAGS + C compiler flags for GNOME, overriding pkg-config + GNOME_LIBS linker flags for GNOME, overriding pkg-config + UHTTPMOCK_CFLAGS + C compiler flags for UHTTPMOCK, overriding pkg-config + UHTTPMOCK_LIBS + linker flags for UHTTPMOCK, overriding pkg-config + GTKDOC_DEPS_CFLAGS + C compiler flags for GTKDOC_DEPS, overriding pkg-config + GTKDOC_DEPS_LIBS + linker flags for GTKDOC_DEPS, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <https://bugzilla.gnome.org/enter_bug.cgi?product=libgdata>. +libgdata home page: <https://wiki.gnome.org/Projects/libgdata>. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libgdata configure 0.17.9 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------------------------------------------ ## +## Report this to https://bugzilla.gnome.org/enter_bug.cgi?product=libgdata ## +## ------------------------------------------------------------------------ ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libgdata $as_me 0.17.9, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + # $is_release = (.git directory does not exist) + if test -d ${srcdir}/.git; then : + ax_is_release=no +else + ax_is_release=yes +fi + + + + +ac_aux_dir= +for ac_dir in build-aux "$srcdir"/build-aux; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +ac_config_headers="$ac_config_headers config.h" + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + +# tar-pax is needed for long filename support for trace files +am__api_version='1.15' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libgdata' + VERSION='0.17.9' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5 +$as_echo_n "checking how to create a pax tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_pax-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=posix -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=posix -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x pax -w "$$tardir"' + am__tar_='pax -L -x pax -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H pax -L' + am__tar_='find "$tardir" -print | cpio -o -H pax -L' + am__untar='cpio -i -H pax -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_pax}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5 + ($am__untar <conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if ${am_cv_prog_tar_pax+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_prog_tar_pax=$_am_tool +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5 +$as_echo "$am_cv_prog_tar_pax" >&6; } + + + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: <http://www.gnu.org/software/coreutils/>. + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +# Enable silent build when available (Automake 1.11) +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test no != "$with_gnu_ld" && break + ;; + *) + test yes != "$with_gnu_ld" && break + ;; + esac + fi + done + IFS=$lt_save_ifs +else + lt_cv_path_LD=$LD # Let the user override the test with a path. +fi +fi + +LD=$lt_cv_path_LD +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + +func_stripname_cnf () +{ + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen=shl_load +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen=dlopen +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report what library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC + + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test no != "$with_gnu_ld" && break + ;; + *) + test yes != "$with_gnu_ld" && break + ;; + esac + fi + done + IFS=$lt_save_ifs +else + lt_cv_path_LD=$LD # Let the user override the test with a path. +fi +fi + +LD=$lt_cv_path_LD +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec_CXX='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='$wl-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='$wl-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test no = "$ld_shlibs_CXX" && can_build_shared=no + + GCC_CXX=$GXX + LD_CXX=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX=$prev$p + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX=$prev$p + else + postdeps_CXX="${postdeps_CXX} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX=$p + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX=$p + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test no = "$ld_shlibs_CXX" && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test yes = "$hardcode_automatic_CXX"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct_CXX" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + + # Find git, defaulting to the 'missing' script so the user gets a nice + # message if git is missing, rather than a plain 'command not found'. + # Extract the first word of "git", so it can be a program name with args. +set dummy git; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GIT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GIT="$GIT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GIT" && ac_cv_path_GIT="${am_missing_run}git" + ;; +esac +fi +GIT=$ac_cv_path_GIT +if test -n "$GIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 +$as_echo "$GIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + # Build the ChangeLog rules. + +GENERATE_CHANGELOG_RULES=' +# Generate ChangeLog +# +# Optional: +# - CHANGELOG_START: git commit ID or tag name to output changelogs from +# (exclusive). (Default: include all commits) +# - CHANGELOG_GIT_FLAGS: General flags to pass to git-log when generating the +# ChangeLog. (Default: various) +# - CHANGELOG_GIT_DIR: .git directory to use. (Default: $(top_srcdir)/.git) + +# git-specific +CHANGELOG_GIT_FLAGS ?= --stat -M -C --name-status --no-color --no-decorate +CHANGELOG_GIT_DIR ?= $(top_srcdir)/.git + +ifeq ($(CHANGELOG_START),) +CHANGELOG_GIT_RANGE = +else +CHANGELOG_GIT_RANGE = $(CHANGELOG_START).. +endif + +# Generate a ChangeLog in $(top_distdir) +dist-ChangeLog: + $(AM_V_GEN)if $(GIT) \ + --git-dir=$(CHANGELOG_GIT_DIR) --work-tree=$(top_srcdir) log \ + $(CHANGELOG_GIT_FLAGS) $(CHANGELOG_GIT_RANGE) \ + | fmt --split-only >.ChangeLog.tmp; \ + then mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \ + else rm -f .ChangeLog.tmp; exit 1; fi + +.PHONY: dist-ChangeLog +' + + + + + +# Extract the first word of "glib-genmarshal", so it can be a program name with args. +set dummy glib-genmarshal; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GLIB_GENMARSHAL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GLIB_GENMARSHAL in + [\\/]* | ?:[\\/]*) + ac_cv_path_GLIB_GENMARSHAL="$GLIB_GENMARSHAL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GLIB_GENMARSHAL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GLIB_GENMARSHAL=$ac_cv_path_GLIB_GENMARSHAL +if test -n "$GLIB_GENMARSHAL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL" >&5 +$as_echo "$GLIB_GENMARSHAL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "glib-mkenums", so it can be a program name with args. +set dummy glib-mkenums; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GLIB_MKENUMS+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GLIB_MKENUMS in + [\\/]* | ?:[\\/]*) + ac_cv_path_GLIB_MKENUMS="$GLIB_MKENUMS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GLIB_MKENUMS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GLIB_MKENUMS=$ac_cv_path_GLIB_MKENUMS +if test -n "$GLIB_MKENUMS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_MKENUMS" >&5 +$as_echo "$GLIB_MKENUMS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +# Requirements +GLIB_REQS=2.44.0 +GLIB_MIN_REQUIRED=GLIB_VERSION_2_44 +GLIB_MAX_ALLOWED='(G_ENCODE_VERSION(2, 44))' +GIO_REQS=2.44.0 +SOUP_REQS=2.42.0 +SOUP_MIN_REQUIRED=SOUP_VERSION_2_42 +SOUP_MAX_ALLOWED=SOUP_VERSION_2_48 +OAUTH_REQS=0.9.4 +GTK_REQS=2.91.2 +GOA_REQS=3.8 +JSON_GLIB_REQS=0.15 +JSON_GLIB_MIN_REQUIRED=JSON_VERSION_1_0 +JSON_GLIB_MAX_ALLOWED=JSON_VERSION_1_0 +GDK_PIXBUF_REQS=2.14 +GDK_PIXBUF_MIN_REQUIRED=GDK_VERSION_2_14 +GDK_PIXBUF_MAX_ALLOWED=GDK_VERSION_2_14 + +# Before making a release, the GDATA_LT_VERSION string should be modified. The string is of the form c:r:a. Follow these instructions sequentially: +# +# 1. If the library source code has changed at all since the last update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’). +# 2. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0. +# 3. If any interfaces have been added since the last public release, then increment age. +# 4. If any interfaces have been removed or changed since the last public release, then set age to 0. +# +# Note that versioning started at 2:0:0 to ensure no conflicts with e-d-s' libgdata library, whose maximum version was 1:0:0 +GDATA_LT_VERSION=25:0:3 + + +GDATA_VERSION_MAJOR=0 +GDATA_VERSION_MINOR=17 +GDATA_VERSION_MICRO=9 +GDATA_API_VERSION=0.0 +GDATA_API_VERSION_MAJOR=0 +GDATA_API_VERSION_MINOR=0 + + + + + + + +GDATA_PACKAGES_PUBLIC="gobject-2.0 glib-2.0 >= $GLIB_REQS gio-2.0 >= $GIO_REQS libxml-2.0 libsoup-2.4 >= $SOUP_REQS json-glib-1.0 >= $JSON_GLIB_REQS" +GDATA_PACKAGES_PRIVATE="gthread-2.0 oauth >= $OAUTH_REQS" +GDATA_PACKAGES="$GDATA_PACKAGES_PUBLIC $GDATA_PACKAGES_PRIVATE" + + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GDATA" >&5 +$as_echo_n "checking for GDATA... " >&6; } + +if test -n "$GDATA_CFLAGS"; then + pkg_cv_GDATA_CFLAGS="$GDATA_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GDATA_PACKAGES\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$GDATA_PACKAGES") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GDATA_CFLAGS=`$PKG_CONFIG --cflags "$GDATA_PACKAGES" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GDATA_LIBS"; then + pkg_cv_GDATA_LIBS="$GDATA_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GDATA_PACKAGES\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$GDATA_PACKAGES") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GDATA_LIBS=`$PKG_CONFIG --libs "$GDATA_PACKAGES" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GDATA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$GDATA_PACKAGES" 2>&1` + else + GDATA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$GDATA_PACKAGES" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GDATA_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements ($GDATA_PACKAGES) were not met: + +$GDATA_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GDATA_CFLAGS +and GDATA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GDATA_CFLAGS +and GDATA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } +else + GDATA_CFLAGS=$pkg_cv_GDATA_CFLAGS + GDATA_LIBS=$pkg_cv_GDATA_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + +# Minimum and maximum requirements for GLib and libsoup, etc. +GDATA_CFLAGS="$GDATA_CFLAGS -DSOUP_VERSION_MIN_REQUIRED=$SOUP_MIN_REQUIRED -DSOUP_VERSION_MAX_ALLOWED=$SOUP_MAX_ALLOWED" +GDATA_CFLAGS="$GDATA_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB_MIN_REQUIRED -DGLIB_VERSION_MAX_ALLOWED='"$GLIB_MAX_ALLOWED"'" +GDATA_CFLAGS="$GDATA_CFLAGS -DJSON_VERSION_MIN_REQUIRED=$JSON_GLIB_MIN_REQUIRED -DJSON_VERSION_MAX_ALLOWED=$JSON_GLIB_MAX_ALLOWED" + + + + +# libsoup 2.47.3 is needed for the new SoupServer API; but it contained a bug in +# soup_server_set_ssl_cert_file() which was only fixed in 2.55.90. + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSOUP" >&5 +$as_echo_n "checking for LIBSOUP... " >&6; } + +if test -n "$LIBSOUP_CFLAGS"; then + pkg_cv_LIBSOUP_CFLAGS="$LIBSOUP_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.55.90\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.55.90") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBSOUP_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.4 >= 2.55.90" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBSOUP_LIBS"; then + pkg_cv_LIBSOUP_LIBS="$LIBSOUP_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.55.90\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.55.90") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBSOUP_LIBS=`$PKG_CONFIG --libs "libsoup-2.4 >= 2.55.90" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBSOUP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsoup-2.4 >= 2.55.90" 2>&1` + else + LIBSOUP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsoup-2.4 >= 2.55.90" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBSOUP_PKG_ERRORS" >&5 + + have_libsoup_2_55_90=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_libsoup_2_55_90=no +else + LIBSOUP_CFLAGS=$pkg_cv_LIBSOUP_CFLAGS + LIBSOUP_LIBS=$pkg_cv_LIBSOUP_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_libsoup_2_55_90=yes +fi +if test "x$have_libsoup_2_55_90" = "xyes"; then : + + +$as_echo "#define HAVE_LIBSOUP_2_55_90 1" >>confdefs.h + + +fi + +# Optional dependencies + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GDK_PIXBUF" >&5 +$as_echo_n "checking for GDK_PIXBUF... " >&6; } + +if test -n "$GDK_PIXBUF_CFLAGS"; then + pkg_cv_GDK_PIXBUF_CFLAGS="$GDK_PIXBUF_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 >= \$GDK_PIXBUF_REQS\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GDK_PIXBUF_CFLAGS=`$PKG_CONFIG --cflags "gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQS" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GDK_PIXBUF_LIBS"; then + pkg_cv_GDK_PIXBUF_LIBS="$GDK_PIXBUF_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 >= \$GDK_PIXBUF_REQS\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GDK_PIXBUF_LIBS=`$PKG_CONFIG --libs "gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQS" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GDK_PIXBUF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQS" 2>&1` + else + GDK_PIXBUF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQS" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GDK_PIXBUF_PKG_ERRORS" >&5 + + have_gdk_pixbuf=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_gdk_pixbuf=no +else + GDK_PIXBUF_CFLAGS=$pkg_cv_GDK_PIXBUF_CFLAGS + GDK_PIXBUF_LIBS=$pkg_cv_GDK_PIXBUF_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_gdk_pixbuf=yes +fi +if test "x$have_gdk_pixbuf" = "xyes"; then + +$as_echo "#define HAVE_GDK_PIXBUF 1" >>confdefs.h + +fi + +# Minimum and maximum requirements for gdk-pixbuf +GDK_PIXBUF_CFLAGS="$GDK_PIXBUF_CFLAGS -DGDK_VERSION_MIN_REQUIRED=$GDK_PIXBUF_MIN_REQUIRED -DGDK_VERSION_MAX_ALLOWED=$GDK_PIXBUF_MAX_ALLOWED" + + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK" >&5 +$as_echo_n "checking for GTK... " >&6; } + +if test -n "$GTK_CFLAGS"; then + pkg_cv_GTK_CFLAGS="$GTK_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= \$GTK_REQS\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= $GTK_REQS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-3.0 >= $GTK_REQS" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTK_LIBS"; then + pkg_cv_GTK_LIBS="$GTK_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= \$GTK_REQS\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= $GTK_REQS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-3.0 >= $GTK_REQS" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-3.0 >= $GTK_REQS" 2>&1` + else + GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-3.0 >= $GTK_REQS" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTK_PKG_ERRORS" >&5 + + have_gtk=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_gtk=no +else + GTK_CFLAGS=$pkg_cv_GTK_CFLAGS + GTK_LIBS=$pkg_cv_GTK_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_gtk=yes +fi + if test "x$have_gtk" = "xyes"; then + HAVE_GTK_TRUE= + HAVE_GTK_FALSE='#' +else + HAVE_GTK_TRUE='#' + HAVE_GTK_FALSE= +fi + + +# GNOME support, which pulls in gcr-base-3 to provide non-pageable memory +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GNOME support" >&5 +$as_echo_n "checking whether to build with GNOME support... " >&6; } +# Check whether --enable-gnome was given. +if test "${enable_gnome+set}" = set; then : + enableval=$enable_gnome; +else + enable_gnome=yes +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gnome" >&5 +$as_echo "$enable_gnome" >&6; } + if test "x$enable_gnome" = "xyes"; then + ENABLE_GNOME_TRUE= + ENABLE_GNOME_FALSE='#' +else + ENABLE_GNOME_TRUE='#' + ENABLE_GNOME_FALSE= +fi + + +# GNOME Online Accounts support -- only used if GNOME support is also enabled +# Pulls in gdata/gdata-goa-authorizer.[ch] +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GOA support" >&5 +$as_echo_n "checking whether to build with GOA support... " >&6; } +# Check whether --enable-goa was given. +if test "${enable_goa+set}" = set; then : + enableval=$enable_goa; +else + enable_goa=yes +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_goa" >&5 +$as_echo "$enable_goa" >&6; } + if test "x$enable_goa" = "xyes" -a "x$enable_gnome" = "xyes"; then + ENABLE_GOA_TRUE= + ENABLE_GOA_FALSE='#' +else + ENABLE_GOA_TRUE='#' + ENABLE_GOA_FALSE= +fi + + +if test "x$enable_gnome" = "xyes"; then + GNOME_PACKAGES_PUBLIC="" + GNOME_PACKAGES_PRIVATE="gcr-base-3 libxml-2.0" + if test "x$enable_goa" = "xyes"; then + GNOME_PACKAGES_PUBLIC="$GNOME_PACKAGES_PUBLIC" + GNOME_PACKAGES_PRIVATE="$GNOME_PACKAGES_PRIVATE goa-1.0 >= $GOA_REQS" + GOA_ENABLED="true" + +$as_echo "#define HAVE_GOA 1" >>confdefs.h + + fi + GNOME_PACKAGES="$GNOME_PACKAGES_PUBLIC $GNOME_PACKAGES_PRIVATE" + +$as_echo "#define HAVE_GNOME 1" >>confdefs.h + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNOME" >&5 +$as_echo_n "checking for GNOME... " >&6; } + +if test -n "$GNOME_CFLAGS"; then + pkg_cv_GNOME_CFLAGS="$GNOME_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GNOME_PACKAGES\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$GNOME_PACKAGES") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GNOME_CFLAGS=`$PKG_CONFIG --cflags "$GNOME_PACKAGES" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GNOME_LIBS"; then + pkg_cv_GNOME_LIBS="$GNOME_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GNOME_PACKAGES\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$GNOME_PACKAGES") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GNOME_LIBS=`$PKG_CONFIG --libs "$GNOME_PACKAGES" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GNOME_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$GNOME_PACKAGES" 2>&1` + else + GNOME_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$GNOME_PACKAGES" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GNOME_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements ($GNOME_PACKAGES) were not met: + +$GNOME_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GNOME_CFLAGS +and GNOME_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GNOME_CFLAGS +and GNOME_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } +else + GNOME_CFLAGS=$pkg_cv_GNOME_CFLAGS + GNOME_LIBS=$pkg_cv_GNOME_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi +else + GNOME_PACKAGES_PUBLIC="" + GNOME_PACKAGES_PRIVATE="" + GNOME_PACKAGES="" +fi + + + + + +# Check whether --enable-always_build_tests was given. +if test "${enable_always_build_tests+set}" = set; then : + enableval=$enable_always_build_tests; +else + enable_always_build_tests=yes +fi + +# Check whether --enable-installed_tests was given. +if test "${enable_installed_tests+set}" = set; then : + enableval=$enable_installed_tests; +else + enable_installed_tests=no +fi + + + if test "$enable_always_build_tests" = "yes"; then + ENABLE_ALWAYS_BUILD_TESTS_TRUE= + ENABLE_ALWAYS_BUILD_TESTS_FALSE='#' +else + ENABLE_ALWAYS_BUILD_TESTS_TRUE='#' + ENABLE_ALWAYS_BUILD_TESTS_FALSE= +fi + +ENABLE_ALWAYS_BUILD_TESTS=$enable_always_build_tests + + + if test "$enable_installed_tests" = "yes"; then + ENABLE_INSTALLED_TESTS_TRUE= + ENABLE_INSTALLED_TESTS_FALSE='#' +else + ENABLE_INSTALLED_TESTS_TRUE='#' + ENABLE_INSTALLED_TESTS_FALSE= +fi + +ENABLE_INSTALLED_TESTS=$enable_installed_tests + + +if test "$enable_always_build_tests" = "yes" || + test "$enable_installed_tests" = "yes"; then : + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UHTTPMOCK" >&5 +$as_echo_n "checking for UHTTPMOCK... " >&6; } + +if test -n "$UHTTPMOCK_CFLAGS"; then + pkg_cv_UHTTPMOCK_CFLAGS="$UHTTPMOCK_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuhttpmock-0.0 >= 0.5.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libuhttpmock-0.0 >= 0.5.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UHTTPMOCK_CFLAGS=`$PKG_CONFIG --cflags "libuhttpmock-0.0 >= 0.5.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$UHTTPMOCK_LIBS"; then + pkg_cv_UHTTPMOCK_LIBS="$UHTTPMOCK_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuhttpmock-0.0 >= 0.5.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libuhttpmock-0.0 >= 0.5.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UHTTPMOCK_LIBS=`$PKG_CONFIG --libs "libuhttpmock-0.0 >= 0.5.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + UHTTPMOCK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libuhttpmock-0.0 >= 0.5.0" 2>&1` + else + UHTTPMOCK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libuhttpmock-0.0 >= 0.5.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$UHTTPMOCK_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libuhttpmock-0.0 >= 0.5.0) were not met: + +$UHTTPMOCK_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables UHTTPMOCK_CFLAGS +and UHTTPMOCK_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables UHTTPMOCK_CFLAGS +and UHTTPMOCK_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } +else + UHTTPMOCK_CFLAGS=$pkg_cv_UHTTPMOCK_CFLAGS + UHTTPMOCK_LIBS=$pkg_cv_UHTTPMOCK_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + +fi + +# Various necessary functions and headers +for ac_func in memset +do : + ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MEMSET 1 +_ACEOF + +fi +done + +for ac_func in setlocale +do : + ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" +if test "x$ac_cv_func_setlocale" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SETLOCALE 1 +_ACEOF + +fi +done + +for ac_func in strchr +do : + ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr" +if test "x$ac_cv_func_strchr" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRCHR 1 +_ACEOF + +fi +done + +for ac_func in strstr +do : + ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" +if test "x$ac_cv_func_strstr" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRSTR 1 +_ACEOF + +fi +done + +for ac_header in sys/time.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIME_H 1 +_ACEOF + +fi + +done + +for ac_header in arpa/inet.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ARPA_INET_H 1 +_ACEOF + +fi + +done + +for ac_header in locale.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALE_H 1 +_ACEOF + +fi + +done + +for ac_header in netinet/in.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NETINET_IN_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/socket.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SOCKET_H 1 +_ACEOF + +fi + +done + + +# Internationalisation support +GETTEXT_PACKAGE=gdata + +cat >>confdefs.h <<_ACEOF +#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" +_ACEOF + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + + + + +case "$am__api_version" in + 1.01234) + as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 + ;; + *) + ;; +esac + +INTLTOOL_REQUIRED_VERSION_AS_INT=`echo 0.40.0 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` +INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` +INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` +if test -n "0.40.0"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= 0.40.0" >&5 +$as_echo_n "checking for intltool >= 0.40.0... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 +$as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } + test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || + as_fn_error $? "Your intltool is too old. You need intltool 0.40.0 or later." "$LINENO" 5 +fi + +# Extract the first word of "intltool-update", so it can be a program name with args. +set dummy intltool-update; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_INTLTOOL_UPDATE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_UPDATE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE +if test -n "$INTLTOOL_UPDATE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 +$as_echo "$INTLTOOL_UPDATE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "intltool-merge", so it can be a program name with args. +set dummy intltool-merge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_INTLTOOL_MERGE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_MERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE +if test -n "$INTLTOOL_MERGE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 +$as_echo "$INTLTOOL_MERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "intltool-extract", so it can be a program name with args. +set dummy intltool-extract; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_INTLTOOL_EXTRACT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_EXTRACT in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT +if test -n "$INTLTOOL_EXTRACT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 +$as_echo "$INTLTOOL_EXTRACT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5 +fi + +if test -z "$AM_DEFAULT_VERBOSITY"; then + AM_DEFAULT_VERBOSITY=1 +fi + + +INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' +INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' +INTLTOOL__v_MERGE_0='@echo " ITMRG " $@;' + + + + +INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' +intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' +intltool__v_merge_options_0='-q' + + + + + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' +INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< $@' + INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' +INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' +if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then + INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< $@' +else + INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM && mkdir $$_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u $$_it_tmp_dir $< $@ && rmdir $$_it_tmp_dir' +fi + INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# Check the gettext tools to make sure they are GNU +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_XGETTEXT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $XGETTEXT in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +XGETTEXT=$ac_cv_path_XGETTEXT +if test -n "$XGETTEXT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGMERGE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MSGMERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MSGMERGE=$ac_cv_path_MSGMERGE +if test -n "$MSGMERGE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MSGFMT=$ac_cv_path_MSGFMT +if test -n "$MSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GMSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then + as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 +fi +xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" +mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" +mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" +if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then + as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 +fi + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_INTLTOOL_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL +if test -n "$INTLTOOL_PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 +$as_echo "$INTLTOOL_PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$INTLTOOL_PERL"; then + as_fn_error $? "perl not found" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 +$as_echo_n "checking for perl >= 5.8.1... " >&6; } +$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 +if test $? -ne 0; then + as_fn_error $? "perl 5.8.1 is required for intltool" "$LINENO" 5 +else + IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 +$as_echo "$IT_PERL_VERSION" >&6; } +fi +if test "x" != "xno-xml"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 +$as_echo_n "checking for XML::Parser... " >&6; } + if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + else + as_fn_error $? "XML::Parser perl module is required for intltool" "$LINENO" 5 + fi +fi + +# Substitute ALL_LINGUAS so we can use it in po/Makefile + + + + + + +# Code coverage + + + + # allow to override gcov location + +# Check whether --with-gcov was given. +if test "${with_gcov+set}" = set; then : + withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov +else + _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 +$as_echo_n "checking whether to build with code coverage support... " >&6; } + # Check whether --enable-code-coverage was given. +if test "${enable_code_coverage+set}" = set; then : + enableval=$enable_code_coverage; +else + enable_code_coverage=no +fi + + + if test x$enable_code_coverage = xyes; then + CODE_COVERAGE_ENABLED_TRUE= + CODE_COVERAGE_ENABLED_FALSE='#' +else + CODE_COVERAGE_ENABLED_TRUE='#' + CODE_COVERAGE_ENABLED_FALSE= +fi + + CODE_COVERAGE_ENABLED=$enable_code_coverage + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 +$as_echo "$enable_code_coverage" >&6; } + + if test "$enable_code_coverage" = "yes" ; then : + + # check for gcov + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. +set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GCOV"; then + ac_cv_prog_GCOV="$GCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GCOV=$ac_cv_prog_GCOV +if test -n "$GCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 +$as_echo "$GCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_GCOV"; then + ac_ct_GCOV=$GCOV + # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. +set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_GCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_GCOV"; then + ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV +if test -n "$ac_ct_GCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 +$as_echo "$ac_ct_GCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_GCOV" = x; then + GCOV=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + GCOV=$ac_ct_GCOV + fi +else + GCOV="$ac_cv_prog_GCOV" +fi + + if test "X$GCOV" = "X:"; then : + as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 +fi + + + if test "$GCC" = "no" ; then : + + as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 + +fi + + # Extract the first word of "lcov", so it can be a program name with args. +set dummy lcov; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LCOV"; then + ac_cv_prog_LCOV="$LCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LCOV="lcov" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LCOV=$ac_cv_prog_LCOV +if test -n "$LCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 +$as_echo "$LCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "genhtml", so it can be a program name with args. +set dummy genhtml; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GENHTML+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GENHTML"; then + ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GENHTML="genhtml" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GENHTML=$ac_cv_prog_GENHTML +if test -n "$GENHTML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 +$as_echo "$GENHTML" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + if test -z "$LCOV" ; then : + + as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 + +fi + + if test -z "$GENHTML" ; then : + + as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 + +fi + + CODE_COVERAGE_CPPFLAGS="-DNDEBUG" + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_LIBS="-lgcov" + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" + + + + + + + + CODE_COVERAGE_RULES_CHECK=' + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture +' + CODE_COVERAGE_RULES_CAPTURE=' + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" +' + CODE_COVERAGE_RULES_CLEAN=' +clean: code-coverage-clean +distclean: code-coverage-clean +code-coverage-clean: + -$(LCOV) --directory $(top_builddir) -z + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete +' + +else + + CODE_COVERAGE_RULES_CHECK=' + @echo "Need to reconfigure with --enable-code-coverage" +' + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" + CODE_COVERAGE_RULES_CLEAN='' + +fi + +CODE_COVERAGE_RULES=' +# Code coverage +# +# Optional: +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. +# Multiple directories may be specified, separated by whitespace. +# (Default: $(top_builddir)) +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated +# by lcov for code coverage. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage +# reports to be created. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, +# set to 0 to disable it and leave empty to stay with the default. +# (Default: empty) +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov +# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov +# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the +# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov +# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering +# lcov instance. (Default: empty) +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov +# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the +# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml +# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore +# +# The generated report will be titled using the $(PACKAGE_NAME) and +# $(PACKAGE_VERSION). In order to add the current git hash to the title, +# use the git-version-gen script, available online. + +# Optional variables +CODE_COVERAGE_DIRECTORY ?= $(top_builddir) +CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info +CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage +CODE_COVERAGE_BRANCH_COVERAGE ?= +CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" +CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= +CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ +$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) +CODE_COVERAGE_IGNORE_PATTERN ?= + +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ + $(CODE_COVERAGE_OUTPUT_FILE); +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ + $(CODE_COVERAGE_IGNORE_PATTERN); +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); +code_coverage_quiet = $(code_coverage_quiet_$(V)) +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) +code_coverage_quiet_0 = --quiet + +# sanitizes the test-name: replaces with underscores: dashes and dots +code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) + +# Use recursive makes in order to ignore errors during check +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' + +# Capture code coverage data +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' + +# Hook rule executed before code-coverage-capture, overridable by the user +code-coverage-capture-hook: + +'"$CODE_COVERAGE_RULES_CLEAN"' + +GITIGNOREFILES ?= +GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) + +A''M_DISTCHECK_CONFIGURE_FLAGS ?= +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage + +.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean +' + + + + + +# General macros + + # C support is enabled by default. + + + # Only enable C++ support if AC_PROG_CXX is called. The redefinition of + # AC_PROG_CXX is so that a fatal error is emitted if this macro is called + # before AC_PROG_CXX, which would otherwise cause no C++ warnings to be + # checked. + + + + + + # Default value for IS-RELEASE is $ax_is_release + ax_compiler_flags_is_release=$ax_is_release + + # Check whether --enable-compile-warnings was given. +if test "${enable_compile_warnings+set}" = set; then : + enableval=$enable_compile_warnings; +else + if test "$ax_compiler_flags_is_release" = "yes"; then : + enable_compile_warnings="yes" +else + enable_compile_warnings="error" +fi +fi + + # Check whether --enable-Werror was given. +if test "${enable_Werror+set}" = set; then : + enableval=$enable_Werror; +else + enable_Werror=maybe +fi + + + # Return the user's chosen warning level + if test "$enable_Werror" = "no" -a \ + "$enable_compile_warnings" = "error"; then : + + enable_compile_warnings="yes" + +fi + + ax_enable_compile_warnings=$enable_compile_warnings + + + + + + + + + + + # Variable names + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Always pass -Werror=unknown-warning-option to get Clang to fail on bad + # flags, otherwise they are always appended to the warn_cflags variable, and + # Clang warns on them for every compilation unit. + # If this is passed to GCC, it will explode, so the flag must be enabled + # conditionally. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unknown-warning-option" >&5 +$as_echo_n "checking whether C compiler accepts -Werror=unknown-warning-option... " >&6; } +if ${ax_cv_check_cflags___Werror_unknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_check_cflags___Werror_unknown_warning_option=yes +else + ax_cv_check_cflags___Werror_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Werror_unknown_warning_option" >&5 +$as_echo "$ax_cv_check_cflags___Werror_unknown_warning_option" >&6; } +if test "x$ax_cv_check_cflags___Werror_unknown_warning_option" = xyes; then : + + ax_compiler_flags_test="-Werror=unknown-warning-option" + +else + + ax_compiler_flags_test="" + +fi + + + # Check that -Wno-suggest-attribute=format is supported + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wno-suggest-attribute=format" >&5 +$as_echo_n "checking whether C compiler accepts -Wno-suggest-attribute=format... " >&6; } +if ${ax_cv_check_cflags___Wno_suggest_attribute_format+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Wno-suggest-attribute=format" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_check_cflags___Wno_suggest_attribute_format=yes +else + ax_cv_check_cflags___Wno_suggest_attribute_format=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wno_suggest_attribute_format" >&5 +$as_echo "$ax_cv_check_cflags___Wno_suggest_attribute_format" >&6; } +if test "x$ax_cv_check_cflags___Wno_suggest_attribute_format" = xyes; then : + + ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format" + +else + + ax_compiler_no_suggest_attribute_flags="" + +fi + + + # Base flags + + + + +for flag in -fno-strict-aliasing ; do + as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +$as_echo_n "checking whether C compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_CFLAGS+:} false; then : + + case " $WARN_CFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS already contains \$flag"; } >&5 + (: WARN_CFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + + if test "$ax_enable_compile_warnings" != "no"; then : + + # "yes" flags + + + + +for flag in -Wall -Wextra -Wundef -Wnested-externs -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wformat=2 -Wold-style-definition -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wredundant-decls -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wimplicit-function-declaration -Wreturn-type -Wswitch-enum -Wswitch-default -Wunsafe-loop-optimizations ; do + as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +$as_echo_n "checking whether C compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_CFLAGS+:} false; then : + + case " $WARN_CFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS already contains \$flag"; } >&5 + (: WARN_CFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + +fi + if test "$ax_enable_compile_warnings" = "error"; then : + + # "error" flags; -Werror has to be appended unconditionally because + # it's not possible to test for + # + # suggest-attribute=format is disabled because it gives too many false + # positives + +if ${WARN_CFLAGS+:} false; then : + + case " $WARN_CFLAGS " in #( + *" -Werror "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS already contains -Werror"; } >&5 + (: WARN_CFLAGS already contains -Werror) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CFLAGS " -Werror" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CFLAGS=-Werror + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + + + + + + +for flag in $ax_compiler_no_suggest_attribute_flags ; do + as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +$as_echo_n "checking whether C compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_CFLAGS+:} false; then : + + case " $WARN_CFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS already contains \$flag"; } >&5 + (: WARN_CFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + +fi + + # In the flags below, when disabling specific flags, always add *both* + # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) + # we enable -Werror, disable a flag, and a build bot passes CFLAGS=-Wall, + # which effectively turns that flag back on again as an error. + for flag in $WARN_CFLAGS; do + case $flag in #( + -Wno-*=*) : + ;; #( + -Wno-*) : + + + + + +for flag in -Wno-error=$($as_echo $flag | $SED 's/^-Wno-//'); do + as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +$as_echo_n "checking whether C compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_CFLAGS+:} false; then : + + case " $WARN_CFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS already contains \$flag"; } >&5 + (: WARN_CFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5 + (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + ;; #( + *) : + ;; +esac + done + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Substitute the variables + + + + + + + + + + + + # Variable names + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + # Always pass -Werror=unknown-warning-option to get Clang to fail on bad + # flags, otherwise they are always appended to the warn_cxxflags variable, + # and Clang warns on them for every compilation unit. + # If this is passed to GCC, it will explode, so the flag must be enabled + # conditionally. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Werror=unknown-warning-option" >&5 +$as_echo_n "checking whether C++ compiler accepts -Werror=unknown-warning-option... " >&6; } +if ${ax_cv_check_cxxflags___Werror_unknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS -Werror=unknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ax_cv_check_cxxflags___Werror_unknown_warning_option=yes +else + ax_cv_check_cxxflags___Werror_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Werror_unknown_warning_option" >&5 +$as_echo "$ax_cv_check_cxxflags___Werror_unknown_warning_option" >&6; } +if test "x$ax_cv_check_cxxflags___Werror_unknown_warning_option" = xyes; then : + + ax_compiler_flags_test="-Werror=unknown-warning-option" + +else + + ax_compiler_flags_test="" + +fi + + + # Check that -Wno-suggest-attribute=format is supported + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wno-suggest-attribute=format" >&5 +$as_echo_n "checking whether C++ compiler accepts -Wno-suggest-attribute=format... " >&6; } +if ${ax_cv_check_cxxflags___Wno_suggest_attribute_format+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS -Wno-suggest-attribute=format" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ax_cv_check_cxxflags___Wno_suggest_attribute_format=yes +else + ax_cv_check_cxxflags___Wno_suggest_attribute_format=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wno_suggest_attribute_format" >&5 +$as_echo "$ax_cv_check_cxxflags___Wno_suggest_attribute_format" >&6; } +if test "x$ax_cv_check_cxxflags___Wno_suggest_attribute_format" = xyes; then : + + ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format" + +else + + ax_compiler_no_suggest_attribute_flags="" + +fi + + + # Base flags + + + + +for flag in -fno-strict-aliasing ; do + as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_CXXFLAGS+:} false; then : + + case " $WARN_CXXFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS already contains \$flag"; } >&5 + (: WARN_CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CXXFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CXXFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + + if test "$ax_enable_compile_warnings" != "no"; then : + + # "yes" flags + + + + +for flag in -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wredundant-decls -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wno-overloaded-virtual -Wswitch-enum -Wswitch-default -Wunsafe-loop-optimizations ; do + as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_CXXFLAGS+:} false; then : + + case " $WARN_CXXFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS already contains \$flag"; } >&5 + (: WARN_CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CXXFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CXXFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + +fi + if test "$ax_enable_compile_warnings" = "error"; then : + + # "error" flags; -Werror has to be appended unconditionally because + # it's not possible to test for + # + # suggest-attribute=format is disabled because it gives too many false + # positives + +if ${WARN_CXXFLAGS+:} false; then : + + case " $WARN_CXXFLAGS " in #( + *" -Werror "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS already contains -Werror"; } >&5 + (: WARN_CXXFLAGS already contains -Werror) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CXXFLAGS " -Werror" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CXXFLAGS=-Werror + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + + + + + + +for flag in $ax_compiler_no_suggest_attribute_flags ; do + as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_CXXFLAGS+:} false; then : + + case " $WARN_CXXFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS already contains \$flag"; } >&5 + (: WARN_CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CXXFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CXXFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + +fi + + # In the flags below, when disabling specific flags, always add *both* + # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) + # we enable -Werror, disable a flag, and a build bot passes CXXFLAGS=-Wall, + # which effectively turns that flag back on again as an error. + for flag in $WARN_CXXFLAGS; do + case $flag in #( + -Wno-*=*) : + ;; #( + -Wno-*) : + + + + + +for flag in -Wno-error=$($as_echo $flag | $SED 's/^-Wno-//'); do + as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_CXXFLAGS+:} false; then : + + case " $WARN_CXXFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS already contains \$flag"; } >&5 + (: WARN_CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_CXXFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_CXXFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + ;; #( + *) : + ;; +esac + done + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Substitute the variables + + + + + + + + + + + + + # Variable names + + + # Always pass -Werror=unknown-warning-option to get Clang to fail on bad + # flags, otherwise they are always appended to the warn_ldflags variable, + # and Clang warns on them for every compilation unit. + # If this is passed to GCC, it will explode, so the flag must be enabled + # conditionally. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unknown-warning-option" >&5 +$as_echo_n "checking whether C compiler accepts -Werror=unknown-warning-option... " >&6; } +if ${ax_cv_check_cflags___Werror_unknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_check_cflags___Werror_unknown_warning_option=yes +else + ax_cv_check_cflags___Werror_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Werror_unknown_warning_option" >&5 +$as_echo "$ax_cv_check_cflags___Werror_unknown_warning_option" >&6; } +if test "x$ax_cv_check_cflags___Werror_unknown_warning_option" = xyes; then : + + ax_compiler_flags_test="-Werror=unknown-warning-option" + +else + + ax_compiler_flags_test="" + +fi + + + # macOS linker does not have --as-needed + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--no-as-needed" >&5 +$as_echo_n "checking whether the linker accepts -Wl,--no-as-needed... " >&6; } +if ${ax_cv_check_ldflags___Wl___no_as_needed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,--no-as-needed" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_ldflags___Wl___no_as_needed=yes +else + ax_cv_check_ldflags___Wl___no_as_needed=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___no_as_needed" >&5 +$as_echo "$ax_cv_check_ldflags___Wl___no_as_needed" >&6; } +if test "x$ax_cv_check_ldflags___Wl___no_as_needed" = xyes; then : + + ax_compiler_flags_as_needed_option="-Wl,--no-as-needed" + +else + + ax_compiler_flags_as_needed_option="" + +fi + + + # macOS linker speaks with a different accent + ax_compiler_flags_fatal_warnings_option="" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--fatal-warnings" >&5 +$as_echo_n "checking whether the linker accepts -Wl,--fatal-warnings... " >&6; } +if ${ax_cv_check_ldflags___Wl___fatal_warnings+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,--fatal-warnings" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_ldflags___Wl___fatal_warnings=yes +else + ax_cv_check_ldflags___Wl___fatal_warnings=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___fatal_warnings" >&5 +$as_echo "$ax_cv_check_ldflags___Wl___fatal_warnings" >&6; } +if test "x$ax_cv_check_ldflags___Wl___fatal_warnings" = xyes; then : + + ax_compiler_flags_fatal_warnings_option="-Wl,--fatal-warnings" + +else + : +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-fatal_warnings" >&5 +$as_echo_n "checking whether the linker accepts -Wl,-fatal_warnings... " >&6; } +if ${ax_cv_check_ldflags___Wl__fatal_warnings+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-fatal_warnings" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_ldflags___Wl__fatal_warnings=yes +else + ax_cv_check_ldflags___Wl__fatal_warnings=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__fatal_warnings" >&5 +$as_echo "$ax_cv_check_ldflags___Wl__fatal_warnings" >&6; } +if test "x$ax_cv_check_ldflags___Wl__fatal_warnings" = xyes; then : + + ax_compiler_flags_fatal_warnings_option="-Wl,-fatal_warnings" + +else + : +fi + + + # Base flags + + + + +for flag in $ax_compiler_flags_as_needed_option ; do + as_CACHEVAR=`$as_echo "ax_cv_check_ldflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 +$as_echo_n "checking whether the linker accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_LDFLAGS+:} false; then : + + case " $WARN_LDFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_LDFLAGS already contains \$flag"; } >&5 + (: WARN_LDFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_LDFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_LDFLAGS=\"\$WARN_LDFLAGS\""; } >&5 + (: WARN_LDFLAGS="$WARN_LDFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_LDFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_LDFLAGS=\"\$WARN_LDFLAGS\""; } >&5 + (: WARN_LDFLAGS="$WARN_LDFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + + if test "$ax_enable_compile_warnings" != "no"; then : + + # "yes" flags + + + + +for flag in ; do + as_CACHEVAR=`$as_echo "ax_cv_check_ldflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 +$as_echo_n "checking whether the linker accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_LDFLAGS+:} false; then : + + case " $WARN_LDFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_LDFLAGS already contains \$flag"; } >&5 + (: WARN_LDFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_LDFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_LDFLAGS=\"\$WARN_LDFLAGS\""; } >&5 + (: WARN_LDFLAGS="$WARN_LDFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_LDFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_LDFLAGS=\"\$WARN_LDFLAGS\""; } >&5 + (: WARN_LDFLAGS="$WARN_LDFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + +fi + if test "$ax_enable_compile_warnings" = "error"; then : + + # "error" flags; -Werror has to be appended unconditionally because + # it's not possible to test for + # + # suggest-attribute=format is disabled because it gives too many false + # positives + + + + +for flag in $ax_compiler_flags_fatal_warnings_option ; do + as_CACHEVAR=`$as_echo "ax_cv_check_ldflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 +$as_echo_n "checking whether the linker accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + +if ${WARN_LDFLAGS+:} false; then : + + case " $WARN_LDFLAGS " in #( + *" $flag "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_LDFLAGS already contains \$flag"; } >&5 + (: WARN_LDFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_LDFLAGS " $flag" + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_LDFLAGS=\"\$WARN_LDFLAGS\""; } >&5 + (: WARN_LDFLAGS="$WARN_LDFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_LDFLAGS=$flag + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_LDFLAGS=\"\$WARN_LDFLAGS\""; } >&5 + (: WARN_LDFLAGS="$WARN_LDFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else + : +fi + +done + + +fi + + # Substitute the variables + + + + + + + # Variable names + + + # Base flags + +if ${WARN_SCANNERFLAGS+:} false; then : + + case " $WARN_SCANNERFLAGS " in #( + *" "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_SCANNERFLAGS already contains "; } >&5 + (: WARN_SCANNERFLAGS already contains ) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_SCANNERFLAGS " " + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_SCANNERFLAGS=\"\$WARN_SCANNERFLAGS\""; } >&5 + (: WARN_SCANNERFLAGS="$WARN_SCANNERFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_SCANNERFLAGS= + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_SCANNERFLAGS=\"\$WARN_SCANNERFLAGS\""; } >&5 + (: WARN_SCANNERFLAGS="$WARN_SCANNERFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + + + if test "$ax_enable_compile_warnings" != "no"; then : + + # "yes" flags + +if ${WARN_SCANNERFLAGS+:} false; then : + + case " $WARN_SCANNERFLAGS " in #( + *" --warn-all "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_SCANNERFLAGS already contains --warn-all "; } >&5 + (: WARN_SCANNERFLAGS already contains --warn-all ) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_SCANNERFLAGS " --warn-all " + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_SCANNERFLAGS=\"\$WARN_SCANNERFLAGS\""; } >&5 + (: WARN_SCANNERFLAGS="$WARN_SCANNERFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_SCANNERFLAGS= --warn-all + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_SCANNERFLAGS=\"\$WARN_SCANNERFLAGS\""; } >&5 + (: WARN_SCANNERFLAGS="$WARN_SCANNERFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + + +fi + if test "$ax_enable_compile_warnings" = "error"; then : + + # "error" flags + +if ${WARN_SCANNERFLAGS+:} false; then : + + case " $WARN_SCANNERFLAGS " in #( + *" --warn-error "*) : + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_SCANNERFLAGS already contains --warn-error "; } >&5 + (: WARN_SCANNERFLAGS already contains --warn-error ) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARN_SCANNERFLAGS " --warn-error " + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_SCANNERFLAGS=\"\$WARN_SCANNERFLAGS\""; } >&5 + (: WARN_SCANNERFLAGS="$WARN_SCANNERFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else + + WARN_SCANNERFLAGS= --warn-error + { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_SCANNERFLAGS=\"\$WARN_SCANNERFLAGS\""; } >&5 + (: WARN_SCANNERFLAGS="$WARN_SCANNERFLAGS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + + +fi + + # Substitute the variables + + + + + + + + # Check whether --enable-introspection was given. +if test "${enable_introspection+set}" = set; then : + enableval=$enable_introspection; +else + enable_introspection=auto +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-introspection" >&5 +$as_echo_n "checking for gobject-introspection... " >&6; } + + case $enable_introspection in #( + no) : + found_introspection="no (disabled, use --enable-introspection to enable)" + ;; #( + yes) : + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + : +else + as_fn_error $? "gobject-introspection-1.0 is not installed" "$LINENO" 5 +fi + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.9.7\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.9.7") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + found_introspection=yes +else + as_fn_error $? "You need to have gobject-introspection >= 0.9.7 installed to build libgdata" "$LINENO" 5 +fi + ;; #( + auto) : + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.9.7\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.9.7") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + found_introspection=yes +else + found_introspection=no +fi + ;; #( + *) : + as_fn_error $? "invalid argument passed to --enable-introspection, should be one of [no/auto/yes]" "$LINENO" 5 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_introspection" >&5 +$as_echo "$found_introspection" >&6; } + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + fi + + + + + + + + + + if test "x$found_introspection" = "xyes"; then + HAVE_INTROSPECTION_TRUE= + HAVE_INTROSPECTION_FALSE='#' +else + HAVE_INTROSPECTION_TRUE='#' + HAVE_INTROSPECTION_FALSE= +fi + + + + + + if test "x" != "xyes"; then : + + + +fi + + # Check whether --enable-vala was given. +if test "${enable_vala+set}" = set; then : + enableval=$enable_vala; +else + + if test "x" = "x"; then : + + enable_vala=auto + +else + + enable_vala= + +fi + +fi + + + case $enable_vala in #( + no) : + enable_vala=no ;; #( + yes) : + + if test "x" != "xyes" -a "x$found_introspection" != "xyes"; then : + + as_fn_error $? "Vala bindings require GObject Introspection" "$LINENO" 5 + +fi + ;; #( + auto) : + + if test "x" != "xyes" -a "x$found_introspection" != "xyes"; then : + + enable_vala=no + +fi + ;; #( + *) : + + as_fn_error $? "Invalid argument passed to --enable-vala, should be one of [no/auto/yes]" "$LINENO" 5 + ;; +esac + + if test "x" = "x"; then : + + vapigen_pkg_name=vapigen + +else + + vapigen_pkg_name=vapigen- + +fi + if test "x" = "x"; then : + + vapigen_pkg="$vapigen_pkg_name" + +else + + vapigen_pkg="$vapigen_pkg_name >= " + +fi + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$vapigen_pkg\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$vapigen_pkg") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + + if test "$enable_vala" = "auto"; then : + + enable_vala=yes + +fi + +else + + case $enable_vala in #( + yes) : + + as_fn_error $? "$vapigen_pkg not found" "$LINENO" 5 + ;; #( + auto) : + + enable_vala=no + ;; #( + *) : + ;; +esac + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for vapigen" >&5 +$as_echo_n "checking for vapigen... " >&6; } + + case $enable_vala in #( + yes) : + + VAPIGEN=`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name` + VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen + if test "x" = "x"; then : + + VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name` + +else + + VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name` + +fi + ;; #( + *) : + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_vala" >&5 +$as_echo "$enable_vala" >&6; } + + + + + + if test "x$enable_vala" = "xyes"; then + ENABLE_VAPIGEN_TRUE= + ENABLE_VAPIGEN_FALSE='#' +else + ENABLE_VAPIGEN_TRUE='#' + ENABLE_VAPIGEN_FALSE= +fi + + + + + + + + + + + + gtk_doc_requires="gtk-doc >= 1.25" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5 +$as_echo_n "checking for gtk-doc... " >&6; } + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_gtk_doc=yes +else + have_gtk_doc=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5 +$as_echo "$have_gtk_doc" >&6; } + + if test "$have_gtk_doc" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found." >&5 +$as_echo "$as_me: WARNING: + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found." >&2;} + fi + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GTKDOC_CHECK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GTKDOC_CHECK"; then + ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK +if test -n "$GTKDOC_CHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 +$as_echo "$GTKDOC_CHECK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_CHECK_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_CHECK_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_CHECK_PATH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH +if test -n "$GTKDOC_CHECK_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5 +$as_echo "$GTKDOC_CHECK_PATH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + for ac_prog in gtkdoc-rebase +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_REBASE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_REBASE in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE +if test -n "$GTKDOC_REBASE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 +$as_echo "$GTKDOC_REBASE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$GTKDOC_REBASE" && break +done +test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" + + # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. +set dummy gtkdoc-mkpdf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_MKPDF in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF +if test -n "$GTKDOC_MKPDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 +$as_echo "$GTKDOC_MKPDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +# Check whether --with-html-dir was given. +if test "${with_html_dir+set}" = set; then : + withval=$with_html_dir; +else + with_html_dir='${datadir}/gtk-doc/html' +fi + + HTML_DIR="$with_html_dir" + + + # Check whether --enable-gtk-doc was given. +if test "${enable_gtk_doc+set}" = set; then : + enableval=$enable_gtk_doc; +else + enable_gtk_doc=no +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 +$as_echo_n "checking whether to build gtk-doc documentation... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 +$as_echo "$enable_gtk_doc" >&6; } + + if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then + as_fn_error $? " + You must have $gtk_doc_requires installed to build documentation for + $PACKAGE_NAME. Please install gtk-doc or disable building the + documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5 + fi + + if test "x$PACKAGE_NAME" != "xglib"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 +$as_echo_n "checking for GTKDOC_DEPS... " >&6; } + +if test -n "$GTKDOC_DEPS_CFLAGS"; then + pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTKDOC_DEPS_LIBS"; then + pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` + else + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : +else + GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS + GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + fi + + # Check whether --enable-gtk-doc-html was given. +if test "${enable_gtk_doc_html+set}" = set; then : + enableval=$enable_gtk_doc_html; +else + enable_gtk_doc_html=yes +fi + + # Check whether --enable-gtk-doc-pdf was given. +if test "${enable_gtk_doc_pdf+set}" = set; then : + enableval=$enable_gtk_doc_pdf; +else + enable_gtk_doc_pdf=no +fi + + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + if test -z "$AM_DEFAULT_VERBOSITY"; then + AM_DEFAULT_VERBOSITY=1 + fi + + + if test x$have_gtk_doc = xyes; then + HAVE_GTK_DOC_TRUE= + HAVE_GTK_DOC_FALSE='#' +else + HAVE_GTK_DOC_TRUE='#' + HAVE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc = xyes; then + ENABLE_GTK_DOC_TRUE= + ENABLE_GTK_DOC_FALSE='#' +else + ENABLE_GTK_DOC_TRUE='#' + ENABLE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc_html = xyes; then + GTK_DOC_BUILD_HTML_TRUE= + GTK_DOC_BUILD_HTML_FALSE='#' +else + GTK_DOC_BUILD_HTML_TRUE='#' + GTK_DOC_BUILD_HTML_FALSE= +fi + + if test x$enable_gtk_doc_pdf = xyes; then + GTK_DOC_BUILD_PDF_TRUE= + GTK_DOC_BUILD_PDF_FALSE='#' +else + GTK_DOC_BUILD_PDF_TRUE='#' + GTK_DOC_BUILD_PDF_FALSE= +fi + + if test -n "$LIBTOOL"; then + GTK_DOC_USE_LIBTOOL_TRUE= + GTK_DOC_USE_LIBTOOL_FALSE='#' +else + GTK_DOC_USE_LIBTOOL_TRUE='#' + GTK_DOC_USE_LIBTOOL_FALSE= +fi + + if test -n "$GTKDOC_REBASE"; then + GTK_DOC_USE_REBASE_TRUE= + GTK_DOC_USE_REBASE_FALSE='#' +else + GTK_DOC_USE_REBASE_TRUE='#' + GTK_DOC_USE_REBASE_FALSE= +fi + + + +ac_config_files="$ac_config_files Makefile libgdata.pc gdata/gdata-version.h gdata/tests/Makefile po/Makefile.in docs/Makefile docs/reference/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_GTK_TRUE}" && test -z "${HAVE_GTK_FALSE}"; then + as_fn_error $? "conditional \"HAVE_GTK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GNOME_TRUE}" && test -z "${ENABLE_GNOME_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GNOME\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GOA_TRUE}" && test -z "${ENABLE_GOA_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GOA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_ALWAYS_BUILD_TESTS_TRUE}" && test -z "${ENABLE_ALWAYS_BUILD_TESTS_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_ALWAYS_BUILD_TESTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_INSTALLED_TESTS_TRUE}" && test -z "${ENABLE_INSTALLED_TESTS_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_INSTALLED_TESTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + ac_config_commands="$ac_config_commands po/stamp-it" + + +if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then + as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then + as_fn_error $? "conditional \"HAVE_INTROSPECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_VAPIGEN_TRUE}" && test -z "${ENABLE_VAPIGEN_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_VAPIGEN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libgdata $as_me 0.17.9, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to <https://bugzilla.gnome.org/enter_bug.cgi?product=libgdata>. +libgdata home page: <https://wiki.gnome.org/Projects/libgdata>." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +libgdata config.status 0.17.9 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libgdata.pc") CONFIG_FILES="$CONFIG_FILES libgdata.pc" ;; + "gdata/gdata-version.h") CONFIG_FILES="$CONFIG_FILES gdata/gdata-version.h" ;; + "gdata/tests/Makefile") CONFIG_FILES="$CONFIG_FILES gdata/tests/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "docs/reference/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/Makefile" ;; + "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# The names of the tagged configurations supported by this script. +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + "po/stamp-it":C) + if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then + as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 + fi + rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" + >"po/stamp-it.tmp" + sed '/^#/d + s/^[[].*] *// + /^[ ]*$/d + '"s|^| $ac_top_srcdir/|" \ + "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" + + sed '/^POTFILES =/,/[^\\]$/ { + /^POTFILES =/!d + r po/POTFILES + } + ' "po/Makefile.in" >"po/Makefile" + rm -f "po/Makefile.tmp" + mv "po/stamp-it.tmp" "po/stamp-it" + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..9c721a5 --- /dev/null +++ b/configure.ac @@ -0,0 +1,221 @@ +AC_PREREQ(2.65) + +# Release version +m4_define(gdata_version_major, 0) +m4_define(gdata_version_minor, 17) +m4_define(gdata_version_micro, 9) + +# API version +# TODO: This currently isn't used in the library name; once we hit gdata_version_major=1, that should be changed +m4_define(gdata_api_version_major, 0) +m4_define(gdata_api_version_minor, 0) + +AC_INIT([libgdata],[gdata_version_major.gdata_version_minor.gdata_version_micro],[https://bugzilla.gnome.org/enter_bug.cgi?product=libgdata],[libgdata],[https://wiki.gnome.org/Projects/libgdata]) +AX_IS_RELEASE([git-directory]) + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_SRCDIR([gdata/gdata.h]) +AC_CONFIG_HEADERS([config.h]) +AC_USE_SYSTEM_EXTENSIONS + +# tar-pax is needed for long filename support for trace files +AM_INIT_AUTOMAKE([1.9 dist-xz no-dist-gzip tar-pax check-news subdir-objects parallel-tests color-tests]) + +# Enable silent build when available (Automake 1.11) +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) + +AC_PROG_CXX +AM_PROG_CC_C_O +LT_INIT([]) +PKG_PROG_PKG_CONFIG +AX_GENERATE_CHANGELOG + +AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal]) +AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums]) + +# Requirements +GLIB_REQS=2.44.0 +GLIB_MIN_REQUIRED=GLIB_VERSION_2_44 +GLIB_MAX_ALLOWED='(G_ENCODE_VERSION(2, 44))' +GIO_REQS=2.44.0 +SOUP_REQS=2.42.0 +SOUP_MIN_REQUIRED=SOUP_VERSION_2_42 +SOUP_MAX_ALLOWED=SOUP_VERSION_2_48 +OAUTH_REQS=0.9.4 +GTK_REQS=2.91.2 +GOA_REQS=3.8 +JSON_GLIB_REQS=0.15 +JSON_GLIB_MIN_REQUIRED=JSON_VERSION_1_0 +JSON_GLIB_MAX_ALLOWED=JSON_VERSION_1_0 +GDK_PIXBUF_REQS=2.14 +GDK_PIXBUF_MIN_REQUIRED=GDK_VERSION_2_14 +GDK_PIXBUF_MAX_ALLOWED=GDK_VERSION_2_14 + +# Before making a release, the GDATA_LT_VERSION string should be modified. The string is of the form c:r:a. Follow these instructions sequentially: +# +# 1. If the library source code has changed at all since the last update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’). +# 2. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0. +# 3. If any interfaces have been added since the last public release, then increment age. +# 4. If any interfaces have been removed or changed since the last public release, then set age to 0. +# +# Note that versioning started at 2:0:0 to ensure no conflicts with e-d-s' libgdata library, whose maximum version was 1:0:0 +GDATA_LT_VERSION=25:0:3 +AC_SUBST(GDATA_LT_VERSION) + +GDATA_VERSION_MAJOR=gdata_version_major +GDATA_VERSION_MINOR=gdata_version_minor +GDATA_VERSION_MICRO=gdata_version_micro +GDATA_API_VERSION=gdata_api_version_major.gdata_api_version_minor +GDATA_API_VERSION_MAJOR=gdata_api_version_major +GDATA_API_VERSION_MINOR=gdata_api_version_minor +AC_SUBST(GDATA_VERSION_MAJOR) +AC_SUBST(GDATA_VERSION_MINOR) +AC_SUBST(GDATA_VERSION_MICRO) +AC_SUBST(GDATA_API_VERSION) +AC_SUBST(GDATA_API_VERSION_MAJOR) +AC_SUBST(GDATA_API_VERSION_MINOR) + +GDATA_PACKAGES_PUBLIC="gobject-2.0 glib-2.0 >= $GLIB_REQS gio-2.0 >= $GIO_REQS libxml-2.0 libsoup-2.4 >= $SOUP_REQS json-glib-1.0 >= $JSON_GLIB_REQS" +GDATA_PACKAGES_PRIVATE="gthread-2.0 oauth >= $OAUTH_REQS" +GDATA_PACKAGES="$GDATA_PACKAGES_PUBLIC $GDATA_PACKAGES_PRIVATE" +AC_SUBST([GDATA_PACKAGES_PUBLIC]) +AC_SUBST([GDATA_PACKAGES_PRIVATE]) +AC_SUBST([GDATA_PACKAGES]) + +PKG_CHECK_MODULES(GDATA, [$GDATA_PACKAGES]) + +# Minimum and maximum requirements for GLib and libsoup, etc. +GDATA_CFLAGS="$GDATA_CFLAGS -DSOUP_VERSION_MIN_REQUIRED=$SOUP_MIN_REQUIRED -DSOUP_VERSION_MAX_ALLOWED=$SOUP_MAX_ALLOWED" +GDATA_CFLAGS="$GDATA_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB_MIN_REQUIRED -DGLIB_VERSION_MAX_ALLOWED='"$GLIB_MAX_ALLOWED"'" +GDATA_CFLAGS="$GDATA_CFLAGS -DJSON_VERSION_MIN_REQUIRED=$JSON_GLIB_MIN_REQUIRED -DJSON_VERSION_MAX_ALLOWED=$JSON_GLIB_MAX_ALLOWED" + +AC_SUBST(GDATA_CFLAGS) +AC_SUBST(GDATA_LIBS) + +# libsoup 2.47.3 is needed for the new SoupServer API; but it contained a bug in +# soup_server_set_ssl_cert_file() which was only fixed in 2.55.90. +PKG_CHECK_MODULES([LIBSOUP], [libsoup-2.4 >= 2.55.90], + [have_libsoup_2_55_90=yes], [have_libsoup_2_55_90=no]) +AS_IF([test "x$have_libsoup_2_55_90" = "xyes"], [ + AC_DEFINE([HAVE_LIBSOUP_2_55_90], [1], + [Define if the new SoupServer API is available]) +]) + +# Optional dependencies +PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQS, have_gdk_pixbuf=yes, have_gdk_pixbuf=no) +if test "x$have_gdk_pixbuf" = "xyes"; then + AC_DEFINE(HAVE_GDK_PIXBUF, 1, [Defined if gdk-pixbuf is installed]) +fi + +# Minimum and maximum requirements for gdk-pixbuf +GDK_PIXBUF_CFLAGS="$GDK_PIXBUF_CFLAGS -DGDK_VERSION_MIN_REQUIRED=$GDK_PIXBUF_MIN_REQUIRED -DGDK_VERSION_MAX_ALLOWED=$GDK_PIXBUF_MAX_ALLOWED" + +AC_SUBST(GDK_PIXBUF_CFLAGS) +AC_SUBST(GDK_PIXBUF_LIBS) + +PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK_REQS], [have_gtk=yes], [have_gtk=no]) +AM_CONDITIONAL([HAVE_GTK], [test "x$have_gtk" = "xyes"]) + +# GNOME support, which pulls in gcr-base-3 to provide non-pageable memory +AC_MSG_CHECKING(whether to build with GNOME support) +AC_ARG_ENABLE(gnome, AS_HELP_STRING([--enable-gnome], [Whether to enable GNOME support]),, enable_gnome=yes) +AC_MSG_RESULT($enable_gnome) +AM_CONDITIONAL([ENABLE_GNOME], [test "x$enable_gnome" = "xyes"]) + +# GNOME Online Accounts support -- only used if GNOME support is also enabled +# Pulls in gdata/gdata-goa-authorizer.[ch] +AC_MSG_CHECKING(whether to build with GOA support) +AC_ARG_ENABLE(goa, AS_HELP_STRING([--enable-goa], [Whether to enable GOA support]),, enable_goa=yes) +AC_MSG_RESULT($enable_goa) +AM_CONDITIONAL([ENABLE_GOA], [test "x$enable_goa" = "xyes" -a "x$enable_gnome" = "xyes"]) + +if test "x$enable_gnome" = "xyes"; then + GNOME_PACKAGES_PUBLIC="" + GNOME_PACKAGES_PRIVATE="gcr-base-3 libxml-2.0" + if test "x$enable_goa" = "xyes"; then + GNOME_PACKAGES_PUBLIC="$GNOME_PACKAGES_PUBLIC" + GNOME_PACKAGES_PRIVATE="$GNOME_PACKAGES_PRIVATE goa-1.0 >= $GOA_REQS" + GOA_ENABLED="true" + AC_DEFINE(HAVE_GOA, 1, [Define if GOA support is enabled]) + fi + GNOME_PACKAGES="$GNOME_PACKAGES_PUBLIC $GNOME_PACKAGES_PRIVATE" + AC_DEFINE(HAVE_GNOME, 1, [Defined if GNOME support is enabled]) + PKG_CHECK_MODULES([GNOME], [$GNOME_PACKAGES]) +else + GNOME_PACKAGES_PUBLIC="" + GNOME_PACKAGES_PRIVATE="" + GNOME_PACKAGES="" +fi +AC_SUBST([GNOME_PACKAGES_PUBLIC]) +AC_SUBST([GNOME_PACKAGES_PRIVATE]) +AC_SUBST([GNOME_PACKAGES]) +AC_SUBST([GOA_ENABLED]) + +AC_ARG_ENABLE([always_build_tests], + AS_HELP_STRING([--enable-always-build-tests], + [Enable always building tests (default: yes)]),, + [enable_always_build_tests=yes]) +AC_ARG_ENABLE([installed_tests], + AS_HELP_STRING([--enable-installed-tests], + [Install test programs (default: no)]),, + [enable_installed_tests=no]) + +AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], + [test "$enable_always_build_tests" = "yes"]) +AC_SUBST([ENABLE_ALWAYS_BUILD_TESTS],[$enable_always_build_tests]) + +AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], + [test "$enable_installed_tests" = "yes"]) +AC_SUBST([ENABLE_INSTALLED_TESTS],[$enable_installed_tests]) + +AS_IF([test "$enable_always_build_tests" = "yes" || + test "$enable_installed_tests" = "yes"],[ + PKG_CHECK_MODULES([UHTTPMOCK],[libuhttpmock-0.0 >= 0.5.0]) +]) + +# Various necessary functions and headers +AC_CHECK_FUNCS([memset]) +AC_CHECK_FUNCS([setlocale]) +AC_CHECK_FUNCS([strchr]) +AC_CHECK_FUNCS([strstr]) +AC_CHECK_HEADERS([sys/time.h]) +AC_CHECK_HEADERS([arpa/inet.h]) +AC_CHECK_HEADERS([locale.h]) +AC_CHECK_HEADERS([netinet/in.h]) +AC_CHECK_HEADERS([sys/socket.h]) + +# Internationalisation support +GETTEXT_PACKAGE=gdata +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define to the Gettext package name]) +AC_SUBST(GETTEXT_PACKAGE) +IT_PROG_INTLTOOL([0.40.0]) + +# Code coverage +AX_CODE_COVERAGE + +# General macros +AX_COMPILER_FLAGS([WARN_CFLAGS],[WARN_LDFLAGS],[$ax_is_release], + [],[-Wunsafe-loop-optimizations]) + +GOBJECT_INTROSPECTION_CHECK([0.9.7]) + +VAPIGEN_CHECK() + +AC_SUBST([AM_CPPFLAGS]) +AC_SUBST([AM_CFLAGS]) +AC_SUBST([AM_CXXFLAGS]) +AC_SUBST([AM_LDFLAGS]) + +GTK_DOC_CHECK([1.25],[--flavour no-tmpl]) + +AC_CONFIG_FILES([ +Makefile +libgdata.pc +gdata/gdata-version.h +gdata/tests/Makefile +po/Makefile.in +docs/Makefile +docs/reference/Makefile +]) +AC_OUTPUT diff --git a/demos/calendar/calendar-cli.c b/demos/calendar/calendar-cli.c new file mode 100644 index 0000000..a1d84f6 --- /dev/null +++ b/demos/calendar/calendar-cli.c @@ -0,0 +1,553 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2015 Philip Withnall <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <gdata/gdata.h> +#include <locale.h> +#include <string.h> + +#define CLIENT_ID "1074795795536-necvslvs0pchk65nf6ju4i6mniogg8fr.apps.googleusercontent.com" +#define CLIENT_SECRET "8totRi50eo2Zfr3SD2DeNAzo" +#define REDIRECT_URI "urn:ietf:wg:oauth:2.0:oob" + +static int +print_usage (char *argv[]) +{ + g_printerr ("%s: Usage — %s <subcommand>\n" + "Subcommands:\n" + " calendars [--all|--own]\n" + " events <calendar ID> [query string]\n" + " insert-event <calendar ID> <title> <start time> " + "<end time> <attendee 1> [attendee 2 …]\n", + argv[0], argv[0]); + return -1; +} + +/* Convert a GTimeVal to an ISO 8601 date string (without a time component). */ +static gchar * +tv_to_iso8601_date (GTimeVal *tv) +{ + struct tm *tm; + + tm = gmtime (&tv->tv_sec); + + return g_strdup_printf ("%04d-%02d-%02d", + tm->tm_year + 1900, + tm->tm_mon + 1, + tm->tm_mday); +} + +static void +print_calendar (GDataCalendarCalendar *calendar) +{ + const gchar *id, *title, *time_zone, *access_level, *description; + gboolean is_hidden, is_selected; + + id = gdata_entry_get_id (GDATA_ENTRY (calendar)); + title = gdata_entry_get_title (GDATA_ENTRY (calendar)); + time_zone = gdata_calendar_calendar_get_timezone (calendar); + is_hidden = gdata_calendar_calendar_is_hidden (calendar); + is_selected = gdata_calendar_calendar_is_selected (calendar); + access_level = gdata_calendar_calendar_get_access_level (calendar); + description = gdata_entry_get_summary (GDATA_ENTRY (calendar)); + + g_print ("%s — %s\n", id, title); + g_print (" Timezone: %s\n", time_zone); + g_print (" Access level: %s\n", access_level); + g_print (" Hidden? %s\n", is_hidden ? "Yes" : "No"); + g_print (" Selected? %s\n", is_selected ? "Yes" : "No"); + g_print (" Description:\n %s\n", description); + + g_print ("\n"); +} + +static void +print_event (GDataCalendarEvent *event) +{ + const gchar *title, *id, *description, *status, *visibility; + const gchar *transparency, *uid; + GTimeVal date_published_tv = { 0, }; + GTimeVal date_edited_tv = { 0, }; + gchar *date_published = NULL; /* owned */ + gchar *date_edited = NULL; /* owned */ + guint sequence; + gboolean guests_can_modify, guests_can_invite_others; + gboolean guests_can_see_guests, anyone_can_add_self; + GList/*<unowned GDataGDWho>*/ *people; /* unowned */ + GList/*<unowned GDataGDWhere>*/ *places; /* unowned */ + GList/*<unowned GDataGDWhen>*/ *times; /* unowned */ + + title = gdata_entry_get_title (GDATA_ENTRY (event)); + id = gdata_entry_get_id (GDATA_ENTRY (event)); + description = gdata_entry_get_content (GDATA_ENTRY (event)); + date_published_tv.tv_sec = gdata_entry_get_published (GDATA_ENTRY (event)); + date_published = g_time_val_to_iso8601 (&date_published_tv); + date_edited_tv.tv_sec = gdata_calendar_event_get_edited (event); + date_edited = g_time_val_to_iso8601 (&date_edited_tv); + status = gdata_calendar_event_get_status (event); + visibility = gdata_calendar_event_get_visibility (event); + transparency = gdata_calendar_event_get_transparency (event); + uid = gdata_calendar_event_get_uid (event); + sequence = gdata_calendar_event_get_sequence (event); + guests_can_modify = gdata_calendar_event_get_guests_can_modify (event); + guests_can_invite_others = gdata_calendar_event_get_guests_can_invite_others (event); + guests_can_see_guests = gdata_calendar_event_get_guests_can_see_guests (event); + anyone_can_add_self = gdata_calendar_event_get_anyone_can_add_self (event); + people = gdata_calendar_event_get_people (event); + places = gdata_calendar_event_get_places (event); + times = gdata_calendar_event_get_times (event); + + g_print ("%s — %s\n", id, title); + g_print (" UID: %s\n", uid); + g_print (" Sequence: %u\n", sequence); + g_print (" Published: %s\n", date_published); + g_print (" Edited: %s\n", date_edited); + g_print (" Status: %s\n", status); + g_print (" Visibility: %s\n", visibility); + g_print (" Transparency: %s\n", transparency); + g_print (" Guests can modify event? %s\n", + guests_can_modify ? "Yes" : "No"); + g_print (" Guests can invite others? %s\n", + guests_can_invite_others ? "Yes" : "No"); + g_print (" Guests can see guest list? %s\n", + guests_can_see_guests ? "Yes" : "No"); + g_print (" Anyone can add themselves? %s\n", + anyone_can_add_self ? "Yes" : "No"); + g_print (" Description:\n %s\n", description); + + g_print (" Guests:\n"); + + for (; people != NULL; people = people->next) { + GDataGDWho *who; + + who = GDATA_GD_WHO (people->data); + g_print (" • %s — %s (%s)\n", + gdata_gd_who_get_value_string (who), + gdata_gd_who_get_email_address (who), + gdata_gd_who_get_relation_type (who)); + } + + g_print (" Locations:\n"); + + for (; places != NULL; places = places->next) { + GDataGDWhere *where; + + where = GDATA_GD_WHERE (places->data); + g_print (" • %s\n", gdata_gd_where_get_value_string (where)); + } + + g_print (" Times:\n"); + + for (; times != NULL; times = times->next) { + GDataGDWhen *when; + GTimeVal start_time = { 0, }, end_time = { 0, }; + gchar *start = NULL, *end = NULL; /* owned */ + + when = GDATA_GD_WHEN (times->data); + + start_time.tv_sec = gdata_gd_when_get_start_time (when); + end_time.tv_sec = gdata_gd_when_get_end_time (when); + + if (gdata_gd_when_is_date (when)) { + start = tv_to_iso8601_date (&start_time); + end = tv_to_iso8601_date (&end_time); + } else { + start = g_time_val_to_iso8601 (&start_time); + end = g_time_val_to_iso8601 (&end_time); + } + + g_print (" • %s to %s (%s)\n", + start, end, gdata_gd_when_get_value_string (when)); + + /* TODO: Reminders are not supported yet. */ + } + + g_print ("\n"); + + g_free (date_published); +} + +static GDataAuthorizer * +create_authorizer (GError **error) +{ + GDataOAuth2Authorizer *authorizer = NULL; /* owned */ + gchar *uri = NULL; + gchar code[100]; + GError *child_error = NULL; + + /* Go through the interactive OAuth dance. */ + authorizer = gdata_oauth2_authorizer_new (CLIENT_ID, CLIENT_SECRET, + REDIRECT_URI, + GDATA_TYPE_CALENDAR_SERVICE); + + /* Get an authentication URI */ + uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, + NULL, FALSE); + + /* Wait for the user to retrieve and enter the verifier. */ + g_print ("Please navigate to the following URI and grant access:\n" + " %s\n", uri); + g_print ("Enter verifier (EOF to abort): "); + + g_free (uri); + + if (scanf ("%100s", code) != 1) { + /* User chose to abort. */ + g_print ("\n"); + g_clear_object (&authorizer); + return NULL; + } + + /* Authorise the token. */ + gdata_oauth2_authorizer_request_authorization (authorizer, code, NULL, + &child_error); + + if (child_error != NULL) { + g_propagate_error (error, child_error); + g_clear_object (&authorizer); + return NULL; + } + + return GDATA_AUTHORIZER (authorizer); +} + +/* List all the user’s calendars. */ +static int +command_calendars (int argc, char *argv[]) +{ + GDataCalendarService *service = NULL; + GDataCalendarQuery *query = NULL; + GDataFeed *feed = NULL; + GList/*<unowned GDataCalendarCalendar>*/ *entries; + GError *error = NULL; + gint retval = 0; + gboolean only_own; /* only query for calendars the user owns */ + GDataAuthorizer *authorizer = NULL; + + if (argc < 2) { + return print_usage (argv); + } else if (argc == 2) { + only_own = FALSE; + } else if (g_strcmp0 (argv[2], "--all") == 0 || + g_strcmp0 (argv[2], "--own") == 0) { + only_own = (g_strcmp0 (argv[2], "--own") == 0); + } else { + only_own = FALSE; + } + + /* Authenticate and create a service. */ + authorizer = create_authorizer (&error); + + if (error != NULL) { + g_printerr ("%s: Error authenticating: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } else if (authorizer == NULL) { + g_printerr ("%s: User chose to abort authentication.\n", + argv[0]); + retval = 1; + goto done; + } + + service = gdata_calendar_service_new (authorizer); + query = gdata_calendar_query_new (NULL); + + if (only_own) { + feed = gdata_calendar_service_query_own_calendars (service, + GDATA_QUERY (query), + NULL, NULL, + NULL, + &error); + } else { + feed = gdata_calendar_service_query_all_calendars (service, + GDATA_QUERY (query), + NULL, NULL, + NULL, + &error); + } + + if (error != NULL) { + g_printerr ("%s: Error querying calendars: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + for (entries = gdata_feed_get_entries (feed); entries != NULL; + entries = entries->next) { + GDataCalendarCalendar *calendar; + + calendar = GDATA_CALENDAR_CALENDAR (entries->data); + print_calendar (calendar); + } + + g_print ("Total of %u results.\n", + g_list_length (gdata_feed_get_entries (feed))); + +done: + g_clear_object (&feed); + g_clear_object (&query); + g_clear_object (&authorizer); + g_clear_object (&service); + + return retval; +} + +/* Query the events in a calendar. */ +static int +command_events (int argc, char *argv[]) +{ + GDataCalendarService *service = NULL; + GDataCalendarCalendar *calendar = NULL; + GDataCalendarQuery *query = NULL; + GError *error = NULL; + gint retval = 0; + const gchar *query_string, *calendar_id; + GDataAuthorizer *authorizer = NULL; + guint n_results; + + if (argc < 3) { + return print_usage (argv); + } + + calendar_id = argv[2]; + query_string = (argc > 3) ? argv[3] : NULL; + + /* Authenticate and create a service. */ + authorizer = create_authorizer (&error); + + if (error != NULL) { + g_printerr ("%s: Error authenticating: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } else if (authorizer == NULL) { + g_printerr ("%s: User chose to abort authentication.\n", + argv[0]); + retval = 1; + goto done; + } + + service = gdata_calendar_service_new (authorizer); + query = gdata_calendar_query_new (query_string); + gdata_query_set_max_results (GDATA_QUERY (query), 10); + calendar = gdata_calendar_calendar_new (calendar_id); + n_results = 0; + + while (TRUE) { + GList/*<unowned GDataCalendarEvent>*/ *entries, *l; + GDataFeed *feed = NULL; + + feed = gdata_calendar_service_query_events (service, calendar, + GDATA_QUERY (query), NULL, + NULL, NULL, &error); + + if (error != NULL) { + g_printerr ("%s: Error querying events: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + entries = gdata_feed_get_entries (feed); + + if (entries == NULL) { + retval = 0; + g_object_unref (feed); + goto done; + } + + for (l = entries; l != NULL; l = l->next) { + GDataCalendarEvent *event; + + event = GDATA_CALENDAR_EVENT (l->data); + print_event (event); + n_results++; + } + + gdata_query_next_page (GDATA_QUERY (query)); + g_object_unref (feed); + } + + g_print ("Total of %u results.\n", n_results); + +done: + g_clear_object (&query); + g_clear_object (&authorizer); + g_clear_object (&calendar); + g_clear_object (&service); + + return retval; +} + +/* Insert a new event into a calendar. */ +static int +command_insert_event (int argc, char *argv[]) +{ + GDataCalendarService *service = NULL; + GDataCalendarCalendar *calendar = NULL; + GDataCalendarEvent *event = NULL; + GDataCalendarEvent *inserted_event = NULL; + GError *error = NULL; + gint retval = 0; + const gchar *calendar_id, *title, *start, *end; + GDataAuthorizer *authorizer = NULL; + GDataGDWhen *when = NULL; + gboolean is_date; + gchar *start_with_time = NULL, *end_with_time = NULL; + GTimeVal start_tv = { 0, }, end_tv = { 0, }; + gint i; + + if (argc < 7) { + return print_usage (argv); + } + + calendar_id = argv[2]; + title = argv[3]; + start = argv[4]; + end = argv[5]; + /* subsequent arguments are e-mail addresses of attendees, + * with at least one required. */ + + /* Authenticate and create a service. */ + authorizer = create_authorizer (&error); + + if (error != NULL) { + g_printerr ("%s: Error authenticating: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } else if (authorizer == NULL) { + g_printerr ("%s: User chose to abort authentication.\n", + argv[0]); + retval = 1; + goto done; + } + + service = gdata_calendar_service_new (authorizer); + calendar = gdata_calendar_calendar_new (calendar_id); + + /* Create the event to insert. */ + event = gdata_calendar_event_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (event), title); + + start_with_time = g_strconcat (start, "T00:00:00Z", NULL); + end_with_time = g_strconcat (end, "T00:00:00Z", NULL); + + if (g_time_val_from_iso8601 (start, &start_tv) && + g_time_val_from_iso8601 (end, &end_tv)) { + /* Includes time. */ + is_date = FALSE; + } else if (g_time_val_from_iso8601 (start_with_time, &start_tv) && + g_time_val_from_iso8601 (end_with_time, &end_tv)) { + /* Does not include time. */ + is_date = TRUE; + } else { + g_printerr ("%s: Could not parse start time ‘%s’ and end time " + "‘%s’ as ISO 8601.\n", argv[0], start, end); + retval = 1; + goto done; + } + + when = gdata_gd_when_new (start_tv.tv_sec, end_tv.tv_sec, is_date); + gdata_calendar_event_add_time (event, when); + g_object_unref (when); + + for (i = 6; i < argc; i++) { + GDataGDWho *who = NULL; + const gchar *relation_type, *email_address; + + relation_type = GDATA_GD_WHO_EVENT_ATTENDEE; + email_address = argv[i]; + + who = gdata_gd_who_new (relation_type, NULL, email_address); + gdata_calendar_event_add_person (event, who); + g_object_unref (who); + } + + /* Insert the event. */ + inserted_event = gdata_calendar_service_insert_calendar_event (service, + calendar, + event, + NULL, + &error); + + if (error != NULL) { + g_printerr ("%s: Error inserting event: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + print_event (inserted_event); + +done: + g_free (start_with_time); + g_free (end_with_time); + g_clear_object (&inserted_event); + g_clear_object (&event); + g_clear_object (&authorizer); + g_clear_object (&calendar); + g_clear_object (&service); + + return retval; +} + +static const struct { + const gchar *command; + int (*handler_fn) (int argc, char **argv); +} command_handlers[] = { + { "calendars", command_calendars }, + { "events", command_events }, + { "insert-event", command_insert_event }, +}; + +int +main (int argc, char *argv[]) +{ + guint i; + gint retval = -1; + + setlocale (LC_ALL, ""); + + if (argc < 2) { + return print_usage (argv); + } + + for (i = 0; i < G_N_ELEMENTS (command_handlers); i++) { + if (strcmp (argv[1], command_handlers[i].command) == 0) { + retval = command_handlers[i].handler_fn (argc, argv); + } + } + + if (retval == -1) { + retval = print_usage (argv); + } + + return retval; +} diff --git a/demos/docs-list/docs-list.c b/demos/docs-list/docs-list.c new file mode 100644 index 0000000..85e0e1e --- /dev/null +++ b/demos/docs-list/docs-list.c @@ -0,0 +1,120 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Debarshi Ray <rishi.is@lostca.se> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * Simple example program to list all documents in the user’s Google Documents + * account, retrieving the account information from GOA. + */ + +#include <gio/gio.h> +#include <glib.h> +#include <locale.h> + +#define GOA_API_IS_SUBJECT_TO_CHANGE +#include <gdata/gdata.h> +#include <goa/goa.h> + +gint +main (void) +{ + GDataDocumentsFeed *feed = NULL; + GDataDocumentsQuery *query = NULL; + GDataDocumentsService *service = NULL; + GError *error = NULL; + GList *accounts = NULL; + GList *entries; + GList *l; + GoaClient *client = NULL; + gint retval; + + setlocale (LC_ALL, ""); + + client = goa_client_new_sync (NULL, &error); + if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); + retval = 1; + goto out; + } + + accounts = goa_client_get_accounts (client); + for (l = accounts; l != NULL; l = l->next) { + GoaAccount *account; + GoaObject *object = GOA_OBJECT (l->data); + const gchar *provider_type; + + account = goa_object_peek_account (object); + provider_type = goa_account_get_provider_type (account); + + if (g_strcmp0 (provider_type, "google") == 0) { + GDataGoaAuthorizer *authorizer; + + authorizer = gdata_goa_authorizer_new (object); + service = gdata_documents_service_new (GDATA_AUTHORIZER (authorizer)); + g_object_unref (authorizer); + } + } + + if (service == NULL) { + g_warning ("Account not found"); + retval = 1; + goto out; + } + + query = gdata_documents_query_new_with_limits (NULL, 1, 10); + gdata_documents_query_set_show_folders (query, TRUE); + + while (TRUE) { + feed = gdata_documents_service_query_documents (service, query, NULL, NULL, NULL, &error); + if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); + retval = 1; + goto out; + } + + entries = gdata_feed_get_entries (GDATA_FEED (feed)); + if (entries == NULL) { + retval = 0; + goto out; + } + + for (l = entries; l != NULL; l = l->next) { + GDataEntry *entry = GDATA_ENTRY (l->data); + const gchar *title; + + title = gdata_entry_get_title (entry); + g_message ("%s", title); + } + + gdata_query_next_page (GDATA_QUERY (query)); + g_object_unref (feed); + } + + retval = 0; + +out: + g_clear_object (&feed); + g_clear_object (&query); + g_clear_object (&service); + g_clear_object (&client); + g_list_free_full (accounts, g_object_unref); + + return retval; +} diff --git a/demos/scrapbook/scrapbook.c b/demos/scrapbook/scrapbook.c new file mode 100644 index 0000000..d909ab0 --- /dev/null +++ b/demos/scrapbook/scrapbook.c @@ -0,0 +1,721 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Joe Cortes 2010 <escozzia@gmail.com> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * This is an extremely simple example program to query youtube videos + * and picasa pictures and add them to a grid. + * It was coded as part of the 2010 Google Code-In. + * Click on Properties to change the window's title, or authenticate + * yourself (it's assumed that your google and picasa ids are the same) + * It's also possible to upload files to picasa. + * Since this is only an example, intended to serve as documentation, + * it's probably full of bugs and a couple of awful programming practices. + * The program itself is of no practical use, but it does what it is + * meant to do and doesn't segfault randomly (I hope so :p). + */ + +#include "scrapbook.h" + +static void +open_in_web_browser (GtkWidget *widget, gchar *uri) /* quicky wrapper for gtk_show_uri */ +{ + gtk_show_uri_on_window (GTK_WINDOW (gtk_widget_get_toplevel (widget)), uri, GDK_CURRENT_TIME, NULL); +} + +static void +picture_selected (GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, ScrapPicSearch *self) +{ + GtkTreeModel *model; + GtkTreeIter iter; + GDataEntry *pic; + GdkPixbuf *thumbnail; + GtkWidget *button; + GtkWidget *image; + + pic = g_slice_new (GDataEntry); + model = gtk_tree_view_get_model (tree); + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get (model, &iter, COL_PIXBUF, &(thumbnail), P_COL_PIC, &(pic), -1); + gtk_widget_destroy (self->search_data->window); + gtk_list_store_append (self->main_data->lStore, &iter); + gtk_list_store_set (self->main_data->lStore, &iter, + ORIG_COL_PIXBUF, thumbnail, + ORIG_COL_TITLE, gdata_entry_get_title (pic), + ORIG_COL_ENTRY, pic, -1); + if (self->main_data->currentRow[self->main_data->currentCol] > self->main_data->max_rows) { + self->main_data->currentCol++; + self->main_data->currentRow[self->main_data->currentCol] = 0; + } + image = gtk_image_new_from_pixbuf (thumbnail); + button = gtk_button_new (); + self->file = GDATA_PICASAWEB_FILE (pic); + gtk_widget_show (image); + gtk_container_add (GTK_CONTAINER (button), image); + /*g_signal_connect (button, "clicked", G_CALLBACK (open_in_web_browser), gdata_entry_get_id (pic)); + * commented out, I can't seem to find anything that will give me a picture's URI */ + + gtk_grid_attach (GTK_GRID (self->main_data->grid), button, + self->main_data->currentCol, + self->main_data->currentRow[self->main_data->currentCol], + 1, 1); + + gtk_widget_show (button); + self->main_data->currentRow[self->main_data->currentCol]++; +} + + + +static void +video_selected (GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, ScrapYTSearch *self) +{ + GtkTreeModel *model; + GtkTreeIter iter; + GDataEntry *video; + GdkPixbuf *thumbnail; + GtkWidget *button; + GtkWidget *image; + video = g_slice_new (GDataEntry); + model = gtk_tree_view_get_model (tree); + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get (model, &iter, COL_PIXBUF, &(thumbnail), COL_VIDEO, &(video), -1); + gtk_widget_destroy (self->window); + gtk_list_store_append (self->main_data->lStore, &iter); + gtk_list_store_set (self->main_data->lStore, &iter, + ORIG_COL_PIXBUF, thumbnail, + ORIG_COL_TITLE, gdata_entry_get_title (video), + ORIG_COL_ENTRY, video, -1); + if (self->main_data->currentRow[self->main_data->currentCol] > self->main_data->max_rows) { + self->main_data->currentCol++; + self->main_data->currentRow[self->main_data->currentCol] = 0; + } + image = gtk_image_new_from_pixbuf (thumbnail); + button = gtk_button_new (); + gtk_widget_show (image); + gtk_container_add (GTK_CONTAINER (button), image); + g_signal_connect (button, "clicked", G_CALLBACK (open_in_web_browser), + (gpointer) gdata_youtube_video_get_player_uri (GDATA_YOUTUBE_VIDEO (video))); + + gtk_grid_attach (GTK_GRID (self->main_data->grid), button, + self->main_data->currentCol, + self->main_data->currentRow[self->main_data->currentCol], + 1, 1); + + gtk_widget_show (button); + self->main_data->currentRow[self->main_data->currentCol]++; +} + +static void +p_display_tree (ScrapPicSearch *self) +{ + GtkCellRenderer *renderer; + GtkWidget *scrollWin; + scrollWin = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrollWin), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + + renderer = gtk_cell_renderer_pixbuf_new (); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (self->tView), -1, + "", renderer, "pixbuf", + P_COL_PIXBUF, NULL); + + renderer = gtk_cell_renderer_text_new (); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (self->tView), -1, + "", renderer, "text", + P_COL_USER, NULL); + + renderer = gtk_cell_renderer_text_new (); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (self->tView), -1, + "", renderer, "text", + P_COL_TITLE, NULL); + + gtk_tree_view_set_model (GTK_TREE_VIEW (self->tView), GTK_TREE_MODEL (self->lStore)); + gtk_container_add (GTK_CONTAINER (scrollWin), self->tView); + + g_signal_connect (self->tView, "row-activated", G_CALLBACK (picture_selected), self); + + gtk_widget_show (self->tView); + gtk_widget_show (scrollWin); + gtk_box_pack_start (GTK_BOX(self->search_data->box1), scrollWin, TRUE, TRUE, 2); +} + + +static void +yt_display_tree (ScrapYTSearch *self) +{ + GtkCellRenderer *renderer; + GtkWidget *scrollWin; + scrollWin = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrollWin), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + renderer = gtk_cell_renderer_pixbuf_new (); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (self->tView), -1, + "", renderer, "pixbuf", + COL_PIXBUF, NULL); + renderer = gtk_cell_renderer_text_new (); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (self->tView), -1, + "", renderer, "text", + COL_TITLE, NULL); + gtk_tree_view_set_model (GTK_TREE_VIEW (self->tView), GTK_TREE_MODEL (self->lStore)); + gtk_container_add (GTK_CONTAINER (scrollWin), self->tView); + g_signal_connect (self->tView, "row-activated", G_CALLBACK (video_selected), self); + gtk_widget_show (self->tView); + gtk_widget_show (scrollWin); + gtk_box_pack_start (GTK_BOX(self->box1), scrollWin, TRUE, TRUE, 2); +} + +GDataMediaThumbnail * +choose_best_thumbnail (GList *thumbnails, gint ideal_size) +{ + gint delta = G_MININT; + GDataMediaThumbnail *thumbnail = NULL; + for (; thumbnails != NULL; thumbnails = thumbnails->next) { + gint new_delta; + GDataMediaThumbnail *current = (GDataMediaThumbnail *) thumbnails->data; + new_delta = gdata_media_thumbnail_get_width (current) - ideal_size; + if (delta == 0) { + break; + } else if ((delta == G_MININT) + || (delta < 0 && new_delta > delta) + || (delta > 0 && new_delta < delta)) { + delta = new_delta; + thumbnail = current; + } + } + return thumbnail; +} + +static void +find_pictures (GDataEntry *entry, guint entry_key, guint entry_count, ScrapPicSearch *self) +{ + GtkTreeIter iter; + GList *thumbnails; + GDataMediaThumbnail *thumbnail; + GFileInputStream *input_stream; + + gtk_list_store_append (self->lStore, &iter); + gtk_list_store_set (self->lStore, &iter, + P_COL_PIXBUF, NULL, + P_COL_TITLE, self->title, + P_COL_USER, self->user, + P_COL_PIC, entry, -1); + thumbnails = gdata_picasaweb_file_get_thumbnails (GDATA_PICASAWEB_FILE (entry)); + thumbnail = choose_best_thumbnail (thumbnails, THUMBNAIL_WIDTH); + if (thumbnail != NULL) { + GFile *thumbnail_file; + thumbnail_file = g_file_new_for_uri (gdata_media_thumbnail_get_uri (thumbnail)); + input_stream = g_file_read (thumbnail_file, NULL, NULL); + self->thumbnail = gdk_pixbuf_new_from_stream_at_scale (G_INPUT_STREAM (input_stream), THUMBNAIL_WIDTH, -1, + TRUE, NULL, NULL); + gtk_list_store_set (self->lStore, &iter, P_COL_PIXBUF, self->thumbnail, -1); /* we can now set the thumbnail ;) */ + g_object_unref (thumbnail_file); + } + gdata_query_set_q (self->query, NULL); +} + + +static void +p_query_element (GDataEntry *entry, guint entry_key, guint entry_count, ScrapPSearch *self) +{ + GError *error=NULL; + ScrapPicSearch *picture; + GDataFeed *feed; + + picture = self->pic; + picture->title = gdata_entry_get_title (entry); + picture->query = picture->search_data->query; + picture->user = self->user; + gdata_query_set_q (picture->query, picture->title); + feed = gdata_picasaweb_service_query_files (self->main_data->picasaweb_service, GDATA_PICASAWEB_ALBUM (entry), picture->query, NULL, + (GDataQueryProgressCallback) find_pictures, picture, &error); + + if (error != NULL) { + g_print ("whoops, somebody raised an error!\n%s", error->message); + g_error_free (error); + } + + if (feed != NULL) { + g_object_unref (feed); + } +} + +static void +p_text_callback (GtkWidget *widget, ScrapPSearch *self) +{ + GError *error = NULL; + GDataFeed *feed; + + self->user = gtk_entry_get_text (GTK_ENTRY (self->user_entry)); + self->pic->tView = gtk_tree_view_new (); + feed = gdata_picasaweb_service_query_all_albums (self->main_data->picasaweb_service, self->query, self->user, NULL, + (GDataQueryProgressCallback) p_query_element, self, &error); + if (error != NULL) { + g_print ("someone raised an error\n%s\n",error->message); + g_error_free (error); + } + + if (feed != NULL) { + g_object_unref (feed); + } + + p_display_tree (self->pic); +} + + +/* ran as a callback for each individual element queried + * it takes the video found, a unique entry_key and entry_count and the data structure as arguments + * parts of this function were inspired (or simply taken) from the totem youtube plugin */ +static void +yt_query_element (GDataEntry *entry, guint entry_key, guint entry_count, ScrapYTSearch *self) +{ + GtkTreeIter iter; + GList *thumbnails; + GDataMediaThumbnail *thumbnail; + const gchar *title; /* the video's title */ + const gchar *uri; /* the video's URI */ + GFileInputStream *input_stream; /* this will be used to make a pixbuf to store the thumbnail */ + + title = gdata_entry_get_title (entry); /* self-explanatory, I hope */ + uri = gdata_youtube_video_get_player_uri (GDATA_YOUTUBE_VIDEO (entry)); /* ditto */ + g_print ("%s %s", title, uri); + gtk_list_store_append (self->lStore, &iter); /* make a new entry for this vid */ + gtk_list_store_set (self->lStore, &iter, + COL_PIXBUF, NULL, /* this will be set in a few moments */ + COL_TITLE, title, + COL_VIDEO, entry, + -1); + /* get a GList of thumbnails for the vid */ + thumbnails = gdata_youtube_video_get_thumbnails (GDATA_YOUTUBE_VIDEO (entry)); + thumbnail = choose_best_thumbnail (thumbnails, THUMBNAIL_WIDTH); + if (thumbnail != NULL) { + GFile *thumbnail_file; + thumbnail_file = g_file_new_for_uri (gdata_media_thumbnail_get_uri (thumbnail)); + input_stream = g_file_read (thumbnail_file, NULL, NULL); + self->thumbnail = gdk_pixbuf_new_from_stream_at_scale (G_INPUT_STREAM (input_stream), THUMBNAIL_WIDTH, -1, + TRUE, NULL, NULL); + gtk_list_store_set (self->lStore, &iter, COL_PIXBUF, self->thumbnail, -1); /* we can now set the thumbnail ;) */ + g_object_unref (thumbnail_file); + } +} + + +static void +yt_text_callback (GtkWidget *widget, ScrapYTSearch *self) +{ + GDataFeed *feed; + + self->txt = gtk_entry_get_text (GTK_ENTRY (self->txt_entry)); + gdata_query_set_q (self->query, self->txt); /* set the string we'll be searching for in youtube */ + + /* do the actual query, running yt_query_element for each object found */ + feed = gdata_youtube_service_query_videos (self->main_data->youtube_service, self->query, NULL, (GDataQueryProgressCallback) yt_query_element, + self, NULL); + if (feed != NULL) { + g_object_unref (feed); + } + + yt_display_tree (self); /* run yt_display_tree to show the results */ +} + + +static void +start_new_picasa_search (GtkWidget *widget, ScrapData *first) +{ + ScrapPSearch *self; + ScrapPicSearch *picture; + GtkWidget *button, *box2; + + self = first->p_search; + picture = first->pic_search; + picture->search_data = self; + picture->search_data->pic = picture; + picture->main_data = self->main_data; + g_assert (GDATA_IS_PICASAWEB_SERVICE (first->picasaweb_service)); + gtk_list_store_clear (self->pic->lStore); + + self->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_resize (GTK_WINDOW (self->window), 400, 400); + g_signal_connect (self->window, "destroy", G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect_swapped (self->window, "delete-event", G_CALLBACK (gtk_widget_destroy), NULL); + + /* our two boxes */ + + self->box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); /* this box contains everything in our window */ + gtk_container_add (GTK_CONTAINER (self->window), self->box1); + box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); + + /* search bar */ + + self->user_entry = gtk_entry_new (); + gtk_entry_set_text (GTK_ENTRY (self->user_entry), "User to search for"); + g_signal_connect (self->user_entry, "activate", (GCallback) p_text_callback, self); + gtk_box_pack_start (GTK_BOX(box2), self->user_entry, TRUE, TRUE, 0); + gtk_widget_show (self->user_entry); + + /* Search button */ + button = gtk_button_new_with_mnemonic ("_Search"); + g_signal_connect (button, "clicked", (GCallback) p_text_callback, self); + gtk_box_pack_start (GTK_BOX (box2), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_box_pack_end (GTK_BOX (self->box1), box2, FALSE, FALSE, 0); /* pack the box with the button and search bar */ + gtk_widget_show (box2); + + gtk_widget_show (self->box1); + gtk_widget_show (self->window); +} + + + +static void +start_new_youtube_search (GtkWidget *widget, ScrapData *first) /* *first is a pointer we use to talk to the main window */ +{ + ScrapYTSearch *self; /* this struct will be used for all the data in the search, if there's time I'll make it into a GObject */ + GtkWidget *button, *box2; + + self = first->yt_search; + + gtk_list_store_clear (self->lStore); /* clear it out */ + self->tView = gtk_tree_view_new (); + /* window stuff */ + self->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_resize (GTK_WINDOW (self->window), 400, 400); + g_signal_connect (self->window, "destroy", G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect_swapped (self->window, "delete-event", G_CALLBACK (gtk_widget_destroy), NULL); + + /* our two boxes */ + + self->box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); /* this box contains everything in our window */ + gtk_container_add (GTK_CONTAINER (self->window), self->box1); + box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); + + /* search bar */ + + self->txt_entry = gtk_entry_new (); + g_signal_connect (self->txt_entry, "activate", G_CALLBACK (yt_text_callback), self); + gtk_box_pack_start (GTK_BOX (box2), self->txt_entry, TRUE, TRUE, 0); + gtk_widget_show (self->txt_entry); + + /* Search button */ + button = gtk_button_new_with_mnemonic ("_Search"); + g_signal_connect (button, "clicked", (GCallback) yt_text_callback, self); + gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); + gtk_widget_show (button); + + gtk_box_pack_end (GTK_BOX (self->box1), box2, FALSE, FALSE, 0); /* pack the box with the button and search bar */ + + gtk_widget_show (box2); + gtk_widget_show (self->box1); + gtk_widget_show (self->window); + + + /* everything else is implemented somewhere else */ +} + + +static void +properties_set (GtkWidget *widget, ScrapProps *self) +{ + GDataClientLoginAuthorizer *authorizer; + GList *domains = NULL; /* list of GDataAuthorizationDomains */ + GError *error = NULL; + + /* Get the username and password to use */ + self->main_data->username = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->username_entry))); + self->main_data->password = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->password_entry))); + + /* Domains we need to be authorised for */ + domains = g_list_prepend (domains, gdata_youtube_service_get_primary_authorization_domain ()); + domains = g_list_prepend (domains, gdata_picasaweb_service_get_primary_authorization_domain ()); + + /* Authenticate */ + authorizer = gdata_client_login_authorizer_new_for_authorization_domains (CLIENT_ID, domains); + + gdata_client_login_authorizer_authenticate (authorizer, self->main_data->username, self->main_data->password, NULL, &error); + + if (error != NULL) { /* we show this to the user in case they mistyped their password */ + GtkWidget *label; + + label = gtk_label_new (error->message); + gtk_widget_show (label); + gtk_box_pack_end (GTK_BOX (self->box1), label, FALSE, FALSE, 0); + + g_print ("error\n%s\n", error->message); + + g_error_free (error); + } + + gdata_service_set_authorizer (GDATA_SERVICE (self->main_data->youtube_service), GDATA_AUTHORIZER (authorizer)); + gdata_service_set_authorizer (GDATA_SERVICE (self->main_data->picasaweb_service), GDATA_AUTHORIZER (authorizer)); + + gtk_widget_destroy (self->window); + g_object_unref (authorizer); +} + +static void +properties_show (GtkWidget *widget, ScrapData *first) +{ + ScrapProps *self; + GtkWidget *label, *button, *box2; + + self = g_slice_new (struct _ScrapProps); + self->main_data = first; + self->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + g_signal_connect (self->window, "destroy", G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (self->window, "delete-event", G_CALLBACK (gtk_widget_destroy), NULL); + + self->box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); + + /* Username/Password labels box */ + box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); + + label = gtk_label_new ("Username"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (box2), label, TRUE, TRUE, 0); + + label = gtk_label_new ("Password"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (box2), label, TRUE, TRUE, 0); + + gtk_widget_show (box2); + gtk_box_pack_start (GTK_BOX (self->box1), box2, FALSE, FALSE, 0); + + /* Username/Password entries box */ + box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); + self->username_entry = gtk_entry_new (); + + if (self->main_data->username != NULL) + gtk_entry_set_text (GTK_ENTRY(self->username_entry), self->main_data->username); + + gtk_widget_show (self->username_entry); + gtk_box_pack_start (GTK_BOX (box2), self->username_entry, TRUE, TRUE, 0); + + self->password_entry = gtk_entry_new (); + gtk_entry_set_visibility (GTK_ENTRY (self->password_entry), FALSE); + + if (self->main_data->password != NULL) + gtk_entry_set_text (GTK_ENTRY(self->password_entry), self->main_data->password); + + gtk_widget_show (self->password_entry); + gtk_box_pack_start (GTK_BOX (box2), self->password_entry, TRUE, TRUE, 0); + + gtk_box_pack_start (GTK_BOX (self->box1), box2, FALSE, FALSE, 0); + gtk_widget_show (box2); + + /* OK button */ + button = gtk_button_new_with_label ("_OK"); + g_signal_connect (button, "clicked", (GCallback) properties_set, self); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (self->box1), button, FALSE, FALSE, 0); + + gtk_widget_show (self->box1); + gtk_container_add (GTK_CONTAINER (self->window), self->box1); + gtk_widget_show (self->window); +} + +static void +select_file (ScrapPUpload *self, GtkFileChooser *file_chooser) +{ + GFile *file; + GError *error = NULL; + GFileInfo *file_info; + GDataUploadStream *upload_stream; + GFileInputStream *file_stream; + + file = gtk_file_chooser_get_file (file_chooser); + + file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, + G_FILE_QUERY_INFO_NONE, NULL, NULL); + + /* upload our file, using the service we've set up, and metadata + * set up in upload () + * no album is specified, but that should be easy to add */ + upload_stream = gdata_picasaweb_service_upload_file (self->main_data->picasaweb_service, NULL /* for now uploading to drop box */, + self->file, g_file_info_get_display_name (file_info), + g_file_info_get_content_type (file_info), NULL, &error); + + g_object_unref (file_info); + g_object_unref (self->file); + self->file = NULL; + + if (error != NULL) { + g_print ("Error: %s\n", error->message); + g_error_free (error); + + g_object_unref (file); + + return; + } + + file_stream = g_file_read (file, NULL, NULL); + g_object_unref (file); + + g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), G_INPUT_STREAM (file_stream), + G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, NULL); + + self->file = gdata_picasaweb_service_finish_file_upload (self->main_data->picasaweb_service, upload_stream, NULL); + + g_object_unref (file_stream); + g_object_unref (upload_stream); +} + +static void +got_name (GtkWidget *widget, ScrapData *scrap_data) +{ + ScrapPUpload *self; + GtkWidget *file_dialog; + + self = scrap_data->p_upload; + + gdata_entry_set_title (GDATA_ENTRY (self->file), + gtk_entry_get_text (GTK_ENTRY (self->name))); + gdata_entry_set_summary (GDATA_ENTRY (self->file), + gtk_entry_get_text (GTK_ENTRY (self->description))); + gtk_widget_destroy (self->dialog); + + file_dialog = gtk_file_chooser_dialog_new ("Upload Photo", GTK_WINDOW (scrap_data->window), GTK_FILE_CHOOSER_ACTION_SAVE, + "_Cancel", GTK_RESPONSE_CANCEL, + "_Open", GTK_RESPONSE_ACCEPT, + NULL); + + if (gtk_dialog_run (GTK_DIALOG (file_dialog)) == GTK_RESPONSE_ACCEPT) { + select_file (self, GTK_FILE_CHOOSER (file_dialog)); + } + + /* since the upload blocks, it's safe to assume the widget won't + * be destroyed until we're done */ + gtk_widget_destroy (file_dialog); +} + +static void +upload (GtkWidget *widget, ScrapData *first) +{ + ScrapPUpload *self; + GtkWidget *label, *content_area; + label = gtk_label_new ("Enter photo name and description"); + self = first->p_upload; + + /* we make a new file, without an id (it will be assigned automatically later on) */ + self->file = gdata_picasaweb_file_new (NULL); + /* dialog to get the file's name and description */ + self->dialog = gtk_dialog_new(); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (self->dialog)); + + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 0); + + self->name = gtk_entry_new (); + g_signal_connect (self->name, "activate", G_CALLBACK (got_name), self); + gtk_widget_show (self->name); + gtk_box_pack_start (GTK_BOX (content_area), self->name, TRUE, TRUE, 0); + + self->description = gtk_entry_new (); + g_signal_connect (self->description, "activate", G_CALLBACK (got_name), first); + gtk_widget_show (self->description); + gtk_box_pack_start (GTK_BOX (content_area), self->description, TRUE, TRUE, 0); + + gtk_widget_show (self->dialog); +} + +int +main(int argc, char **argv) +{ + ScrapData *scrapbook; + ScrapPSearch *picasaSearch; + ScrapYTSearch *youtubeSearch; + ScrapPicSearch *photoSearch; + ScrapPUpload *fUpload; + GtkWidget *button; + GtkWidget *vbox; + + scrapbook = g_slice_new (struct _ScrapData); + scrapbook->max_rows = 5; + + gtk_init (&argc, &argv); + + scrapbook->currentCol = 0; + scrapbook->currentRow[scrapbook->currentCol] = 0; + + scrapbook->lStore = gtk_list_store_new (ORIG_N_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING, GDATA_TYPE_ENTRY); + scrapbook->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (scrapbook->window), "Scrapbook"); + g_signal_connect (scrapbook->window, "destroy", G_CALLBACK (gtk_main_quit), NULL); + g_signal_connect (scrapbook->window, "delete-event", G_CALLBACK (gtk_main_quit), NULL); + + youtubeSearch = g_slice_new (struct _ScrapYTSearch); /* get some memory for the structure */ + youtubeSearch->txt = NULL; + scrapbook->yt_search = youtubeSearch; + youtubeSearch->main_data = scrapbook; + /* create a new query, without any search text, starting at 0, and search only MAX_RESULTS results */ + youtubeSearch->query = gdata_query_new_with_limits (NULL, 0, MAX_RESULTS); + /* create a new youtube service, giving it our developer key; google no longer uses client ids so we send in an empty string (NULL gives an error) */ + scrapbook->youtube_service = gdata_youtube_service_new (DEVELOPER_KEY, NULL); + /* create a new list store and tree to show the user the results + * it has three columns (two of which are displayed): a pixbuf for the thumbnail, the title, and the video data itself (as a gdata generic entry) */ + youtubeSearch->lStore = gtk_list_store_new (N_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING, GDATA_TYPE_ENTRY); + + picasaSearch = g_slice_new (struct _ScrapPSearch); + scrapbook->p_search = picasaSearch; + picasaSearch->main_data = scrapbook; + picasaSearch->query = gdata_query_new_with_limits (NULL, 0, MAX_RESULTS); + scrapbook->picasaweb_service = gdata_picasaweb_service_new (NULL); + + photoSearch = g_slice_new (struct _ScrapPicSearch); + scrapbook->p_search->pic = photoSearch; + scrapbook->pic_search = photoSearch; + photoSearch->lStore = gtk_list_store_new (P_N_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, GDATA_TYPE_ENTRY); + + fUpload = g_slice_new (struct _ScrapPUpload); + scrapbook->p_upload = fUpload; + fUpload->main_data = scrapbook; + + scrapbook->box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + scrapbook->grid = gtk_grid_new (); + + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); + + /* Add buttons to the main window */ + button = gtk_button_new_with_mnemonic ("Add YouTube _Video"); + g_signal_connect (button, "clicked", (GCallback) start_new_youtube_search, scrapbook); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gtk_button_new_with_mnemonic ("Add PicasaWeb _Photo"); + g_signal_connect (button, "clicked", (GCallback) start_new_picasa_search, scrapbook); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gtk_button_new_with_mnemonic ("P_roperties"); + g_signal_connect (button, "clicked", (GCallback) properties_show, scrapbook); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gtk_button_new_with_mnemonic ("_Upload Photo to PicasaWeb"); + g_signal_connect (button, "clicked", (GCallback) upload, scrapbook); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (scrapbook->box1), vbox, FALSE, FALSE, 5); + + gtk_box_pack_start (GTK_BOX (scrapbook->box1), scrapbook->grid, TRUE, TRUE, 0); + gtk_widget_show (scrapbook->grid); + gtk_widget_show (scrapbook->box1); + gtk_container_add (GTK_CONTAINER (scrapbook->window), scrapbook->box1); + gtk_widget_show (scrapbook->window); + gtk_main (); + return 0; +} diff --git a/demos/scrapbook/scrapbook.h b/demos/scrapbook/scrapbook.h new file mode 100644 index 0000000..802e736 --- /dev/null +++ b/demos/scrapbook/scrapbook.h @@ -0,0 +1,188 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Joe Cortes 2010 <escozzia@gmail.com> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <gtk/gtk.h> +#include <gdata/gdata.h> +#include <glib.h> +#include <glib-object.h> +#define DEVELOPER_KEY "AI39si5MkSF-0bzTmP5WETk1D-Z7inHaQJzX13PeG_5Uzeu8mz3vo40cFoqnxjejB-UqzYFrqzOSlsqJvHuPNEGqdycqnPo30A" +#define CLIENT_ID "ytapi-GNOME-libgdata-444fubtt-0" +#define THUMBNAIL_WIDTH 180 +#define MAX_RESULTS 10 + +/* how this works is that there's a struct for every window opened + * they contain that individual window's data + * and every one of them (except for scrap data, which is for the main window) + * has a pointer to the one for the main window called main_data */ + +enum { + COL_PIXBUF, + COL_TITLE, + COL_VIDEO, + N_COLS +}; + +enum { + P_COL_PIXBUF, + P_COL_TITLE, + P_COL_USER, + P_COL_PIC, + P_N_COLS +}; + + +enum { + ORIG_COL_PIXBUF, + ORIG_COL_TITLE, + ORIG_COL_ENTRY, + ORIG_N_COLS +}; + +typedef struct _ScrapYTSearch ScrapYTSearch; +typedef struct _ScrapPSearch ScrapPSearch; +typedef struct _ScrapPUpload ScrapPUpload; +typedef struct _ScrapPicSearch ScrapPicSearch; + +typedef struct _ScrapData { + GtkWidget *window; + gint currentCol; + gint currentRow[5]; + GtkWidget *box1; + GtkWidget *grid; + GtkWidget *scrollWindow; + ScrapYTSearch *yt_search; + ScrapPSearch *p_search; + ScrapPicSearch *pic_search; + ScrapPUpload *p_upload; + gint max_rows; + gchar *username; + gchar *password; + GtkListStore *lStore; + + GDataYouTubeService *youtube_service; + GDataPicasaWebService *picasaweb_service; +} ScrapData; +struct _ScrapPUpload { + ScrapData *main_data; + GDataPicasaWebFile *file; + GtkWidget *dialog; + GtkWidget *name; + GtkWidget *description; +}; + +struct _ScrapPicSearch { /* for finding pictures */ + const gchar *title; + gchar *uri; + const gchar *user; + GdkPixbuf *thumbnail; + ScrapData *main_data; + ScrapPSearch *search_data; + GDataQuery *query; + GDataPicasaWebFile *file; + GtkListStore *lStore; + GtkWidget *tView; +}; + +struct _ScrapYTSearch { /* youtube search data */ + GtkWidget *txt_entry; + const gchar *txt; + GtkWidget *window; + GDataQuery *query; + gchar *title; + gchar *uri; + GdkPixbuf *thumbnail; + GtkWidget *box1; + ScrapData *main_data; /* <- points to a structure containing main vars */ + GtkListStore *lStore; + GtkWidget *tView; +}; + +struct _ScrapPSearch { /* for finding albums */ + GtkWidget *window; + GDataQuery *query; + gchar *title; + gchar *uri; + GdkPixbuf *thumbnail; + GtkWidget *box1; + ScrapData *main_data; + GtkWidget *user_entry; + const gchar *user; + ScrapPicSearch *pic; +}; + +typedef struct _ScrapProps { + GtkWidget *window; + GtkWidget *box1; + GtkWidget *username_entry, *password_entry; + ScrapData *main_data; +} ScrapProps; + + +static void +open_in_web_browser (GtkWidget *widget, gchar *uri); + +static void +picture_selected (GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, ScrapPicSearch *self); + +static void +video_selected (GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, ScrapYTSearch *self); + +static void +p_display_tree (ScrapPicSearch *self); + +static void +yt_display_tree (ScrapYTSearch *self); + +GDataMediaThumbnail * +choose_best_thumbnail (GList *thumbnails, gint ideal_size); + +static void +find_pictures (GDataEntry *entry, guint entry_key, guint entry_count, ScrapPicSearch *self); + +static void +p_query_element (GDataEntry *entry, guint entry_key, guint entry_count, ScrapPSearch *self); + +static void +p_text_callback (GtkWidget *widget, ScrapPSearch *self); + +static void +yt_query_element (GDataEntry *entry, guint entry_key, guint entry_count, ScrapYTSearch *self); + +static void +yt_text_callback (GtkWidget *widget, ScrapYTSearch *self); + +static void +start_new_picasa_search (GtkWidget *widget, ScrapData *first); + +static void +start_new_youtube_search (GtkWidget *widget, ScrapData *first); + +static void +properties_set (GtkWidget *widget, ScrapProps *self); + +static void +properties_show (GtkWidget *widget, ScrapData *first); + +static void +upload (GtkWidget *widget, ScrapData *first); + + + diff --git a/demos/tasks/tasks-cli.c b/demos/tasks/tasks-cli.c new file mode 100644 index 0000000..c795761 --- /dev/null +++ b/demos/tasks/tasks-cli.c @@ -0,0 +1,350 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright © 2017 Philip Withnall <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <gdata/gdata.h> +#include <locale.h> +#include <string.h> + +#define CLIENT_ID "1074795795536-necvslvs0pchk65nf6ju4i6mniogg8fr.apps.googleusercontent.com" +#define CLIENT_SECRET "8totRi50eo2Zfr3SD2DeNAzo" +#define REDIRECT_URI "urn:ietf:wg:oauth:2.0:oob" + +static int +print_usage (char *argv[]) +{ + g_printerr ("%s: Usage — %s <subcommand>\n" + "Subcommands:\n" + " tasklists\n" + " tasks <tasklist ID> [query string]\n", + argv[0], argv[0]); + return -1; +} + +static void +print_tasklist (GDataTasksTasklist *tasklist) +{ + const gchar *id, *title, *description; + + id = gdata_entry_get_id (GDATA_ENTRY (tasklist)); + title = gdata_entry_get_title (GDATA_ENTRY (tasklist)); + description = gdata_entry_get_summary (GDATA_ENTRY (tasklist)); + + g_print ("%s — %s\n", id, title); + g_print (" Description:\n %s\n", description); + + g_print ("\n"); +} + +static const gchar * +format_status (const gchar *status) +{ + if (g_strcmp0 (status, GDATA_TASKS_STATUS_NEEDS_ACTION) == 0) + return "needs action"; + else if (g_strcmp0 (status, GDATA_TASKS_STATUS_COMPLETED) == 0) + return "completed"; + else + return status; +} + +static void +print_task (GDataTasksTask *task) +{ + const gchar *title, *id, *description, *parent_id, *position, *notes; + const gchar *status; + GTimeVal date_published_tv = { 0, }; + gchar *date_published = NULL; /* owned */ + GTimeVal due_tv = { 0, }; + gchar *due = NULL; /* owned */ + GTimeVal completed_tv = { 0, }; + gchar *completed = NULL; /* owned */ + gboolean is_deleted, is_hidden; + + title = gdata_entry_get_title (GDATA_ENTRY (task)); + id = gdata_entry_get_id (GDATA_ENTRY (task)); + description = gdata_entry_get_content (GDATA_ENTRY (task)); + date_published_tv.tv_sec = gdata_entry_get_published (GDATA_ENTRY (task)); + date_published = g_time_val_to_iso8601 (&date_published_tv); + parent_id = gdata_tasks_task_get_parent (task); + position = gdata_tasks_task_get_position (task); + notes = gdata_tasks_task_get_notes (task); + status = gdata_tasks_task_get_status (task); + due_tv.tv_sec = gdata_tasks_task_get_due (task); + due = g_time_val_to_iso8601 (&due_tv); + completed_tv.tv_sec = gdata_tasks_task_get_completed (task); + completed = g_time_val_to_iso8601 (&completed_tv); + is_deleted = gdata_tasks_task_is_deleted (task); + is_hidden = gdata_tasks_task_is_hidden (task); + + g_print ("%s — %s\n", id, title); + g_print (" Published: %s\n", date_published_tv.tv_sec != 0 ? date_published : "unknown"); + g_print (" Status: %s\n", format_status (status)); + g_print (" Due: %s\n", due_tv.tv_sec != 0 ? due : "not set"); + g_print (" Completed: %s\n", completed_tv.tv_sec != 0 ? completed : "not yet"); + g_print (" Deleted? %s\n", is_deleted ? "Yes" : "No"); + g_print (" Hidden? %s\n", is_hidden ? "Yes" : "No"); + g_print (" Position: %s\n", position); + g_print (" Parent ID: %s\n", parent_id); + g_print (" Description:\n %s\n", description); + g_print (" Notes:\n %s\n", notes); + + g_print ("\n"); + + g_free (completed); + g_free (due); + g_free (date_published); +} + +/* FIXME: Factor all this code out of all the demos */ +static GDataAuthorizer * +create_authorizer (GError **error) +{ + GDataOAuth2Authorizer *authorizer = NULL; /* owned */ + gchar *uri = NULL; + gchar code[100]; + GError *child_error = NULL; + + /* Go through the interactive OAuth dance. */ + authorizer = gdata_oauth2_authorizer_new (CLIENT_ID, CLIENT_SECRET, + REDIRECT_URI, + GDATA_TYPE_TASKS_SERVICE); + + /* Get an authentication URI */ + uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, + NULL, FALSE); + + /* Wait for the user to retrieve and enter the verifier. */ + g_print ("Please navigate to the following URI and grant access:\n" + " %s\n", uri); + g_print ("Enter verifier (EOF to abort): "); + + g_free (uri); + + if (scanf ("%100s", code) != 1) { + /* User chose to abort. */ + g_print ("\n"); + g_clear_object (&authorizer); + return NULL; + } + + /* Authorise the token. */ + gdata_oauth2_authorizer_request_authorization (authorizer, code, NULL, + &child_error); + + if (child_error != NULL) { + g_propagate_error (error, child_error); + g_clear_object (&authorizer); + return NULL; + } + + return GDATA_AUTHORIZER (authorizer); +} + +/* List all the user’s task-lists. */ +static int +command_tasklists (int argc, char *argv[]) +{ + GDataTasksService *service = NULL; + GDataTasksQuery *query = NULL; + GDataFeed *feed = NULL; + GList/*<unowned GDataTasksTasklist>*/ *entries; + GError *error = NULL; + gint retval = 0; + GDataAuthorizer *authorizer = NULL; + + if (argc != 2) { + return print_usage (argv); + } + + /* Authenticate and create a service. */ + authorizer = create_authorizer (&error); + + if (error != NULL) { + g_printerr ("%s: Error authenticating: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } else if (authorizer == NULL) { + g_printerr ("%s: User chose to abort authentication.\n", + argv[0]); + retval = 1; + goto done; + } + + service = gdata_tasks_service_new (authorizer); + query = gdata_tasks_query_new (NULL); + + feed = gdata_tasks_service_query_all_tasklists (service, + GDATA_QUERY (query), + NULL, NULL, + NULL, + &error); + + if (error != NULL) { + g_printerr ("%s: Error querying tasklists: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + for (entries = gdata_feed_get_entries (feed); entries != NULL; + entries = entries->next) { + GDataTasksTasklist *tasklist; + + tasklist = GDATA_TASKS_TASKLIST (entries->data); + print_tasklist (tasklist); + } + + g_print ("Total of %u results.\n", + g_list_length (gdata_feed_get_entries (feed))); + +done: + g_clear_object (&feed); + g_clear_object (&query); + g_clear_object (&authorizer); + g_clear_object (&service); + + return retval; +} + +/* Query the tasks in a tasklist. */ +static int +command_tasks (int argc, char *argv[]) +{ + GDataTasksService *service = NULL; + GDataTasksTasklist *tasklist = NULL; + GDataTasksQuery *query = NULL; + GError *error = NULL; + gint retval = 0; + const gchar *query_string, *tasklist_id; + GDataAuthorizer *authorizer = NULL; + guint n_results; + + if (argc < 3) { + return print_usage (argv); + } + + tasklist_id = argv[2]; + query_string = (argc > 3) ? argv[3] : NULL; + + /* Authenticate and create a service. */ + authorizer = create_authorizer (&error); + + if (error != NULL) { + g_printerr ("%s: Error authenticating: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } else if (authorizer == NULL) { + g_printerr ("%s: User chose to abort authentication.\n", + argv[0]); + retval = 1; + goto done; + } + + service = gdata_tasks_service_new (authorizer); + query = gdata_tasks_query_new (query_string); + gdata_query_set_max_results (GDATA_QUERY (query), 10); + tasklist = gdata_tasks_tasklist_new (tasklist_id); + n_results = 0; + + while (TRUE) { + GList/*<unowned GDataTasksTask>*/ *entries, *l; + GDataFeed *feed = NULL; + + feed = gdata_tasks_service_query_tasks (service, tasklist, + GDATA_QUERY (query), + NULL, NULL, NULL, + &error); + + if (error != NULL) { + g_printerr ("%s: Error querying tasks: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + entries = gdata_feed_get_entries (feed); + + if (entries == NULL) { + retval = 0; + g_object_unref (feed); + break; + } + + for (l = entries; l != NULL; l = l->next) { + GDataTasksTask *task; + + task = GDATA_TASKS_TASK (l->data); + print_task (task); + n_results++; + } + + gdata_query_next_page (GDATA_QUERY (query)); + g_object_unref (feed); + } + + g_print ("Total of %u results.\n", n_results); + +done: + g_clear_object (&query); + g_clear_object (&authorizer); + g_clear_object (&tasklist); + g_clear_object (&service); + + return retval; +} + +static const struct { + const gchar *command; + int (*handler_fn) (int argc, char **argv); +} command_handlers[] = { + { "tasklists", command_tasklists }, + { "tasks", command_tasks }, +}; + +int +main (int argc, char *argv[]) +{ + guint i; + gint retval = -1; + + setlocale (LC_ALL, ""); + + if (argc < 2) { + return print_usage (argv); + } + + for (i = 0; i < G_N_ELEMENTS (command_handlers); i++) { + if (strcmp (argv[1], command_handlers[i].command) == 0) { + retval = command_handlers[i].handler_fn (argc, argv); + } + } + + if (retval == -1) { + retval = print_usage (argv); + } + + return retval; +} diff --git a/demos/youtube/youtube-cli.c b/demos/youtube/youtube-cli.c new file mode 100644 index 0000000..37ff4af --- /dev/null +++ b/demos/youtube/youtube-cli.c @@ -0,0 +1,585 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2015 Philip Withnall <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <gdata/gdata.h> +#include <locale.h> +#include <string.h> + +#define CLIENT_ID "1074795795536-necvslvs0pchk65nf6ju4i6mniogg8fr.apps.googleusercontent.com" +#define CLIENT_SECRET "8totRi50eo2Zfr3SD2DeNAzo" +#define REDIRECT_URI "urn:ietf:wg:oauth:2.0:oob" +#define DEVELOPER_KEY "AIzaSyCENhl8yDxDZbyhTF6p-ok-RefK07xdXUg" + +static int +print_usage (char *argv[]) +{ + g_printerr ("%s: Usage — %s <subcommand>\n" + "Subcommands:\n" + " search <query string>\n" + " info <video ID>\n" + " standard-feed <feed name>\n" + " categories\n" + " related <video ID>\n" + " upload <filename> <title> [description]\n", + argv[0], argv[0]); + return -1; +} + +static void +print_video (GDataYouTubeVideo *video) +{ + const gchar *title, *player_uri, *id, *description; + GList/*<unowned GDataMediaThumbnail>*/ *thumbnails; + GTimeVal date_published_tv = { 0, }; + gchar *date_published = NULL; /* owned */ + guint duration; /* seconds */ + guint rating_min = 0, rating_max = 0, rating_count = 0; + gdouble rating_average = 0.0; + + title = gdata_entry_get_title (GDATA_ENTRY (video)); + player_uri = gdata_youtube_video_get_player_uri (video); + id = gdata_entry_get_id (GDATA_ENTRY (video)); + description = gdata_youtube_video_get_description (video); + thumbnails = gdata_youtube_video_get_thumbnails (video); + date_published_tv.tv_sec = gdata_entry_get_published (GDATA_ENTRY (video)); + date_published = g_time_val_to_iso8601 (&date_published_tv); + duration = gdata_youtube_video_get_duration (video); + gdata_youtube_video_get_rating (video, &rating_min, &rating_max, + &rating_count, &rating_average); + + g_print ("%s — %s\n", player_uri, title); + g_print (" ID: %s\n", id); + g_print (" Published: %s\n", date_published); + g_print (" Duration: %us\n", duration); + g_print (" Rating: %.2f (min: %u, max: %u, count: %u)\n", + rating_average, rating_min, rating_max, rating_count); + g_print (" Description:\n %s\n", description); + g_print (" Thumbnails:\n"); + + for (; thumbnails != NULL; thumbnails = thumbnails->next) { + GDataMediaThumbnail *thumbnail; + + thumbnail = GDATA_MEDIA_THUMBNAIL (thumbnails->data); + g_print (" • %s\n", + gdata_media_thumbnail_get_uri (thumbnail)); + } + + g_print ("\n"); + + g_free (date_published); +} + +static void +print_category (GDataCategory *category) +{ + const gchar *term, *label; + + term = gdata_category_get_term (category); + label = gdata_category_get_label (category); + + g_print ("%s — %s\n", term, label); +} + +static GDataAuthorizer * +create_authorizer (GError **error) +{ + GDataOAuth2Authorizer *authorizer = NULL; /* owned */ + gchar *uri = NULL; + gchar code[100]; + GError *child_error = NULL; + + /* Go through the interactive OAuth dance. */ + authorizer = gdata_oauth2_authorizer_new (CLIENT_ID, CLIENT_SECRET, + REDIRECT_URI, + GDATA_TYPE_YOUTUBE_SERVICE); + + /* Get an authentication URI */ + uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, + NULL, FALSE); + + /* Wait for the user to retrieve and enter the verifier. */ + g_print ("Please navigate to the following URI and grant access:\n" + " %s\n", uri); + g_print ("Enter verifier (EOF to abort): "); + + g_free (uri); + + if (scanf ("%100s", code) != 1) { + /* User chose to abort. */ + g_print ("\n"); + g_clear_object (&authorizer); + return NULL; + } + + /* Authorise the token. */ + gdata_oauth2_authorizer_request_authorization (authorizer, code, NULL, + &child_error); + + if (child_error != NULL) { + g_propagate_error (error, child_error); + g_clear_object (&authorizer); + return NULL; + } + + return GDATA_AUTHORIZER (authorizer); +} + +/* Search for videos given a simple query string. */ +static int +command_search (int argc, char *argv[]) +{ + GDataYouTubeService *service = NULL; + GDataYouTubeQuery *query = NULL; + GDataFeed *feed = NULL; + GList/*<unowned GDataYouTubeVideo>*/ *entries; + GError *error = NULL; + gint retval = 0; + const gchar *query_string; + + if (argc < 3) { + return print_usage (argv); + } + + query_string = argv[2]; + + service = gdata_youtube_service_new (DEVELOPER_KEY, NULL); + query = gdata_youtube_query_new (query_string); + feed = gdata_youtube_service_query_videos (service, GDATA_QUERY (query), + NULL, NULL, NULL, &error); + + if (error != NULL) { + g_printerr ("%s: Error querying YouTube: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + for (entries = gdata_feed_get_entries (feed); entries != NULL; + entries = entries->next) { + GDataYouTubeVideo *video; + + video = GDATA_YOUTUBE_VIDEO (entries->data); + print_video (video); + } + + g_print ("Total of %u results.\n", gdata_feed_get_total_results (feed)); + +done: + g_clear_object (&feed); + g_clear_object (&query); + g_clear_object (&service); + + return retval; +} + +/* Display information about a single video. */ +static int +command_info (int argc, char *argv[]) +{ + GDataYouTubeService *service = NULL; + GDataEntry *result = NULL; + GDataYouTubeVideo *video; /* unowned */ + GError *error = NULL; + gint retval = 0; + const gchar *entry_id; + + if (argc < 3) { + return print_usage (argv); + } + + entry_id = argv[2]; + + service = gdata_youtube_service_new (DEVELOPER_KEY, NULL); + result = gdata_service_query_single_entry (GDATA_SERVICE (service), + NULL, entry_id, NULL, + GDATA_TYPE_YOUTUBE_VIDEO, + NULL, &error); + + if (error != NULL) { + g_printerr ("%s: Error querying YouTube: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + video = GDATA_YOUTUBE_VIDEO (result); + print_video (video); + +done: + g_clear_object (&result); + g_clear_object (&service); + + return retval; +} + +static gboolean +standard_feed_type_from_name (const gchar *name, + GDataYouTubeStandardFeedType *out) +{ + /* Indexed by GDataYouTubeStandardFeedType. */ + const gchar *feed_type_names[] = { + "top-rated", + "top-favorites", + "most-viewed", + "most-popular", + "most-recent", + "most-discussed", + "most-linked", + "most-responded", + "recently-featured", + "watch-on-mobile", + }; + guint i; + + G_STATIC_ASSERT (G_N_ELEMENTS (feed_type_names) == + GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED + 1); + + for (i = 0; i < G_N_ELEMENTS (feed_type_names); i++) { + if (g_strcmp0 (feed_type_names[i], name) == 0) { + *out = (GDataYouTubeStandardFeedType) i; + return TRUE; + } + } + + return FALSE; +} + +/* List all videos in a standard feed. */ +static int +command_standard_feed (int argc, char *argv[]) +{ + GDataYouTubeService *service = NULL; + GDataFeed *feed = NULL; + GList/*<unowned GDataYouTubeVideo>*/ *entries; + GError *error = NULL; + gint retval = 0; + GDataYouTubeStandardFeedType feed_type; + + if (argc < 3) { + return print_usage (argv); + } + + if (!standard_feed_type_from_name (argv[2], &feed_type)) { + g_printerr ("%s: Invalid feed type ‘%s’.\n", argv[0], argv[2]); + retval = 1; + goto done; + } + + service = gdata_youtube_service_new (DEVELOPER_KEY, NULL); + feed = gdata_youtube_service_query_standard_feed (service, feed_type, + NULL, NULL, NULL, + NULL, &error); + + if (error != NULL) { + g_printerr ("%s: Error querying YouTube: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + for (entries = gdata_feed_get_entries (feed); entries != NULL; + entries = entries->next) { + GDataYouTubeVideo *video; + + video = GDATA_YOUTUBE_VIDEO (entries->data); + print_video (video); + } + + g_print ("Total of %u results.\n", gdata_feed_get_total_results (feed)); + +done: + g_clear_object (&feed); + g_clear_object (&service); + + return retval; +} + +/* List videos related to a given one. */ +static int +command_related (int argc, char *argv[]) +{ + GDataYouTubeService *service = NULL; + GDataFeed *feed = NULL; + GList/*<unowned GDataYouTubeVideo>*/ *entries; + GError *error = NULL; + gint retval = 0; + const gchar *entry_id; + GDataYouTubeVideo *query_video = NULL; + + if (argc < 3) { + return print_usage (argv); + } + + entry_id = argv[2]; + query_video = gdata_youtube_video_new (entry_id); + + service = gdata_youtube_service_new (DEVELOPER_KEY, NULL); + feed = gdata_youtube_service_query_related (service, query_video, NULL, + NULL, NULL, NULL, &error); + + if (error != NULL) { + g_printerr ("%s: Error querying YouTube: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + for (entries = gdata_feed_get_entries (feed); entries != NULL; + entries = entries->next) { + GDataYouTubeVideo *video; + + video = GDATA_YOUTUBE_VIDEO (entries->data); + print_video (video); + } + + g_print ("Total of %u results.\n", gdata_feed_get_total_results (feed)); + +done: + g_clear_object (&query_video); + g_clear_object (&feed); + g_clear_object (&service); + + return retval; +} + +/* List all available video categories. */ +static int +command_categories (int argc, char *argv[]) +{ + GDataYouTubeService *service = NULL; + GDataAPPCategories *app_categories = NULL; + GList/*<unowned GDataCategory>*/ *categories; + GError *error = NULL; + gint retval = 0; + + service = gdata_youtube_service_new (DEVELOPER_KEY, NULL); + app_categories = gdata_youtube_service_get_categories (service, NULL, + &error); + + if (error != NULL) { + g_printerr ("%s: Error querying YouTube: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print results. */ + for (categories = gdata_app_categories_get_categories (app_categories); + categories != NULL; + categories = categories->next) { + GDataCategory *category; + + category = GDATA_CATEGORY (categories->data); + print_category (category); + } + + g_print ("Total of %u results.\n", + g_list_length (gdata_app_categories_get_categories (app_categories))); + +done: + g_clear_object (&app_categories); + g_clear_object (&service); + + return retval; +} + +/* Upload a video. */ +static int +command_upload (int argc, char *argv[]) +{ + GDataYouTubeService *service = NULL; + GDataUploadStream *upload_stream = NULL; + GError *error = NULL; + gint retval = 0; + const gchar *filename; + GFile *video_file = NULL; + GFileInputStream *video_file_stream = NULL; + GFileInfo *video_file_info = NULL; + GDataYouTubeVideo *video = NULL; + GDataYouTubeVideo *uploaded_video = NULL; + gssize transfer_size; + const gchar *content_type, *slug; + GDataAuthorizer *authorizer = NULL; + const gchar *title, *description; + + if (argc < 3) { + return print_usage (argv); + } + + filename = argv[2]; + title = (argc > 3) ? argv[3] : NULL; + description = (argc > 4) ? argv[4] : NULL; + + /* Load the file and query its details. */ + video_file = g_file_new_for_commandline_arg (filename); + + video_file_info = g_file_query_info (video_file, + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," + G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, + G_FILE_QUERY_INFO_NONE, NULL, + &error); + + if (error != NULL) { + g_printerr ("%s: Error loading video information ‘%s’: %s\n", + argv[0], filename, error->message); + g_error_free (error); + retval = 1; + goto done; + } + + content_type = g_file_info_get_content_type (video_file_info); + slug = g_file_info_get_display_name (video_file_info); + + video_file_stream = g_file_read (video_file, NULL, &error); + + if (error != NULL) { + g_printerr ("%s: Error loading video ‘%s’: %s\n", + argv[0], filename, error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Build the video. */ + video = gdata_youtube_video_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (video), title); + gdata_entry_set_summary (GDATA_ENTRY (video), description); + + /* Authenticate and create a service. */ + authorizer = create_authorizer (&error); + + if (error != NULL) { + g_printerr ("%s: Error authenticating: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } else if (authorizer == NULL) { + g_printerr ("%s: User chose to abort authentication.\n", + argv[0]); + retval = 1; + goto done; + } + + service = gdata_youtube_service_new (DEVELOPER_KEY, + GDATA_AUTHORIZER (authorizer)); + + /* Start the upload. */ + upload_stream = gdata_youtube_service_upload_video (service, video, + slug, content_type, + NULL, &error); + + if (error != NULL) { + g_printerr ("%s: Error initializing upload with YouTube: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Upload the video */ + transfer_size = g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), + G_INPUT_STREAM (video_file_stream), + G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | + G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, + NULL, &error); + + if (error != NULL) { + g_printerr ("%s: Error transferring file: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Finish off the upload */ + uploaded_video = gdata_youtube_service_finish_video_upload (service, + upload_stream, + &error); + + if (error != NULL) { + g_printerr ("%s: Error finishing upload with YouTube: %s\n", + argv[0], error->message); + g_error_free (error); + retval = 1; + goto done; + } + + /* Print the uploaded video as confirmation. */ + g_print ("Uploaded %" G_GSSIZE_FORMAT " bytes.\n", transfer_size); + print_video (uploaded_video); + +done: + g_clear_object (&authorizer); + g_clear_object (&uploaded_video); + g_clear_object (&video); + g_clear_object (&video_file_info); + g_clear_object (&video_file_stream); + g_clear_object (&video_file); + g_clear_object (&upload_stream); + g_clear_object (&service); + + return retval; +} + +static const struct { + const gchar *command; + int (*handler_fn) (int argc, char **argv); +} command_handlers[] = { + { "search", command_search }, + { "info", command_info }, + { "standard-feed", command_standard_feed }, + { "categories", command_categories }, + { "related", command_related }, + { "upload", command_upload }, +}; + +int +main (int argc, char *argv[]) +{ + guint i; + gint retval = -1; + + setlocale (LC_ALL, ""); + + if (argc < 2) { + return print_usage (argv); + } + + for (i = 0; i < G_N_ELEMENTS (command_handlers); i++) { + if (strcmp (argv[1], command_handlers[i].command) == 0) { + retval = command_handlers[i].handler_fn (argc, argv); + } + } + + if (retval == -1) { + retval = print_usage (argv); + } + + return retval; +} diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..034926c --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = reference + +-include $(top_srcdir)/git.mk diff --git a/docs/Makefile.in b/docs/Makefile.in new file mode 100644 index 0000000..6dd514d --- /dev/null +++ b/docs/Makefile.in @@ -0,0 +1,724 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = docs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_append_link_flags.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_check_link_flag.m4 \ + $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_compiler_flags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_cflags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_cxxflags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_gir.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_ldflags.m4 \ + $(top_srcdir)/m4/ax_generate_changelog.m4 \ + $(top_srcdir)/m4/ax_is_release.m4 \ + $(top_srcdir)/m4/ax_require_defined.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_LDFLAGS = @AM_LDFLAGS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_ALWAYS_BUILD_TESTS = @ENABLE_ALWAYS_BUILD_TESTS@ +ENABLE_INSTALLED_TESTS = @ENABLE_INSTALLED_TESTS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GDATA_API_VERSION = @GDATA_API_VERSION@ +GDATA_API_VERSION_MAJOR = @GDATA_API_VERSION_MAJOR@ +GDATA_API_VERSION_MINOR = @GDATA_API_VERSION_MINOR@ +GDATA_CFLAGS = @GDATA_CFLAGS@ +GDATA_LIBS = @GDATA_LIBS@ +GDATA_LT_VERSION = @GDATA_LT_VERSION@ +GDATA_PACKAGES = @GDATA_PACKAGES@ +GDATA_PACKAGES_PRIVATE = @GDATA_PACKAGES_PRIVATE@ +GDATA_PACKAGES_PUBLIC = @GDATA_PACKAGES_PUBLIC@ +GDATA_VERSION_MAJOR = @GDATA_VERSION_MAJOR@ +GDATA_VERSION_MICRO = @GDATA_VERSION_MICRO@ +GDATA_VERSION_MINOR = @GDATA_VERSION_MINOR@ +GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@ +GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@ +GENHTML = @GENHTML@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIT = @GIT@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GNOME_CFLAGS = @GNOME_CFLAGS@ +GNOME_LIBS = @GNOME_LIBS@ +GNOME_PACKAGES = @GNOME_PACKAGES@ +GNOME_PACKAGES_PRIVATE = @GNOME_PACKAGES_PRIVATE@ +GNOME_PACKAGES_PUBLIC = @GNOME_PACKAGES_PUBLIC@ +GOA_ENABLED = @GOA_ENABLED@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LCOV = @LCOV@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ +LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UHTTPMOCK_CFLAGS = @UHTTPMOCK_CFLAGS@ +UHTTPMOCK_LIBS = @UHTTPMOCK_LIBS@ +USE_NLS = @USE_NLS@ +VAPIGEN = @VAPIGEN@ +VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ +VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CXXFLAGS = @WARN_CXXFLAGS@ +WARN_LDFLAGS = @WARN_LDFLAGS@ +WARN_SCANNERFLAGS = @WARN_SCANNERFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = reference +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am new file mode 100644 index 0000000..ac8fa54 --- /dev/null +++ b/docs/reference/Makefile.am @@ -0,0 +1,119 @@ +## Process this file with automake to produce Makefile.in + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# This is a blank Makefile.am for using gtk-doc. +# Copy this to your project's API docs directory and modify the variables to +# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples +# of using the various options. + +# The name of the module, e.g. 'glib'. +DOC_MODULE=gdata + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +# e.g. DOC_SOURCE_DIR=../../../gtk +DOC_SOURCE_DIR="$(abs_top_srcdir)/gdata" + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +SCANGOBJ_OPTIONS= + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS=--rebuild-types --deprecated-guards="LIBGDATA_DISABLE_DEPRECATED" + +# Extra options to supply to gtkdoc-mkdb. +# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml +MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=gdata + +# Extra options to supply to gtkdoc-fixref. Not normally needed. +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html +FIXXREF_OPTIONS= + +# Add the builddir to the HTML path so that version.xml is found +MKHTML_OPTIONS= + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB=$(top_srcdir)/gdata/*.h $(top_srcdir)/gdata/services/*/*.h +CFILE_GLOB=$(top_srcdir)/gdata/*.c $(top_srcdir)/gdata/services/*/*.c + +# Header files to ignore when scanning. +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h +IGNORE_HFILES = \ + common.h \ + mock-resolver.h \ + mock-server.h \ + gdata-private.h \ + gdata-parser.h \ + gdata-marshal.h \ + gdata-enums.h \ + gdata-media-enums.h \ + gdata-media-group.h \ + gdata-youtube-enums.h \ + gdata-picasaweb-enums.h \ + gdata-documents-enums.h \ + gdata-exif-tags.h \ + gdata-georss-where.h \ + gdata-buffer.h \ + gdata-batch-private.h \ + gdata-batch-feed.h \ + gdata-gd-feed-link.h \ + gdata-dummy-authorizer.c \ + gdata-dummy-authorizer.h \ + gdata-documents-utils.h \ + $(NULL) + +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES = \ + structure.png \ + data-flow.png \ + cancellation.png \ + $(NULL) + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files=gdata-overview.xml gdata-running.xml + +# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded +# These files must be listed here *and* in content_files +# e.g. expand_content_files=running.sgml +expand_content_files= + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) +AM_CFLAGS = $(GDATA_CFLAGS) +GTKDOC_LIBS=$(top_builddir)/gdata/libgdata.la + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/gtk-doc.make + +# This should be in gtk-doc.make, since we are calling gtkdoc-scan with +# --rebuild-types +SCANOBJ_FILES += $(DOC_MODULE).types + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST += \ + structure.dia \ + data-flow.dia \ + cancellation.dia \ + $(NULL) + +if ENABLE_GTK_DOC +TESTS_ENVIRONMENT = cd $(builddir) && +TESTS = $(GTKDOC_CHECK) +endif + +-include $(top_srcdir)/git.mk diff --git a/docs/reference/Makefile.in b/docs/reference/Makefile.in new file mode 100644 index 0000000..25eafdf --- /dev/null +++ b/docs/reference/Makefile.in @@ -0,0 +1,1294 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = docs/reference +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_append_link_flags.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_check_link_flag.m4 \ + $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_compiler_flags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_cflags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_cxxflags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_gir.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_ldflags.m4 \ + $(top_srcdir)/m4/ax_generate_changelog.m4 \ + $(top_srcdir)/m4/ax_is_release.m4 \ + $(top_srcdir)/m4/ax_require_defined.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/test-driver $(top_srcdir)/gtk-doc.make +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_CFLAGS = $(GDATA_CFLAGS) + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) +AM_CXXFLAGS = @AM_CXXFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_LDFLAGS = @AM_LDFLAGS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_ALWAYS_BUILD_TESTS = @ENABLE_ALWAYS_BUILD_TESTS@ +ENABLE_INSTALLED_TESTS = @ENABLE_INSTALLED_TESTS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GDATA_API_VERSION = @GDATA_API_VERSION@ +GDATA_API_VERSION_MAJOR = @GDATA_API_VERSION_MAJOR@ +GDATA_API_VERSION_MINOR = @GDATA_API_VERSION_MINOR@ +GDATA_CFLAGS = @GDATA_CFLAGS@ +GDATA_LIBS = @GDATA_LIBS@ +GDATA_LT_VERSION = @GDATA_LT_VERSION@ +GDATA_PACKAGES = @GDATA_PACKAGES@ +GDATA_PACKAGES_PRIVATE = @GDATA_PACKAGES_PRIVATE@ +GDATA_PACKAGES_PUBLIC = @GDATA_PACKAGES_PUBLIC@ +GDATA_VERSION_MAJOR = @GDATA_VERSION_MAJOR@ +GDATA_VERSION_MICRO = @GDATA_VERSION_MICRO@ +GDATA_VERSION_MINOR = @GDATA_VERSION_MINOR@ +GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@ +GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@ +GENHTML = @GENHTML@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIT = @GIT@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GNOME_CFLAGS = @GNOME_CFLAGS@ +GNOME_LIBS = @GNOME_LIBS@ +GNOME_PACKAGES = @GNOME_PACKAGES@ +GNOME_PACKAGES_PRIVATE = @GNOME_PACKAGES_PRIVATE@ +GNOME_PACKAGES_PUBLIC = @GNOME_PACKAGES_PUBLIC@ +GOA_ENABLED = @GOA_ENABLED@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LCOV = @LCOV@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ +LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UHTTPMOCK_CFLAGS = @UHTTPMOCK_CFLAGS@ +UHTTPMOCK_LIBS = @UHTTPMOCK_LIBS@ +USE_NLS = @USE_NLS@ +VAPIGEN = @VAPIGEN@ +VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ +VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CXXFLAGS = @WARN_CXXFLAGS@ +WARN_LDFLAGS = @WARN_LDFLAGS@ +WARN_SCANNERFLAGS = @WARN_SCANNERFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# This is a blank Makefile.am for using gtk-doc. +# Copy this to your project's API docs directory and modify the variables to +# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples +# of using the various options. + +# The name of the module, e.g. 'glib'. +DOC_MODULE = gdata + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +# e.g. DOC_SOURCE_DIR=../../../gtk +DOC_SOURCE_DIR = "$(abs_top_srcdir)/gdata" + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +SCANGOBJ_OPTIONS = + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS = --rebuild-types --deprecated-guards="LIBGDATA_DISABLE_DEPRECATED" + +# Extra options to supply to gtkdoc-mkdb. +# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml +MKDB_OPTIONS = --sgml-mode --output-format=xml --name-space=gdata + +# Extra options to supply to gtkdoc-fixref. Not normally needed. +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html +FIXXREF_OPTIONS = + +# Add the builddir to the HTML path so that version.xml is found +MKHTML_OPTIONS = + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB = $(top_srcdir)/gdata/*.h $(top_srcdir)/gdata/services/*/*.h +CFILE_GLOB = $(top_srcdir)/gdata/*.c $(top_srcdir)/gdata/services/*/*.c + +# Header files to ignore when scanning. +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h +IGNORE_HFILES = \ + common.h \ + mock-resolver.h \ + mock-server.h \ + gdata-private.h \ + gdata-parser.h \ + gdata-marshal.h \ + gdata-enums.h \ + gdata-media-enums.h \ + gdata-media-group.h \ + gdata-youtube-enums.h \ + gdata-picasaweb-enums.h \ + gdata-documents-enums.h \ + gdata-exif-tags.h \ + gdata-georss-where.h \ + gdata-buffer.h \ + gdata-batch-private.h \ + gdata-batch-feed.h \ + gdata-gd-feed-link.h \ + gdata-dummy-authorizer.c \ + gdata-dummy-authorizer.h \ + gdata-documents-utils.h \ + $(NULL) + + +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES = \ + structure.png \ + data-flow.png \ + cancellation.png \ + $(NULL) + + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files = gdata-overview.xml gdata-running.xml + +# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded +# These files must be listed here *and* in content_files +# e.g. expand_content_files=running.sgml +expand_content_files = +GTKDOC_LIBS = $(top_builddir)/gdata/libgdata.la +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) +SETUP_FILES = \ + $(content_files) \ + $(expand_content_files) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) structure.dia data-flow.dia \ + cancellation.dia $(NULL) +DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + sgml.stamp html.stamp pdf.stamp + + +# This includes the standard gtk-doc make rules, copied by gtkdocize. + +# This should be in gtk-doc.make, since we are calling gtkdoc-scan with +# --rebuild-types +SCANOBJ_FILES = $(DOC_MODULE).args $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals $(DOC_MODULE).types +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test +@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = +@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp +@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = +@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp + +#### setup #### +GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_@AM_V@) +GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) +GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; + +#### scan #### +GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_@AM_V@) +GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) +GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; +GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_@AM_V@) +GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) +GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; + +#### xml #### +GTK_DOC_V_XML = $(GTK_DOC_V_XML_@AM_V@) +GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_@AM_DEFAULT_V@) +GTK_DOC_V_XML_0 = @echo " DOC Building XML"; + +#### html #### +GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_@AM_V@) +GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_@AM_DEFAULT_V@) +GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; +GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_@AM_V@) +GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_@AM_DEFAULT_V@) +GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; + +#### pdf #### +GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_@AM_V@) +GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_@AM_DEFAULT_V@) +GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; +@ENABLE_GTK_DOC_TRUE@TESTS_ENVIRONMENT = cd $(builddir) && +@ENABLE_GTK_DOC_TRUE@TESTS = $(GTKDOC_CHECK) +all: all-am + +.SUFFIXES: +.SUFFIXES: .log .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/reference/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/gtk-doc.make $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +@ENABLE_GTK_DOC_FALSE@all-local: +all-am: Makefile all-local +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-local + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am all-local check check-TESTS check-am clean \ + clean-generic clean-libtool clean-local cscopelist-am ctags-am \ + dist-hook distclean distclean-generic distclean-libtool \ + distclean-local distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic maintainer-clean-local mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags-am uninstall uninstall-am uninstall-local + +.PRECIOUS: Makefile + + +gtkdoc-check.test: Makefile + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ + chmod +x $@ + +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +.PHONY: all-gtk-doc + +@ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +setup-build.stamp: + -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ + fi + $(AM_V_at)touch setup-build.stamp + +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) + $(GTK_DOC_V_SCAN)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) + $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + $(AM_V_at)touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent + $(GTK_DOC_V_XML)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) + $(AM_V_at)touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +$(DOC_MAIN_SGML_FILE): sgml-build.stamp + @true + +xml/gtkdocentities.ent: Makefile + $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ + echo "<!ENTITY package \"$(PACKAGE)\">"; \ + echo "<!ENTITY package_bugreport \"$(PACKAGE_BUGREPORT)\">"; \ + echo "<!ENTITY package_name \"$(PACKAGE_NAME)\">"; \ + echo "<!ENTITY package_string \"$(PACKAGE_STRING)\">"; \ + echo "<!ENTITY package_tarname \"$(PACKAGE_TARNAME)\">"; \ + echo "<!ENTITY package_url \"$(PACKAGE_URL)\">"; \ + echo "<!ENTITY package_version \"$(PACKAGE_VERSION)\">"; \ + ) > $@ + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ + mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$$?" = "0"; then \ + mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + -@test "x$(HTML_IMAGES)" = "x" || \ + for file in $(HTML_IMAGES) ; do \ + test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ + done; + $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + $(AM_V_at)touch html-build.stamp + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ + mkpdf_options=""; \ + gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkpdf_options="$$mkpdf_options --verbose"; \ + fi; \ + fi; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + $(AM_V_at)touch pdf-build.stamp + +############## + +clean-local: + @rm -f *~ *.bak + @rm -rf .libs + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ + rm -f $(DOC_MODULE).types; \ + fi + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ + rm -f $(DOC_MODULE)-sections.txt; \ + fi + +distclean-local: + @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ + fi + +maintainer-clean-local: + @rm -rf xml html + +install-data-local: + @installfiles=`echo $(builddir)/html/*`; \ + if test "$$installfiles" = '$(builddir)/html/*'; \ + then echo 1>&2 'Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +@HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs +@HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: +@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" +@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" +@HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" +@HAVE_GTK_DOC_FALSE@ @false + +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local + @mkdir $(distdir)/html + @cp ./html/* $(distdir)/html + @-cp ./$(DOC_MODULE).pdf $(distdir)/ + @-cp ./$(DOC_MODULE).types $(distdir)/ + @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ + @cd $(distdir) && rm -f $(DISTCLEANFILES) + @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/docs/reference/cancellation.dia b/docs/reference/cancellation.dia new file mode 100644 index 0000000000000000000000000000000000000000..3595787616fab51beb6ef884c3b7d13fd803b289 GIT binary patch literal 1273 zcmV<V1P1#biwFP!000021MON%lj1fIzVj<wo+~RX8H2sE%+_wIQaPlOLpEnh*up4l zBuW-AT=Lt~elP<z=4DJRS$k@rklSDD)t|m@`1JX89vLg9VlKtV#K<xYCVUxi5su8i zzy12bH9x;}J_Ve9g#S>{xdBgzIQcX(XId{l_Im5}8bzC!YN=4fmndeve`yra9vJn^ zmyTiV0t8gkq%CiyS}Q(TYGw#JXCre${qLcYOA(lvRc`0YNGfARqmlVEO)s;T!}RuW zj$kin$R>)>@72&2T%LCg^n$4(?0g|(4kmiDD4A5?B(FO*xm65CB7AxJ(tpajlsCL% z9qMSM6FsLY<f7~c<|fJ}f*_X=0+Zo*u4fJVL%f}n%iT@x>n^&lJ9S@oJRUEk(u#6j zb~%wUVpL>awOX?4{lq?vV2d3aR*g|ixz_ST|EDyH&ly10{1$DOMsBEha6EALEGkge zJkYc8YeUnOp>G;OU-6hvB6g_vT<Dv@Z*Bu$T%DA?-yg5J8#1)Y;~{XF!<@^Hhj7UQ z7N6K=`!*Fwv)rtAYSxQ(=T1!4R5+|t7ZKesmBW91Kc<a*fpf+&sIU2I`)OxR<m4ab z>wK_(X(|G$0^@`6I~VZOn+O33!h@0dr?o#@#qj|e5MgP$7V>RRd0mW)!!MIZ74~FO zgjUddD#D0m@GkP4F1FBM;NfTDA&jvL9+7QZ-gRz$Da4qGARWW`BP-u0*AHDR=l-JT z`cRl&0t#aqQ>Em(2+Y9UZIH(i6QQ1!*KEs=7INykNLjd!hpaJ+gEIo-t9(5W7r1U* zU>mk=gMoob5*Z%6JQEvP5F`X%ubljd&Bwk}qO6>6GosYNiG{6&J!3qa>1uFt9ri@3 zfT`145?k4Y`<{jI0AJ}Yp27Y<keZ#=owo>tZ|qg?L;}tufz*x!x7i~CJIHpkLxK$K zX9DloNzaI(?Ox|sCsT1k5fyBzmNZQv_v{MU<{wP2rTU&7=v;3qa?c}ztxEk%p$|Du z+Knll^JoM8qarqqSZ@+#0pyoG`WuT@Omm;^o`0A3pcIt{gU7Y@uYNtJ`<t<HLn1=3 zUC-0Liak>5u&jEHAV&<voE=`ygQxp(fqzJ&UKSv$v`f`O<4gifv={_4@J(Ebw(T8b z1`L(&PA$`;*?7MT3b8D{3!oSBV1-h)>nmliS)okeuj``05Z<3Lh=QRt1chJ|Yls`y z%HA=l4AQ~-fs}HrsnVykGI45yHz${Oozxc0*XI+&X%mWb`J;b>jKXU;p&*|9Mj+&_ z1hPN41Ic#FAT5LZ<P74}Wf0OVgODPFc=u!wa*9E`mO)wu`AHb0qLwqL%OEatnl0wo z$n&s`lWGq3T=JYbM6QJ&pp^3^-UxrDq>#(FBNt53Bnxc|I!zaJ(oF(>G4}pn6&><8 z6`k7<)UbAvgu8CDRTkGBI$Z}19O9%!77VG&18~zXRQN24Qby{4hxE&21J<L%0|qWN zY{r(U8ZSNL?f{Yg&}l2r4e=Dd3s1Q>_)@G%p2B@JNQh~G`Uy`FjBM9+AC0GsEl+g- z!Vpp$Emz(3YqBA-TCRF@uJUS^jRuW!6@i=&gQnVYm5VHwI1i_(W;6zhGT3wq!)w{8 jX?B85*|O6Q#ZKAh^yjNDoxR_;zI6Tr(VtJ&12X^snYC&D literal 0 HcmV?d00001 diff --git a/docs/reference/cancellation.png b/docs/reference/cancellation.png new file mode 100644 index 0000000000000000000000000000000000000000..62b8d44344a4994889f99ea6be0e7276d4e2b04b GIT binary patch literal 7849 zcma)h2UwF`w`Bmuh|(l<5dunYB7%yv&^yw5mEL>rp$iBKktTvbKm-J&H<hL!y(rQI z3?)G55c(Xy|IW<++?o5_`#z9BlK144z1LoA?RZUf1yT|Q5(orBs-!5Z1%VJ8fWO0_ zgy1nv+D`*K5qTk$bf8e^)V#)T@b6W3MMEzL<jT<BUxLQO<va-Fma3Ahw2pty#!Qe7 zmHs(oi;>cBhb5IFey6&KH$_elX0y#%U0`6Yqxqghj?&nC1xLf<DBgzRs}2m#Rn|xp zz;f$#)%N+yMI<EXro?GIRG{#c7Hm;sk!C?2oq0^1dZv97yoyB5pB(XIPB-r6Hlp0V zJY8a>k*0uxDN!W}`hh2i>Se8#A|8Hz+bRQbadD%RRZcFhdCx}f^xl^Qgb-fZLjNf7 zkYiyXA+6gtJRan1FZQ_2wlr2%4Nps-A=bn#z96r9Hct2U_O?7BfP4poS>k4zX>Z)P z!N6ej<Vn6JCkY9O|Kr)W3Mt>2Xd#g2;V`#X{n?^n=SR!gA}-Z6H8Rk~rY3d{4grG? z5ctcCjHQi@{>AM}grC#ys9@LDhAWxNYO1SST3aWbeWj$N92~fC%K4hkzdn8&9!~AU z9OLmYYHB$0*VNSF;v&<{o8ZoOx@C_ZJ=&8iXnvTkeBb4lF!H$+%Wu!d%*;$9W-KEE z11lTbQE*#SRL4?(c5`zx*B2s)Af(WrXza%iT3T8G^R}ElT@DU3qp0i0`g#-!)rZ+3 zWfUnfZwlPUMqME{GB$2)X_+WDj-~DH>PpYZprNMzhS>ohfAHV|3vyv`(b&j{n}^5A z(GiQq`mX=X7oeNzH#9V)rlDa)7HXB6@Lz0okk{(P$H!MySEni77BFjR2)j6cEgr=A zcP<13_9sWnd6WpZxweg(I}#Bx6rH1J4N639ZLR;&OtYVhvokc(-qjVH8n|`Hq^zhY zy2~mZg<3>EeE86+itg}@4)=KLd=D&JTXZNmp<R%Zho?ipw9&I`a?;S;9|EzZb7&Jq z<zERKa&>n0_V5@E*+1T2<Kp51tJf*jX>D!wY&1C=d3D!%i-;dJH9j6q0p@v0x}mw* z>0oQApD~h!kdSaoJCfz4a#5QFr-;J4iV8CLA1pQ@uc@(d{!ZaM0pt~d`WW4(;bD)3 z&Uh5R=}1Uvem<O=oBQtFC#<PopH{E0J7X)llbQOgs=%wlv<Y2SG>N);dhF@SMOvk* z?4y4CW^+phyfkuK(0nY`@$_R;lMyeC_LZv;IxI^U;}U**G3;#3TqF0<`0Q*l#k<nd z$yz6UUteE4J39@Hl-%6hq$D*pwf?q{laiCF`udcFgkRM*iL$KHP+c7z9ew?4(O=@? z;>wNd>+0%Qk>Ipk=i1bon%erWMkA1#Ha0~#Zq`)$gZ0T~-wo`_ioLzPqPlu=ax$(b z6#}_V@O**vo^|)LmX?;BoE*Q|fY?5adY*(S`-{uO#7#|2#l^+l-Q7F>E#NzB`ZD$> zbpr#NVq;_T@|aP5q~zpoj*bXuu6R&Jzim)pAo$$x-@nt+ZjAWsy9`WDK7_+9v16r# z5x;jZeMU|;PoH}G_{4Wvxw&nA`t(U+E*1ijVM+{VxDSDR(%j;@1%c3A(|Qbn2+|aS z1GeB*+y-wLJYOJygjcb2WoOzd`GsJ9lk!o`G5Z@weSp_kxNnE}_-6<vzKWo)0jZlw zx|@d63=Vr^;O|dFXq!mM(nVAgv2YSD@rqAg$c_3V{1UCrW3Q!W+1ZS!zNEy&we|H* zf$<+d6l7(8PEKBp{(?jzD=PR~PJdQe4-5=|Jq248OUA@%T41cG<wup}^6S^HiT8$V zFp{I-P-o}&i2Nba{jpMQGcz+2e$?Qyg1r31_;{&Uqwhu*$h-3LjX&RBjQjB4xuIlW zK$qQru)X~d1k;=Tgm@~B;=;n`ZBJMDzhZWh7)6um@5OY?`v(O{2J9eN#Pp7PeX*_; zXmroS1P#1%-u=PNfg%;u$9Mi%vPW|Mj<A}zj~bEA1JC(&VioLYQg7u%&}mUI#MIbG zNhP4Kk$(ewj`0i#32AL_zo>JW+EVda`fk|dU5dyrDJ$DOJe+F_5tF8<G;f!OVlWuW zOYn5%Jn^97W+aQsc2o9{GZi&;t^c-Frs~A(>@6CaI-5S48BMq8hKNLBQDI?ZbhMnT zY>8NWa<Z$7%f|Zpv*hI05+O~tr~YrXi&g1!U@2=Rdb+x)ZH_DavT}0KNaWbq7{#S0 zW@gFF<KlY9=k{D83PzckER5a>TVtHIln!}?UNM2J!<ll0SI}XL4n`ebb=RSa+url= z;dk}wE2SOk6tXfhQMI)`Mn+kx>>UED{P3?@Ew1`lk;2QE(hgjWXRGUJ)Qg2!yX}w= znfH|%BM)W7Q;&1xj>**Xh%Dv*8SnwE8{JIc+A;P+qHF<=e#KK;+hj&jeooGkH*ci; zuJ)^ylwRw-c8M@T>Vx;HR;Ft4RLB0>kEqDV^^J|A;Pca?U5_WKs`bJxuBY-$bWx>= zn=jfNhxj#V=g<;*A+E_flHipJ#a|q&Ir;Ze!McRDej7y2KQ=zT3Tlh+TKOW$I?U&1 zM@Pr*&Q4Z#HZ89~c%n3xKfmVc{YRHEq~#`+jFP#FLt!0_c!^btwY3-C1A7nu8R*Y% zgSh`a&;f2{YIu0~=g(I;IW3+T<-&HdAYENub#--peN=7j{p|j_>go|wgcp^gH%Tv} zQKQ+tbCAk1v1Ifi?$_@-gGrLz{b$PuWD8!&#m&lA3wQX|?V-2^&IQvZqDjj1%C++7 zUn<^a4&EY2>8Yu&pKI`7YYWeBX?ZLt_`GLv^4Bl*EaBCGT(Kq<Xtmehm}x4oooVu6 zO^xfr1p52meCR1F3JzUIK|z5Z#YjQ%JR>7UA#=|J9%^E2EEaUI{<*y%h9!<e<2A2Y zivcIh^TAC~(Rz@A-QDtRzWJ@KA!o<?WMpJF$$ENv6he}a6ICOAzUkgxm!xmszP)u6 zERmO&nOR!vGb4?LY9v|Fq#h_evMb@Zk!vU$=uYhWRL!!XKZAf^e_@rIpa0<SP@g-U zP2mgqEFs%xUc#vB>SKUESW72dfk3(=ss5sn!GA)bs3$s+w!T$9FRH&gE**C>5C;w! zEOidm1|7Oe<fUwWQBzW)B#AcRuP-d@oc54T5Y55pM0OwViVEtShkBD*{DGMoju{+! zp<;0c#%%yiLGh)bp%J-%|Guc`=5*sdNl9~ll*TK;h)@o82A02oHzd%|nS@4jAW8uG z)YtzQ92^8pr5ARneK#8y;#Al*v7eqN;e&no_U+rmL=|c2&w$eOJfpt{%Jk`JaQV3d zP4N#t9knWl@`bU&wXAFX+{<__pFgnl28UZx<rP~KtK=U8y9jQsB`1?TA}V(~<a2ya zinyCqXtQutociEoU2U#X!k$(9cfIS($m2R}kA#H8u^!ypaY8b1@2f1)C9YYE!t^&j ziREiNlDRKmj*X7icrB{~y0I};zu5DFU2O!L7it+eBZNK{DL2kBGLIkotWeY2cr4+T z@b%>Vv$<u0F)T^DY}lJ|9<p_VQF{A?nfjb65oniv+Jp-SU$F*Sbfhs~&O9|_M(avQ zMS*e6?7zNtEd9;)iq^}#?pjr5iQqU2M|=BEDGEspMdOlZU-pddMOlqDb(Qih5587U z_xkc2rhyicSY`Ka*5XblCIyR*U~+myq*is3ac_b+-%#Jwv_ALatI)jG)ojKr&V=<f zm2I%laznQQf=C4YSwZE`rlwQjP-P0FR%vI-wjb`Td=dg0FUxugNQ7~j-Es74t)_Dz zMS}LBc3zMIb8atwPt>wgij6Ae{(doE7}(Y(u^*M@8cIq5M>|EzMc9pv^ghhW536H^ zlv`@5syTv|2xVnucX#)^*8Pj{7bEo~4*h{t5tYU#a^_Y0=RX#U&0m?VVa20FTpaYz zS8=sTNu-Dsu+RPg*u_IFWd8`0v-JCHM-gzfsC&IXxi|E6r@JYSv$u2fNSBz;Te*qx z?!^CD6Kqc4IHCNo{g&w8-HLuk`b$_Y)v0D^#>vm`aQLl4*bxTBo&K(_?%?<5sD>iS z)X~S`Ar)dDh}4>X6y_h;y>Y-TQ500ViuIe@3?a~k&6L*VZqy<7*HW(%L$!j#a>e{A zii+fJ-vD6W+1Xiw0`=tIn1O|iTjZ;IcF8FzgUy?5Yin!GVHcq-f^2MW%gR)EX@Y`+ zt`HM1IDlG`^ZdD>4^}5a%Kd1^CQ78dxguZ{w_oz)t&osV+xfARm{>C)Bn=G@rbimS zf~eMFXRse>WhbqbBvK0#jV007{{e94=TC!MDYTT7`R5-ibh!OCXOsHc%p2V27rGLK z#ct;^8a<<P3Mnf@ql5hY@kd7<jni9OTgAofRHPIy;WZC5wSw{CRm8=_dH+E`hyYl8 zj%WDGOz<#r2;|x2|BkZ!z2iUN<-fi`o)!8fF3-J2^^!Co>)Q3H-=0QMUAKsl;CQCP z&6J}^_iVuYPNBawXL@f*NlElIS|OIcG94fh^!jtf>dVX3%(MGY0zd^w2IJiYiHKzM z&CF)SHd}T($R$^thQ`K(LE#6AMW)F3t+@Zzr<s|v-gKU^en3CpmX?-&_#h}L8CGH! zkgiNkON&ZPeWImRaPDGdDtWpk<K?wG-RK4Hi;@5ofzRk;Np0;ukPXMbboBHx($jMv z2YB{n@IA*QZGnh6oC|AjY&?>@IMQHNyK3<=A%O&l5#$i_1zsT<VTp5pHat4IJFLJA zN8*FeH6+huXKq{=Ippzu7DQ!d_u1A^B7mX-IZ|XFaB|=>Ed+;0G~F4}GBB{Wvx}uj zNJ`Qz)fr2IcQLvt+65dRna<p*e*8vWvfUa?z(O;W14<aWUuq6?iwpu`)*iaCx=PQ$ z@JJ{0X(mft&>;@Uz?Xx|b1eb)K>Zpp;!bzm$Bxg1p75diawWss40uI+ax9==OO6iP zFJ>ku8y!ZAsW{X>81O!F!YnPt#K!u0d#h#&-Qnc?Iwno#1Fp%*Ns?$*5s`!MnfKV_ zhaQZ&?uarKH@nYAt}0CE9BfS44GjS5P7}6H7!J!D+{EET?6uA?0%3Rk#$>K%_v6;r z3j_S;wS(JXG&BR*qLt<4E`X~i(h3wGee1e$ieF5b3pt$mn#%T9U;#ezs0@(B%hzaN zFxUezv9O(Q9Dsq2Nk_s90d3{uE3c~Z02Jj%g=tMyResIH>L^<B9B&=TqE}(^5a>wl zD-Xv&<v|w}wFd0kE`84g3%E&!-t@U1*nT++H`kt`kx*{dnl+$wSEUAICvpgUb^8gf zS%R^?zW&OUD{RQ_6y}S$i}N3Q!x8!Dj~`)qZP}7x61gdvtE;PQ^3N=)40@887?E4A z@&W%CAE$<c@KbFxnY9a2+?Hp+9x=Vm#K7B$vR3Q@zHZ9j<Lr}35S3R`O9E6`b8wSx zU`J0+Pfkwm_!qB91I3Qm8>L)~wUyOgZDY_Oe_~hUsjIM0201x7+Vv{etm0Iii?vi} z&%x$gyYr+FkX)70mX`TIo&52W(spntt*qRvu^ZgG?|*Wz0hk-S{ZPTi27|mxb=(q3 z-{yMX%*{=pJTW6CQsOXLN$eUi!S@nrsbxCEzbJv<lmAzR{Et%l|H_t_Znvb!&wIOr zk{s;pSz;ugq|8J1$ARkWXX@G_<ho`5Lb(VC-lb$h!RIFYqJGd0vO<3;S0FcI$(cp` zVBv6(Zim=$9xsKvHvyFV0q($i!<z3*mo1?DC?_063>UtM`u{JSY!$b=y1IC2%Ft-L zEm2Ykq@(u&jR$%6vdapjbLL$DWe}nj6l`vM+y_JrIMu_s;N7GEqA$PiNkAZba{^ov zzyug8c>*Zf_ugJd7Z=_3;8VN@NNbU7KAJ>rZS53h$@5srQ|U9u&`@AV$oTn*N*t!8 zr(=K%Vp~H*NT{r$;=ve=sB#!(|Az;zEiP*7=pa#H7iWh?Ngf=_gLz?_t%u!7jIn>~ zdEB#Se|C=m>B|;%!{KmxqHHr6u0iE55O}WDip+H=5hQ%_G;N{%{CEx1htkNC2wDGG zMNd!fZwXX#-uWJScX<$`X-n{tCvLj&?%lhCuf?^|W59gq>Fj*QaGyl7^?%@jXbQ_i zXF%dk*4X_ckh(fM4GayHZl}=-m`%5bg@Hk_wuNQdAAb}yJDo|Sfj9|(M*8n#sS~>b zPw{u9Da8D6d%L@A&`6fJm>6Owr?rnCg)>#<PaQG6>A*F)B>nZNkg@R;SUuIH?Y&iP zq^64tpR3m)&Xkc6SQ9`P81ha49DtG@Gb~~*PUbGQb^t9#Y8o2ShX!JLsewU|Fs?MU z*bSTpuhC;)QVUSw<e;GRz7nJObQ1uVEHwS)%U5F0E$uELR<hmNwzsx`qbCKGQ&5l$ zJ3j>l9|})Z^ad09{{6ehV)y0Cm#JYe7UV>Q>B&a@+`-<SNsIrsU;D`nNSLur8sHOr zCT}ot)z_y*D6*zfT$;z>Do!Q}rs%vpJ-?6x?|}kQQBi>}1?t+Yz|9AHV5H~=!j8^X zRzqVDY-L$lS(jCn0dKdB(wKP@z|&<62A~lz&MYRYZJ_zjpHtjQLFML#0ARx7{jswE zN&e-mJd682JWL7KF*QxfTY!?fxLI3AQ3ReG@R=Eyn^(G4Hame6s7k&i?$}A4!q#?i zezLT*)RV$Ydx7nYrvlE67AFj-BamsPrlu1U6V4)2y}cyxPOB>5b%A|51K>c-qo;Z3 z>gL7_bT81l@v@N=?@CHE(Z40)WedRUH-FWZ0nQB!ATZ3MN56&+KzssQ@O-CFK$lw= zh~UprS3ImoOo`rTu(y`IEi6R#VczL*zh#6J|Mhj+LV|$%;_m*zGCp*+B>;%GtYz0n zVq$>1zj*x`7znrM=)Nv)JG;1WsAYLC4=_zjv8Fz|`A~?RUA{G;O?&nqegML8_Vee6 zj(I#D|2SYr*4(-r<1h2?8qM0yj$^-0aq42t{KC`E&#q<?=y4?tjh>|a4F(q89h1km zFyZ0hv$JOXcL2G5m`f~}7J;2unN|JhS4_0LaH5p2dGnFC;_VyrE#lzJr>9LG@o1f; zu8hvixVX9Hp-^_6O`moQofG`r-5&%UykAO_(5L@&JFYnr=5|wYn+U;=Vg~o0sol<% zbyFpX+S~J1Q0M`N%QkWOlRZG<sYWj}C|gFez*t~r-u(TWg#xNqZZtkToUc_{td<=^ zaRYh@py9p0m)FjpZw(>A!KZGayV(N+>d2u|ZS<EfU$#6$4t4Ek%ko#zd7+-3p2t0s z=lQjd`S|*$rm}k$uU?A0qmoh5PB7A>@CPU)Bk6a8giPXr!knCnGxLC{A`$tIUW1}p zPQ5?#VWhHyl$SiV<7mBR5by_&f_9+r^3bl=&y^_1Vy)fW!sfqR-WQkc=(NiV@dcz5 zz%iY$fO|Ek(~pWXY*}R+ej$<Q3Yk5BN=gb)ncxDo(4hM1w`3+U@S|s7u(G)+kglwd zd^7$ZnES^z0rT;8b*-qW**!Zsl#u~+%L_buNCMajmM~{c1$=N2;2=O7=1@HRc;Ae4 zI^`GOSA)Qj08Cc;FjgDbcCOP6^Yin-3ZSE+s<G^d0aJn_7Zw&67#R~262J${S_AJp zj&YW=Bqk<$kOR+Sy3WPe&~VZ%?8F#3)abRW_ue4Cji9TySJ|m6BO{}*uyABVi<z0Z z(5oW>1HE>wrmhauqU)B{)@&3|;7q$0<lVLIo^1_M3hlOYKX11Pzwb2h%KB!1H=)KD z;He;F0Jgn*$Gsn)1<Yk&i2~Qhc<IldxGt;6b)6VcmdDHV&07Njt?~ubkx9&V@8ICC z11^T(#Fc5zmF43OfCb0T&kxqVc5f##lJHiFg61q+!G70`&?fugf<eiP92RIa;`8G6 zE%Cs@Nh!ZgMK^=0n|N7LI`^AoS0w4c-g<fpofB$Noqk|81?6<&c<ZZ9$}RDPxHv&S z*dN>eEMRA6y!?A1Q7r+xF)Ywv{VRw#7HE-{Qj@E_J!hM$i16QQZ!qlK%fkb}I#9QW zmxsC~o8y`)>gwl!pPikaDvEjoqXG<r5-@+K^A2RzY4#ZGFz&e#s5Kxu1Al*tc>kUk zuxl>uV$FJUV8td-^MH`KHp8gLt6*mK8jVIbzO{%1le{Gnj6Xj+A&EwC!q~wDd=CG| zGa27ix9{A!BP}g0l<5qqjDbOcL1pnKu;wY2l`3O(Gwh<dveM1nT`-iJCee^r&(JXQ zSd3HkP<8>3g|xJ^tgNgr9UY(=gFZ)fbu|Kkkbg!OA&e^nibpDBCN?!MPtp%(B9Yhb zv!+*$Vqjn>C@A0ul+%8gm60(!GBPsro*ipaknC0?EJXSppGm{k3k`{*?H=Yqpg|nR zxy$u^^o3VqsJ$rTWt+?$AW?vzu20pI=LMtHaqV<_7e7_4zM5KCeB(VxVA#ilg)JPy zPeE5^=WU9Fqk{t+ieOEhZt_WFftoC>fXa?l2W^J*bZUtyb&Af&%h%S|*VSJ?E_D?I zwh?fmxnK#$$H(7ZaB$qYvpT@Dp9U5NvYh#WyA;nD2t4EvP&^*j@zb244xqN==jY?+ zlJzUiKoM}bTw2=*Os0okO9sZqi@L&$D>x=;im;QZxzp2A0Kb4n4#)nI{hg3?-t4uU ze5})~$*HQY?h1;yS9$)+1umfng?NIeM_gvy=?mA8+oQm!@mZSyz5qXJZGPV4&sWNp z$3VLbF7F<le*do8@)Vfhz(m1sr?M$fAc~5Lu;nYW`qHTjS0hU*DnbGK@!j}UMD60} z$ld15&cedN$49!_t{}^!Sl%xldP)c1J3rZc;cDu)>HRmvpD&!078es=tjS9@TC=Ne z@9*zZQc{AR0U}=z4$m(uOT_ymzkcY|-QS<ohXD<q(spKhCnw_?+ayg+K(4B)sz7+n zoC9SCDj0C<SmLzN>Hz@(9*rOZnCa;afqotxwRUn!q*ws9GuiS;kxEwBRhXqovu}T2 zU*E)pF92nuxhPUQnpX=1Oc}u)B!&2MfG!{>Km`@G=c79Rz%1u52f(Y%e;dS7K|_Q8 zA#TRsGB`L`MMcHN#s+jXOigD1HjZuF=efSfGXl~djE(U;iXmm(y8jdkFV*2j^=(JH zdVd+xAEFD-hq@YA)&U~7`Limj55rKG6+i1<qC&97k8ayj+kJOm4a+mKXBup4FJ~q7 z360N>@3$2b6Ek+^BE!Sn_=}qgVwyfy;yke`bHbHIY^|*Q4T5{r!o(I|hg(-^A%#b~ z(?p3)un$X~(^?^`**e^yha;5v{_R_tdgEX@BP*){SyrIUfnxG+Y)c%xUaoi@bRVtW z!8A-s{5NM?nV6W8l9IlC`vw4377BU^|LV&um?xK)l{JT))VbD!b`I!Kf|C*v`D+1! zQrOWKjesLcfK+-T2m#bq74PFDFE0-~Tm#;Ng9Ebb*LBd=$f2BvUSQ*9Lk>;N&F4U^ zSd6wCd~H)R`TF(i$F~F?JZLB^l&#nJ&$b5_xt-lIh;&deNiGqVD+|Fa0pqW!f=1GP z-vDC&<m7}WUAeqK{gdZ(v!7e{GkQ22espxSlzdqb+1?)J;o+gA6kl0c*=S8~ri%aT zc7zA~%g<m~uek##=FLCaGN51M{2Bdk4I6jEYb-yerml&qMn;TGP5mQM6t}}oq@^Q1 xUrvEQXo$5Q55<Iuc1%Bk5Hox-w<HoiW0s%as}#+uWCIg~D9NeIRv;`Q{};b4Q-%Nl literal 0 HcmV?d00001 diff --git a/docs/reference/data-flow.dia b/docs/reference/data-flow.dia new file mode 100644 index 0000000000000000000000000000000000000000..9b1155bcf7144927c7e791a21c5035e3f6b3fe6e GIT binary patch literal 1657 zcmV-<28Q_`iwFP!000021MOVha+^35zRy!I^wyD)#BW`v)9!9}?{;?Ez4pjPw%KCv zfSklPoqd{puzix1fYvq!I|k&GRGtY5M4Tgu^BsNXL&=-BkE>9-r%4*b(O8GT&@~#( zVn2u$WBspBA8uX!?cL2AKOnF9*CHV+jo%Ta;%uxh8C$;|4j&#KK)6i_ixUtA8<5iB z7ZQeK$QupyyBkg0H{cUS#I@ooVJr!z8%DK=tms&ulG*1)5^o}3&s!DkW^ouN+C2%! z`m1^N(T9bZ;enkKw%24qrwJvW>rET{<9SU?uW3>?yIRL-z?-n``lv~b9dX=iQ?yEX zqiAvW>Ye#2?^1DLXRE5CwNBWIB#R(A_QU5U%qIc?7a_za!}46ua7+h&os-MmO|R=N zyso?Cy6%E>vW^p$kboV#oW^lTNtAnK$%Z!flg>!UL+sSBT8v^IFczQb|D1&BQwES< z{)V<ok-JC&|1@w9TGUv12z<7jJW86b-1=6M_4^<VrXj8BeGswE%x}9fUw%4S_TJsz zG8%GgwabI=Qj1!bFAs}N;M4R>m>ssMv9v6j4bRPbx!qGICcji#tTPuO+0vvi|9-bj zYsCXDGS1#C#M8g&j1|NC$VlXq#Mf@M_wl2?V;!7x1pZk6-8h_{@_@K8p81aEXB~eF zB4iDm@_3K4MV;;Gv}`)zohQ*Eq=k7Cc-Fw?hmmOj!x|uQZ03-LbTyg9Np#EzIvG%A zKg$}&gZh>++Vp)%gT<1aFpirU4<bG#lS33%;Lt(dd^T_9B3;H0lM0%7eht0EOa5>t z3GstXdSaf=SkEu!Kx&LE*cMq353odJK_rkR4x<cH9At8V)qFfp0hS{XS8`!Ry{Tu@ zmjEjO9n17gY#D-jyN*R~vD+=yKG8?E2R2xM4YdZF4Xl9)ESZ3_fMp`##lR!z0Ml~B ziPtc4nV5+)G_BO8E{L+a_Mly<1pY`9KIJuK@Coi%SBS(Bt8yo<Yjd&+!Y%I=iBerl z*;bGoo>cQ&f1}|&Wx<T>bFs^NaD@1Za5jKz9DdApP7fpSR1`YMYUiq)bZTW6!)WJ- z*Q<+YMXR4DjW(-_QsY#yQN@=p!^M5pr7|*hT|rNS+brhUd&YQ{NsmDG^*7p*=cOV% zS)8r;+U~bw-90V@N=7?j8n^?dfuMY<VeGgDr}fgwM$;iFwxQU@X|`c@!Zr|+O*d>S z^ODmIY-T5Ypc_Ah0bfxR-M9+f5MikJMnCxmmdrQaC9?{?VRgYb<R(8?5Dt@<SR;sw z7`K|PMo~1Ok)L({qCr(QX<TB?HoOFz_(95tIivN<;;q?`nneDDBuV^mB9c){)02=! zi&M19XgWJP7iWmulRb2SM|>0v75BpG+5vZs<r*$yw*|8|fTlzwbMqKLYziPl&vdyr z;M(^0PhvFfj}1+>&&XojV;Xb&J`R2PTm}N{9e!j}84-m5!u<l^CGZ%dKRl)rDZ^>~ zI&uJ!%%V#03Mh^vSLhhL$dddvvhjGHB4gOSl`)9#%!#XHj5bTZ+ZJq=Ses?ic(LRQ z9|j)Tz=h(+KIj*}{!AEo?$!SX(J=BDR02jn1q|m|1Pre=%P?fWEA~L4Uu17et|DNR z2UXdkxo)Ebj2;LWB@x2BM8Lqc_evEoVEZkMrd$aFI>0fluR4YRH1hhRWBf_eHGgDO z)0C8P6)7VN#}}w&pdU=jfUS3cB3rJSfvlaJfzfsJ3|k2r)%!B$$U~kIG+I%C*4sdl zCtK1$4!|zNg{pxKU_;mKm9X)FQeWvB(pi9~gpEG$1bv>Zps@8`P>ctzOhq@_3hHEx z!^;>4l*~Aq59nnR4wq1bO+`3b5sub7L9spX<i0{N0XC4uy$HJD0NZoKNpIN3FA-C( zQRLH&JPsAx=qcO4&%-vX4%miNg(IgMg~H)oMd4^MBt<wB;W!OAy9>bC@&RY<0nWPu z;A{mr1vn`T-|2wi%ibkbQ2attEI59jBt=E?uSN2err2YaZ%JnPbve-OA_qEhb71BH zj>LBt;O{^0scd(RZ07(={XvMNREK4zI{TSYou^WrN_8sLsZ{skQynsTkm@Yp7-D;j zlU24hK%Uq-<Mg7k{qLWDRpz@==2InYPfOa?$uB?8{!8-R&B4D>zPtG!a2<HeYGD8X DeaR^h literal 0 HcmV?d00001 diff --git a/docs/reference/data-flow.png b/docs/reference/data-flow.png new file mode 100644 index 0000000000000000000000000000000000000000..d1ff178e41fdda781d5a714e6d87e8b7eaba2f39 GIT binary patch literal 24681 zcmd43^;?u(+Xgy-h>C!Opdg}yq=Yom!U%{GDxC__(hML-7zju`w19+kH_{=9bV+yT z(B157{J!rv_8+i+*mFGZf$z*c>%P}o*ShLF&+$=GkRiH4eFcF)5IvDay+9yv4-p8Q zluNkqj_KOf|KJavo#YecOP4N<Oes#n|GjK2t6_&g5OiVxhg0Ue5QjkAK|Db{Qg-^j zGUljFzJE@z;dt@dowpaBhY}%~zq(9PK4#C!Q1LB9_m-Pw7yi^M?*FN2oZVk8(^tMM zovv)7dOsk6nf2qRyEK<^xZT{pr<`0Py}L0LFt9yEH&v>wd#~)EWo%&$rI{U$$Os-P zG<H8;Ey;Q*@nmhh3bVA-EQF7cNcZkS$IC_X7<VK*_C+E4A5ONHcKUt$cEi!pv0np$ z7*}W!LP&5K1-=zEReIUa67Q5PZQ**r`w4vo;qjNOkQk<hQ2Nk?hCdQb|G)T?l!b@b zXpS`BB;@}d=oV`B_MXM0Wywh)2iiQUkQg6<V0biu!<_B+c5Wj#knPq)j-E{J`!Gi2 zR=#Q`dpoU)nZNQ@$B0s^11AE(j2oAPNWOl|7UC^-b&D_Prh1G2IH9$pZQh*(nah!Q zMz^h3w+qj`qW5B|GovRGCx%sA&X$B;tF7M7Wa1P}jy^kU!>dpjf7e5c-lsm>4U#+E zMj$R+(IJR05?R)~c~dTxUEFo;D1@r)a1>Q6Eo{H`<EQ`f?-jZd^XKbj=AC~;6b8oT zrb2eQ`aW@3-g20(tH%xd;{Af#Hg{ZMvHMT<XJOm@;ru(LTj$aU#1wXB>}B~=-E(-# zX1htrsg+0P+?Ja@Fua;26LTnjh`0$Wsjmn|vu2?GbT(OiOh<ZukK7lPQ_PO(<vqt} zijdL<c$+Th4UG2YVaL|rmcd0_BL0IxRN^_xWM1znC+kl9+%~00r%`^oE*<N@5?LlM z$#26mdp*r-ccZV}%Hnm~*kaH4c3{mK+G6dbG4k7#D9yF!FP41;#-2N37ggMz)}z4M zA#ZW4V`e$#a}K-q_gico+2?t)hb|@i>iHPC_xk<q$ITzub-dHQgqfPIsT)3)k*TPt zC{(~fY&Z;h;j2hKdh`p-)~GYK%4SBoUt@gnSBM{<ORngX4h|*Lgxe{%4lufSjurD_ z#MJ&qV`ojcVVa43<K9mKo;JNdtwyi3i!N&_>QMHVMHZ&#<B*1J1*j<LR!4bXB);Xe zGRXDM_=!i*9?1kGw?BXR_ww>GHZ~>?DlX>3C|SL+G;=z&{M+f0n`|_%sdZ!D3?qiN z=1E6YVxq+g-HtHF*%1x;Tj<Qq(<Ft4@hU}^PR@bYu?<6#wZ^{_`59c?q1T>UT3Y7n zR{gY^5PQ>ft=|WMkVCT0U6w@bFbE3^i-?Hu^6tzwhwQIUaBhtR&<cO?^6I?V=lnN5 z<=ONvtzzop-KieGAbJ_g;i4yOlrWO>$-!op6b_=2^e0Bbu*<ACC@6?YG4?7EQI++S zq??;te&LhkzZZ$9KYMwp*@`fK0<Um<aPTZn>@-ACthu!{n%nRS28BR0NDX{w$$L9g zVAvWi`fe*}cF1{mnIWR}J`-8!M3HF^8#}xB*}+Wu%hZ(A)bn-sbAy;mi1-^fqOXQc z6?TgG1_qLlkkAR)r{!<bkfhxfb+$K5`M5<R>bwKfNP4k!a=6{-Ptzzw49*2SP_Q>D zftXh4?L_tIQcr58YIcTRja$%7vw<913X0$NXhIt&e|-wP^-$l$q||b(yi@G>suThz zKI0KQrIDdwU#^~bv8K+OqoyEw2C~Z`vPueL<>-+TtGJ+`ZkWQK0NPf#Rqgqw9K100 zyLW#WGzK`Xk7ujp##$z*v)$%1qo`L_QmAs?6|$c6c*dwz<0krt1y3UEBV5nQ!jf*c z(6PTZw!Oa}=;v2dSU8j7xZK;^(BNso&zu?`e<x=xOFbVKO@PQCwx>-Kxq0&@t&n}G z-GV}*w7)`(5JN~aE*@T)p6gDx%-g~by7ueiF(Z-1`VC)U`3nQ^5E7r^K8*DAiEy9p z?rt$LF;Y^}(Zis!90POnkyJ&xew;_*&O3`Xi(Plqm5)|SCOFjdJkYlg2)G@^yLazC zeE2YsqqDuWb+p|nj%Mn<eDx}Y4~ow1;73pp>B#4J8Mr{$aV=CXd3(NHtNQ&zj37d3 z><31|v$eGq)0a6Ac3<uL_wPs~a%FWDT~km}V%3{Q>hS7vrw0z+-pUX?nUC1<N@2!( zQ8h#wF>IK=Y4Pv}Jc2Kto(}~DPYxI2_{@5lx$D*RT<2zH>hIAgr&YTi=V%toW%jwj ztdI9r4QOF`IN^CEG_xJrzHxaG(-!>vDTZDSjgB6{Z11d%Rcw8FH23Yn>pFpn_lbRG zaDnsDj%mLQB0frT;KLPO$F)&C_tU=K-krtn#6hQ*qV2JwF3Y{?F#ku79>M(o-GUx& z!JMg<t6O9e^x?y=^_uhX0>h{MHXf15Pb2nLM+C&hYh(g%lhBF1!9Ec!Tz>6%e?5-d z@T=^-;bL>D99xxkA5_9vg`*>;pPhw;<<6Zu3=E!VBqB|>3oUV;qf^0ezo=BKS!L3l z;C6bHAAq-V^Tv&pv5Jx>A&i}|qJ+f69qsLga3C^B?P<FTVRRTtK3$oZPVD`BTV&RZ zgv#BB*1+4M%PTAIH>Vp~qGyYmz-Ao}pji5Ej8f4~G~<mBYwMDxELtQ8_wX5ZV} zYYd<*EGQVRaX<IF$)nzg<FSmZL$LFO<~=nzc~9Q!dQq1>*?VODKJhJ^dwXIIE8mn^ zbqd}zAMIi^;9@fzxY!65-niqtjlI2y+evADJ{Lw%>2dMfp<wfeGk^RENl1)gO+J&r zl?F?HleK=n<>KQLg~?`X7OOXYV72(|O<HKw{?~*Tmi6rPcpnBve2^Nz5fyYhIe@1^ zA-k<=PWwx33}C?tC^@tTQx)Tiii+TDzcDf@08^Lzl7lz5yD?QyB6c8=t=btUeqOad z4m)@7h>g-}qIzs#U>{t7AR8fqm7<(D^r@<<Dl9`mLBY|^5|87WHVmxzOkN)L@2$DH z%WPB7yX|?{0>noKLt2E>v&=qXYTm_;7-4XB-~a|@f_n-=^E>nO62G!4Em_d`6&7xT z*}!?EV%O}ge78M0`O203CPIQhhoHr>JK-^t!uLF|OIV)t^mN^DQv(A7Q^w<W>&0>V z(?UTiYP2qPczAeKY#HD~o`$nUavRFY$~MilM!+#jjcC9{EP5AdvSY5+KAoDH(kZvU zn*bN0VgCc4o^3YLfthAD;(r{E5kj{#H$Mp^yd`9hecY<bO3TsG*Kgh=H8S8K;xQ5$ zutS3r6XFaEhQB`I-$=omi-?F=SYLOCvjl55Su){<wf777It1eyFj;t;Q>VNaEWh51 z1e^*kDOd$~>a46Rl}uIFqovfW8H9)Rq#&D<F^^GOsr^zgEJZlGmbx*{)W*ifV5v=_ z?7b*{i{ZXZHSE4l)jH5R3BV~_?nw<)XRCgHXdA*P4|ewh=G^l2`h9I3om`y?qt~y0 zfp5KpQ%+p@31ZE`!ND6tLw2y8mQa?g84twV!a|9~$X-j>eK@6H!`P?(j5yAVFX}bh z1-D)nLZA>U5{bTbjZsRf9*$k>n}V6fz!}L!L_F1^kdh`LC7Yn*+V{l78F*S0k`yC& zN1cO%BU-?UF#%2-d?OHC;iTwF{l^y%-Ot`jNO-8Toq;2S{qGbazBB=+Nx*V+FztEb z(+G|!KVgK@?ZF&8tBA0$>ttjJeP(bXd=l`&4CY$GVq;?ma`obPjEOO9h*~S`WdiRH zHnO!!_|5xQAZi_zb0ccCbjoa#<)iuW@$tdF*9P<H!JpQuVXw}2KR<)3qoShLhKmUw z6R^I715<spd>={8rH?XV%)uu_7=pWJcp@i9Ens<z^mL=1Bqt{aoI){=-F%yBwq`?P zqhb`V51JA&c^~E!Y`;3p$HtbWRbtr~NY|LJR*QQ3HY+zbSMrCT)5fdy@ha?Yo&AE{ zN?aW&@$&SH{PxY-cnywn1`8Ec#Cr8{fcGDNnuw^V7TBl_l5%1SP8Jr^y3dzUMMmvW zn#E>te)@(#UnUm<r}6EZx2Og}=^`Xq4VZ!43Gni8Sfr$+G>mcLOG^bgIddy3E2X@M z;n=!>Ng?81RS;9m>`%ChL+teQY=B$ArFW3Fwzfx8UUc4zGlAlNxHJ$O3VAvNU%}{Y z&}exDg|oQ`J+ZR`a1;n#a3~fdKdYQJr@wI-^k-`|3Mn+m$;->j$+dKL8q;3z5T&Q5 z*U}oH<}(X@cNuJg!qM{Vr^Sdg3YFJ^yK#<^kr9CSBQAd47RiHygOfG0`10AaHpouu z>gtg6^fS}bMVi^ku48^lPW@$w!9vHJxSd6Q(uWTp9v&RngR3(i$bqPvEN*g9hu|#E z+uIu=1<lQyW0miE>gzwDZ+RrlcgCIfsp-9Qc9wqp_(}4Mew&ue`1n@~9WfKG`(rV} zj#m^TA~n?qY@g5F*TBb16MEK`6+E3_SJ*?SXz$<<3kM7A(BI#GqWpqA?SZ13TXkHV zp1u7}ohP9UDKagp*Q_`<*9zVME2}x#f{@jsklB}`QD`(?`OehT6m>5|OYpcT1JhHW zP?bXYv-pznJA{+Gs##r+OVDNsr})vnq=NJn(#Xh2*WEs~mnqMJWbZMIlEQ=vt*7cZ zYfcIvT0uexxh(7(#rn!nA*3k}xVg*GnDB}UVT_>RCOqO)y;q#5OSt!2+Og=}8%up6 zN^Dc7Mywt!Kl;pWqhiZ!-@dH-q=lM=W9@qEpr<z>&>onB#|f!jQ%}#!<QJY^UNidh zN)7(7TRkcABBD%nbnYiykl=bs-sRz2-<fK2X8)wlggcq}Ez>=AJYSHBzM-qj8crX0 zN_Gc+ds-(JLBRuv5%ph)MhXlG;V4=KMMW)7O$EiqR>J{<+@c_0n;0xb!0p5-TNN{u zWganQ_a=ohiyUV|>yhqSq|Q^T*dayDRq*g<`!(lPVqo^yNNGi#iy$=!4-bbl3qmTa zL**C*eK=TF=H@h1RL1)HbwUd1){nisg}mA<2RB{8K0nX=+U4<5bxr9r`I;>poLh4i z^_VqHa%+3rWoHo<baTvc0=+g0F3jV_=KemMgW5!yz@!(Z;O#UT-&Nod5P$ys8B*K; zDdPh)b(0XWN4)xg{m=9{=kwvEnzN(UKYvml`%-$k`>qN}_)>Ak@|lNwc{Rdm#<#x4 zsZ2-3sr$Ak#s3*&h3oOp!a^R5Aj3OIjbM3t{{9_ye~|s8gan+xwUlq}3Us=n@{A!^ z2eqMOs7;?x{!~s*Gw&4+X|_%U<zs?_WQYck7{0c&T-#ad(J*H5QO%?U*QBW#WuEB3 zEQGk;nD`|13+;p&YZ&%AUENqqp>hSZfO$Wgr(}1oUJYcl`Ecqws?X0{BA@+)L^|Vr z)H-<l&sf(pav|X4EBLMt=HiPynNbShdDRQv_*f##6^bcu-Yhe0rG&%0mhlx)39eCo ztug|l3OInQ849VyZZ_S@Z{EZ18<9R`eBe`YjbFVPH9WY5)XdlSl>9Ntn1E3>Cue-t zWx`9&q+pLm8^++r`-z>O*vZH=g11^9%>RTA*S{s=v;p}fC7+o~@!}sLLWyFfR9zl| zk}r^MOqANt3*hUd9tlB0-QY_#XL~qWW(OXNSr{f`(v3t$2|MPz(3s=6vkRV!?0L^x z{qO1Ej@Kjz=ibT%S)^vUJ<C3QxdLCZYNm19w@0Xn_uKxS_#H+UPq2BRyZbqW!0Y!_ z^E$T9lai9OE1jMr`F2c4qS2HdX1}v-2+G1v!91XhdAump*AFo*At7OObQJt%BRuLm zp9cM$x%c~Hj!R2RRxveyvDr1X|DWzmpWZHS7-PAiITfE2@`tZo=nSUh7tJwJwo`SU zrGJ<%NsaupfaIj7r>E>gtqMwA{RZj7!=G<xFT@YqY?(gE?SEt+vux5H#TQ5?4%x<L z{G(40{kx(eXH&gL21y<(A72<cJmTzdfevZAvjeUdzPYo-lmPyb6s8;+6VvXxsROCC z>^*&20tu^=(^CTCTi>FikHMW6bZot_wdE#l&R$U`z)5p>#%|_~nhp)6DAx2hM=1-# zLbbzM<Kg0V#EP~G5qiXqRk;i_Hp(D_z=KzmmgW&b-tX_{cSSj)xkfu&mT2(Hhp!t* zQ5K%Ln;42ZW6a{~H*B2sv;zujSxs_a*mZn384-Sdepc0oU%X2(l88%w5fN&TkIlD7 zQ*mgQzOKLc^EKp-Z*PebZiO)meGH8Wx5sEUCDV3l5Rg`jZDaa>jy?ZUZlKcB+*WSn z><pH^TL6U_><5QVd6CsbEUfsIO_&@+c>_#;cA;^ngPonhH&nVZ;~(ir&A|t4i0e#8 z)A>(b;<Wm?i!wfaT47bHqiy*0ZWGUVeCE$YCAms9_fmJv_wTptW6bW+(;FOa&7pqN ze#XBe3xOZ&;~;s5C?H@l{2S60?U`!+M?7YQ3U}X_6O6k$u~d8~{53dh_68gzRF*mw z4i-HrMBo#zo2-qN>E}B^=9izJpH+xJxPU=Dc5vW#EGYIQq$=pZRm%S!6XQifm-8Y$ zqqocf;c*=dV0t0WUE%3d^NDI#s0P9E)2ty!36{M_!~fRlXom%x`P_ih8n4V+MtH3w zlE(|ypk;Duip!+y4wOA_n#rI$;=u*8c?|<RdGZ7-3Nu`MAHEp&=8xY^WRS_}(XPq@ zZwsRKLV3VOdY_r4AF<<WI}fvj*Y#hZPHAgy)~Isk!`_JuE&xZj4oN?BL*RP`aHL<j zZZ=S%c6t=W=jP{O9*DMh%%zFH$xnS2eL1UZ`*P#UFJHQ3GE^|Pz0fIOHQpvfh<NZR zhu+$_Gxqd&y=HY~MN(1{Z2Q$D<bg~H(8Vz2rN%xrkv;8)8HLc3W~R6sG&F@BxU~{- zVy=+N8tCf>+!k$tf$~1&(7%EDLd1UYzh{gz;%*}FoNs0C1w*n)ift#rxCs6(^yjy` z%YA0W&Kr}z92^{A{U7i+tf<@BZ9_H<$r|`b#8r4~RRslN$EkYLo)mbeHW)_a(!W4D zHEHLud|5{(51K!*(53ikp+!eW2Tyn-`oZgu>TD46?WCnI!kv|dy3iMVEB-G0_953G zz<Jf#)5G)N!2@yexRJrjh`uZ30S{ut-Or$gASNbuJ>J8*M7c@n#ayit$RDta7j{KQ z=39S`&Qlcl9sUOoUSY3Tgx&)*Ng#c6!B*KCi1-&jFqf1xHHYDy$H?wRI(JxAs8oYw zOZoI+Utod~$&v%4@sO&qgtf%S$3xzLwJ}e>TMu8bhTRslo;=)Mz+N`@Xn^$2n)!YH zWdz0Z3WrrFxaJoYtj5a2ATXqfyy(Y~=;Y9=zIFY&p_LWgty|a|h4FwthMtlE<P3uA z6v`R{d#TbVQK1xxp*Osj4<dikTBz0dGLX7bS>Na5P`rmUAT-TB`jhQ7a(GcAEbn{n zX^x`Uvc;T<a-GO1H(J~wcCpLCd3B2|&kP=#dhNeqFg>4!K@$QcWhJHmK7Eo>R_=we zO{>TR>KBRUq&18&8qtIMG)yJ@Mw&#Tm7%UP)<OelZ<AR@lJySCul6eTPV?h8ZI(K> z@T5l~wn@ECr&V(k@g23;NUJboe5~2(M;-eaZx)3<21iF%Sd8!^sUO<jgB?@}Qf4K( zeEIO~cpYrjF9%OW-YtO9eyL}wrqt!aH@lbbaoJsQ*?rrL^ci;7jp?~4R-;J=oWI5V zmaum^o58pzvFN3lJ5!S!{3<gNopI%vvE@-QKN`FK)TE1>Y9QPwx3ivIUjI%w^=Zxe zpY8WZVMY5=G*VPJy_R#Zypc@?$y!j`p1AIK)I0TOikC+iZy{xCfh6pcoBh<<Su25K z^wm6zzY{6?aaoQZa?d{6LYoOfeZpfxD=RCojEpqM3CX)5qC$shT!=@)(D^;R%ssNQ z5<brMw%rQ#`MEUm^?9-&yO)PMJk^Aj0()<*s*N?-NO$#C-n_kg`le<e%a=$;E9$zi z;^h~&=i~(^Pls6IGHX)Bd|yyh)WWlb1oYAs4<*{rVbZ#;s>FWrE(j)^&RsZgxIf%E z2pdRYnb-kt5*t^_m!T|y%64aG2V3f53jk(rWybIq-I=12z9ZvN>+S~C=R|XayBHpt zrr#I2Z7fs1dQ<P@1vfM3`=s@x5-TQB;LEjRwrfmdCm6*}hS!Dm*Bu61ebb6=TQZRa z1!+&uT18!p(Rw?~PrriFM<VabBu4G}B`O+|b^A-1?h0w%Xl9smVcfZTocDPKj2`kw z0bbr)ye8MM+dT{qnxk7)4u=uSqB!uL=ik)juHR(M4lga=UZNX+Xo~+-SjN;hokKak zmtxk;k39)x@Ah&F!cy3fS^l>oYSyN{8%<v=Tb+7Dsul*&Rt9_A9$`Bw!4Za!&F-l# zP`PK=yu_Tdes&j+ZW90d{!<o`Bn2J2sI-?Fum7qdz<Oo8N-MGZ0zUrGpz@EZB!o&A z#CqtvZq779$_NhZK#^AbWwxrzxi;l~;;1xh$-9}dbt^AJm>6G`U)*DsI#n^6vToOo zxi5Ms-fKQS6~tfDy1b_Z+NDs8sxJr$q}C=dMClK@qrL7N?-m63G&vvTBKZ_Fazh@c zpHItu%%Q&p9mjhKccs4M5#uWL4Gj&Um;N${i@Sr%0Vi?N*rhybp}9Kt(jZZiCzP}I z9cOQTL}9v8bC+2Wb=cnHjO94jbONJB$J4Cv-x8s@T}`uOt(sp@JNs5F<^B?k;eU$` z-mmRN&)-F&KS+n|Z^cQg{Oy~*!kKr;fY3+FybwmFfla@mTvlI@NAmQ}^z<}`Zl#Hl zQGccyCz!R<tET_%Lc3?M*n9x$&VP$iE3=o<|2OY?r^B<R>oi!uLww$+W3*=*_;<d0 z|1mN+@`>4D)Q;XtZ@kxa(uaIu6(wAHe;>Bg{i>}hF6-Se>@yM1ncq{qokmzx?`C6X zZlSv(f+|9{;f<}%(+yUiS8YcZT-Tk%)a<UC7g~&d8b8ncx`2@xAoYem2KjSq>pUNy z%V0zzT@{X2k<T2U`TG0!?<hWVXr67*oxAa$oqoOf^#Ogtqx@}ORIht}$Xa7Zh%Rx2 z>DdR1ZIZX>9^aVMLBozfv#biy9VWH0)jC2p5t7D?fS|G}97k_el~1nfxcSDNw~^F> z)^{*>5GSuJEpJm$B&lZR(-2B<a#+e+3e~DAGnhXPyNbWg%+J3U=YE!-m$x`xB@7Q% z`O8&60$?Vl$6w5H_KQD{e04BraUol{^3hdYves3-2HFDH3bPQgAq~w?L++t6yM^H3 z;FZ<PMPpuxK4X0r9jC@P^w(gp(`zduC4t^Y`|F)Tmk@E^A|vrHUd-rQ{zO26ja%0* z>3HqOin%%;ZW+FO*#nJs?5=$|{sILSPX8lBJnj$7#`q5@FYh#nx6;zm*qc6sn<l?7 zb#ihtGGc`1ReIiqc3KY<Kf99vfvu1jw^p2=pC6h8hlhu7Y>i{^5v*6riEHL&X8{y> zn*0}ATtc9J`s>#(l>KZIDfUJQ@t6%Q6B85YvjI5K)|N576phFbTT_Nc6`fkTGB)UW zN(@YuK!E+5Nn(y*#sdJ=%4!{YpHR>Jn+&dwS7VXpYQ90EcN(NA*k@IT9<cW%DF?*o zEASy?<U!xQsh3#l{7)v}<R`3$S5EAq1hX9UA!qWwG~kI~PWA9Wz+ynL!^FUV%`uL= za_SAB@pdl(N{W1#pA{@Wt*}Fq8ioRK>1sK#9!yQU)cO%J$bPvO+g2LKCTssH2=p~X z7oc&~U%kDXT3gNgvm%p|8L*q&h>q#%Qi7>VoOhuQmOI7I?<GJ&3@7={h4JxmI57$e z3b0cAaB;lxqR{*6w{I(;M(^MOx@T!2<a)#lmWBPGGBh$0vR0OmX6Q3DK+Z2=Ej3YU zMT)p{4?eWtThZ{B?tun9v{_+uFC>7^L{X5ELazZ5Q-rJJz*I7%++@!sBoHuS-PH23 zW~xHWLT8*o6R}4vYzx@{8e6~%UGj*x#wepu7qB;0TogJ<RAPqK4+Gf~$l777YoX9E zBI^cc4N26$f#dG0<xo&i@Iq_w_wUcJE{`BbBl>{>xU-!2+?ww9U>aV$V|8`){QNv5 z*gif!uxB3QaL-PF61*?TMB^>S$lfy>DqtYhsdNg05xQttFo=x~$ZejX*fon@(O!`7 z(ER!K-PUY#YXs;1>PQ5da`MA(;jfu4FVs`76|BsD+}g=H+4?^&0OtiAFJpZJgOHGr z)zwuUZEbK$*Y2!oUD)@>jlb{{Epm(I+xWwncMJAl+PG@DiJs}6^6$bua_V`Yt-+80 z?L4r6JI_X2(9ksWm!_vQ;1sV6dRqSz<;%_v(UY{==mUMWnNXN9w9!QB(J?9V(FNFV z0Dfa_Yx~vLx58yVr=&yxfPv&P-nW>)dF&X94TppNI-W)74ft!-V2eYnVTglapfdY( zYusYIp$x<>F`MP-S3f_fHxWB{I$ny?Gcyou08yg7bqhO@EGTiw!Js{02``sC_d33F z(c{YBwCD85a)(uF?7q=~CE3pWAwoiL#Q+ws>DH}VD=RD9JUn#bZrCJ$5!%dgqvdE{ zZ)#qXTG;ej8}pkbe{c{Ja7dZ~lz57L%3MhGpvQWL0!%C@BEs?f%r#wEGgns>YhpRj z1w+{%?^$3cK?2TU2K)kRSWA0*dso+gu!$eGH#hIv(;|Mrf%b<O)|HtXjZpewuOst6 z>GYguPCX6uk5Hd!)e&K}qob9u>{mRen?snee&8KE$)75hee8+yMPKtU`=B)djEh$A zaG_M?#8%dEWzc2L`h-v>)E=0sHb5Y9vEKkR#it3|YlLt78XJqz&2~i8nu8tx2fgH= zpx4j=G&hH$S)$kjW_ANUfVu+@X$!?DRO#iDssfgMcnIAPvhEC(O!dZVVoXe_larI& z6Qcb5;oeZ->_%Kd$UzL0M1j}&YgUX5O54JlovSW&J(Haiw?w~84Dd=+3n>^AfMV5n z-)d2Sq_QLN2~$~^&b#nCI>lyvNl!v{u3sAeo&SaYRL(F*7{);&nV6Vdjc`2#czAdU zi;Lx<8dOmDSyGZaE7RHP`dTR0%1KU+LEMtBclh^b#%wmJu_w;<Oj~tKC5nd1C|2gI zT9cQj7f0s8`C2M3u&CKP7cJ)0C@b}D`z@%gofU#hvvr^a*j+RQ*CY6$uyATp((i@_ z6}N%r_KpJ<h6Ziq&9|?gH<RdOqgcWgD8Bwtt8eK-PbYGWiG@uKcKuHGsYDjwEKJNS zE$}lAL>-oD>v(yi?op4qejc~|WsY3etFhgW+hV&bCKe0*>3G||Y_0v}zRb<d&Gu*k zW3pORq=xnqU#6x;T&$bI59UrX5nQ&9M!o%Nx1DtAVn*A3f3)SeU=VUR1*sKEIaPrc z%qoM_(toC33^56Kr`x20^7`Uplh7pzK7f<&T!nKNuf+Vfr^k>x(%&Cj$oI)Y>%|*e zkbzZ5l)>qckd(x&IvT|HkORc}-&bl~dxZoAv6)nrwT{<u0S@8>%n%Qj8w_1(sZ^@H z?D{pt0ili;L2yWjPg6&Zwz2;O4@W~Ns^7kaE<iT(#Or26EoC_|iM8JSZZv|GuEf;q zxEco`f*lBOPLy(@^pN7s%Lqe2ou5Lp2r<cGPkUQdUY-GY%bHl}uymJLhrnY1jtm0+ zUbn0uE+NK6D1!A$K<9*1LrV+7tJ12vrY6~Q>5DmrM70Jm*;>~Q%}LuvL|8{l%U503 z2?Qb*ygE(}#(IJiC!YIt1+fR<T^kars+90=1R;1^6t>TVJukH73M#3}tb|vtyy1>i zX2q7a!(2Q(fbk+?r3TWMbt|17<%(J3#0O*DHUh40MAN=}`4YPa^yK8^$T~hG!ih*H zHKVn?Jz0&e6anca8gT&u@6413U;)rOh(73SUEg$je?q6Bk@XUxx8z=m8Hy(L;-qys zIq^|uL+7scXBsNK>|{jozMh-?y>pM$=b68}j+qeJsy{o~ahoihXZkp>hOV%wV~d^Y zgV3SkV9?XX;J+d4bK$f!#dKXcaVWO#g^Bv87wPwqk<b2sEui1Ld4oa$be;8Su_v~z zjnCB7aeFHX`JCKf#-_i2Y|a+B<-T!;UtACMh9!vizh<$50_WV{K_4ym*E}mqd-)zP zzrJl5Sxy%>kjZr2XJ^;zQeW|DI#jU?4a^J|6NKDSEM!Ld*7cvDCh$k){9DO=ng%5` zGplVdQx4USR2kS7%xf?qfzDbFsly(Slsp>?jA0V8kJhaaA<T-}8ATK83GFo=N*Oo@ zSWZr7cAF(kuYEt?M`8=&{z=X#=Og0<Bbh(i=Z71dERif#ntRNh^`|ydP2H`HjJq*P zxd8(`p~jiSIZs;Uj_*0WjigHJPs`L)nHGCfMxu>KdsBxIGXMKmH6?{3Tca>0JzY9e zG*@Y*vt_!Rm~=JcWooo`Y>KK^l@r&)yHigd{W`FX%Xf`VG#F58mFa$$>8%&iktM%! z>>r{<!;}5xwr)$cjbIE$2*qm~;^k;e__&-^NW^a4uXM-w5GQf9_0Su#@yvnExrg$< zgB{&I@Itk&*{7%K>OgB)ZL4+=%Xv|L+s>j^-gK?6s7$Q~Sr~aUy4d{2oiJH<vC3+f zLWy)#`9pj2-!)XW+qRfq>yxB?b*74PbCO*5AMd%0XVl2@o%AOZ-+y1O5mVHCG#<<2 zQgh=VGPjU~^x@DzjMzq@qMH0=%dys9<@2@pQjYCIMtAt`B;b$KtWHm)tDI8$EIq*l zoH(yP@zXXEDr%i{AR4v}lB5h=rs`Ud>}~M6oKJf)thmAx8-2Fhj}QNL+%QjVG+xpH ze3d-t$B(=9R}p=bCChVE!`#2jA5ym`EOeGU6mocvE|ntTDZHI)QJEhudr?#UhBxXZ z8JV<}#?7xNyWrqG;Ln)zj!R2t-nz9+b5s6_Y?D%Eg}C#*>ppHdDw+O1&6sWLr##nu z{H~~cA3QnfBqPtAo!6ARr`MOpRa-YLPk!Ff9<#Bc@l|uIr|p@}O+^xy!-r8_$%<a* z(`%%!I^;Jm7wueTb4F^A-%ocJr}6n=GT~R+U%ztiVnY2ko!&XU{Gp^yPmfbANe3V1 z=6dwai0E|9p7k7c$xq>Br9XLHTyI;NlHuj|E}j#aL@tmIy-TRiCSMwQg75aLU)1O! z+4CTL%iFFsP}mC)r$!Fl6ch*(cTc;ulSt^euP0VI^2Wm=<V<CeI^gJ5uHE?%9;pv? z`BAvhe2T8T?Y7-a2pxHl8f|W09LI>5`Ad4onmFPdh6I~+SGI`enwz^d#V=Kl1^YN1 zVviN+yk&d4vOicx?x{L-@Wog*NMAqprp}&^rk&uk-W=k$n~9+77`E4M1=}y55PK?r za5nQ;Tv2z|aVHE{1&1`brm1v)){Su8$k1JS=SO_Jhxb*vQMs##>z}oDOZ$`%IV@qw z1ma}j9G<4O6;Ek9CeA?bC>k0)w4KY!TwimqeO;k3s%Z4ruNTONQ!DR##;W{%p5$*= zD#-ILZq7KQq}b@{9xwMshJ{ju#Oba47RlxZ0$Hbpg@LH3R`fU2?Cj#YX<GU1i6&AX z)S5;6Qy#lhj_`L6mw#83p=L*w#ZLX!KaTi|jzq6VQa(kUQVHMGk`*6X=fmhrL8Gam z<K@RtnRn#GPVNpZ3(M>2oe2~T92<vHb4m2OG8TI#qm4qWyi#GQcN4N^KOSHnR*z-$ z`<(3#p$o2awmq9gIuA{VYdkdF3C>T9@M~{xb#*n8O8@br_km2L6e@eU<N-f7rSI=k zyd#lke(h@4x34enzAK;@@}vteu+)#uW_CLn9&6m+x)ORiyhrN$JAm(&R-e_o-Er~q zi9M5X`FmtT8vWJ<xyOpn?vchE?@N*g{`vF8j{rZj&kPwX+frc6E-HHJMdxNRkP`z~ zED9OaItLj(KuV=HGheC=B<J1%q_@bIl9F=!_U*fO?*fYOidIRfR3%W02>*_JazXe> zNkqct>9H;s7yLIw-HzdDMIj^AzyDAre{N-G$CIxv$=lw)m+~UL*Gw<&Tz>og$xix6 zl?ym-I9vx>KbpGDQilg+y(|6vKDM_98XHpyZx%?t=Aa}g09xr?N=k)3gOQ&|DMS6k ziGb<`3#<118m@`+FI$hf)+O*F2PGIg+LcM4f4Z&8U4~*KMMGE5G&Dg%qmA$=<(*sf z!3H??(VCIhoSa^Nol9e6QPQ?PAvLCw_FU&a<j<o?9gtk4L1Br{+nxV(r}FqL{`pbl zOv~;!t76XUEw=wUGP0@gI%iSR+)-mmB9+no0><1!?L_wZC!K0@3skewEzf)w2Pc>m zbctThviwE@YqtG<6Hh3ms}^{^Ag`G>ECsWFw)AI`4O5Nh-UMo$vFsas$cQ)Z;V7So zimqJgUZwsiy1#xHKHg4m8RH@zZ#5K0EXrax@DQ+ESy@>#vkXf)s4kVUuU@D;MWB3Q zcp4s>E&1qrk`nXU1Tdh^PNBlh0&IM=)FzAk@&(6g+h6vy=IOlh+5LZ8N!mj?I!w*b ztzIO24QQ%l)#%J_b-8<}ou`_^DSm!z{?d|3cVC$B77U1qj`Map@|ph>;JS-6$QKl0 zVp2&qb2=Auj1b9o_?&F`QEvC>H$`!|!jIJ<hCmO>tK?79ky6QhWNMCLr}e^2*{@6& z(x%U-l5vw$?x-2Oy~~iW9UaWM>Xg%_>f4air}QZ2kA$kd)}QG4CDEE3m*|LNF8Qpa z+~CUhuF2B+Xg4k^5+rx=S+3;4exc6^eY-#t>((pH1s`HV_baSl#3}+@*ag^4t;9|u zXmSl+n{haAKPbv{Jm=!)&M{YG;@|9EH{RnsGx<>!7NePXyJ$noGWq`d0sRG=+_{u) zGfT13xrP4!qS;wQ51;F6<5B75tFw{$T<OIhb)vPb4^AGf8*i~}_?*meem&b&(?Ym- z`?ciT7n;E}GBdVfOmnH-Cf>4aZYAv2uYu?D>lbU7oWNs_i2D>*EKPyO2T0ZxPkn$9 zj^qi$+G=Z|7}5qfo<jj3pHv{o0ARF+JEo*C>h<ksDQm6F8Fys(V(#}_mX!)b>B=Yb zic2#?Lq_`fB|+Wn$y;8bp)WZ&Ixb$s*R*I~G+A3>e&31hH};b~$ySqZ&}Bt)^H#1b zYaV>)xKEL*C=wkK@*+(?<x;X`cve7Mx@u;XJBKe#E`14$>4W{%ysPwONhuMVh0Ko! zTa3xiH-6@rC#jkmSDbGjxhGmhd3is}N}?oA9)7DTd80<RzmZb(-T$^QUxrmUC&E!^ zzG_Hkf2(x4R?%HXuelv^$j&NSM=xDh^=m<@nJVVJkq<T8#{?_Z7QZ~A9gmPpYI&dR z6O^CrNkr<YBb<HwEQqExgeSOcq@jbJCzQx!;yhK#{M?ly`9<b*@N~pUb(T*3Pqdlf zS6StOoQ|6O=ct{@q59*_+t;2~3F$&y*+@2E#d0XcWSzc+#-1GM-HnJmDnG~)Dorsw zrF?Pu_^DD@7u5vnhtgF#F>R=x_Sa}>Xrg0cVj?3CPxmJ<W<9|Bu-%${;%ek6M|I=I zH|WI0#-2gtC?FtUnE(_b_cM`^SGe@watv50J9C~JoD>?%6c!fpMNv_=<9mL*;@V+S zq#34qterd@7Wt5!%f`r``U~=TfV2T)kf2;Ls)(Ils>J7)9MZ>yFL+6Qo1(jJP(86P z=gHI70W&_-Kv;_mK7NBDFV~Y7={fWBWZiS4qs++#xN#Az_5UAqfFlef$9YLe(+PPq zDkIK$GlIvLJ*m_`=X?InE*@G-&nI$Le{wZr^tFbwSj40YyUSIK(9VA0vCP?n`NZUz zz;jxmnNOYae!8*Sj+;4j7ugT2r<c>G20H!R*A3P@ww=*c)TIXsXQsnyT9j|@7ZBa! z#JI=t|9a}Kce}u;H+#^1f>&{Z{})889N~i38v^xWTF0KzpEBXQ-H+&h#tw6B50o|L ze(ukld5j{<pKT>E9((U({(GN}<k)g2yla)UIAf7c0)<+oF7j7&yVVu%?-uuc%PBQ* z7*J7h7rqC1(3Nu8Uqd@MFe1ye#axeeU`t;JECe$=Eu{fmzR&;U0AL0*Pm#q)c=TYA zY4^<1Z4svjHq$78Z=e{0I*5)g4t!;DQW8Zh7Dg;@0OIcH?tmWLLV$}aNG@6L{U*ME z4o8IDz^^W#uq?RsK?mdSd0*f6%uEcx8TR6o<BrWN?HKry`|kS01oS_;{=I(vx_jr& zD`;>%e}3-2&$$&9D};vhT>;8CN=ix?1-gU|L5=<a0k_57DkCDO_DiAt0ZbowheJd$ z$S@Y@7BD}!*vQBTTuH^dZKEK=a7JU6^I5Y+a&yd~gM)ZdlGA8~8YiQXtL8AVjLf#0 z-iI$D@ARo?$5y85V{YDTrM*>(*P-?8TM-YJ>EXs}Yi;c)&1~T`vta-BCML!2YvZCJ zA=@eMzW(<W<$~!yz0cIRIxZSf;kdxaaNVT1L4lXd=Vxz@D9hcu%p8`knwqU<c54S7 zfh#U;4p+4{-?}AY2&2XXYZ%@g<gRfSM!1CX2Ud%>uEx;~Pm~|I$elMRjN&XP$j_}= zv_;qlXzu^gd0Z}McCgiK^*?w(+qO@oyBJ1(`&xHD7m1OJ_RQI89Icw<&pN{QrzK~u z7G&%5{A)U%#5I4r&mDXni13E_t~$9MDTb(02-kR{X2y@z_h*h*k8A{l1l9)2Y-GlE z^cU_XSjty8m=A|}JH(E=&aL&mR}mA48f;8ITlQ)76$y_?9{YZmN4GQ2V*by$K(q>x zInVvI1J3!DyvwIuKcvb>dQufRZ9nV)Qx2e!Z^C-APEMtgKbUQCzW#mtWEk7UBBc-Y ztTr8kT?9%TwAqP>h<10`=hZ8LfCH@ek0ZnPf@J>$($&~6z3`WY#$_RFCeWAd3Ps-^ z0J$u<LR9~^_utb7i5;^ymm51eayD}1ww=N9tZF@QJSR+{uL>{V(P44(&CPeGqyUmu z0(pK+2WZ0-kcQp9J)YFu`qIo|tQ<?p;do!`@C^HE1C|G{HT6orFRcJO1IRDsn_SQd zKLG{+450zd7)v=8yYMM?&8&h|RL(S1KUa&GjX3Lz)uJ!@UL$39Jg~a(XW{41QU7aC zTd%dA6PK_!#12F(y?K?l(3h#P^*fxAk?QO`Alt02CeGizMxVOg&--F7pwB_xN1P6S zPY2)qZKX;$B>34bp4TT2HG+P`L-FOBO&Tfpqjd)6%G$bZ>#XG)ks~zLUM4Dhbs8TC z9H|EzYI^EFm)w$3qh`wazC4)bdeh;y%4hCd7hfE>SXVeaRwRD&`t{VpLgScfx-#&q z*tzSq&Ntw!dw%|GeeT<vqvJAMWE$tX7nz;SP6~XAEX6pnmg%4T=La)^o{c1BrKJG< z*^~&p9gL5zc3juh=>WeG`u&1EaADlePaW5OhJ~q24OE5Z4uI~f6nAQRnj0JoP^qyR z1tJ=Lp#0?-G!mC-1H3|@L)zTYahw0`jRBGz?J{oX9h00zphLj!*slx*xri?;EI=#p z2pGP(oOZwn0k%?myS(FB8!&UO-#<G}QI7g<=;BM6DMBELt9+lTgi(O@)%}d%;*Y0J z6t1K}X~w?swj8sM*L?F^#j`D5nmaYUtx94QUu$)q3g5tT#1|~R8>RsSs}}nt^&?lW zJQ6*Ablm}X(W6V!W}sBKc~c`%ng~e^I+ITqiFm2o0YL&{#aXuu-Sx5v)yx<^^M2@F z&e|SgJNG6)eFX^sLjpiE<7IY@BO}pQ&@n)Coo=~d1w_6wXo>?01yoqz>>#-xJW#K3 zt1|sTo))^b`_<p|P;@Fn&u!`NT#XdP%*@P$Jzp9yA#}^_n}7X+k}e)t?4z0Q;JAb^ zDLSl=y8=0@e18>WI;En)aNE_sOe)fJ<qY5~%>(`UaX3pvD{S8wWV683;Rhb8uyC|D zFr+f0fABtR-J@iOo?WdL3%9bb=2($k*zV|5v(VGc&pqfJNlUf~E^{6X#ku0m@(!)* zmOSg_HoDoWaX=2M7z4z&&fpbLVaUkIeV9Q?w0kZK2?EF#kZb(=ddi?^85<piP$7W= z<`0ncp1glwxmIxo#LEd5^<4mN4k7!FVQlH|-veO{;2B-=ET<TtY{bRJDxl!}-x9Qr zFZuTZ<|?@EiJe8Lq$ZsUL3jbg%hDVv6mYAThKn%(AvT{50;6E8D-+ltK&JL{39GNG z>or3MQFDQK09xpzL7AE6z(i7r6O%`2D|Betg&(qOvVCtOpUi&7mQ1*QP^j>n%swU~ z=W1$NNq#<1AX!LFd7}UfvePpobWvRlO?iCLp;E=n%&a4m{2L&LQOCJy-le7b(j~h9 zm^D!Z$@0RzU{>F~0S(#%A<Z)XGC+kzrY}AJeA#{sgkx}cK&3G@*tRuxU((BkuC5}m z)4dZC6X8Ccr!AwS?*TUUrDSK_yR=vL$?3|38>ClLjoEsjSaPw^fqpm>A762ka2^mX z%SYztIXj(I4o=VezZ<&wQW8>`;#~7!Ei)jx!cw110PCJs;R+HEWKDZVM}Lff24e{H z1g}T_*cgn@%9>V`)G5$+d`D3sU;#>pKY#w9Lcf0pKKg5&0Tzc|*2)|J5;e2=IXEoA zmyU)mE-qdsXRPdzEFCcaoAgB3Va22`LuHDHT|+|yyaz4!8}HjZ5p7vr#gSjf?2;nB zTMgge7lLLgjs!GQOLJZx{Rl<<_V=0u$DYu{r40aCFMBrF?C2Judnl$uE&|A|M@@z_ zG&Ey2T6C^EK|cjO12y4Uj3bMS|B?AeCfttM1p<H_0=_ErY~2%%hULglf8jy|=_-&C z9N9*Mt8}HlTrC4ZnyP9)Ac+oZqeJ;Kt$25VWR70{T6cwRM(4l;%jm2N)S8vBAFBer z2YMuK{7Lh}))Pv0RZB|_QXBtU2&XI9Hm+E48Oi92E0-^KuTlwu69bw*wgWDkt_=F4 z<;>jbX*UK+U$DdGF~B7T#;}151r(qMhAp83`!P@M1%sl;wq$>0sNVl)cXL~tHb@-+ zvzCifEg_u-C_tMX)Ai$1NXSbc$Bzl%((H2?NrCe1IO_kmMi=-4lMbigDgZ`w0z?J^ z>Vi>^S@Gz#NTl1*5|ibDuUs<lZ$DT%!+jaZd@Lt7fOP~@EgJ!Pa1T-QGSJ#?{yC}U zOLdz_0Q3siV^c_lb^t9`(;Va7*4D-k_#|)vEUkJW+?804nE^Z)8L3fP(H0{dL32S4 z1<YIC2M;E{yoPz~!Qs8)nJ{=h?!DN`StA03G*DfDh6dz46Yl4(01Cm75XK*)P_uJ$ zv~YlTOixcwwTjJDob+g<86w(YgoXC##$9am7khuu)z=p$ck1j4=^{{hLC~D0S5pnq z!^mhJ?pMkX9U0k|qjS6~;};mXzq9jpxM&HSFF=1~K0uEnyn6Ls!b7|HTfz>0G^!I= z_T=g?sH;G5Y>ky7!bhP~oow<7qScQ9llZ^Jyk(Xl%kIjM9n|^sG6Bz?K222n6pF6l zd+^}k2$O5vdA45a40R3|JDc9w){5_F*F2+q6j0J9%F&rkb<w=01t7V3o+u6UK_g>h ztKp*brmO4DW(n|(#qt1c4)=4Yj+WMHgPPxfADiv)%~s8f;Lte&#$k6wrLJ7^R&V;t z@=xFFLBpiJ;t^&u^9K&Nn23lrw*191*+%q+z{NqRv|b=n&g}Cv=HcblhB%R9R+CvW z-#eofDxB^(WpIGw;h0B~nKARl%+~nkJ0_^1xwyEnTLCf^e}DO@Del&A_WRoQf*>Y3 zoH##QSXp`d>eb}RiU`2*uwKi=pIN3qk%)PJ{Tc<CHRwLHIU;25_4oG!>oQu<1|*Rt zQ#ew|T(4>oBWlJPs}nWiXL>A!ieiVT{S^yPhN@XV-FC)G0)VVw1*|S0<|n;K2Ss3F zqCt(@sic$?lYEr&N<F0Y;-E8u+#M2ec&&rN0|?TD0^a~m9Rp1lBw3J)aYsI53@NLq z2)xNN585)r+itoo-;bPqZFN#NyiF04v~R(e09*q%c#+P=%<MD}@?Kp_3qqWZK-6oX zhr;AVN!ufNQbCRLIG`4Yr;sy%nn!oahvBNZwT;ao=%k(!cVR0K?J)otWlBPb2Rxnb z8yhbOh-SjfA9HY|Z1)e`XJ(dlWW@Z1;|Y2cTDfmOKmiMWj{V(TE9bbyfY$q2I}e|3 zQ@Y+?GykH^!MR|I@VNUHuqVqIxtsi}6r14x9Wed=-heNE`t-?Hv>+uoTf58_)(BX( zbL9ab&}crl!BsA3YkP()U|w5(j;IAmlE^Dl(<dk^Y8Gv0px=U`3swaMqRy&cp9pGt z41coLfwW?wEwVo55J>dkg}z$c_CS{A7-%eBi9pl}4|+A=jV@&A^49}YHeTVFd(zs? z3F=R2|AjPVA_RhN2m8AK)a>ecAU*WJ(#O2C)&ZRS2fcX+i@G0{V3Z$OQETI>sIoM^ zx_r^`ULsbMd<UTf+GrTN4Cpd1f##6rP`aD*cERzY2P?2o2ueGLfQ*gB#z6Im_4!jc zYol0LKP*sKCTQ(M5m76H1?+T2zY6b*Ba|5}t9o=^5hD(OheJ?GXvYYI6D$Dv1~y`T zzGcpK%(Dl_Bk+Imz{_i_YmjDP(f<~F_yR!p|A%QRbB@Y2W_uuN^<a3VOjULyXy$+% z5$`;uDrAX&0da;!1ffp7e?JpCNNYt#2&IP*zUAQAPJrG*5)cr8+Bw)X_+M-_^JOYA zcD5XVg4enZ|7mQ*0+0UjfB}9A^)5;pv)1Rq+>_iBnR)jxLJ0^pbq=&1Ee);}ll@|h zFM5|F1rdeF$1GuU+LF&uM%9wp5f7BIdS&KZ{k>(&ZRc8m=u2DiKH;SGBbi{oHTbT# zk?U(KE6@HR=W4eRPWLVS?QCr`PQ3W}3s36$_l`qD(KnLSerZO36Xaig@kO|Q*HlB? z4zv35rlKY5PVAK{=E5x<f2*~l)sn&A^r}%ae}I5uZEYR7-hqx898|Bu$Mqlsq7Enq zAecOOXj%}IFJgT5Az&d;`AkYpfN$AJ(3y{=o^~~+il&F!rGmye@WNxK1BYO(egLJD zP@l_R?n2&wt(;hb0Vv5hqyUz~FFG*d`1#HGSG=#C{qZAoC8i3#u950dQa|{{&Dzc` zQH`z|p>(;luN@c%Kn7yQ0@iszb}1@qYig?P>%d_p7(kci-uy>J0P0swrTe)U7BiK6 z_UtMay1fI??U&S4CQ_jCNBl3_0dQh0=;|c^La|GLsTYibMDPFj3^2&Nw2TaF*q!%4 z47z;zGNd)5b3o0;0?Ud2FLK7`bx6cev!Ewl_OL^A0q8rvv9kjjW|G??z^wqDxWr^B z=k-yltB6Tq_z;RsTSrG=W8EmgQ|dlD-Pe;Gz`1tCo>pvgcb6dnf*zI|V?C<bAO8ps zED1~gI7kBDhO*zDmxnhl0K6?B3vXV4hbFrRFD51}Ev<p{mpM=G<4IiqkW<eD3^0`a z=@A+(|LmvLP})a?4O(7`pq|dk&IS`ECnNjEb!lpnMVgJ4VgcrVv=$_p4+x@AD6CEy zo;<H~mk{pu0Op(m4IY&J?y?H@5q!03O3^T;1pMwsC5=6;$Ca?~a7qv+85w=abgR>9 z7#E?k<MTsbnKJJ;NK%nc-D1N5&QNKN9gr)r59Om(7R76dq%<fL2)(yAUv~dBPuytB zYg*KS^4}Uwd`lL^u}1?_H>s$ogoP_+XJ^6o;NMu4)BM(4E2<ZA^!`Wj8BgEc+MZPn zaAfkmD4L~iOj@wP=hHnENu-qo5*$vb1q2}tg+vB|_6{uD_!D`nkQ6)%4InjTy1a}N zR}QzkJ1E;K4#~+qY@LNA8Szs4e;M)WOOdAm9*%?+EOaVFX_Wm`9X|HS8Ch9bd3Zub zUj8Hc5CI2^*J^yUwssPt45w}-u+}A%I^x6?ftGbg5KcZY_Wwdu3X^LfVnZNYeZ0Nz zfLr?ovrC2~gR~od9s=mX*C>E#fT2QMx>!!kX%p7~8M7fUiv)pX1)L(#5Mx$X+p)|d zU?y=ETa17Z22{H&oScDJD$peo5~hTIDGL(&%yF<?%`Gi0pv#2|Xyh&<=71@O6+{6M z!ud;1y&Aw0_Yxop#M<{Y_p?K$Dox-7VU6nR@m{m55T3-tu`)ZRyLW$$kKg`;MtmmF z@yZ1PoAH}B_8{=^^ScW7aaxD$14VJ;hW9TaMBOJC7Vs!gm8xd;4f^9NxoHo8WRVbS zS?=IaDR116Mg92k1IQyATDrR9Ad-hXvlM=z<-$dv6_z`$E1)1v1%K-?0VisIx`7Zh z@K{P|$N#bi!Kgty0F;;K&!1y?iGxt}EcHbYAg<j80tmSeYBY5lS~@`Sn&h%1TJBCH zz<S@iFe&&61>OH+Nggai{DZzA1Zd#1=wpeM7l2p^OtikHrbQ6AfS?IG`d?s^`=mja z=tX)ctZ~{k*h@$^`k~VRLLqr!grOY}(2-Y&iH#tZV9A;5yK7_7-o$Y1ffRC{l$;FN z>kVq^i}?6h0_1gwHv1nxeFD(}kSjywumnaCJ78{x$@S$M$k^H0!IJ)?aO$oO7ek_v zqs(fPK<nXH48Oa9TplUm#LfnO!{&25082Z|FKG~REW*Oa0GyKfBthPSWp&{L2OT#D zvjW-G|Cq+Opz}`Ji*&3muc}HEZuxJ7+P=QNi3z<QO5a7^1;gaV2Mdi!NQrJd@Br_c zroJeIixtrzA-5KQo1Xj^6XSYvVB>?@0&M^=*%8+Xb!6_qPmnN^`9OOGs+3wVO%l+v zDWxm_G#?-yIKFUA1SBlh4h~qcx`V?Wv@O8jOnv|bDp@!56R=_5I*8!K`blK-m{<+V zVRs+Z=xW|vXYjh3Z%7yjQW_y$TIypGM1;cc8q9&E0bg{q)D7{vf;RkcQlHXMc<a@2 zq5JjGRYI+})ITb|^qSVER8u!V-vJkcbnFZ)s7$*9R1<y0(5EZb94j<dG&eVgWo8}i ziql4yh@aMLIl7GViBsC#02%pIUST0r0&Sh0ke_2^LMp>hetR?DyZ0HpEI^6+$o+Qk z0TTQ*^DiL6f#BcF&~SI$WgWY}VK_Q6O3=8lu(Wgoz-e*O1a6d(1{FPdckKr}(2KzW zc(i!r&@*#K`U&T}fm#Q)O!+Zu*w>K{e73W)*!>TNnYTl2=xqXhLihyID%ORA%^3(l zFcRd&_}D#s0#=X$Z7^t2LsL>F;MQxP9JL%m*L$f?4HuEd2wI#)_^Fg1YM;mu5(_}t zf+7ww|5@oxJPAG!4oLuJ%pJJ`O?EIGEMMu$5D4q#l0ihT2#NQ<Ck3IB1RN5W=zs|? z<g3`rGL$m=M*nnh8T<i7^ZzJzpsA{e0(Izp4*V;%522ES_6(@ofc}adMb0ya{u!kA zrh|E}_4Se1YoNtXMCwl~3@+^7x`FH`uT)+bei8r<k_V*IYo1@e0Glx22G>XI!Fvnq z4hndEQ`4KIq&C=~2J$1VLL+}rgu+j^fIJ?%Bv|=TYj1C;uul_o_`nCeV!40c98@|e zUemw#;42<D_Oy4SMcx&F>K-y`D88{58Nn6Mb^x8?*5)RxBI1U`0BHeq1NPR&w9=K& zPPRK?lk$M*TP7b3VrA?lgK$YH^rFeSq3qs1%dI-T>bv}GQ1GnH<H03a8)mZ$C={)q z_HWAkctHu|S5#X@_XUP<bxQTue7Ikc%+w>(X0>0a>+YMpdUV%52_GYohvY=|KV~tz z!BXEgMDm8nCZBubs`1(cldXr{Y0u=|vxoBXMOp}EZ{WQ`C<1E&)Ka<vAF){5|GEr{ zML%l3jPi2q@5*2=8?1H}zWckek${trKuL2@Xk{Oy#WB~mK>yqPhI^PDp~DIqbV&X$ zUcBg({?LQFzW=p20Bz*tAzNFvmAQAAqk&Z|*#tkHz{|^PQi4G6!61!uwl$}FT3Zuw z$3W18Al%&C47&u)m!vUV1n+AMvnQzesDTAi>BL1(|H*++g6c96k>L#^XdJ<={y)`R z`6HD3+kR}vd?}$Ub*!awNZMo#35ldlvPBCaMz*nKO$sM;$|&n7TO!G%Fr_S|Q;d{t zB$1^!V=M>R@?P^Uf5h7lq8{@+&*yW0?&Z4g>&pM%s|4hdI_9IhA!xyUlAPk=Et@u( zIy&~ed2^K_OdO6axwnO??)0#<G#e;=YU=)K0oq3xgn8c4z`$8ZN<{wORrDuMAV)z` zOyBKww}-c-5^*{FXP=<RRe*Er@Y#m)6^Y^#lasBjt>#u%>dMMATonhxos#(5XaV8( zO-=52wXh;OA8izn)X({OGK>^NM+5-6AE9I7;xY(0^tiP(kOy44AkonA`Nc`A>gXo9 zQxRV#ZaR-DOF?G<j0l9qfuW&88Co|eB9V(;osagaq=4560zj0%MUY<B1fhE17+=qd z?@Ie#A4(})?(LG7HwbPySbb&C;qt*1KdGFF>qQ>xOkH^)Cm>R{&6mk*A}J%oz+5SI z7a!e9=1DGZZ9S^0swyFof^RU#TD5&eUEzZV7It=wne1an*n2g9)7cm1*!FQmkgnR9 zwERjTU}eed&({}A|6pdfov^m<t4eIedI$*%Lr%xyz=64en^tbaMB_1MXOJi%!t$T# zoPDIei(2rs5OebWS#rpNnM@IB%%*1Dpk|4&h1}#f+|*c{F*Y&D1KuA*e%y*MN)G$o zB_blip^a}hrge~&>&bb8h)1^%Kkw#dM!H`bYOKp|_~Tl(zN_@wY^KeTBd^+zm}1bJ z(_2$xrW79+m(#<mpo!?dqAn;T1Qzs>Jl6w&lcYFHj(59CC})P|tv71iFCS(+p5`}L z|7`+blNo7ZYU-wW9(HO#0jr^*VGSsb$xNcWlaDb{RLq_H+m@wBm={cr*iQB?3zh}k z`h;EQ=iO^!0-dW+Y^eV&Xefc-saVfsTJ7I|mC`JqfACK2pf4xol!rSRMn!W_Db3mt zqot)K>M5Jo(07rm=0NHKs|%nxmd@YI-=A)#v}61BiGTmi?U~$sNk0PcLo0RY!Q6jv z6mOXYe?TW3`C>WLbCO{&J5iKk0^7#M#`_E74n_Fo!UZ5BVV_mBv~Iuo_Mthr3v<yV zMX6(nZ_foWq-hBmR`E(PjAzs86^Tc?q5G5iZl$oWs=9hX5AS#u<)2O;;N!5;=5);@ ziiIu)s38Ql`0vD0tKWU@1Jw5XE+t1zm6n#~;>U7Wc@OyXv9U22S_w0N_)bB;Q)b;d zb5d8?S;5o?*9=;oIgm%I^#){m=N4_%*fIq5<}QtMGAk8hf`WsAc9l=l*8g&gd`L&b zR86hq*|TRj!Z>c6_n=5`kz}T6Slr+Q_m7QjT_coj@ZdngXR~U7$U)yTl=h|SRu+o| z>70hWp0X|lrKP<g3C1`<C>>bZ1jkTG+{DDh-OY_lE2rC^x?0yKqwQ<#<g|RkXDsiN zGOj7Mru^|hX+bIJO+tM9Q5%~G9~pbW#@=5un!>^fa7C8@nBld*oEUwsARUW>$~s2Z zh=Jk%C8T9$q_@|*Y%}6!$N7_M(xqB&zHqW6bzw_!>RI7Jv%mO_NN6E(;n%h{=(WY( z5F>MVdklkueu7R5bQd}@GyO+`1*F8p$~?Pv7&YEfUy8NLGSL-`-1B#WpZIL?nRAa3 zrk}pBCEKe2HK!dBh<5?zjUo2j+yUgKXojt2%S37x!o7hp1bh{q15l>>Frx&!2-^o; zre|K`>Ch{+)vwTsyApas&v16VyGP?Mp9|!F$hF(pBC^q=I^(ryO$zYtJ$v>W3Wzmx z?pZ`kGW@Tcw(mJ$>Y%aF?Z4O>8P!UmXTCV+m*uLyFxM+G_wyLbgy^yEYIt8Pzpufn z2s%{|AE9n_WR0bs9(^f~1hu2YezPbkK0f}_r%$kPy1KeLv$^?@qvH|+D?}o4GpF>) zy)W2fV_E6x7Noui=j|RNwXg2UR;m=ytBESX*c&NQgAQhimrjP?5k2GOB`YB@-RkGh zs%?)l*rln7T9vDAprmA+L#C0&jr{z|uU~Hh!X6zR4Xup*y2DG`SCpeYg_Z1RZx=TT zveR)ran`a}f6U-qu1Jk~-$ge;UgeDQ8ml<HTdMrnpV_K4*RqeVHbO*zuE6u>&#jLi zKQ(o|Q)hfLv~PeX4o?Ja+_(`vx4W5q<B!q&dim1O!r~pKOe#wMVCO4|AAq0<?hV<9 zFEd(J$M)B7BB?{BcBhH>dj%DztOu{h_KvXRcJ15=(#0IGU5#D4z6AZ|DI3&<L4z=e zfZ$A{_VpdVYH?V}#l?j;%1|X`Xkg&r?QKz%M7@-hl)QohM2R&L64ob9>{xN{!nw)Z z5fS!QV*bzf{MJuP#f)HICB?-tMmfOvQc~Kwmt(PBscr4;Lj2K1MMYTnEq3&46p@#l zb33|_xMA9yy2VypOl+@ifgiRJaY{o|^P>n4&C1a+lR5mmv@~OO?V|viEL<`W+V&40 zDnq6{a1^kqqDGAd%X7?{U(=;<)zu->MTv<bIP2ec;}^mJdjlp9^!Gn#+0b++>IK*( zB!1qqlNrg$U%|}K6(p)wf8M~$3Pb_4XU}u6$GC(tGLOrfZSUb@>(5NU>Y{S^2#%1w zAgiFDKuS{5lmxl27l38hGKW3TV|drx41ybZ$y=QGn)!A6mLORhn~s<m{?O0`RF{lR z!iCDJs^w*6VhIgMB_a5<j{A7w7aavpod@1tRaJ$w4cb+7d&9NRxdD%@?BpVpZ%%(F zUM{?9kLuXIYZs{TqKft1-PH_621P^}T(OqgS|flTdLaS?XJyjqSLr~A<pG?1Dm(&9 zfjA5;lke|-6oE+2FSxtEWip>Wd6JjONAyTM9DSM2MkbBpjA={gP;FpK9+ni3JNIjG z4qws1lGY(w#GXN2DGvtL+?*(i9CIi6vldJHWq8S~iWrH%p`qbf8i|mN!T~-3nvs;K zs6vW4FjxSg`*a0QZr!wL2;Km#a!eB{#flLAqPT7MU*>sGAA!hFps%m_fde_2e8tvB zj+{Pwb_&`kPyxc&VM{YlBzaXwz*n#Pg@vG=Acx7z&j+C=og(t+7})-B-0(OfLqoCH z7vHE7J`U#K6fpQu*N2v_sgn4IW*$j9XbZxLAT_e@{f8iE-yQ{g?SU9u9oDe2va6}7 zq@sd~5B%H8U}=q{<m*9Spc@xA`w_`fdQK4d!hJwd1w9L+U0CKyhb^wjmw{-3bJ5Y! z!NKYQJV3;b+%s-3^yN-knjLC_Y^IgDIST?hY#C?1vXlRSJLlwN5IW<zLY7EYcj$<k zy_J%(ag9)=1NrDtEa^=dCU@@QbGXGT9IABaMNPy2nomeftf12w5DbHEjtp}J5s7zH z2Rf#pU}$f@fP{5&zUe8X3oU<N%wB9)PA%WN`G@x>RgOa(<5%ADH~Ho9nHj`J{fJ+S z$%^|1d=C+kQpeo|4K*PO5D0=RN+ag&?e}Oj!(+$FzYQ1PzaKnl|Lw7@e5Gzg=S2D5 z^FJ56e^y&FmBiy5nyHzY?9tJ8eHRnu4HB{9nLPG_U*xaWahnEj{#-jXT3Qnl6eMF1 zo>AA=IQV}4c@W=xzl)Yo(bb~QS;IEAwm<s&k+}AAI0gYD$AdE^37VRo=31RxAQ`9y zVg5MPDB|dTG~N59rGY*^_$noI1#L9$`aZ!iz6bS7NJ=4`J3BjHx}?XJ`7Q_70cjIR zlEgx`5Dj659}nR#w|I$1`!*~Np%53qQW6pp+=mS{MMXs~LUkc5Y^lE9nBk>B_^Wuz zCa(hT6V*bTF?SXN*#=DS3I$?^z|abdiZ*T9WOwo;{*9p4wewWQVOPq_tC20jWi_1H zj?;e_P0oq&afKMLYP~TS%YELZM*)Up#2XO5@YG08F=(TjV(u;#Ra*(H6?$2qA(fVL z`Wx_IMC8$z?L5J)9UU;7{;4_mhg#jGI*a-<W##35aDI?#gfr(}_!t*zmp^)hfn6Ma zz+`VYJA-mwy!e6vpSyQ4@goK-DX33^@L#+5jAstiFt0F)c>rAzs3ch0hS|pJp+d+t zs=PcGb914jH}@R*33GmXL7j%p*_Xs|2DbfKT^)-5V$0CtPD`&^l>`@qE(t~n?l6Zx zZsjEgqf7WQT^iygxHYu2YkRTnl`B{1ev#`i?p9c+j2wzi-v#&w=?%>v`?eY_X}Ef` zEt1{c-A>O#QYa#aMa9J*U+CBx5HJmiCIC|(vA!-b_}puCec%H}KsOI_;y}j+2M6g1 zv}3oZR7i77MI>>0sx{G_c{ljFp`ok0J1|U|AmAOF^Y7jjmzP&xBLuNWHz*W>d&n|T zh`@Ft4u$=2#!NG!y|zp<fSZe}{0JHeubhb*lN&OCU+H7K2FiKX*4Fd{!>qLQ^dwo` znbvk~pZ<D80Foj+{DrX8a|B_BH&S);@YwX<AayF0iYlorKR=ct)@XU=Og{ogbB6Xu zY<-B5wstVSKYHIEH916hR`%!-gs1HH^)Plo@F>hMbC-Wux&HI%>*(Ez8`Yoj2@ls- z#P3y3ZxuyBv5G{ZISO(QzT-9KFyb-lQ-IRCIy&ubZ6CHqCl(bKAGEUaUeZ!iQv*7H zE+5ihD5?Q-$m{-%XhFEDx|NfIA>uyn%**;4hm`@B=Q;ArivJHe*g)T>KL$o-VUbW! zFpN>NAF+_J<=(IaKnfxf=-tqj!O8$(qbCfwc4l0bSd~RzitK^V7IM9Wn&QGjH&0Kf zLVO0g)}TT}raF%j0%-TEsi>^e@ptp_Da*`s49w8oyu-UwJz>nii<8WpjaZ%LyU_Qs zB71uF5xeB$lp|AnU}`DwLDt*SvX6Orc|dCm*kY&+v4gn<1vSq)q1P%~A=2^z(tmJz z|KX2@`CSJphT4ao@MW*D!;zM#MGdF0OH1|rjHRhJC#Nmd7;Q7cLpnks?nNK|9^Ju} zHvMt!xC&QU7jCz*GWhV}7F4_UV|WPql@h*BFq~m7G~WqxgP(g*&1m{MW%{<_>~QTR z*^Jj|7u*ZiexG*G3j6sN(~}i$+5P4b+2GRr+|!AnhrJQI3?>VTTiY*Rc8%riQA`_= z)$M=R_;sH^jA(X`tyRQ@v=<`-*VH#e{PE+rWn~P@U_Qucx(l#2k~b85U|TZoi4!e( z=DNhKb=gcNWPt(opcRZskW4DowEBBfyg6#Ao2Iub_B8g<mm7|*-KnlHp)Rs7$(y29 zW20F&ThMoTh2V6@hM41eL4VOl)%#x$B}vKoWuB|7>(;;jb=iuY(bijNGrVlsxEHvV z@%rGl^B64zQ&>ip`v<6A)ebavHg@V5-pS8*rBEs`9pvhopP9*>lyZ}LzL#BY`ur5b z=6ZUn!?T(3;CuBKn$3)^<;DH_cS6$rysF*P#H;Tvid=PbFT5^&=2FSskWRzPhnlF> zSk}};xYatuB*4``Tfh-{*WhxNI84IbvZ>S)zP^tW5-dDCM&J=pK}3bCpXw<$jSU`r zl2K9QG4ddL_n$u}XQfm%4&*vn%C^s!J=|S7%@?3y9hbYX=jKxgdQJ1e@o;B>Hg66M z4fXQ!s<I}CWnp{4HPLBlEQlRp+JIFRARU|I_^<iy%h#oA2PAvS78(Z{UfEd6^X;+x zsIN08I8@VgN83BN%xrsScQ+Hq84p`q8x5f5<>=S-JC%j3t=n*7AzYNEJmbBT#gM!3 zV!qQaG=$Y9<a2qzr)R41*v5r#39P054=2LT?XWd=xRGn3a`v{<J2~rLb8SDoez-sA zoeO*#+!SnVTn}7on?GSV(N`s+EGlw!!x|yX-dX7mtfV&6Ka4gA@39M-I+VG|s*N0T zzqhuG9iCStG#hknl=b|4g{<zI!M{%Pt*i)U)r`<p4dly|2ZpJVKl%ciS9{I}+UXOK zzJ1D*mj!4sV2fkK^B>OXQSDGAwxnC{$)vMS#|!`~)|to>-zCSTB_SvOXl(^oUH<>g zUw2g4L?p#CanZ$ZK%K5i3tO?TnjpS9I*&%4L1J-Q+7*Ky^nG6g%q=X`wrp{;Aqa+q i$Yq0jJb25{CBfVqxAs4qzmtQXhyx~vj2{{~NB<YZaK2gq literal 0 HcmV?d00001 diff --git a/docs/reference/gdata-docs.xml b/docs/reference/gdata-docs.xml new file mode 100644 index 0000000..817dfbe --- /dev/null +++ b/docs/reference/gdata-docs.xml @@ -0,0 +1,309 @@ +<?xml version="1.0"?> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> + <!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent"> + %gtkdocentities; +]> +<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude"> + <bookinfo> + <title>GData Reference Manual + for GData &package_version;. + + + + + GData Overview + + + + Object Hierarchy + + + + + + Core API + + Core API + + + + + + + + + + + + + + Access Control List API + + + + + + Batch Operation API + + + + + + Authentication/Authorization API + + + + + + + + + + Comment API + + + + + + + Namespace API + + Atom API + + + + + + + + Atom Publishing Protocol API + + + + + GData API + + + + + + + + + + + + + + GContact API + + + + + + + + + + + Media RSS API + + + + + + + + YouTube API + + + + + + + + + Service APIs + + YouTube API + + + + + + + + + Google Calendar API + + + + + + + + + + Google Contacts API + + + + + + + + Google Documents/Drive API + + + + + + + + + + + + + + + + + + Google PicasaWeb API + + + + + + + + + + + Google Tasks API + + + + + + + + Google Freebase API + + + + + + + + + + + + Appendices + + API Index + + + + Index of deprecated symbols + + + + Index of new symbols in 0.1.1 + + + + Index of new symbols in 0.2.0 + + + + Index of new symbols in 0.3.0 + + + + Index of new symbols in 0.4.0 + + + + Index of new symbols in 0.5.0 + + + + Index of new symbols in 0.6.0 + + + + Index of new symbols in 0.7.0 + + + + Index of new symbols in 0.8.0 + + + + Index of new symbols in 0.9.0 + + + + Index of new symbols in 0.9.1 + + + + Index of new symbols in 0.10.0 + + + + Index of new symbols in 0.11.0 + + + + Index of new symbols in 0.13.0 + + + + Index of new symbols in 0.13.1 + + + + Index of new symbols in 0.13.3 + + + + Index of new symbols in 0.13.4 + + + + Index of new symbols in 0.15.0 + + + + Index of new symbols in 0.15.1 + + + + Index of new symbols in 0.16.0 + + + + Index of new symbols in 0.17.0 + + + + Index of new symbols in 0.17.2 + + + + Index of new symbols in 0.17.7 + + + + Index of new symbols in 0.17.9 + + + + + diff --git a/docs/reference/gdata-overrides.txt b/docs/reference/gdata-overrides.txt new file mode 100644 index 0000000..e69de29 diff --git a/docs/reference/gdata-overview.xml b/docs/reference/gdata-overview.xml new file mode 100644 index 0000000..d2709d2 --- /dev/null +++ b/docs/reference/gdata-overview.xml @@ -0,0 +1,244 @@ + + + + + GData Overview + 3 + GDATA Library + + + GData Overview + overview of libgdata's architecture + + + + Introduction + libgdata is a library to allow access to web services using the GData protocol from the desktop. The GData protocol is a simple protocol for reading and writing + data on the web, designed by Google. + + + Protocols + Google's services were originally only accessible using an XML-based protocol called GData. However, later additions + to the set of available services use a REST-style JSON protocol. libgdata supports both protocols, although specific + services use exactly one of the two protocols. + The core API in libgdata transparently supports both protocols, so client code need not consider which protocol to use. + + + + XML protocol + The GData XML protocol is designed by Google to allow interaction with their web services. It is based on the Atom Publishing + protocol, with namespaced XML additions. Communication between the client and server is broadly achieved through HTTP + requests with query parameters, and Atom feeds being returned with result entries. Each service + has its own namespaced additions to the GData protocol; for example, the Google Calendar service's API has + specialisations for addresses and time periods. +
+ + + + An overview of the data flow when making a request of a GData service. +
+
+ Results are always returned in the form of result feeds, containing multiple + entries. How the entries are interpreted depends on what was queried of the service, but when + using libgdata, this is all taken care of transparently. +
+ + + JSON protocol + The more recent JSON protocol is similar in architecture to the XML protocol: entries are arranged into feeds, and the core + operations available are: listing all entries, getting a specific entry, inserting an entry, updating an entry and deleting an entry. + The key difference between the two protocols, apart from the serialisation format, is that the JSON protocol is not namespaced. Each + service uses a specific JSON format, and there is no formal sharing of data structures between services. For example, every entry + in the XML protocol is required to have a title, ID and update time (as per the Atom specification). Such commonality between + JSON entries is purely ad-hoc. + Differences between the XML and JSON protocols are hidden by the libgdata API. Both protocols are implemented by the standard + GDataService, GDataFeed and + GDataEntry classes. + + + + Structure + The basic design of libgdata mirrors the protocol's structure quite closely: +
+ + + + An overview of the libgdata class structure. +
+
+ + + GDataService + Subclassed for each different web service implemented, this class represents a single client's + connection to the relevant web service, holding their authentication state, and making the necessary + requests to read and write data to and from the service. All top-level actions, such as creating a new + object on the server, are carried out through a service. + There should be one GDataService subclass for + each of the services listed in the GData + documentation. + + + GDataQuery + For queries to have multiple individual parameters, a + GDataQuery can be used to specify the parameters. + Query objects are optional, and can only be used with queries (not with entry insertions, updates + or deletions). The query object builds the query URI used by the + GDataService when sending the query to the + server. + Services can subclass GDataQuery if the service + supports non-standard query parameters. + + + + GDataFeed + Effectively a list of GDataEntrys, the + GDataFeed class is a direct counterpart of the root + <feed> element in the Atom feeds which form the GData protocol. It contains the + elements in a query response, as well as general information about the response, such as links to + related feeds and the categories under which the query response falls. + GDataFeed is usually not subclassed by services, + as there are rarely service-specific elements in a feed itself. + + + GDataEntry + A GDataEntry is a direct counterpart of the + <entry> element in the Atom feeds which form the GData protocol. It represents a + single object of unspecified semantics; an entry could be anything from a calendar event to a video + comment or access control rule. Semantics are given to entries by subclassing + GDataEntry for the various types of entries returned + by queries to a service. Such subclasses implement useful, relevant and query-specific properties + on the entry (such as the duration of a video, or the recurrence rules of a calendar event). + + + +
+
+ + + Development Philosophy + As the GData protocol (and all the service-specific protocols which extend it) is reasonably young, it is subject to fairly + frequent updates and expansions. While backwards compatibility is maintained, these updates necessitate that libgdata + remains fairly flexible in how it treats data. The sections below detail some of the ways in which libgdata achieves this, + and the reasoning behind them, as well as other major design decisions behind libgdata's API. + + + Enumerable Properties + There are many class properties in libgdata which should, at first glance, be implemented as enumerated types. Function + calls such as gdata_link_get_relation_type() + and gdata_gd_im_address_get_protocol() + would, in a conventional library, return a value from an enum, which would work well, and be more typesafe and + memory-efficient than using arbitrary strings. + However, such an implementation would not be forwards-compatible. If a protocol addition was made which added another + link relation type, or added supportf or another IM protocol, there would be no way for libgdata to represent some + of the data it retrieved from the server. It could return an “other” value from the enum, but that could lead to + data loss in the common case of GData entries being queried from the server, processed, then updated again. + For this reason – which is made more troublesome by the fact that it is unpredictable when updates to the protocol are + released, or when updated XML/JSON will start coming over the wire – libgdata uses enumerated types sparingly; they are + only used when it is very improbable (or even impossible) for the property in question to be extended or changed in + the future. In any other case, a string value is used instead, with libgdata providing #defined values + for the known values of the property. These values should be used as much as possible by applications which use + libgdata (i.e. they should be treated as if they were enumerated values), but applications are free to use strings + of their own, too. All validation of such pseudo-enums is left to the server. + One situation where it is acceptable to use enumerated types is in API which is only ever used to query the server, and + isn't involved in processing or representing the response at all, i.e. subclasses of + GDataQuery. + + + + String Constants + As the protocols are XML- or JSON-based, they make extensive use of string constants, typically as + enumerated types or namespaced URIs. To stop the authors of applications + which use libgdata from having to continually look up the correct “magic strings” to use, all such strings should + be #defined in libgdata, and referenced in the appropriate function documentation. + + + + New Services + The API required to implement support for a new service using libgdata is not publicly exposed. This is because doing + so would clutter the API to a large extent; for example, exposing various properties as writeable which are currently + only readable. While the freedom for users of libgdata to write their own services is a good one, it is outweighed by + the muddlement that this would bring to the API. + Furthermore, since it is highly unlikely that anyone except Google will use GData as a basis for communicating with + their service, there is little harm in restricting the implementation of services to libgdata. If someone wants to + implement support for a new GData service, it is for the benefit of everyone if this implementation is done in libgdata + itself, rather than their application. + + + + Cancellable Support + As libgdata is a network library, it has to be able to deal with operations which take a long (and indeterminate) amount + of time due to network latencies. As well as providing asynchronous operation support, every such operation in libgdata + is cancellable, using GCancellable. + Using GCancellable, any ongoing libgdata operation can be cancelled + from any other thread by calling g_cancellable_cancel. + If the ongoing operation is doing network activity, the operation will be cancelled as safely as possible (although + the server's state cannot be guaranteed when cancelling a non-idempotent operation, such as an insertion or update, + since the server may have already committed the results of the operation, but might not have returned them to libgdata + yet) and the operation will return to its calling function with a + G_IO_ERROR_CANCELLED error. Similarly, + if the operation is yet to do network activity, it will return with the above error before the network activity is + started, leaving the server unchanged. + However, if the operation has finished its network activity, libgdata does not guarantee that it will return with an + error — it may return successfully. There is no way to fix this, as it is an inherent race condition between checking + for cancellation for the last time, and returning the successful result. Rather than reduce the probability of the race + condition occurring, but still have the possibility of it occurring, libgdata will just continue to process an operation + after its network activity is over, and return success. + This may be useful in situations where the user is cancelling an operation due to it taking too long; the application + using libgdata may want to make use of the result of the operation, even if it has previously tried to cancel the + operation after network activity finished. + The behaviour of cancellation in libgdata can be represented as follows: +
+ + + + The behaviour of cancellation in libgdata. +
+
+
+ + + Privacy + Privacy is an important consideration with code such as libgdata's, which handles valuable data such as people's + address books and Google Account login details. + Unfortunately, it's infeasible for libgdata to ensure that no private data is ever leaked from a process. To do this + properly would require almost all the data allocated by libgdata (and all the libraries it depends on, all the way down + to the TLS implementation) to use non-pageable memory for all network requests and responses, and to be careful about + zeroing them before freeing them. There isn't enough support for this level of paranoia in the lower levels of the + stack (such as libsoup). + However, it is feasible to ensure that the user's password and authentication/authorization tokens aren't leaked. This + is done in several ways in libgdata: + + + If libgdata is compiled with libgcr support enabled (using the + --enable-gnome configuration flag), it will use libgcr's support for + non-pageable memory. This will try hard to avoid passwords and auth. tokens being paged out to disk at + any point (although there are circumstances, such as when hibernating, where this is + unavoidable). + Otherwise, libgdata will ensure that passwords and auth. tokens are zeroed out in memory before being + freed, which lowers the chance of them reaching disk at a later stage. + + + Unless run with LIBGDATA_DEBUG set to 4, libgdata will attempt to + redact all usernames, passwords and auth. tokens from debug log output. This aims to prevent accidental + disclosure of passwords, etc. in bug reports. Currently, this is implemented using a fixed set of + search patterns, so it's possible that certain bits of private information will not be redacted; any + such occurrence is a bug which should be reported on + GNOME + Bugzilla. + + + + libgdata universally uses HTTPS rather than HTTP for communicating with servers. The port which is used may be changed + for testing purposes, using the LIBGDATA_HTTPS_PORT environment variable; but the protocol used will + always be HTTPS. + + libgdata provides ways to upload and download files, but does not implement code for loading or saving those files to + or from disk. Since these files will typically be user data (such as their Google Drive documents), it is highly + recommended that they are given restricted permissions, any temporary files are only readable by the current user, + and files are potentially encrypted on disk where appropriate. The aim is to avoid leaking user data to other users + of the system, or to attackers who gain access to the user’s hard drive (which may not be encrypted). libgdata itself + only guarantees that data is encrypted while being sent over the network. + +
+
diff --git a/docs/reference/gdata-running.xml b/docs/reference/gdata-running.xml new file mode 100644 index 0000000..c78a2a3 --- /dev/null +++ b/docs/reference/gdata-running.xml @@ -0,0 +1,84 @@ + + + + + Running GData Applications + 3 + GDATA Library + + + Running GData Applications + running and debugging GData applications + + + + Running and Debugging GData Applications + + + Environment variables + libgdata makes use of a few environment variables which affect how it runs, mainly with respect to debugging. + + + <envar>LIBGDATA_DEBUG</envar> + If this environment variable is set to one of the following values, libgdata will give debug output + (at various levels). If it's unset, no debug output will be produced. + + + 0 + Output no debug messages or network logs. + + + 1 + Output debug messages, but not network logs. + + + 2 + Output debug messages and network traffic headers. + + + 3 + Output debug messages and full network traffic logs. + + + + So, to debug a program which uses libgdata, run it from a terminal with the following command: + $LIBGDATA_DEBUG=3 ./my-program-name &> libgdata.log + + + + + Debugging Advice + The easiest way to debug problems with libgdata is to use the + LIBGDATA_DEBUG environment variable to observe all the network + traffic being transmitted and received by libgdata. Typically, any problems will occur in the final network + request/response, which is the last one in the log output. + If debugging using the environment variables and log output is not possible, it is sometimes possible to diagnose problems + by examining the error responses sent by the Google servers to libgdata. These are exposed as the error messages returned + by libgdata methods; so when handling errors from libgdata method calls, it is a good idea to output the message from + the GError to a debug log, or even as a warning in the user's + .xsession-errors file. + + Error Handling when Uploading a Document + + GDataUploadStream *upload_stream; + GError *error = NULL; /* make sure to initialise the GError to NULL */ + + /* Other code goes here. */ + + upload_stream = gdata_documents_service_upload_document (service, document, slug, content_type, destination_folder, NULL, + &error); + + /* Handle any errors. */ + if (error != NULL) { + /* Note that the error message is outputted to the terminal/logs. + * It will contain important debugging information from the Google servers. */ + g_error ("Error getting upload stream: %s", error->message); + g_error_free (error); + + return; + } + + + + + diff --git a/docs/reference/gdata-sections.txt b/docs/reference/gdata-sections.txt new file mode 100644 index 0000000..06fd3c8 --- /dev/null +++ b/docs/reference/gdata-sections.txt @@ -0,0 +1,2880 @@ +
+gdata-version +Version Information +GDATA_MAJOR_VERSION +GDATA_MINOR_VERSION +GDATA_MICRO_VERSION +GDATA_CHECK_VERSION +
+ +
+gdata-service +GDataService +GDataService +GDataServiceClass +GDataServiceError +GDataParserError +GDataOperationType +GDataQueryProgressCallback +gdata_service_is_authorized +gdata_service_get_authorizer +gdata_service_set_authorizer +gdata_service_get_authorization_domains +gdata_service_query +gdata_service_query_async +gdata_service_query_finish +gdata_service_query_single_entry +gdata_service_query_single_entry_async +gdata_service_query_single_entry_finish +gdata_service_insert_entry +gdata_service_insert_entry_async +gdata_service_insert_entry_finish +gdata_service_update_entry +gdata_service_update_entry_async +gdata_service_update_entry_finish +gdata_service_delete_entry +gdata_service_delete_entry_async +gdata_service_delete_entry_finish +gdata_service_get_proxy_uri +gdata_service_set_proxy_uri +gdata_service_get_proxy_resolver +gdata_service_set_proxy_resolver +gdata_service_get_timeout +gdata_service_set_timeout +gdata_service_get_locale +gdata_service_set_locale + +GDATA_SERVICE +GDATA_IS_SERVICE +GDATA_TYPE_SERVICE +gdata_service_get_type +GDATA_SERVICE_GET_CLASS +GDATA_SERVICE_CLASS +GDATA_IS_SERVICE_CLASS +gdata_service_error_quark +GDATA_SERVICE_ERROR +GDATA_PARSER_ERROR +gdata_parser_error_quark + +GDataServicePrivate +
+ +
+gdata-query +GDataQuery +GDataQuery +GDataQueryClass +gdata_query_new +gdata_query_new_with_limits +gdata_query_get_query_uri +gdata_query_next_page +gdata_query_previous_page +gdata_query_get_q +gdata_query_set_q +gdata_query_get_etag +gdata_query_set_etag +gdata_query_get_author +gdata_query_set_author +gdata_query_get_categories +gdata_query_set_categories +gdata_query_get_published_min +gdata_query_set_published_min +gdata_query_get_published_max +gdata_query_set_published_max +gdata_query_get_updated_min +gdata_query_set_updated_min +gdata_query_get_updated_max +gdata_query_set_updated_max +gdata_query_get_start_index +gdata_query_set_start_index +gdata_query_get_max_results +gdata_query_set_max_results +gdata_query_is_strict +gdata_query_set_is_strict + +gdata_query_get_type +GDATA_QUERY +GDATA_QUERY_CLASS +GDATA_QUERY_GET_CLASS +GDATA_TYPE_QUERY +GDATA_IS_QUERY +GDATA_IS_QUERY_CLASS + +GDataQueryPrivate +
+ +
+gdata-feed +GDataFeed +GDataFeed +GDataFeedClass +gdata_feed_get_title +gdata_feed_get_subtitle +gdata_feed_get_id +gdata_feed_get_etag +gdata_feed_get_authors +gdata_feed_get_categories +gdata_feed_get_entries +gdata_feed_look_up_entry +gdata_feed_get_generator +gdata_feed_get_links +gdata_feed_look_up_link +gdata_feed_get_logo +gdata_feed_get_icon +gdata_feed_get_updated +gdata_feed_get_rights +gdata_feed_get_start_index +gdata_feed_get_total_results +gdata_feed_get_items_per_page +gdata_feed_get_next_page_token + +GDATA_FEED +GDATA_FEED_CLASS +GDATA_FEED_GET_CLASS +gdata_feed_get_type +GDATA_IS_FEED +GDATA_IS_FEED_CLASS +GDATA_TYPE_FEED + +GDataFeedPrivate +
+ +
+gdata-entry +GDataEntry +GDataEntry +GDataEntryClass +gdata_entry_new +gdata_entry_get_title +gdata_entry_set_title +gdata_entry_get_summary +gdata_entry_set_summary +gdata_entry_get_id +gdata_entry_get_etag +gdata_entry_get_content +gdata_entry_set_content +gdata_entry_get_content_uri +gdata_entry_set_content_uri +gdata_entry_get_published +gdata_entry_get_updated +gdata_entry_get_authors +gdata_entry_add_author +gdata_entry_add_category +gdata_entry_get_categories +gdata_entry_add_link +gdata_entry_remove_link +gdata_entry_look_up_link +gdata_entry_look_up_links +gdata_entry_is_inserted +gdata_entry_get_rights +gdata_entry_set_rights + +gdata_entry_get_type +GDATA_ENTRY +GDATA_ENTRY_CLASS +GDATA_ENTRY_GET_CLASS +GDATA_IS_ENTRY +GDATA_IS_ENTRY_CLASS +GDATA_TYPE_ENTRY + +GDataEntryPrivate +
+ +
+gdata-youtube-service +GDataYouTubeService +GDataYouTubeService +GDataYouTubeServiceClass +GDataYouTubeServiceError +GDataYouTubeStandardFeedType +gdata_youtube_service_new +gdata_youtube_service_get_primary_authorization_domain +gdata_youtube_service_query_videos +gdata_youtube_service_query_videos_async +gdata_youtube_service_query_related +gdata_youtube_service_query_related_async +gdata_youtube_service_query_standard_feed +gdata_youtube_service_query_standard_feed_async +gdata_youtube_service_upload_video +gdata_youtube_service_finish_video_upload +gdata_youtube_service_get_categories +gdata_youtube_service_get_categories_async +gdata_youtube_service_get_categories_finish +gdata_youtube_service_get_developer_key + +GDATA_YOUTUBE_SERVICE +GDATA_YOUTUBE_SERVICE_CLASS +GDATA_YOUTUBE_SERVICE_ERROR +GDATA_YOUTUBE_SERVICE_GET_CLASS +GDATA_IS_YOUTUBE_SERVICE +GDATA_IS_YOUTUBE_SERVICE_CLASS +GDATA_TYPE_YOUTUBE_SERVICE +gdata_youtube_service_get_type +gdata_youtube_service_error_quark + +GDataYouTubeServicePrivate +
+ +
+gdata-youtube-video +GDataYouTubeVideo +GDATA_YOUTUBE_ASPECT_RATIO_WIDESCREEN +GDATA_YOUTUBE_ACTION_RATE +GDATA_YOUTUBE_ACTION_COMMENT +GDATA_YOUTUBE_ACTION_COMMENT_VOTE +GDATA_YOUTUBE_ACTION_VIDEO_RESPOND +GDATA_YOUTUBE_ACTION_EMBED +GDATA_YOUTUBE_ACTION_SYNDICATE +GDATA_YOUTUBE_LICENSE_CC +GDATA_YOUTUBE_LICENSE_STANDARD +GDATA_YOUTUBE_RATING_TYPE_SIMPLE +GDATA_YOUTUBE_RATING_TYPE_MPAA +GDATA_YOUTUBE_RATING_TYPE_V_CHIP +GDataYouTubeVideo +GDataYouTubeVideoClass +GDataYouTubePermission +gdata_youtube_video_new +gdata_youtube_video_look_up_content +gdata_youtube_video_get_thumbnails +gdata_youtube_video_get_category +gdata_youtube_video_set_category +gdata_youtube_video_get_credit +gdata_youtube_video_get_description +gdata_youtube_video_set_description +gdata_youtube_video_get_duration +gdata_youtube_video_get_keywords +gdata_youtube_video_set_keywords +gdata_youtube_video_get_location +gdata_youtube_video_set_location +gdata_youtube_video_get_view_count +gdata_youtube_video_get_favorite_count +gdata_youtube_video_is_restricted_in_country +gdata_youtube_video_get_media_rating +gdata_youtube_video_get_access_control +gdata_youtube_video_set_access_control +gdata_youtube_video_get_player_uri +gdata_youtube_video_is_private +gdata_youtube_video_set_is_private +gdata_youtube_video_is_draft +gdata_youtube_video_set_is_draft +gdata_youtube_video_get_state +gdata_youtube_video_get_rating +gdata_youtube_video_get_uploaded +gdata_youtube_video_get_recorded +gdata_youtube_video_set_recorded +gdata_youtube_video_get_video_id +gdata_youtube_video_get_video_id_from_uri +gdata_youtube_video_get_aspect_ratio +gdata_youtube_video_set_aspect_ratio +gdata_youtube_video_get_coordinates +gdata_youtube_video_set_coordinates + +GDATA_IS_YOUTUBE_VIDEO +GDATA_IS_YOUTUBE_VIDEO_CLASS +GDATA_TYPE_YOUTUBE_VIDEO +GDATA_YOUTUBE_VIDEO +GDATA_YOUTUBE_VIDEO_CLASS +GDATA_YOUTUBE_VIDEO_GET_CLASS +gdata_youtube_video_get_type + +GDataYouTubeVideoPrivate +
+ +
+gdata-contacts-service +GDataContactsService +GDataContactsService +GDataContactsServiceClass +gdata_contacts_service_new +gdata_contacts_service_get_primary_authorization_domain +gdata_contacts_service_query_contacts +gdata_contacts_service_query_contacts_async +gdata_contacts_service_insert_contact +gdata_contacts_service_insert_contact_async +gdata_contacts_service_query_groups +gdata_contacts_service_query_groups_async +gdata_contacts_service_insert_group +gdata_contacts_service_insert_group_async + +gdata_contacts_service_get_type +GDATA_CONTACTS_SERVICE +GDATA_CONTACTS_SERVICE_CLASS +GDATA_CONTACTS_SERVICE_GET_CLASS +GDATA_IS_CONTACTS_SERVICE +GDATA_IS_CONTACTS_SERVICE_CLASS +GDATA_TYPE_CONTACTS_SERVICE + +GDataContactsServicePrivate +
+ +
+gdata-contacts-query +GDataContactsQuery +GDataContactsQuery +GDataContactsQueryClass +gdata_contacts_query_new +gdata_contacts_query_new_with_limits +gdata_contacts_query_get_order_by +gdata_contacts_query_set_order_by +gdata_contacts_query_get_sort_order +gdata_contacts_query_set_sort_order +gdata_contacts_query_show_deleted +gdata_contacts_query_set_show_deleted +gdata_contacts_query_get_group +gdata_contacts_query_set_group + +gdata_contacts_query_get_type +GDATA_CONTACTS_QUERY +GDATA_CONTACTS_QUERY_CLASS +GDATA_CONTACTS_QUERY_GET_CLASS +GDATA_IS_CONTACTS_QUERY +GDATA_IS_CONTACTS_QUERY_CLASS +GDATA_TYPE_CONTACTS_QUERY + +GDataContactsQueryPrivate +
+ +
+gdata-contacts-contact +GDataContactsContact +GDATA_CONTACTS_GENDER_MALE +GDATA_CONTACTS_GENDER_FEMALE +GDATA_CONTACTS_PRIORITY_LOW +GDATA_CONTACTS_PRIORITY_NORMAL +GDATA_CONTACTS_PRIORITY_HIGH +GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL +GDATA_CONTACTS_SENSITIVITY_NORMAL +GDATA_CONTACTS_SENSITIVITY_PERSONAL +GDATA_CONTACTS_SENSITIVITY_PRIVATE +GDataContactsContact +GDataContactsContactClass +gdata_contacts_contact_new +gdata_contacts_contact_get_name +gdata_contacts_contact_set_name +gdata_contacts_contact_get_short_name +gdata_contacts_contact_set_short_name +gdata_contacts_contact_get_initials +gdata_contacts_contact_set_initials +gdata_contacts_contact_get_maiden_name +gdata_contacts_contact_set_maiden_name +gdata_contacts_contact_get_nickname +gdata_contacts_contact_set_nickname +gdata_contacts_contact_get_file_as +gdata_contacts_contact_set_file_as +gdata_contacts_contact_get_birthday +gdata_contacts_contact_set_birthday +gdata_contacts_contact_get_gender +gdata_contacts_contact_set_gender +gdata_contacts_contact_get_mileage +gdata_contacts_contact_set_mileage +gdata_contacts_contact_get_occupation +gdata_contacts_contact_set_occupation +gdata_contacts_contact_get_subject +gdata_contacts_contact_set_subject +gdata_contacts_contact_get_priority +gdata_contacts_contact_set_priority +gdata_contacts_contact_get_sensitivity +gdata_contacts_contact_set_sensitivity +gdata_contacts_contact_get_directory_server +gdata_contacts_contact_set_directory_server +gdata_contacts_contact_get_billing_information +gdata_contacts_contact_set_billing_information +gdata_contacts_contact_get_email_addresses +gdata_contacts_contact_get_primary_email_address +gdata_contacts_contact_add_email_address +gdata_contacts_contact_remove_all_email_addresses +gdata_contacts_contact_get_im_addresses +gdata_contacts_contact_get_primary_im_address +gdata_contacts_contact_add_im_address +gdata_contacts_contact_remove_all_im_addresses +gdata_contacts_contact_get_postal_addresses +gdata_contacts_contact_get_primary_postal_address +gdata_contacts_contact_add_postal_address +gdata_contacts_contact_remove_all_postal_addresses +gdata_contacts_contact_get_phone_numbers +gdata_contacts_contact_get_primary_phone_number +gdata_contacts_contact_add_phone_number +gdata_contacts_contact_remove_all_phone_numbers +gdata_contacts_contact_get_organizations +gdata_contacts_contact_get_primary_organization +gdata_contacts_contact_add_organization +gdata_contacts_contact_remove_all_organizations +gdata_contacts_contact_add_jot +gdata_contacts_contact_get_jots +gdata_contacts_contact_remove_all_jots +gdata_contacts_contact_add_relation +gdata_contacts_contact_get_relations +gdata_contacts_contact_remove_all_relations +gdata_contacts_contact_add_website +gdata_contacts_contact_get_websites +gdata_contacts_contact_get_primary_website +gdata_contacts_contact_remove_all_websites +gdata_contacts_contact_add_event +gdata_contacts_contact_get_events +gdata_contacts_contact_remove_all_events +gdata_contacts_contact_add_calendar +gdata_contacts_contact_get_calendars +gdata_contacts_contact_get_primary_calendar +gdata_contacts_contact_remove_all_calendars +gdata_contacts_contact_add_external_id +gdata_contacts_contact_get_external_ids +gdata_contacts_contact_remove_all_external_ids +gdata_contacts_contact_add_hobby +gdata_contacts_contact_get_hobbies +gdata_contacts_contact_remove_all_hobbies +gdata_contacts_contact_add_language +gdata_contacts_contact_get_languages +gdata_contacts_contact_remove_all_languages +gdata_contacts_contact_get_groups +gdata_contacts_contact_add_group +gdata_contacts_contact_remove_group +gdata_contacts_contact_is_group_deleted +gdata_contacts_contact_get_extended_property +gdata_contacts_contact_get_extended_properties +gdata_contacts_contact_set_extended_property +gdata_contacts_contact_get_user_defined_field +gdata_contacts_contact_get_user_defined_fields +gdata_contacts_contact_set_user_defined_field +gdata_contacts_contact_get_edited +gdata_contacts_contact_is_deleted +gdata_contacts_contact_get_photo_etag +gdata_contacts_contact_get_photo +gdata_contacts_contact_get_photo_async +gdata_contacts_contact_get_photo_finish +gdata_contacts_contact_set_photo +gdata_contacts_contact_set_photo_async +gdata_contacts_contact_set_photo_finish + +gdata_contacts_contact_get_type +GDATA_CONTACTS_CONTACT +GDATA_CONTACTS_CONTACT_CLASS +GDATA_CONTACTS_CONTACT_GET_CLASS +GDATA_IS_CONTACTS_CONTACT +GDATA_IS_CONTACTS_CONTACT_CLASS +GDATA_TYPE_CONTACTS_CONTACT + +GDataContactsContactPrivate +
+ +
+gdata-calendar-service +GDataCalendarService +GDataCalendarService +GDataCalendarServiceClass +gdata_calendar_service_new +gdata_calendar_service_get_primary_authorization_domain +gdata_calendar_service_query_all_calendars +gdata_calendar_service_query_all_calendars_async +gdata_calendar_service_query_own_calendars +gdata_calendar_service_query_own_calendars_async +gdata_calendar_service_query_events +gdata_calendar_service_query_events_async +gdata_calendar_service_insert_event +gdata_calendar_service_insert_event_async +gdata_calendar_service_insert_calendar_event +gdata_calendar_service_insert_calendar_event_async + +gdata_calendar_service_get_type +GDATA_CALENDAR_SERVICE +GDATA_CALENDAR_SERVICE_CLASS +GDATA_CALENDAR_SERVICE_GET_CLASS +GDATA_IS_CALENDAR_SERVICE +GDATA_IS_CALENDAR_SERVICE_CLASS +GDATA_TYPE_CALENDAR_SERVICE + +GDataCalendarServicePrivate +
+ +
+gdata-calendar-query +GDataCalendarQuery +GDataCalendarQuery +GDataCalendarQueryClass +gdata_calendar_query_new +gdata_calendar_query_new_with_limits +gdata_calendar_query_get_future_events +gdata_calendar_query_set_future_events +gdata_calendar_query_get_single_events +gdata_calendar_query_set_single_events +gdata_calendar_query_get_order_by +gdata_calendar_query_set_order_by +gdata_calendar_query_get_sort_order +gdata_calendar_query_set_sort_order +gdata_calendar_query_get_start_min +gdata_calendar_query_set_start_min +gdata_calendar_query_get_start_max +gdata_calendar_query_set_start_max +gdata_calendar_query_get_recurrence_expansion_start +gdata_calendar_query_set_recurrence_expansion_start +gdata_calendar_query_get_recurrence_expansion_end +gdata_calendar_query_set_recurrence_expansion_end +gdata_calendar_query_get_timezone +gdata_calendar_query_set_timezone +gdata_calendar_query_get_max_attendees +gdata_calendar_query_set_max_attendees +gdata_calendar_query_show_deleted +gdata_calendar_query_set_show_deleted + +gdata_calendar_query_get_type +GDATA_CALENDAR_QUERY +GDATA_CALENDAR_QUERY_CLASS +GDATA_CALENDAR_QUERY_GET_CLASS +GDATA_IS_CALENDAR_QUERY +GDATA_IS_CALENDAR_QUERY_CLASS +GDATA_TYPE_CALENDAR_QUERY + +GDataCalendarQueryPrivate +
+ +
+gdata-calendar-calendar +GDataCalendarCalendar +GDataCalendarCalendar +GDataCalendarCalendarClass +gdata_calendar_calendar_new +gdata_calendar_calendar_get_color +gdata_calendar_calendar_set_color +gdata_calendar_calendar_is_hidden +gdata_calendar_calendar_set_is_hidden +gdata_calendar_calendar_is_selected +gdata_calendar_calendar_set_is_selected +gdata_calendar_calendar_get_timezone +gdata_calendar_calendar_set_timezone +gdata_calendar_calendar_get_edited +gdata_calendar_calendar_get_times_cleaned +gdata_calendar_calendar_get_access_level + +gdata_calendar_calendar_get_type +GDATA_CALENDAR_CALENDAR +GDATA_CALENDAR_CALENDAR_CLASS +GDATA_CALENDAR_CALENDAR_GET_CLASS +GDATA_IS_CALENDAR_CALENDAR +GDATA_IS_CALENDAR_CALENDAR_CLASS +GDATA_TYPE_CALENDAR_CALENDAR + +GDataCalendarCalendarPrivate +
+ +
+gdata-calendar-event +GDataCalendarEvent +GDataCalendarEvent +GDataCalendarEventClass +gdata_calendar_event_new +gdata_calendar_event_get_people +gdata_calendar_event_add_person +gdata_calendar_event_get_places +gdata_calendar_event_add_place +gdata_calendar_event_get_times +gdata_calendar_event_get_primary_time +gdata_calendar_event_add_time +gdata_calendar_event_get_recurrence +gdata_calendar_event_set_recurrence +gdata_calendar_event_get_original_event_details +gdata_calendar_event_is_exception +gdata_calendar_event_get_anyone_can_add_self +gdata_calendar_event_set_anyone_can_add_self +gdata_calendar_event_get_guests_can_invite_others +gdata_calendar_event_set_guests_can_invite_others +gdata_calendar_event_get_guests_can_modify +gdata_calendar_event_set_guests_can_modify +gdata_calendar_event_get_guests_can_see_guests +gdata_calendar_event_set_guests_can_see_guests +gdata_calendar_event_get_sequence +gdata_calendar_event_set_sequence +gdata_calendar_event_get_status +gdata_calendar_event_set_status +gdata_calendar_event_get_transparency +gdata_calendar_event_set_transparency +gdata_calendar_event_get_uid +gdata_calendar_event_set_uid +gdata_calendar_event_get_visibility +gdata_calendar_event_set_visibility +gdata_calendar_event_get_edited + +gdata_calendar_event_get_type +GDATA_CALENDAR_EVENT +GDATA_CALENDAR_EVENT_CLASS +GDATA_CALENDAR_EVENT_GET_CLASS +GDATA_IS_CALENDAR_EVENT +GDATA_IS_CALENDAR_EVENT_CLASS +GDATA_TYPE_CALENDAR_EVENT + +GDataCalendarEventPrivate +
+ +
+gdata-types +GData Types +GDataColor +gdata_color_from_hexadecimal +gdata_color_to_hexadecimal + +GDATA_TYPE_COLOR +gdata_color_get_type +
+ +
+gdata-youtube-query +GDataYouTubeQuery +GDataYouTubeQuery +GDataYouTubeQueryClass +GDataYouTubeAge +GDataYouTubeFormat +GDataYouTubeSafeSearch +GDataYouTubeSortOrder +GDataYouTubeUploader +gdata_youtube_query_new +gdata_youtube_query_get_age +gdata_youtube_query_set_age +gdata_youtube_query_get_format +gdata_youtube_query_set_format +gdata_youtube_query_get_language +gdata_youtube_query_set_language +gdata_youtube_query_get_license +gdata_youtube_query_set_license +gdata_youtube_query_get_location +gdata_youtube_query_set_location +gdata_youtube_query_get_order_by +gdata_youtube_query_set_order_by +gdata_youtube_query_get_restriction +gdata_youtube_query_set_restriction +gdata_youtube_query_get_safe_search +gdata_youtube_query_set_safe_search +gdata_youtube_query_get_sort_order +gdata_youtube_query_set_sort_order +gdata_youtube_query_get_uploader +gdata_youtube_query_set_uploader + +GDATA_IS_YOUTUBE_QUERY +GDATA_IS_YOUTUBE_QUERY_CLASS +GDATA_TYPE_YOUTUBE_QUERY +GDATA_YOUTUBE_QUERY +GDATA_YOUTUBE_QUERY_CLASS +GDATA_YOUTUBE_QUERY_GET_CLASS +gdata_youtube_query_get_type + +GDataYouTubeQueryPrivate +
+ +
+gdata-access-handler +GDataAccessHandler +GDATA_LINK_ACCESS_CONTROL_LIST +GDataAccessHandler +GDataAccessHandlerIface +gdata_access_handler_get_rules +gdata_access_handler_get_rules_async + +gdata_access_handler_get_type +GDATA_ACCESS_HANDLER +GDATA_ACCESS_HANDLER_CLASS +GDATA_ACCESS_HANDLER_GET_IFACE +GDATA_IS_ACCESS_HANDLER +GDATA_TYPE_ACCESS_HANDLER +
+ +
+gdata-access-rule +GDataAccessRule +GDATA_ACCESS_SCOPE_USER +GDATA_ACCESS_SCOPE_DOMAIN +GDATA_ACCESS_SCOPE_DEFAULT +GDATA_ACCESS_ROLE_NONE +GDataAccessRule +GDataAccessRuleClass +gdata_access_rule_new +gdata_access_rule_get_role +gdata_access_rule_set_role +gdata_access_rule_get_scope +gdata_access_rule_set_scope +gdata_access_rule_get_edited +gdata_access_rule_get_key + +gdata_access_rule_get_type +GDATA_ACCESS_RULE +GDATA_ACCESS_RULE_CLASS +GDATA_ACCESS_RULE_GET_CLASS +GDATA_IS_ACCESS_RULE +GDATA_IS_ACCESS_RULE_CLASS +GDATA_TYPE_ACCESS_RULE + +GDataAccessRulePrivate +
+ +
+gdata-parsable +GDataParsable +GDataParsable +GDataParsableClass +gdata_parsable_get_content_type +gdata_parsable_new_from_xml +gdata_parsable_get_xml +gdata_parsable_new_from_json +gdata_parsable_get_json + +gdata_parsable_get_type +GDATA_IS_PARSABLE +GDATA_IS_PARSABLE_CLASS +GDATA_PARSABLE +GDATA_PARSABLE_CLASS +GDATA_PARSABLE_GET_CLASS +GDATA_TYPE_PARSABLE + +GDataParsablePrivate +
+ +
+gdata-calendar-feed +GDataCalendarFeed +GDataCalendarFeed +GDataCalendarFeedClass +gdata_calendar_feed_get_timezone +gdata_calendar_feed_get_times_cleaned + +gdata_calendar_feed_get_type +GDATA_CALENDAR_FEED +GDATA_CALENDAR_FEED_CLASS +GDATA_CALENDAR_FEED_GET_CLASS +GDATA_IS_CALENDAR_FEED +GDATA_IS_CALENDAR_FEED_CLASS +GDATA_TYPE_CALENDAR_FEED + +GDataCalendarFeedPrivate +
+ +
+gdata-category +GDataCategory +GDATA_CATEGORY_SCHEMA_LABELS +GDATA_CATEGORY_SCHEMA_LABELS_SHARED +GDATA_CATEGORY_SCHEMA_LABELS_STARRED +GDATA_CATEGORY_SCHEMA_LABELS_VIEWED +GDataCategory +GDataCategoryClass +gdata_category_new +gdata_category_get_term +gdata_category_set_term +gdata_category_get_scheme +gdata_category_set_scheme +gdata_category_get_label +gdata_category_set_label + +gdata_category_get_type +GDATA_CATEGORY +GDATA_CATEGORY_CLASS +GDATA_CATEGORY_GET_CLASS +GDATA_IS_CATEGORY +GDATA_IS_CATEGORY_CLASS +GDATA_TYPE_CATEGORY + +GDataCategoryPrivate +
+ +
+gdata-link +GDataLink +GDATA_LINK_ALTERNATE +GDATA_LINK_BATCH +GDATA_LINK_EDIT +GDATA_LINK_EDIT_MEDIA +GDATA_LINK_ENCLOSURE +GDATA_LINK_RELATED +GDATA_LINK_SELF +GDATA_LINK_VIA +GDATA_LINK_PARENT +GDataLink +GDataLinkClass +gdata_link_new +gdata_link_get_uri +gdata_link_set_uri +gdata_link_get_relation_type +gdata_link_set_relation_type +gdata_link_get_content_type +gdata_link_set_content_type +gdata_link_get_language +gdata_link_set_language +gdata_link_get_title +gdata_link_set_title +gdata_link_get_length +gdata_link_set_length + +gdata_link_get_type +GDATA_IS_LINK +GDATA_IS_LINK_CLASS +GDATA_LINK +GDATA_LINK_CLASS +GDATA_LINK_GET_CLASS +GDATA_TYPE_LINK + +GDataLinkPrivate +
+ +
+gdata-author +GDataAuthor +GDataAuthor +GDataAuthorClass +gdata_author_new +gdata_author_get_name +gdata_author_set_name +gdata_author_get_uri +gdata_author_set_uri +gdata_author_get_email_address +gdata_author_set_email_address + +gdata_author_get_type +GDATA_AUTHOR +GDATA_AUTHOR_CLASS +GDATA_AUTHOR_GET_CLASS +GDATA_IS_AUTHOR +GDATA_IS_AUTHOR_CLASS +GDATA_TYPE_AUTHOR + +GDataAuthorPrivate +
+ +
+gdata-generator +GDataGenerator +GDataGenerator +GDataGeneratorClass +gdata_generator_get_name +gdata_generator_get_uri +gdata_generator_get_version + +gdata_generator_get_type +GDATA_GENERATOR +GDATA_GENERATOR_CLASS +GDATA_GENERATOR_GET_CLASS +GDATA_IS_GENERATOR +GDATA_IS_GENERATOR_CLASS +GDATA_TYPE_GENERATOR + +GDataGeneratorPrivate +
+ +
+gdata-gd-organization +GDataGDOrganization +GDATA_GD_ORGANIZATION_WORK +GDATA_GD_ORGANIZATION_OTHER +GDataGDOrganization +GDataGDOrganizationClass +gdata_gd_organization_new +gdata_gd_organization_get_name +gdata_gd_organization_set_name +gdata_gd_organization_get_title +gdata_gd_organization_set_title +gdata_gd_organization_get_relation_type +gdata_gd_organization_set_relation_type +gdata_gd_organization_get_label +gdata_gd_organization_set_label +gdata_gd_organization_is_primary +gdata_gd_organization_set_is_primary +gdata_gd_organization_get_department +gdata_gd_organization_set_department +gdata_gd_organization_get_job_description +gdata_gd_organization_set_job_description +gdata_gd_organization_get_symbol +gdata_gd_organization_set_symbol +gdata_gd_organization_get_location +gdata_gd_organization_set_location + +gdata_gd_organization_get_type +GDATA_GD_ORGANIZATION +GDATA_GD_ORGANIZATION_CLASS +GDATA_GD_ORGANIZATION_GET_CLASS +GDATA_IS_GD_ORGANIZATION +GDATA_IS_GD_ORGANIZATION_CLASS +GDATA_TYPE_GD_ORGANIZATION + +GDataGDOrganizationPrivate +
+ +
+gdata-gd-when +GDataGDWhen +GDATA_GD_EVENT_STATUS_CANCELED +GDATA_GD_EVENT_STATUS_CONFIRMED +GDATA_GD_EVENT_STATUS_TENTATIVE +GDATA_GD_EVENT_VISIBILITY_CONFIDENTIAL +GDATA_GD_EVENT_VISIBILITY_DEFAULT +GDATA_GD_EVENT_VISIBILITY_PRIVATE +GDATA_GD_EVENT_VISIBILITY_PUBLIC +GDATA_GD_EVENT_TRANSPARENCY_OPAQUE +GDATA_GD_EVENT_TRANSPARENCY_TRANSPARENT +GDataGDWhen +GDataGDWhenClass +gdata_gd_when_new +gdata_gd_when_get_start_time +gdata_gd_when_set_start_time +gdata_gd_when_get_end_time +gdata_gd_when_set_end_time +gdata_gd_when_is_date +gdata_gd_when_set_is_date +gdata_gd_when_get_value_string +gdata_gd_when_set_value_string +gdata_gd_when_get_reminders +gdata_gd_when_add_reminder + +gdata_gd_when_get_type +GDATA_GD_WHEN +GDATA_GD_WHEN_CLASS +GDATA_GD_WHEN_GET_CLASS +GDATA_IS_GD_WHEN +GDATA_IS_GD_WHEN_CLASS +GDATA_TYPE_GD_WHEN + +GDataGDWhenPrivate +
+ +
+gdata-gd-who +GDataGDWho +GDATA_GD_WHO_EVENT_ATTENDEE +GDATA_GD_WHO_EVENT_ORGANIZER +GDATA_GD_WHO_EVENT_PERFORMER +GDATA_GD_WHO_EVENT_SPEAKER +GDataGDWho +GDataGDWhoClass +gdata_gd_who_new +gdata_gd_who_get_relation_type +gdata_gd_who_set_relation_type +gdata_gd_who_get_value_string +gdata_gd_who_set_value_string +gdata_gd_who_get_email_address +gdata_gd_who_set_email_address + +gdata_gd_who_get_type +GDATA_GD_WHO +GDATA_GD_WHO_CLASS +GDATA_GD_WHO_GET_CLASS +GDATA_IS_GD_WHO +GDATA_IS_GD_WHO_CLASS +GDATA_TYPE_GD_WHO + +GDataGDWhoPrivate +
+ +
+gdata-gd-where +GDataGDWhere +GDATA_GD_WHERE_EVENT +GDATA_GD_WHERE_EVENT_ALTERNATE +GDATA_GD_WHERE_EVENT_PARKING +GDataGDWhere +GDataGDWhereClass +gdata_gd_where_new +gdata_gd_where_get_relation_type +gdata_gd_where_set_relation_type +gdata_gd_where_get_value_string +gdata_gd_where_set_value_string +gdata_gd_where_get_label +gdata_gd_where_set_label + +gdata_gd_where_get_type +GDATA_GD_WHERE +GDATA_GD_WHERE_CLASS +GDATA_GD_WHERE_GET_CLASS +GDATA_IS_GD_WHERE +GDATA_IS_GD_WHERE_CLASS +GDATA_TYPE_GD_WHERE + +GDataGDWherePrivate +
+ +
+gdata-gd-email-address +GDataGDEmailAddress +GDATA_GD_EMAIL_ADDRESS_HOME +GDATA_GD_EMAIL_ADDRESS_OTHER +GDATA_GD_EMAIL_ADDRESS_WORK +GDataGDEmailAddress +GDataGDEmailAddressClass +gdata_gd_email_address_new +gdata_gd_email_address_get_address +gdata_gd_email_address_set_address +gdata_gd_email_address_get_relation_type +gdata_gd_email_address_set_relation_type +gdata_gd_email_address_get_label +gdata_gd_email_address_set_label +gdata_gd_email_address_is_primary +gdata_gd_email_address_set_is_primary +gdata_gd_email_address_get_display_name +gdata_gd_email_address_set_display_name + +gdata_gd_email_address_get_type +GDATA_GD_EMAIL_ADDRESS +GDATA_GD_EMAIL_ADDRESS_CLASS +GDATA_GD_EMAIL_ADDRESS_GET_CLASS +GDATA_IS_GD_EMAIL_ADDRESS +GDATA_IS_GD_EMAIL_ADDRESS_CLASS +GDATA_TYPE_GD_EMAIL_ADDRESS + +GDataGDEmailAddressPrivate +
+ +
+gdata-gd-im-address +GDataGDIMAddress +GDATA_GD_IM_ADDRESS_HOME +GDATA_GD_IM_ADDRESS_NETMEETING +GDATA_GD_IM_ADDRESS_OTHER +GDATA_GD_IM_ADDRESS_WORK +GDATA_GD_IM_PROTOCOL_AIM +GDATA_GD_IM_PROTOCOL_LIVE_MESSENGER +GDATA_GD_IM_PROTOCOL_YAHOO_MESSENGER +GDATA_GD_IM_PROTOCOL_SKYPE +GDATA_GD_IM_PROTOCOL_QQ +GDATA_GD_IM_PROTOCOL_GOOGLE_TALK +GDATA_GD_IM_PROTOCOL_ICQ +GDATA_GD_IM_PROTOCOL_JABBER +GDataGDIMAddress +GDataGDIMAddressClass +gdata_gd_im_address_new +gdata_gd_im_address_get_address +gdata_gd_im_address_set_address +gdata_gd_im_address_get_protocol +gdata_gd_im_address_set_protocol +gdata_gd_im_address_get_relation_type +gdata_gd_im_address_set_relation_type +gdata_gd_im_address_get_label +gdata_gd_im_address_set_label +gdata_gd_im_address_is_primary +gdata_gd_im_address_set_is_primary + +gdata_gd_im_address_get_type +GDATA_GD_IM_ADDRESS +GDATA_GD_IM_ADDRESS_CLASS +GDATA_GD_IM_ADDRESS_GET_CLASS +GDATA_IS_GD_IM_ADDRESS +GDATA_IS_GD_IM_ADDRESS_CLASS +GDATA_TYPE_GD_IM_ADDRESS + +GDataGDIMAddressPrivate +
+ +
+gdata-gd-postal-address +GDataGDPostalAddress +GDATA_GD_POSTAL_ADDRESS_WORK +GDATA_GD_POSTAL_ADDRESS_HOME +GDATA_GD_POSTAL_ADDRESS_OTHER +GDATA_GD_ADDRESS_USAGE_GENERAL +GDATA_GD_ADDRESS_USAGE_LOCAL +GDATA_GD_MAIL_CLASS_BOTH +GDATA_GD_MAIL_CLASS_LETTERS +GDATA_GD_MAIL_CLASS_NEITHER +GDATA_GD_MAIL_CLASS_PARCELS +GDataGDPostalAddress +GDataGDPostalAddressClass +gdata_gd_postal_address_new +gdata_gd_postal_address_get_address +gdata_gd_postal_address_set_address +gdata_gd_postal_address_get_relation_type +gdata_gd_postal_address_set_relation_type +gdata_gd_postal_address_get_label +gdata_gd_postal_address_set_label +gdata_gd_postal_address_is_primary +gdata_gd_postal_address_set_is_primary +gdata_gd_postal_address_get_mail_class +gdata_gd_postal_address_set_mail_class +gdata_gd_postal_address_get_usage +gdata_gd_postal_address_set_usage +gdata_gd_postal_address_get_agent +gdata_gd_postal_address_set_agent +gdata_gd_postal_address_get_house_name +gdata_gd_postal_address_set_house_name +gdata_gd_postal_address_get_street +gdata_gd_postal_address_set_street +gdata_gd_postal_address_get_po_box +gdata_gd_postal_address_set_po_box +gdata_gd_postal_address_get_neighborhood +gdata_gd_postal_address_set_neighborhood +gdata_gd_postal_address_get_city +gdata_gd_postal_address_set_city +gdata_gd_postal_address_get_subregion +gdata_gd_postal_address_set_subregion +gdata_gd_postal_address_get_region +gdata_gd_postal_address_set_region +gdata_gd_postal_address_get_postcode +gdata_gd_postal_address_set_postcode +gdata_gd_postal_address_get_country +gdata_gd_postal_address_get_country_code +gdata_gd_postal_address_set_country + +gdata_gd_postal_address_get_type +GDATA_GD_POSTAL_ADDRESS +GDATA_GD_POSTAL_ADDRESS_CLASS +GDATA_GD_POSTAL_ADDRESS_GET_CLASS +GDATA_IS_GD_POSTAL_ADDRESS +GDATA_IS_GD_POSTAL_ADDRESS_CLASS +GDATA_TYPE_GD_POSTAL_ADDRESS + +GDataGDPostalAddressPrivate +
+ +
+gdata-gd-phone-number +GDataGDPhoneNumber +GDATA_GD_PHONE_NUMBER_ASSISTANT +GDATA_GD_PHONE_NUMBER_CALLBACK +GDATA_GD_PHONE_NUMBER_CAR +GDATA_GD_PHONE_NUMBER_COMPANY_MAIN +GDATA_GD_PHONE_NUMBER_FAX +GDATA_GD_PHONE_NUMBER_HOME +GDATA_GD_PHONE_NUMBER_HOME_FAX +GDATA_GD_PHONE_NUMBER_ISDN +GDATA_GD_PHONE_NUMBER_MAIN +GDATA_GD_PHONE_NUMBER_MOBILE +GDATA_GD_PHONE_NUMBER_OTHER +GDATA_GD_PHONE_NUMBER_OTHER_FAX +GDATA_GD_PHONE_NUMBER_PAGER +GDATA_GD_PHONE_NUMBER_RADIO +GDATA_GD_PHONE_NUMBER_TELEX +GDATA_GD_PHONE_NUMBER_TTY_TDD +GDATA_GD_PHONE_NUMBER_WORK +GDATA_GD_PHONE_NUMBER_WORK_FAX +GDATA_GD_PHONE_NUMBER_WORK_MOBILE +GDATA_GD_PHONE_NUMBER_WORK_PAGER +GDataGDPhoneNumber +GDataGDPhoneNumberClass +gdata_gd_phone_number_new +gdata_gd_phone_number_get_number +gdata_gd_phone_number_set_number +gdata_gd_phone_number_get_uri +gdata_gd_phone_number_set_uri +gdata_gd_phone_number_get_relation_type +gdata_gd_phone_number_set_relation_type +gdata_gd_phone_number_get_label +gdata_gd_phone_number_set_label +gdata_gd_phone_number_is_primary +gdata_gd_phone_number_set_is_primary + +gdata_gd_phone_number_get_type +GDATA_GD_PHONE_NUMBER +GDATA_GD_PHONE_NUMBER_CLASS +GDATA_GD_PHONE_NUMBER_GET_CLASS +GDATA_IS_GD_PHONE_NUMBER +GDATA_IS_GD_PHONE_NUMBER_CLASS +GDATA_TYPE_GD_PHONE_NUMBER + +GDataGDPhoneNumberPrivate +
+ +
+gdata-gd-reminder +GDataGDReminder +GDATA_GD_REMINDER_ALERT +GDATA_GD_REMINDER_EMAIL +GDATA_GD_REMINDER_SMS +GDataGDReminder +GDataGDReminderClass +gdata_gd_reminder_new +gdata_gd_reminder_get_method +gdata_gd_reminder_set_method +gdata_gd_reminder_get_absolute_time +gdata_gd_reminder_set_absolute_time +gdata_gd_reminder_is_absolute_time +gdata_gd_reminder_get_relative_time +gdata_gd_reminder_set_relative_time + +gdata_gd_reminder_get_type +GDATA_GD_REMINDER +GDATA_GD_REMINDER_CLASS +GDATA_GD_REMINDER_GET_CLASS +GDATA_IS_GD_REMINDER +GDATA_IS_GD_REMINDER_CLASS +GDATA_TYPE_GD_REMINDER + +GDataGDReminderPrivate +
+ +
+gdata-media-category +GDataMediaCategory +GDataMediaCategory +GDataMediaCategoryClass +gdata_media_category_new +gdata_media_category_get_category +gdata_media_category_set_category +gdata_media_category_get_scheme +gdata_media_category_set_scheme +gdata_media_category_get_label +gdata_media_category_set_label + +gdata_media_category_get_type +GDATA_MEDIA_CATEGORY +GDATA_MEDIA_CATEGORY_CLASS +GDATA_MEDIA_CATEGORY_GET_CLASS +GDATA_IS_MEDIA_CATEGORY +GDATA_IS_MEDIA_CATEGORY_CLASS +GDATA_TYPE_MEDIA_CATEGORY + +GDataMediaCategoryPrivate +
+ +
+gdata-media-credit +GDataMediaCredit +GDataMediaCredit +GDataMediaCreditClass +gdata_media_credit_get_credit +gdata_media_credit_get_scheme +gdata_media_credit_get_role + +gdata_media_credit_get_type +GDATA_MEDIA_CREDIT +GDATA_MEDIA_CREDIT_CLASS +GDATA_MEDIA_CREDIT_GET_CLASS +GDATA_IS_MEDIA_CREDIT +GDATA_IS_MEDIA_CREDIT_CLASS +GDATA_TYPE_MEDIA_CREDIT + +GDataMediaCreditPrivate +
+ +
+gdata-youtube-credit +GDataYouTubeCredit +GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER +GDataYouTubeCredit +GDataYouTubeCreditClass +gdata_youtube_credit_get_entity_type + +gdata_youtube_credit_get_type +GDATA_YOUTUBE_CREDIT +GDATA_YOUTUBE_CREDIT_CLASS +GDATA_YOUTUBE_CREDIT_GET_CLASS +GDATA_IS_YOUTUBE_CREDIT +GDATA_IS_YOUTUBE_CREDIT_CLASS +GDATA_TYPE_YOUTUBE_CREDIT + +GDataYouTubeCreditPrivate +
+ +
+gdata-media-content +GDataMediaContent +GDataMediaContent +GDataMediaContentClass +GDataMediaMedium +GDataMediaExpression +gdata_media_content_get_uri +gdata_media_content_get_filesize +gdata_media_content_get_content_type +gdata_media_content_get_medium +gdata_media_content_is_default +gdata_media_content_get_expression +gdata_media_content_get_duration +gdata_media_content_get_height +gdata_media_content_get_width +gdata_media_content_download + +gdata_media_content_get_type +GDATA_MEDIA_CONTENT +GDATA_MEDIA_CONTENT_CLASS +GDATA_MEDIA_CONTENT_GET_CLASS +GDATA_IS_MEDIA_CONTENT +GDATA_IS_MEDIA_CONTENT_CLASS +GDATA_TYPE_MEDIA_CONTENT + +GDataMediaContentPrivate +
+ +
+gdata-youtube-content +GDataYouTubeContent +GDataYouTubeContent +GDataYouTubeContentClass +gdata_youtube_content_get_format + +gdata_youtube_content_get_type +GDATA_YOUTUBE_CONTENT +GDATA_YOUTUBE_CONTENT_CLASS +GDATA_YOUTUBE_CONTENT_GET_CLASS +GDATA_IS_YOUTUBE_CONTENT +GDATA_IS_YOUTUBE_CONTENT_CLASS +GDATA_TYPE_YOUTUBE_CONTENT + +GDataYouTubeContentPrivate +
+ +
+gdata-media-thumbnail +GDataMediaThumbnail +GDataMediaThumbnail +GDataMediaThumbnailClass +gdata_media_thumbnail_get_uri +gdata_media_thumbnail_get_height +gdata_media_thumbnail_get_width +gdata_media_thumbnail_get_time +gdata_media_thumbnail_download + +gdata_media_thumbnail_get_type +GDATA_MEDIA_THUMBNAIL +GDATA_MEDIA_THUMBNAIL_CLASS +GDATA_MEDIA_THUMBNAIL_GET_CLASS +GDATA_IS_MEDIA_THUMBNAIL +GDATA_IS_MEDIA_THUMBNAIL_CLASS +GDATA_TYPE_MEDIA_THUMBNAIL + +GDataMediaThumbnailPrivate +
+ +
+gdata-youtube-state +GDataYouTubeState +GDataYouTubeState +GDataYouTubeStateClass +gdata_youtube_state_get_name +gdata_youtube_state_get_reason_code +gdata_youtube_state_get_help_uri +gdata_youtube_state_get_message + +gdata_youtube_state_get_type +GDATA_YOUTUBE_STATE +GDATA_YOUTUBE_STATE_CLASS +GDATA_YOUTUBE_STATE_GET_CLASS +GDATA_IS_YOUTUBE_STATE +GDATA_IS_YOUTUBE_STATE_CLASS +GDATA_TYPE_YOUTUBE_STATE + +GDataYouTubeStatePrivate +
+ +
+gdata-picasaweb-service +GDataPicasaWebService +GDataPicasaWebService +GDataPicasaWebServiceClass +gdata_picasaweb_service_new +gdata_picasaweb_service_get_primary_authorization_domain +gdata_picasaweb_service_get_user +gdata_picasaweb_service_get_user_async +gdata_picasaweb_service_get_user_finish +gdata_picasaweb_service_query_all_albums +gdata_picasaweb_service_query_all_albums_async +gdata_picasaweb_service_query_files +gdata_picasaweb_service_query_files_async +gdata_picasaweb_service_upload_file +gdata_picasaweb_service_finish_file_upload +gdata_picasaweb_service_insert_album +gdata_picasaweb_service_insert_album_async + +gdata_picasaweb_service_get_type +GDATA_IS_PICASAWEB_SERVICE +GDATA_IS_PICASAWEB_SERVICE_CLASS +GDATA_PICASAWEB_SERVICE +GDATA_PICASAWEB_SERVICE_CLASS +GDATA_PICASAWEB_SERVICE_GET_CLASS +GDATA_TYPE_PICASAWEB_SERVICE +
+ +
+gdata-picasaweb-feed +GDataPicasaWebFeed +GDataPicasaWebFeed +GDataPicasaWebFeedClass + +gdata_picasaweb_feed_get_type +GDATA_PICASAWEB_FEED +GDATA_PICASAWEB_FEED_CLASS +GDATA_PICASAWEB_FEED_GET_CLASS +GDATA_IS_PICASAWEB_FEED +GDATA_IS_PICASAWEB_FEED_CLASS +GDATA_TYPE_PICASAWEB_FEED +
+ +
+gdata-picasaweb-user +GDataPicasaWebUser +GDataPicasaWebUser +GDataPicasaWebUserClass +gdata_picasaweb_user_get_user +gdata_picasaweb_user_get_nickname +gdata_picasaweb_user_get_quota_limit +gdata_picasaweb_user_get_quota_current +gdata_picasaweb_user_get_max_photos_per_album +gdata_picasaweb_user_get_thumbnail_uri + +gdata_picasaweb_user_get_type +GDATA_PICASAWEB_USER +GDATA_PICASAWEB_USER_CLASS +GDATA_PICASAWEB_USER_GET_CLASS +GDATA_IS_PICASAWEB_USER +GDATA_IS_PICASAWEB_USER_CLASS +GDATA_TYPE_PICASAWEB_USER + +GDataPicasaWebUserPrivate +
+ +
+gdata-picasaweb-query +GDataPicasaWebQuery +GDataPicasaWebQuery +GDataPicasaWebQueryClass +gdata_picasaweb_query_new +gdata_picasaweb_query_new_with_limits +gdata_picasaweb_query_get_visibility +gdata_picasaweb_query_set_visibility +gdata_picasaweb_query_get_thumbnail_size +gdata_picasaweb_query_set_thumbnail_size +gdata_picasaweb_query_get_image_size +gdata_picasaweb_query_set_image_size +gdata_picasaweb_query_get_tag +gdata_picasaweb_query_set_tag +gdata_picasaweb_query_get_bounding_box +gdata_picasaweb_query_set_bounding_box +gdata_picasaweb_query_get_location +gdata_picasaweb_query_set_location + +gdata_picasaweb_query_get_type +GDATA_IS_PICASAWEB_QUERY +GDATA_IS_PICASAWEB_QUERY_CLASS +GDATA_PICASAWEB_QUERY +GDATA_PICASAWEB_QUERY_CLASS +GDATA_PICASAWEB_QUERY_GET_CLASS +GDATA_TYPE_PICASAWEB_QUERY + +GDataPicasaWebQueryPrivate +
+ +
+gdata-picasaweb-album +GDataPicasaWebAlbum +GDataPicasaWebAlbum +GDataPicasaWebAlbumClass +GDataPicasaWebVisibility +gdata_picasaweb_album_new +gdata_picasaweb_album_get_id +gdata_picasaweb_album_get_user +gdata_picasaweb_album_get_nickname +gdata_picasaweb_album_get_edited +gdata_picasaweb_album_get_location +gdata_picasaweb_album_set_location +gdata_picasaweb_album_get_visibility +gdata_picasaweb_album_set_visibility +gdata_picasaweb_album_get_timestamp +gdata_picasaweb_album_set_timestamp +gdata_picasaweb_album_get_num_photos +gdata_picasaweb_album_get_num_photos_remaining +gdata_picasaweb_album_get_bytes_used +gdata_picasaweb_album_is_commenting_enabled +gdata_picasaweb_album_set_is_commenting_enabled +gdata_picasaweb_album_get_comment_count +gdata_picasaweb_album_get_tags +gdata_picasaweb_album_set_tags +gdata_picasaweb_album_get_contents +gdata_picasaweb_album_get_thumbnails +gdata_picasaweb_album_get_coordinates +gdata_picasaweb_album_set_coordinates + +gdata_picasaweb_album_get_type +GDATA_IS_PICASAWEB_ALBUM +GDATA_IS_PICASAWEB_ALBUM_CLASS +GDATA_PICASAWEB_ALBUM +GDATA_PICASAWEB_ALBUM_CLASS +GDATA_PICASAWEB_ALBUM_GET_CLASS +GDATA_TYPE_PICASAWEB_ALBUM + +GDataPicasaWebAlbumPrivate +
+ +
+gdata-picasaweb-file +GDataPicasaWebFile +GDATA_PICASAWEB_VIDEO_STATUS_PENDING +GDATA_PICASAWEB_VIDEO_STATUS_READY +GDATA_PICASAWEB_VIDEO_STATUS_FINAL +GDATA_PICASAWEB_VIDEO_STATUS_FAILED +GDataPicasaWebFile +GDataPicasaWebFileClass +gdata_picasaweb_file_new +gdata_picasaweb_file_get_id +gdata_picasaweb_file_get_edited +gdata_picasaweb_file_get_version +gdata_picasaweb_file_get_album_id +gdata_picasaweb_file_set_album_id +gdata_picasaweb_file_get_width +gdata_picasaweb_file_get_height +gdata_picasaweb_file_get_size +gdata_picasaweb_file_get_checksum +gdata_picasaweb_file_set_checksum +gdata_picasaweb_file_get_timestamp +gdata_picasaweb_file_set_timestamp +gdata_picasaweb_file_is_commenting_enabled +gdata_picasaweb_file_set_is_commenting_enabled +gdata_picasaweb_file_get_comment_count +gdata_picasaweb_file_get_rotation +gdata_picasaweb_file_set_rotation +gdata_picasaweb_file_get_video_status +gdata_picasaweb_file_get_tags +gdata_picasaweb_file_set_tags +gdata_picasaweb_file_get_credit +gdata_picasaweb_file_get_caption +gdata_picasaweb_file_set_caption +gdata_picasaweb_file_get_contents +gdata_picasaweb_file_get_thumbnails +gdata_picasaweb_file_get_distance +gdata_picasaweb_file_get_exposure +gdata_picasaweb_file_get_flash +gdata_picasaweb_file_get_focal_length +gdata_picasaweb_file_get_fstop +gdata_picasaweb_file_get_image_unique_id +gdata_picasaweb_file_get_iso +gdata_picasaweb_file_get_make +gdata_picasaweb_file_get_model +gdata_picasaweb_file_get_coordinates +gdata_picasaweb_file_set_coordinates + +gdata_picasaweb_file_get_type +GDATA_IS_PICASAWEB_FILE +GDATA_IS_PICASAWEB_FILE_CLASS +GDATA_PICASAWEB_FILE +GDATA_PICASAWEB_FILE_CLASS +GDATA_PICASAWEB_FILE_GET_CLASS +GDATA_TYPE_PICASAWEB_FILE + +GDataPicasaWebFilePrivate +
+ +
+gdata-documents-entry +GDataDocumentsEntry +GDATA_DOCUMENTS_ACCESS_ROLE_OWNER +GDATA_DOCUMENTS_ACCESS_ROLE_WRITER +GDATA_DOCUMENTS_ACCESS_ROLE_READER +GDataDocumentsEntry +GDataDocumentsEntryClass +gdata_documents_entry_get_path +gdata_documents_entry_get_resource_id +gdata_documents_entry_get_document_id +gdata_documents_entry_get_edited +gdata_documents_entry_get_last_modified_by +gdata_documents_entry_get_last_viewed +gdata_documents_entry_get_quota_used +gdata_documents_entry_get_file_size +gdata_documents_entry_writers_can_invite +gdata_documents_entry_set_writers_can_invite +gdata_documents_entry_is_deleted + +gdata_documents_entry_get_type +GDATA_DOCUMENTS_ENTRY +GDATA_DOCUMENTS_ENTRY_CLASS +GDATA_DOCUMENTS_ENTRY_GET_CLASS +GDATA_IS_DOCUMENTS_ENTRY +GDATA_IS_DOCUMENTS_ENTRY_CLASS +GDATA_TYPE_DOCUMENTS_ENTRY + +GDataDocumentsEntryPrivate +
+ +
+gdata-documents-feed +GDataDocumentsFeed +GDataDocumentsFeed +GDataDocumentsFeedClass + +gdata_documents_feed_get_type +GDATA_DOCUMENTS_FEED +GDATA_DOCUMENTS_FEED_CLASS +GDATA_DOCUMENTS_FEED_GET_CLASS +GDATA_IS_DOCUMENTS_FEED +GDATA_IS_DOCUMENTS_FEED_CLASS +GDATA_TYPE_DOCUMENTS_FEED + +GDataDocumentsFeedPrivate +
+ +
+gdata-documents-folder +GDataDocumentsFolder +GDataDocumentsFolder +GDataDocumentsFolderClass +gdata_documents_folder_new + +gdata_documents_folder_get_type +GDATA_DOCUMENTS_FOLDER +GDATA_DOCUMENTS_FOLDER_CLASS +GDATA_DOCUMENTS_FOLDER_GET_CLASS +GDATA_IS_DOCUMENTS_FOLDER +GDATA_IS_DOCUMENTS_FOLDER_CLASS +GDATA_TYPE_DOCUMENTS_FOLDER + +GDataDocumentsFolderPrivate +
+ +
+gdata-documents-document +GDataDocumentsDocument +GDataDocumentsDocument +GDataDocumentsDocumentClass +gdata_documents_document_new +gdata_documents_document_download +gdata_documents_document_get_download_uri +gdata_documents_document_get_thumbnail_uri + +gdata_documents_document_get_type +GDATA_DOCUMENTS_DOCUMENT +GDATA_DOCUMENTS_DOCUMENT_CLASS +GDATA_DOCUMENTS_DOCUMENT_GET_CLASS +GDATA_IS_DOCUMENTS_DOCUMENT +GDATA_IS_DOCUMENTS_DOCUMENT_CLASS +GDATA_TYPE_DOCUMENTS_DOCUMENT + +GDataDocumentsDocumentPrivate +
+ +
+gdata-documents-presentation +GDataDocumentsPresentation +GDATA_DOCUMENTS_PRESENTATION_PDF +GDATA_DOCUMENTS_PRESENTATION_PNG +GDATA_DOCUMENTS_PRESENTATION_PPT +GDATA_DOCUMENTS_PRESENTATION_SWF +GDATA_DOCUMENTS_PRESENTATION_TXT +GDataDocumentsPresentation +GDataDocumentsPresentationClass +gdata_documents_presentation_new + +gdata_documents_presentation_get_type +GDATA_DOCUMENTS_PRESENTATION +GDATA_DOCUMENTS_PRESENTATION_CLASS +GDATA_DOCUMENTS_PRESENTATION_GET_CLASS +GDATA_IS_DOCUMENTS_PRESENTATION +GDATA_IS_DOCUMENTS_PRESENTATION_CLASS +GDATA_TYPE_DOCUMENTS_PRESENTATION + +GDataDocumentsPresentationPrivate +
+ +
+gdata-documents-query +GDataDocumentsQuery +GDataDocumentsQuery +GDataDocumentsQueryClass +gdata_documents_query_new +gdata_documents_query_new_with_limits +gdata_documents_query_show_deleted +gdata_documents_query_set_show_deleted +gdata_documents_query_show_folders +gdata_documents_query_set_show_folders +gdata_documents_query_get_folder_id +gdata_documents_query_set_folder_id +gdata_documents_query_get_title +gdata_documents_query_get_exact_title +gdata_documents_query_set_title +gdata_documents_query_get_collaborator_addresses +gdata_documents_query_add_collaborator +gdata_documents_query_get_reader_addresses +gdata_documents_query_add_reader + +gdata_documents_query_get_type +GDATA_DOCUMENTS_QUERY +GDATA_DOCUMENTS_QUERY_CLASS +GDATA_DOCUMENTS_QUERY_GET_CLASS +GDATA_IS_DOCUMENTS_QUERY +GDATA_IS_DOCUMENTS_QUERY_CLASS +GDATA_TYPE_DOCUMENTS_QUERY + +GDataDocumentsQueryPrivate +
+ +
+gdata-documents-spreadsheet +GDataDocumentsSpreadsheet +GDATA_DOCUMENTS_SPREADSHEET_CSV +GDATA_DOCUMENTS_SPREADSHEET_HTML +GDATA_DOCUMENTS_SPREADSHEET_ODS +GDATA_DOCUMENTS_SPREADSHEET_PDF +GDATA_DOCUMENTS_SPREADSHEET_TSV +GDATA_DOCUMENTS_SPREADSHEET_XLS +GDataDocumentsSpreadsheet +GDataDocumentsSpreadsheetClass +gdata_documents_spreadsheet_new +gdata_documents_spreadsheet_get_download_uri + +gdata_documents_spreadsheet_get_type +GDATA_DOCUMENTS_SPREADSHEET +GDATA_DOCUMENTS_SPREADSHEET_CLASS +GDATA_DOCUMENTS_SPREADSHEET_GET_CLASS +GDATA_IS_DOCUMENTS_SPREADSHEET +GDATA_IS_DOCUMENTS_SPREADSHEET_CLASS +GDATA_TYPE_DOCUMENTS_SPREADSHEET + +GDataDocumentsSpreadsheetPrivate +
+ +
+gdata-documents-text +GDataDocumentsText +GDATA_DOCUMENTS_TEXT_DOC +GDATA_DOCUMENTS_TEXT_HTML +GDATA_DOCUMENTS_TEXT_JPEG +GDATA_DOCUMENTS_TEXT_ODT +GDATA_DOCUMENTS_TEXT_PDF +GDATA_DOCUMENTS_TEXT_PNG +GDATA_DOCUMENTS_TEXT_RTF +GDATA_DOCUMENTS_TEXT_TXT +GDATA_DOCUMENTS_TEXT_ZIP +GDataDocumentsText +GDataDocumentsTextClass +gdata_documents_text_new + +gdata_documents_text_get_type +GDATA_DOCUMENTS_TEXT +GDATA_DOCUMENTS_TEXT_CLASS +GDATA_DOCUMENTS_TEXT_GET_CLASS +GDATA_IS_DOCUMENTS_TEXT +GDATA_IS_DOCUMENTS_TEXT_CLASS +GDATA_TYPE_DOCUMENTS_TEXT + +GDataDocumentsTextPrivate +
+ +
+gdata-documents-drawing +GDataDocumentsDrawing +GDATA_DOCUMENTS_DRAWING_JPEG +GDATA_DOCUMENTS_DRAWING_PDF +GDATA_DOCUMENTS_DRAWING_PNG +GDATA_DOCUMENTS_DRAWING_SVG +GDataDocumentsDrawing +GDataDocumentsDrawingClass +gdata_documents_drawing_new + +gdata_documents_drawing_get_type +GDATA_DOCUMENTS_DRAWING +GDATA_DOCUMENTS_DRAWING_CLASS +GDATA_DOCUMENTS_DRAWING_GET_CLASS +GDATA_IS_DOCUMENTS_DRAWING +GDATA_IS_DOCUMENTS_DRAWING_CLASS +GDATA_TYPE_DOCUMENTS_DRAWING + +GDataDocumentsDrawingPrivate +
+ +
+gdata-documents-pdf +GDataDocumentsPdf +GDataDocumentsPdf +GDataDocumentsPdfClass +gdata_documents_pdf_new + +gdata_documents_pdf_get_type +GDATA_DOCUMENTS_PDF +GDATA_DOCUMENTS_PDF_CLASS +GDATA_DOCUMENTS_PDF_GET_CLASS +GDATA_IS_DOCUMENTS_PDF +GDATA_IS_DOCUMENTS_PDF_CLASS +GDATA_TYPE_DOCUMENTS_PDF + +GDataDocumentsPdfPrivate +
+ +
+gdata-documents-service +GDataDocumentsService +GDataDocumentsService +GDataDocumentsServiceClass +GDataDocumentsServiceError +gdata_documents_service_new +gdata_documents_service_get_primary_authorization_domain +gdata_documents_service_get_spreadsheet_authorization_domain +gdata_documents_service_get_metadata +gdata_documents_service_get_metadata_async +gdata_documents_service_get_metadata_finish +gdata_documents_service_query_documents +gdata_documents_service_query_documents_async +gdata_documents_service_upload_document +gdata_documents_service_upload_document_resumable +gdata_documents_service_update_document +gdata_documents_service_update_document_resumable +gdata_documents_service_finish_upload +gdata_documents_service_copy_document +gdata_documents_service_copy_document_async +gdata_documents_service_copy_document_finish +gdata_documents_service_add_entry_to_folder +gdata_documents_service_add_entry_to_folder_async +gdata_documents_service_add_entry_to_folder_finish +gdata_documents_service_remove_entry_from_folder +gdata_documents_service_remove_entry_from_folder_async +gdata_documents_service_remove_entry_from_folder_finish +gdata_documents_service_get_upload_uri + +gdata_documents_service_get_type +GDATA_DOCUMENTS_SERVICE +GDATA_DOCUMENTS_SERVICE_CLASS +GDATA_DOCUMENTS_SERVICE_ERROR +GDATA_DOCUMENTS_SERVICE_GET_CLASS +GDATA_IS_DOCUMENTS_SERVICE +GDATA_IS_DOCUMENTS_SERVICE_CLASS +GDATA_TYPE_DOCUMENTS_SERVICE +gdata_documents_service_error_quark + +GDataDocumentsServicePrivate +
+ +
+gdata-documents-metadata +GDataDocumentsMetadata +GDataDocumentsMetadata +GDataDocumentsMetadataClass +gdata_documents_metadata_get_quota_total +gdata_documents_metadata_get_quota_used + +gdata_documents_metadata_get_type +GDATA_DOCUMENTS_METADATA +GDATA_DOCUMENTS_METADATA_CLASS +GDATA_DOCUMENTS_METADATA_GET_CLASS +GDATA_IS_DOCUMENTS_METADATA +GDATA_IS_DOCUMENTS_METADATA_CLASS +GDATA_TYPE_DOCUMENTS_METADATA + +GDataDocumentsMetadataPrivate +
+ +
+gdata-download-stream +GDataDownloadStream +GDataDownloadStream +GDataDownloadStreamClass +gdata_download_stream_new +gdata_download_stream_get_service +gdata_download_stream_get_authorization_domain +gdata_download_stream_get_cancellable +gdata_download_stream_get_download_uri +gdata_download_stream_get_content_type +gdata_download_stream_get_content_length + +GDATA_DOWNLOAD_STREAM +GDATA_DOWNLOAD_STREAM_CLASS +GDATA_DOWNLOAD_STREAM_GET_CLASS +GDATA_IS_DOWNLOAD_STREAM +GDATA_IS_DOWNLOAD_STREAM_CLASS +GDATA_TYPE_DOWNLOAD_STREAM +gdata_download_stream_get_type + +GDataDownloadStreamPrivate +
+ +
+gdata-upload-stream +GDataUploadStream +GDATA_LINK_RESUMABLE_CREATE_MEDIA +GDATA_LINK_RESUMABLE_EDIT_MEDIA +GDataUploadStream +GDataUploadStreamClass +gdata_upload_stream_new +gdata_upload_stream_new_resumable +gdata_upload_stream_get_response +gdata_upload_stream_get_service +gdata_upload_stream_get_authorization_domain +gdata_upload_stream_get_cancellable +gdata_upload_stream_get_method +gdata_upload_stream_get_upload_uri +gdata_upload_stream_get_entry +gdata_upload_stream_get_slug +gdata_upload_stream_get_content_type +gdata_upload_stream_get_content_length + +gdata_upload_stream_get_type +GDATA_UPLOAD_STREAM +GDATA_UPLOAD_STREAM_CLASS +GDATA_UPLOAD_STREAM_GET_CLASS +GDATA_IS_UPLOAD_STREAM +GDATA_IS_UPLOAD_STREAM_CLASS +GDATA_TYPE_UPLOAD_STREAM + +GDataUploadStreamPrivate +
+ +
+gdata-gd-name +GDataGDName +GDataGDName +GDataGDNameClass +gdata_gd_name_new +gdata_gd_name_get_given_name +gdata_gd_name_set_given_name +gdata_gd_name_get_additional_name +gdata_gd_name_set_additional_name +gdata_gd_name_get_family_name +gdata_gd_name_set_family_name +gdata_gd_name_get_prefix +gdata_gd_name_set_prefix +gdata_gd_name_get_suffix +gdata_gd_name_set_suffix +gdata_gd_name_get_full_name +gdata_gd_name_set_full_name + +gdata_gd_name_get_type +GDATA_GD_NAME +GDATA_GD_NAME_CLASS +GDATA_GD_NAME_GET_CLASS +GDATA_IS_GD_NAME +GDATA_IS_GD_NAME_CLASS +GDATA_TYPE_GD_NAME + +GDataGDNamePrivate +
+ +
+gdata-gcontact-jot +GDataGContactJot +GDATA_GCONTACT_JOT_HOME +GDATA_GCONTACT_JOT_KEYWORDS +GDATA_GCONTACT_JOT_OTHER +GDATA_GCONTACT_JOT_USER +GDATA_GCONTACT_JOT_WORK +GDataGContactJot +GDataGContactJotClass +gdata_gcontact_jot_new +gdata_gcontact_jot_get_content +gdata_gcontact_jot_set_content +gdata_gcontact_jot_get_relation_type +gdata_gcontact_jot_set_relation_type + +gdata_gcontact_jot_get_type +GDATA_GCONTACT_JOT +GDATA_GCONTACT_JOT_CLASS +GDATA_GCONTACT_JOT_GET_CLASS +GDATA_IS_GCONTACT_JOT +GDATA_IS_GCONTACT_JOT_CLASS +GDATA_TYPE_GCONTACT_JOT + +GDataGContactJotPrivate +
+ +
+gdata-gcontact-relation +GDataGContactRelation +GDATA_GCONTACT_RELATION_ASSISTANT +GDATA_GCONTACT_RELATION_BROTHER +GDATA_GCONTACT_RELATION_CHILD +GDATA_GCONTACT_RELATION_DOMESTIC_PARTNER +GDATA_GCONTACT_RELATION_FATHER +GDATA_GCONTACT_RELATION_FRIEND +GDATA_GCONTACT_RELATION_MANAGER +GDATA_GCONTACT_RELATION_MOTHER +GDATA_GCONTACT_RELATION_PARENT +GDATA_GCONTACT_RELATION_PARTNER +GDATA_GCONTACT_RELATION_REFERRER +GDATA_GCONTACT_RELATION_RELATIVE +GDATA_GCONTACT_RELATION_SISTER +GDATA_GCONTACT_RELATION_SPOUSE +GDataGContactRelation +GDataGContactRelationClass +gdata_gcontact_relation_new +gdata_gcontact_relation_get_name +gdata_gcontact_relation_set_name +gdata_gcontact_relation_get_relation_type +gdata_gcontact_relation_set_relation_type +gdata_gcontact_relation_get_label +gdata_gcontact_relation_set_label + +gdata_gcontact_relation_get_type +GDATA_GCONTACT_RELATION +GDATA_GCONTACT_RELATION_CLASS +GDATA_GCONTACT_RELATION_GET_CLASS +GDATA_IS_GCONTACT_RELATION +GDATA_IS_GCONTACT_RELATION_CLASS +GDATA_TYPE_GCONTACT_RELATION + +GDataGContactRelationPrivate +
+ +
+gdata-gcontact-website +GDataGContactWebsite +GDATA_GCONTACT_WEBSITE_HOME_PAGE +GDATA_GCONTACT_WEBSITE_BLOG +GDATA_GCONTACT_WEBSITE_PROFILE +GDATA_GCONTACT_WEBSITE_HOME +GDATA_GCONTACT_WEBSITE_WORK +GDATA_GCONTACT_WEBSITE_OTHER +GDATA_GCONTACT_WEBSITE_FTP +GDataGContactWebsite +GDataGContactWebsiteClass +gdata_gcontact_website_new +gdata_gcontact_website_get_uri +gdata_gcontact_website_set_uri +gdata_gcontact_website_get_relation_type +gdata_gcontact_website_set_relation_type +gdata_gcontact_website_get_label +gdata_gcontact_website_set_label +gdata_gcontact_website_is_primary +gdata_gcontact_website_set_is_primary + +gdata_gcontact_website_get_type +GDATA_GCONTACT_WEBSITE +GDATA_GCONTACT_WEBSITE_CLASS +GDATA_GCONTACT_WEBSITE_GET_CLASS +GDATA_IS_GCONTACT_WEBSITE +GDATA_IS_GCONTACT_WEBSITE_CLASS +GDATA_TYPE_GCONTACT_WEBSITE + +GDataGContactWebsitePrivate +
+ +
+gdata-gcontact-event +GDataGContactEvent +GDATA_GCONTACT_EVENT_ANNIVERSARY +GDATA_GCONTACT_EVENT_OTHER +GDataGContactEvent +GDataGContactEventClass +gdata_gcontact_event_new +gdata_gcontact_event_get_date +gdata_gcontact_event_set_date +gdata_gcontact_event_get_relation_type +gdata_gcontact_event_set_relation_type +gdata_gcontact_event_get_label +gdata_gcontact_event_set_label + +gdata_gcontact_event_get_type +GDATA_GCONTACT_EVENT +GDATA_GCONTACT_EVENT_CLASS +GDATA_GCONTACT_EVENT_GET_CLASS +GDATA_IS_GCONTACT_EVENT +GDATA_IS_GCONTACT_EVENT_CLASS +GDATA_TYPE_GCONTACT_EVENT + +GDataGContactEventPrivate +
+ +
+gdata-gcontact-calendar +GDataGContactCalendar +GDATA_GCONTACT_CALENDAR_HOME +GDATA_GCONTACT_CALENDAR_WORK +GDATA_GCONTACT_CALENDAR_FREE_BUSY +GDataGContactCalendar +GDataGContactCalendarClass +gdata_gcontact_calendar_new +gdata_gcontact_calendar_get_uri +gdata_gcontact_calendar_set_uri +gdata_gcontact_calendar_get_relation_type +gdata_gcontact_calendar_set_relation_type +gdata_gcontact_calendar_get_label +gdata_gcontact_calendar_set_label +gdata_gcontact_calendar_is_primary +gdata_gcontact_calendar_set_is_primary + +gdata_gcontact_calendar_get_type +GDATA_GCONTACT_CALENDAR +GDATA_GCONTACT_CALENDAR_CLASS +GDATA_GCONTACT_CALENDAR_GET_CLASS +GDATA_IS_GCONTACT_CALENDAR +GDATA_IS_GCONTACT_CALENDAR_CLASS +GDATA_TYPE_GCONTACT_CALENDAR + +GDataGContactCalendarPrivate +
+ +
+gdata-gcontact-external-id +GDataGContactExternalID +GDATA_GCONTACT_EXTERNAL_ID_ACCOUNT +GDATA_GCONTACT_EXTERNAL_ID_CUSTOMER +GDATA_GCONTACT_EXTERNAL_ID_NETWORK +GDATA_GCONTACT_EXTERNAL_ID_ORGANIZATION +GDataGContactExternalID +GDataGContactExternalIDClass +gdata_gcontact_external_id_new +gdata_gcontact_external_id_get_value +gdata_gcontact_external_id_set_value +gdata_gcontact_external_id_get_relation_type +gdata_gcontact_external_id_set_relation_type +gdata_gcontact_external_id_get_label +gdata_gcontact_external_id_set_label + +gdata_gcontact_external_id_get_type +GDATA_GCONTACT_EXTERNAL_ID +GDATA_GCONTACT_EXTERNAL_ID_CLASS +GDATA_GCONTACT_EXTERNAL_ID_GET_CLASS +GDATA_IS_GCONTACT_EXTERNAL_ID +GDATA_IS_GCONTACT_EXTERNAL_ID_CLASS +GDATA_TYPE_GCONTACT_EXTERNAL_ID + +GDataGContactExternalIDPrivate +
+ +
+gdata-gcontact-language +GDataGContactLanguage +GDataGContactLanguage +GDataGContactLanguageClass +gdata_gcontact_language_new +gdata_gcontact_language_get_code +gdata_gcontact_language_set_code +gdata_gcontact_language_get_label +gdata_gcontact_language_set_label + +gdata_gcontact_language_get_type +GDATA_GCONTACT_LANGUAGE +GDATA_GCONTACT_LANGUAGE_CLASS +GDATA_GCONTACT_LANGUAGE_GET_CLASS +GDATA_IS_GCONTACT_LANGUAGE +GDATA_IS_GCONTACT_LANGUAGE_CLASS +GDATA_TYPE_GCONTACT_LANGUAGE + +GDataGContactLanguagePrivate +
+ +
+gdata-youtube-category +GDataYouTubeCategory +GDataYouTubeCategory +GDataYouTubeCategoryClass +gdata_youtube_category_is_assignable +gdata_youtube_category_is_browsable +gdata_youtube_category_is_deprecated + +gdata_youtube_category_get_type +GDATA_YOUTUBE_CATEGORY +GDATA_YOUTUBE_CATEGORY_CLASS +GDATA_YOUTUBE_CATEGORY_GET_CLASS +GDATA_IS_YOUTUBE_CATEGORY +GDATA_IS_YOUTUBE_CATEGORY_CLASS +GDATA_TYPE_YOUTUBE_CATEGORY + +GDataYouTubeCategoryPrivate +
+ +
+gdata-app-categories +GDataAPPCategories +GDataAPPCategories +GDataAPPCategoriesClass +gdata_app_categories_get_categories +gdata_app_categories_is_fixed + +gdata_app_categories_get_type +GDATA_APP_CATEGORIES +GDATA_APP_CATEGORIES_CLASS +GDATA_APP_CATEGORIES_GET_CLASS +GDATA_IS_APP_CATEGORIES +GDATA_IS_APP_CATEGORIES_CLASS +GDATA_TYPE_APP_CATEGORIES + +GDataAPPCategoriesPrivate +
+ +
+gdata-comparable +GDataComparable +GDataComparable +GDataComparableIface +gdata_comparable_compare + +gdata_comparable_get_type +GDATA_COMPARABLE +GDATA_COMPARABLE_CLASS +GDATA_COMPARABLE_GET_IFACE +GDATA_IS_COMPARABLE +GDATA_TYPE_COMPARABLE +
+ +
+gdata-batch-operation +GDataBatchOperation +GDataBatchOperation +GDataBatchOperationClass +GDataBatchOperationType +GDataBatchOperationCallback +gdata_batch_operation_add_query +gdata_batch_operation_add_insertion +gdata_batch_operation_add_update +gdata_batch_operation_add_deletion +gdata_batch_operation_run +gdata_batch_operation_run_async +gdata_batch_operation_run_finish +gdata_batch_operation_get_service +gdata_batch_operation_get_authorization_domain +gdata_batch_operation_get_feed_uri + +GDATA_BATCH_OPERATION +GDATA_IS_BATCH_OPERATION +GDATA_TYPE_BATCH_OPERATION +gdata_batch_operation_get_type +GDATA_BATCH_OPERATION_GET_CLASS +GDATA_BATCH_OPERATION_CLASS +GDATA_IS_BATCH_OPERATION_CLASS + +GDataBatchOperationPrivate +
+ +
+gdata-batchable +GDataBatchable +GDataBatchable +GDataBatchableIface +gdata_batchable_create_operation + +gdata_batchable_get_type +GDATA_BATCHABLE +GDATA_BATCHABLE_CLASS +GDATA_BATCHABLE_GET_IFACE +GDATA_IS_BATCHABLE +GDATA_TYPE_BATCHABLE +
+ +
+gdata-contacts-group +GDataContactsGroup +GDATA_CONTACTS_GROUP_CONTACTS +GDATA_CONTACTS_GROUP_FRIENDS +GDATA_CONTACTS_GROUP_FAMILY +GDATA_CONTACTS_GROUP_COWORKERS +GDataContactsGroup +GDataContactsGroupClass +gdata_contacts_group_new +gdata_contacts_group_get_edited +gdata_contacts_group_is_deleted +gdata_contacts_group_get_system_group_id +gdata_contacts_group_get_extended_property +gdata_contacts_group_get_extended_properties +gdata_contacts_group_set_extended_property + +GDATA_CONTACTS_GROUP +GDATA_IS_CONTACTS_GROUP +GDATA_TYPE_CONTACTS_GROUP +gdata_contacts_group_get_type +GDATA_CONTACTS_GROUP_GET_CLASS +GDATA_CONTACTS_GROUP_CLASS +GDATA_IS_CONTACTS_GROUP_CLASS + +GDataContactsGroupPrivate +
+ +
+gdata-authorizer +GDataAuthorizer +GDataAuthorizer +GDataAuthorizerInterface +gdata_authorizer_process_request +gdata_authorizer_is_authorized_for_domain +gdata_authorizer_refresh_authorization +gdata_authorizer_refresh_authorization_async +gdata_authorizer_refresh_authorization_finish + +GDATA_TYPE_AUTHORIZER +GDATA_AUTHORIZER +GDATA_AUTHORIZER_CLASS +GDATA_IS_AUTHORIZER +GDATA_AUTHORIZER_GET_IFACE +gdata_authorizer_get_type +
+ +
+gdata-authorization-domain +GDataAuthorizationDomain +GDataAuthorizationDomain +GDataAuthorizationDomainClass +gdata_authorization_domain_get_service_name +gdata_authorization_domain_get_scope + +GDATA_AUTHORIZATION_DOMAIN +GDATA_IS_AUTHORIZATION_DOMAIN +GDATA_TYPE_AUTHORIZATION_DOMAIN +gdata_authorization_domain_get_type +GDATA_AUTHORIZATION_DOMAIN_GET_CLASS +GDATA_AUTHORIZATION_DOMAIN_CLASS +GDATA_IS_AUTHORIZATION_DOMAIN_CLASS + +GDataAuthorizationDomainPrivate +
+ +
+gdata-client-login-authorizer +GDataClientLoginAuthorizer +GDataClientLoginAuthorizer +GDataClientLoginAuthorizerClass +GDataClientLoginAuthorizerError +gdata_client_login_authorizer_new +gdata_client_login_authorizer_new_for_authorization_domains +gdata_client_login_authorizer_authenticate +gdata_client_login_authorizer_authenticate_async +gdata_client_login_authorizer_authenticate_finish +gdata_client_login_authorizer_get_client_id +gdata_client_login_authorizer_get_username +gdata_client_login_authorizer_get_password +gdata_client_login_authorizer_get_proxy_uri +gdata_client_login_authorizer_set_proxy_uri +gdata_client_login_authorizer_get_proxy_resolver +gdata_client_login_authorizer_set_proxy_resolver +gdata_client_login_authorizer_get_timeout +gdata_client_login_authorizer_set_timeout + +GDATA_TYPE_CLIENT_LOGIN_AUTHORIZER +GDATA_CLIENT_LOGIN_AUTHORIZER +GDATA_CLIENT_LOGIN_AUTHORIZER_CLASS +GDATA_IS_CLIENT_LOGIN_AUTHORIZER +GDATA_IS_CLIENT_LOGIN_AUTHORIZER_CLASS +GDATA_CLIENT_LOGIN_AUTHORIZER_GET_CLASS +gdata_client_login_authorizer_get_type +GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR +gdata_client_login_authorizer_error_quark + +GDataClientLoginAuthorizerPrivate +
+ +
+gdata-oauth1-authorizer +GDataOAuth1Authorizer +GDataOAuth1Authorizer +GDataOAuth1AuthorizerClass +gdata_oauth1_authorizer_new +gdata_oauth1_authorizer_new_for_authorization_domains +gdata_oauth1_authorizer_request_authentication_uri +gdata_oauth1_authorizer_request_authentication_uri_async +gdata_oauth1_authorizer_request_authentication_uri_finish +gdata_oauth1_authorizer_request_authorization +gdata_oauth1_authorizer_request_authorization_async +gdata_oauth1_authorizer_request_authorization_finish +gdata_oauth1_authorizer_get_application_name +gdata_oauth1_authorizer_get_locale +gdata_oauth1_authorizer_set_locale +gdata_oauth1_authorizer_get_proxy_uri +gdata_oauth1_authorizer_set_proxy_uri +gdata_oauth1_authorizer_get_proxy_resolver +gdata_oauth1_authorizer_set_proxy_resolver +gdata_oauth1_authorizer_get_timeout +gdata_oauth1_authorizer_set_timeout + +GDATA_TYPE_OAUTH1_AUTHORIZER +GDATA_OAUTH1_AUTHORIZER +GDATA_OAUTH1_AUTHORIZER_CLASS +GDATA_IS_OAUTH1_AUTHORIZER +GDATA_IS_OAUTH1_AUTHORIZER_CLASS +GDATA_OAUTH1_AUTHORIZER_GET_CLASS +gdata_oauth1_authorizer_get_type + +GDataOAuth1AuthorizerPrivate +
+ +
+gdata-goa-authorizer +GDataGoaAuthorizer +GDataGoaAuthorizer +GDataGoaAuthorizerClass +gdata_goa_authorizer_new +gdata_goa_authorizer_get_goa_object + +GDATA_TYPE_GOA_AUTHORIZER +GDATA_GOA_AUTHORIZER +GDATA_GOA_AUTHORIZER_CLASS +GDATA_IS_GOA_AUTHORIZER +GDATA_IS_GOA_AUTHORIZER_CLASS +GDATA_GOA_AUTHORIZER_GET_CLASS +gdata_goa_authorizer_get_type + +GDataGoaAuthorizerPrivate +GOA_API_IS_SUBJECT_TO_CHANGE +
+ +
+gdata-commentable +GDataCommentable +GDataCommentable +GDataCommentableInterface +gdata_commentable_query_comments +gdata_commentable_query_comments_async +gdata_commentable_query_comments_finish +gdata_commentable_insert_comment +gdata_commentable_insert_comment_async +gdata_commentable_insert_comment_finish +gdata_commentable_delete_comment +gdata_commentable_delete_comment_async +gdata_commentable_delete_comment_finish + +gdata_commentable_get_type +GDATA_COMMENTABLE +GDATA_COMMENTABLE_CLASS +GDATA_COMMENTABLE_GET_IFACE +GDATA_IS_COMMENTABLE +GDATA_TYPE_COMMENTABLE +
+ +
+gdata-comment +GDataComment +GDataComment +GDataCommentClass + +GDATA_TYPE_COMMENT +GDATA_COMMENT +GDATA_COMMENT_CLASS +GDATA_IS_COMMENT +GDATA_IS_COMMENT_CLASS +GDATA_COMMENT_GET_CLASS +gdata_comment_get_type + +GDataCommentPrivate +
+ +
+gdata-youtube-comment +GDataYouTubeComment +GDataYouTubeComment +GDataYouTubeCommentClass +gdata_youtube_comment_new +gdata_youtube_comment_get_parent_comment_uri +gdata_youtube_comment_set_parent_comment_uri + +GDATA_TYPE_YOUTUBE_COMMENT +GDATA_YOUTUBE_COMMENT +GDATA_YOUTUBE_COMMENT_CLASS +GDATA_IS_YOUTUBE_COMMENT +GDATA_IS_YOUTUBE_COMMENT_CLASS +GDATA_YOUTUBE_COMMENT_GET_CLASS +gdata_youtube_comment_get_type + +GDataYouTubeCommentPrivate +
+ +
+gdata-picasaweb-comment +GDataPicasaWebComment +GDataPicasaWebComment +GDataPicasaWebCommentClass +gdata_picasaweb_comment_new + +GDATA_TYPE_PICASAWEB_COMMENT +GDATA_PICASAWEB_COMMENT +GDATA_PICASAWEB_COMMENT_CLASS +GDATA_IS_PICASAWEB_COMMENT +GDATA_IS_PICASAWEB_COMMENT_CLASS +GDATA_PICASAWEB_COMMENT_GET_CLASS +gdata_picasaweb_comment_get_type + +GDataPicasaWebCommentPrivate +
+ +
+gdata-documents-upload-query +GDataDocumentsUploadQuery +GDataDocumentsUploadQuery +GDataDocumentsUploadQueryClass +gdata_documents_upload_query_new +gdata_documents_upload_query_build_uri +gdata_documents_upload_query_get_folder +gdata_documents_upload_query_set_folder +gdata_documents_upload_query_get_convert +gdata_documents_upload_query_set_convert + +gdata_documents_upload_query_get_type +GDATA_DOCUMENTS_UPLOAD_QUERY +GDATA_DOCUMENTS_UPLOAD_QUERY_CLASS +GDATA_DOCUMENTS_UPLOAD_QUERY_GET_CLASS +GDATA_IS_DOCUMENTS_UPLOAD_QUERY +GDATA_IS_DOCUMENTS_UPLOAD_QUERY_CLASS +GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY + +GDataDocumentsUploadQueryPrivate +
+ +
+gdata-tasks-service +GDataTasksService +GDataTasksService +GDataTasksServiceClass +gdata_tasks_service_new +gdata_tasks_service_get_primary_authorization_domain +gdata_tasks_service_query_all_tasklists +gdata_tasks_service_query_all_tasklists_async +gdata_tasks_service_query_tasks +gdata_tasks_service_query_tasks_async +gdata_tasks_service_insert_task +gdata_tasks_service_insert_task_async +gdata_tasks_service_insert_tasklist +gdata_tasks_service_insert_tasklist_async +gdata_tasks_service_delete_task +gdata_tasks_service_delete_task_async +gdata_tasks_service_delete_tasklist +gdata_tasks_service_delete_tasklist_async +gdata_tasks_service_update_task +gdata_tasks_service_update_task_async +gdata_tasks_service_update_tasklist +gdata_tasks_service_update_tasklist_async + +gdata_tasks_service_get_type +GDATA_TASKS_SERVICE +GDATA_TASKS_SERVICE_CLASS +GDATA_TASKS_SERVICE_GET_CLASS +GDATA_IS_TASKS_SERVICE +GDATA_IS_TASKS_SERVICE_CLASS +GDATA_TYPE_TASKS_SERVICE + +GDataTasksServicePrivate +
+ +
+gdata-tasks-query +GDataTasksQuery +GDataTasksQuery +GDataTasksQueryClass +gdata_tasks_query_new +gdata_tasks_query_get_completed_max +gdata_tasks_query_set_completed_max +gdata_tasks_query_get_completed_min +gdata_tasks_query_set_completed_min +gdata_tasks_query_get_due_max +gdata_tasks_query_set_due_max +gdata_tasks_query_get_due_min +gdata_tasks_query_set_due_min +gdata_tasks_query_get_show_completed +gdata_tasks_query_set_show_completed +gdata_tasks_query_get_show_deleted +gdata_tasks_query_set_show_deleted +gdata_tasks_query_get_show_hidden +gdata_tasks_query_set_show_hidden + +gdata_tasks_query_get_type +GDATA_TASKS_QUERY +GDATA_TASKS_QUERY_CLASS +GDATA_TASKS_QUERY_GET_CLASS +GDATA_IS_TASKS_QUERY +GDATA_IS_TASKS_QUERY_CLASS +GDATA_TYPE_TASKS_QUERY + +GDataTasksQueryPrivate +
+ +
+gdata-tasks-task +GDataTasksTask +GDATA_TASKS_STATUS_NEEDS_ACTION +GDATA_TASKS_STATUS_COMPLETED +GDataTasksTask +GDataTasksTaskClass +gdata_tasks_task_new +gdata_tasks_task_get_parent +gdata_tasks_task_get_position +gdata_tasks_task_get_notes +gdata_tasks_task_set_notes +gdata_tasks_task_get_status +gdata_tasks_task_set_status +gdata_tasks_task_get_due +gdata_tasks_task_set_due +gdata_tasks_task_get_completed +gdata_tasks_task_set_completed +gdata_tasks_task_is_deleted +gdata_tasks_task_set_is_deleted +gdata_tasks_task_is_hidden + +gdata_tasks_task_get_type +GDATA_TASKS_TASK +GDATA_TASKS_TASK_CLASS +GDATA_TASKS_TASK_GET_CLASS +GDATA_IS_TASKS_TASK +GDATA_IS_TASKS_TASK_CLASS +GDATA_TYPE_TASKS_TASK + +GDataTasksTaskPrivate +
+ +
+gdata-tasks-tasklist +GDataTasksTasklist +GDataTasksTasklist +GDataTasksTasklistClass +gdata_tasks_tasklist_new + +gdata_tasks_tasklist_get_type +GDATA_TASKS_TASKLIST +GDATA_TASKS_TASKLIST_CLASS +GDATA_TASKS_TASKLIST_GET_CLASS +GDATA_IS_TASKS_TASKLIST +GDATA_IS_TASKS_TASKLIST_CLASS +GDATA_TYPE_TASKS_TASKLIST +
+ +
+gdata-freebase-service +GDataFreebaseService +GDataFreebaseService +GDataFreebaseServiceClass +gdata_freebase_service_new +gdata_freebase_service_get_primary_authorization_domain +gdata_freebase_service_query +gdata_freebase_service_query_async +gdata_freebase_service_get_topic +gdata_freebase_service_get_topic_async +gdata_freebase_service_search +gdata_freebase_service_search_async +gdata_freebase_service_get_image + +gdata_freebase_service_get_type +GDATA_FREEBASE_SERVICE +GDATA_FREEBASE_SERVICE_CLASS +GDATA_FREEBASE_SERVICE_GET_CLASS +GDATA_IS_FREEBASE_SERVICE +GDATA_IS_FREEBASE_SERVICE_CLASS +GDATA_TYPE_FREEBASE_SERVICE + +GDataFreebaseServicePrivate +
+ +
+gdata-freebase-query +GDataFreebaseQuery +GDataFreebaseQuery +GDataFreebaseQueryClass +gdata_freebase_query_new +gdata_freebase_query_new_from_variant + +gdata_freebase_query_get_type +GDATA_FREEBASE_QUERY +GDATA_FREEBASE_QUERY_CLASS +GDATA_FREEBASE_QUERY_GET_CLASS +GDATA_IS_FREEBASE_QUERY +GDATA_IS_FREEBASE_QUERY_CLASS +GDATA_TYPE_FREEBASE_QUERY + +GDataFreebaseQueryPrivate +
+ +
+gdata-freebase-result +GDataFreebaseResult +GDataFreebaseResult +GDataFreebaseResultClass +gdata_freebase_result_new +gdata_freebase_result_dup_variant + +gdata_freebase_result_get_type +GDATA_FREEBASE_RESULT +GDATA_FREEBASE_RESULT_CLASS +GDATA_FREEBASE_RESULT_GET_CLASS +GDATA_IS_FREEBASE_RESULT +GDATA_IS_FREEBASE_RESULT_CLASS +GDATA_TYPE_FREEBASE_RESULT + +GDataFreebaseResultPrivate +
+ +
+gdata-freebase-topic-query +GDataFreebaseTopicQuery +GDataFreebaseTopicQuery +GDataFreebaseTopicQueryClass +gdata_freebase_topic_query_new +gdata_freebase_topic_query_set_filter +gdata_freebase_topic_query_get_filter +gdata_freebase_topic_query_set_language +gdata_freebase_topic_query_get_language + +gdata_freebase_topic_query_get_type +GDATA_FREEBASE_TOPIC_QUERY +GDATA_FREEBASE_TOPIC_QUERY_CLASS +GDATA_FREEBASE_TOPIC_QUERY_GET_CLASS +GDATA_IS_FREEBASE_TOPIC_QUERY +GDATA_IS_FREEBASE_TOPIC_QUERY_CLASS +GDATA_TYPE_FREEBASE_TOPIC_QUERY + +GDataFreebaseTopicQueryPrivate +
+ +
+gdata-freebase-topic-result +GDataFreebaseTopicResult +GDataFreebaseTopicResult +GDataFreebaseTopicResultClass +gdata_freebase_topic_result_new +gdata_freebase_topic_result_dup_object +GDataFreebaseTopicObject +gdata_freebase_topic_object_ref +gdata_freebase_topic_object_unref +gdata_freebase_topic_object_list_properties +gdata_freebase_topic_object_get_id +gdata_freebase_topic_object_get_property_count +gdata_freebase_topic_object_get_property_hits +gdata_freebase_topic_object_get_property_value +GDataFreebaseTopicValue +gdata_freebase_topic_value_ref +gdata_freebase_topic_value_unref +gdata_freebase_topic_value_get_property +gdata_freebase_topic_value_get_text +gdata_freebase_topic_value_get_language +gdata_freebase_topic_value_get_creator +gdata_freebase_topic_value_get_timestamp +gdata_freebase_topic_value_get_value_type +gdata_freebase_topic_value_copy_value +gdata_freebase_topic_value_get_int +gdata_freebase_topic_value_get_double +gdata_freebase_topic_value_get_string +gdata_freebase_topic_value_get_object +gdata_freebase_topic_value_is_image + +gdata_freebase_topic_result_get_type +gdata_freebase_topic_object_get_type +gdata_freebase_topic_value_get_type +GDATA_FREEBASE_TOPIC_RESULT +GDATA_FREEBASE_TOPIC_RESULT_CLASS +GDATA_FREEBASE_TOPIC_RESULT_GET_CLASS +GDATA_IS_FREEBASE_TOPIC_RESULT +GDATA_IS_FREEBASE_TOPIC_RESULT_CLASS +GDATA_TYPE_FREEBASE_TOPIC_RESULT +GDATA_TYPE_FREEBASE_TOPIC_OBJECT +GDATA_TYPE_FREEBASE_TOPIC_VALUE + +GDataFreebaseTopicResultPrivate +
+ +
+gdata-freebase-search-query +GDataFreebaseSearchQuery +GDataFreebaseSearchQuery +GDataFreebaseSearchQueryClass +gdata_freebase_search_query_new +gdata_freebase_search_query_set_language +gdata_freebase_search_query_get_language +gdata_freebase_search_query_set_stemmed +gdata_freebase_search_query_get_stemmed +GDataFreebaseSearchFilterType +gdata_freebase_search_query_open_filter +gdata_freebase_search_query_close_filter +gdata_freebase_search_query_add_filter +gdata_freebase_search_query_add_location + +gdata_freebase_search_query_get_type +GDATA_FREEBASE_SEARCH_QUERY +GDATA_FREEBASE_SEARCH_QUERY_CLASS +GDATA_FREEBASE_SEARCH_QUERY_GET_CLASS +GDATA_IS_FREEBASE_SEARCH_QUERY +GDATA_IS_FREEBASE_SEARCH_QUERY_CLASS +GDATA_TYPE_FREEBASE_SEARCH_QUERY +gdata_freebase_search_filter_type_get_type +GDATA_TYPE_FREEBASE_SEARCH_FILTER_TYPE + +GDataFreebaseSearchQueryPrivate +
+ +
+gdata-freebase-search-result +GDataFreebaseSearchResult +GDataFreebaseSearchResult +GDataFreebaseSearchResultClass +GDataFreebaseSearchResultItem +gdata_freebase_search_result_new +gdata_freebase_search_result_get_num_items +gdata_freebase_search_result_get_total_hits +gdata_freebase_search_result_get_item +gdata_freebase_search_result_item_get_mid +gdata_freebase_search_result_item_get_id +gdata_freebase_search_result_item_get_name +gdata_freebase_search_result_item_get_language +gdata_freebase_search_result_item_get_notable_id +gdata_freebase_search_result_item_get_notable_name +gdata_freebase_search_result_item_get_score + +gdata_freebase_search_result_get_type +gdata_freebase_search_result_item_get_type +GDATA_FREEBASE_SEARCH_RESULT +GDATA_FREEBASE_SEARCH_RESULT_CLASS +GDATA_FREEBASE_SEARCH_RESULT_GET_CLASS +GDATA_IS_FREEBASE_SEARCH_RESULT +GDATA_IS_FREEBASE_SEARCH_RESULT_CLASS +GDATA_TYPE_FREEBASE_SEARCH_RESULT +GDATA_TYPE_FREEBASE_SEARCH_RESULT_ITEM + +GDataFreebaseSearchResultPrivate +
+ +
+gdata-oauth2-authorizer +GDataOAuth2Authorizer +GDATA_OAUTH2_REDIRECT_URI_OOB +GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO +GDataOAuth2Authorizer +GDataOAuth2AuthorizerClass +gdata_oauth2_authorizer_new +gdata_oauth2_authorizer_new_for_authorization_domains +gdata_oauth2_authorizer_build_authentication_uri +gdata_oauth2_authorizer_request_authorization +gdata_oauth2_authorizer_request_authorization_async +gdata_oauth2_authorizer_request_authorization_finish +gdata_oauth2_authorizer_get_client_id +gdata_oauth2_authorizer_get_redirect_uri +gdata_oauth2_authorizer_get_client_secret +gdata_oauth2_authorizer_dup_refresh_token +gdata_oauth2_authorizer_set_refresh_token +gdata_oauth2_authorizer_get_locale +gdata_oauth2_authorizer_set_locale +gdata_oauth2_authorizer_get_timeout +gdata_oauth2_authorizer_set_timeout +gdata_oauth2_authorizer_get_proxy_resolver +gdata_oauth2_authorizer_set_proxy_resolver + +GDATA_TYPE_OAUTH2_AUTHORIZER +GDATA_OAUTH2_AUTHORIZER +GDATA_OAUTH2_AUTHORIZER_CLASS +GDATA_IS_OAUTH2_AUTHORIZER +GDATA_IS_OAUTH2_AUTHORIZER_CLASS +GDATA_OAUTH2_AUTHORIZER_GET_CLASS +gdata_oauth2_authorizer_get_type + +GDataOAuth2AuthorizerPrivate +
+ +
+gdata-youtube-feed +GDataYouTubeFeed +GDataYouTubeFeed +GDataYouTubeFeedClass + +gdata_youtube_feed_get_type +GDATA_YOUTUBE_FEED +GDATA_YOUTUBE_FEED_CLASS +GDATA_YOUTUBE_FEED_GET_CLASS +GDATA_IS_YOUTUBE_FEED +GDATA_IS_YOUTUBE_FEED_CLASS +GDATA_TYPE_YOUTUBE_FEED + +GDataYouTubeFeedPrivate +
+ +
+gdata-calendar-access-rule +GDataCalendarAccessRule +GDATA_CALENDAR_ACCESS_ROLE_READ +GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY +GDATA_CALENDAR_ACCESS_ROLE_EDITOR +GDATA_CALENDAR_ACCESS_ROLE_OWNER +GDATA_CALENDAR_ACCESS_ROLE_ROOT +GDataCalendarAccessRule +GDataCalendarAccessRuleClass +gdata_calendar_access_rule_new + +gdata_calendar_access_rule_get_type +GDATA_CALENDAR_ACCESS_RULE +GDATA_CALENDAR_ACCESS_RULE_CLASS +GDATA_CALENDAR_ACCESS_RULE_GET_CLASS +GDATA_IS_CALENDAR_ACCESS_RULE +GDATA_IS_CALENDAR_ACCESS_RULE_CLASS +GDATA_TYPE_CALENDAR_ACCESS_RULE + +GDataCalendarAccessRulePrivate +
+ +
+gdata-documents-access-rule +GDataDocumentsAccessRule +GDataDocumentsAccessRule +GDataDocumentsAccessRuleClass +gdata_documents_access_rule_new + +gdata_documents_access_rule_get_type +GDATA_DOCUMENTS_ACCESS_RULE +GDATA_DOCUMENTS_ACCESS_RULE_CLASS +GDATA_DOCUMENTS_ACCESS_RULE_GET_CLASS +GDATA_IS_DOCUMENTS_ACCESS_RULE +GDATA_IS_DOCUMENTS_ACCESS_RULE_CLASS +GDATA_TYPE_DOCUMENTS_ACCESS_RULE + +GDataDocumentsAccessRulePrivate +
diff --git a/docs/reference/gdata.types b/docs/reference/gdata.types new file mode 100644 index 0000000..f926126 --- /dev/null +++ b/docs/reference/gdata.types @@ -0,0 +1,101 @@ +gdata_access_handler_get_type +gdata_access_rule_get_type +gdata_app_categories_get_type +gdata_author_get_type +gdata_authorization_domain_get_type +gdata_authorizer_get_type +gdata_batch_operation_get_type +gdata_batchable_get_type +gdata_calendar_access_rule_get_type +gdata_calendar_calendar_get_type +gdata_calendar_event_get_type +gdata_calendar_feed_get_type +gdata_calendar_query_get_type +gdata_calendar_service_get_type +gdata_category_get_type +gdata_client_login_authorizer_get_type +gdata_color_get_type +gdata_comment_get_type +gdata_commentable_get_type +gdata_comparable_get_type +gdata_contacts_contact_get_type +gdata_contacts_group_get_type +gdata_contacts_query_get_type +gdata_contacts_service_get_type +gdata_documents_access_rule_get_type +gdata_documents_document_get_type +gdata_documents_drawing_get_type +gdata_documents_entry_get_type +gdata_documents_feed_get_type +gdata_documents_folder_get_type +gdata_documents_metadata_get_type +gdata_documents_pdf_get_type +gdata_documents_presentation_get_type +gdata_documents_query_get_type +gdata_documents_service_get_type +gdata_documents_spreadsheet_get_type +gdata_documents_text_get_type +gdata_documents_upload_query_get_type +gdata_download_stream_get_type +gdata_entry_get_type +gdata_feed_get_type +gdata_freebase_query_get_type +gdata_freebase_result_get_type +gdata_freebase_search_query_get_type +gdata_freebase_search_result_get_type +gdata_freebase_search_result_item_get_type +gdata_freebase_service_get_type +gdata_freebase_topic_object_get_type +gdata_freebase_topic_query_get_type +gdata_freebase_topic_result_get_type +gdata_freebase_topic_value_get_type +gdata_gcontact_calendar_get_type +gdata_gcontact_event_get_type +gdata_gcontact_external_id_get_type +gdata_gcontact_jot_get_type +gdata_gcontact_language_get_type +gdata_gcontact_relation_get_type +gdata_gcontact_website_get_type +gdata_gd_email_address_get_type +gdata_gd_im_address_get_type +gdata_gd_name_get_type +gdata_gd_organization_get_type +gdata_gd_phone_number_get_type +gdata_gd_postal_address_get_type +gdata_gd_reminder_get_type +gdata_gd_when_get_type +gdata_gd_where_get_type +gdata_gd_who_get_type +gdata_generator_get_type +gdata_goa_authorizer_get_type +gdata_link_get_type +gdata_media_category_get_type +gdata_media_content_get_type +gdata_media_credit_get_type +gdata_media_thumbnail_get_type +gdata_oauth1_authorizer_get_type +gdata_oauth2_authorizer_get_type +gdata_parsable_get_type +gdata_picasaweb_album_get_type +gdata_picasaweb_comment_get_type +gdata_picasaweb_feed_get_type +gdata_picasaweb_file_get_type +gdata_picasaweb_query_get_type +gdata_picasaweb_service_get_type +gdata_picasaweb_user_get_type +gdata_query_get_type +gdata_service_get_type +gdata_tasks_query_get_type +gdata_tasks_service_get_type +gdata_tasks_task_get_type +gdata_tasks_tasklist_get_type +gdata_upload_stream_get_type +gdata_youtube_category_get_type +gdata_youtube_comment_get_type +gdata_youtube_content_get_type +gdata_youtube_credit_get_type +gdata_youtube_feed_get_type +gdata_youtube_query_get_type +gdata_youtube_service_get_type +gdata_youtube_state_get_type +gdata_youtube_video_get_type diff --git a/docs/reference/html/GDataAPPCategories.html b/docs/reference/html/GDataAPPCategories.html new file mode 100644 index 0000000..7d32131 --- /dev/null +++ b/docs/reference/html/GDataAPPCategories.html @@ -0,0 +1,216 @@ + + + + +GDataAPPCategories: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataAPPCategories

+

GDataAPPCategories — GData APP categories object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + +
+GList * + +gdata_app_categories_get_categories () +
+gboolean + +gdata_app_categories_is_fixed () +
+
+
+

Properties

+
+++++ + + + + + +
gbooleanis-fixedRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataAPPCategories
 GDataAPPCategoriesClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataAPPCategories
+
+
+
+

Includes

+
#include <gdata/app/gdata-app-categories.h>
+
+
+
+

Description

+

GDataAPPCategories is a list of categories (GDataCategory) returned as the result of querying an

+Atom Publishing Protocol Category Document. + +
+
+

Functions

+
+

gdata_app_categories_get_categories ()

+
GList *
+gdata_app_categories_get_categories (GDataAPPCategories *self);
+

Returns a list of the categories in this category list.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAPPCategories

 
+
+
+

Returns

+

a GList of GDataCategorys.

+

[element-type GData.Category][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_app_categories_is_fixed ()

+
gboolean
+gdata_app_categories_is_fixed (GDataAPPCategories *self);
+

Returns “is-fixed”.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAPPCategories

 
+
+
+

Returns

+

whether entries may use categories not in this category list

+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDataAPPCategories

+
typedef struct _GDataAPPCategories GDataAPPCategories;
+

All the fields in the GDataAPPCategories structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataAPPCategoriesClass

+
typedef struct {
+} GDataAPPCategoriesClass;
+
+

All the fields in the GDataAPPCategoriesClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “is-fixed” property

+
  “is-fixed”                 gboolean
+

Whether entries may use categories not in this category list.

+

API reference: app:categories

+

Flags: Read

+

Default value: FALSE

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataAccessHandler.html b/docs/reference/html/GDataAccessHandler.html new file mode 100644 index 0000000..ac5551e --- /dev/null +++ b/docs/reference/html/GDataAccessHandler.html @@ -0,0 +1,361 @@ + + + + +GDataAccessHandler: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataAccessHandler

+

GDataAccessHandler — GData access handler interface

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + +
+GDataFeed * + +gdata_access_handler_get_rules () +
+void + +gdata_access_handler_get_rules_async () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
#defineGDATA_LINK_ACCESS_CONTROL_LIST
 GDataAccessHandler
 GDataAccessHandlerIface
+
+
+

Object Hierarchy

+
    GInterface
+    ╰── GDataAccessHandler
+
+
+
+

Prerequisites

+

+GDataAccessHandler requires + GDataEntry.

+
+ +
+

Includes

+
#include <gdata/gdata-access-handler.h>
+
+
+
+

Description

+

GDataAccessHandler is an interface which can be implemented by GDataEntrys which can have their permissions controlled by an +access control list (ACL). It has a set of methods which allow the GDataAccessRules for the access handler/entry to be retrieved, +added, modified and deleted, with immediate effect.

+

For an example of inserting an access rule into an ACL, see the documentation for GDataAccessRule.

+

When implementing the interface, classes must implement an is_owner_rule function. It's optional to implement a +get_authorization_domain function, but if it's not implemented, any operations on the access handler's +GDataAccessRules will be performed unauthorized (i.e. as if by a non-logged-in user). This will not usually work.

+
+
+

Functions

+
+

gdata_access_handler_get_rules ()

+
GDataFeed *
+gdata_access_handler_get_rules (GDataAccessHandler *self,
+                                GDataService *service,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GError **error);
+

Retrieves a GDataFeed containing all the access rules which apply to the given GDataAccessHandler. Only the owner of a GDataAccessHandler may +view its rule feed.

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

+

A GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be returned if the server indicates there is a problem with the query.

+

For each rule in the response feed, progress_callback + will be called in the main thread. If there was an error parsing the XML response, +a GDataParserError will be returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataAccessHandler

 

service

a GDataService

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when a rule is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of access control rules, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.3.0

+
+
+
+

gdata_access_handler_get_rules_async ()

+
void
+gdata_access_handler_get_rules_async (GDataAccessHandler *self,
+                                      GDataService *service,
+                                      GCancellable *cancellable,
+                                      GDataQueryProgressCallback progress_callback,
+                                      gpointer progress_user_data,
+                                      GDestroyNotify destroy_progress_user_data,
+                                      GAsyncReadyCallback callback,
+                                      gpointer user_data);
+

Retrieves a GDataFeed containing all the access rules which apply to the given GDataAccessHandler. Only the owner of a GDataAccessHandler may +view its rule feed. self + and service + are both reffed when this function is called, so can safely be unreffed after this function returns.

+

For more details, see gdata_access_handler_get_rules(), which is the synchronous version of this function, and gdata_service_query_async(), which +is the base asynchronous query function.

+

When the operation is finished, callback + will be called. You can then call gdata_service_query_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataAccessHandler

 

service

a GDataService

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when a rule is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

Types and Values

+
+

GDATA_LINK_ACCESS_CONTROL_LIST

+
#define GDATA_LINK_ACCESS_CONTROL_LIST "http://schemas.google.com/acl/2007#accessControlList"
+
+

The relation type URI of the access control list location for this resource.

+

For more information, see the

+ACL specification. +

Since: 0.7.0

+
+
+
+

GDataAccessHandler

+
typedef struct _GDataAccessHandler GDataAccessHandler;
+

All the fields in the GDataAccessHandler structure are private and should never be accessed directly.

+

Since: 0.3.0

+
+
+
+

GDataAccessHandlerIface

+
typedef struct {
+	GTypeInterface parent;
+
+	gboolean (*is_owner_rule) (GDataAccessRule *rule);
+	GDataAuthorizationDomain *(*get_authorization_domain) (GDataAccessHandler *self);
+
+	GDataFeed *(*get_rules) (GDataAccessHandler *self,
+	                         GDataService *service,
+	                         GCancellable *cancellable,
+	                         GDataQueryProgressCallback progress_callback,
+	                         gpointer progress_user_data,
+	                         GError **error);
+} GDataAccessHandlerIface;
+
+

The class structure for the GDataAccessHandler interface.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

GTypeInterface parent;

the parent type

 

is_owner_rule ()

a function to return whether the given GDataAccessRule has the role of an owner (of a GDataAccessHandler).

 

get_authorization_domain ()

a function to return the GDataAuthorizationDomain to be used for all operations on the access rules +belonging to this access handler; not implementing this function is equivalent to returning NULL from it, which signifies that operations on the +access rules don't require authorization; new in version 0.9.0.

[allow-none]

get_rules ()

a function to query, parse and return a GDataFeed of +GDataAccessRules for a given entry — the virtual function for +gdata_access_handler_get_rules(); new in version 0.17.2.

[nullable]
+
+

Since: 0.9.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataAccessRule.html b/docs/reference/html/GDataAccessRule.html new file mode 100644 index 0000000..8074e7b --- /dev/null +++ b/docs/reference/html/GDataAccessRule.html @@ -0,0 +1,638 @@ + + + + +GDataAccessRule: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataAccessRule

+

GDataAccessRule — GData access rule object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataAccessRule * + +gdata_access_rule_new () +
const gchar * + +gdata_access_rule_get_role () +
+void + +gdata_access_rule_set_role () +
+void + +gdata_access_rule_get_scope () +
+void + +gdata_access_rule_set_scope () +
+gint64 + +gdata_access_rule_get_edited () +
const gchar * + +gdata_access_rule_get_key () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gint64editedRead
+gchar *keyRead
+gchar *roleRead / Write
+gchar *scope-typeRead / Write
+gchar *scope-valueRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGDATA_ACCESS_SCOPE_USER
#defineGDATA_ACCESS_SCOPE_DOMAIN
#defineGDATA_ACCESS_SCOPE_DEFAULT
#defineGDATA_ACCESS_ROLE_NONE
 GDataAccessRule
 GDataAccessRuleClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataAccessRule
+                ├── GDataCalendarAccessRule
+                ╰── GDataDocumentsAccessRule
+
+
+
+

Includes

+
#include <gdata/gdata-access-rule.h>
+
+
+
+

Description

+

GDataAccessRule is a subclass of GDataEntry to represent a generic access rule from an access control list (ACL). +It is returned by the ACL methods implemented in the GDataAccessHandler interface.

+

Access rules should be inserted to the GDATA_LINK_ACCESS_CONTROL_LIST URI of the feed or entry they should be applied to. This will return a +GDATA_SERVICE_ERROR_CONFLICT error if a rule already exists on that feed or entry for that scope type and value.

+
+

Example 4. Adding a Rule to the Access Control List for an Entry

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
GDataAuthorizationDomain *domain;
+GDataService *service;
+GDataEntry *entry;
+GDataFeed *acl_feed;
+GDataAccessRule *rule, *new_rule;
+GError *error = NULL;
+
+domain = gdata_documents_service_get_primary_authorization_domain ();
+
+/* Retrieve a GDataEntry which will have a new rule inserted into its ACL. */
+service = build_my_service ();
+entry = get_the_entry (service);
+
+/* Create and insert a new access rule for example@gmail.com which grants them _no_ permissions on the entry.
+ * In a real application, the GDataEntry subclass would define its own access roles which are more useful. For example,
+ * GDataDocumentsEntry defines access roles for users who can read (but not write) a Google Document, and users who
+ * can also write to the document. */
+rule = gdata_access_rule_new (NULL);
+gdata_access_rule_set_role (rule, GDATA_ACCESS_ROLE_NONE); /* or, for example, GDATA_DOCUMENTS_ACCESS_ROLE_READER */
+gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_USER, "example@gmail.com"); /* e-mail address of the user the ACL applies to */
+
+acl_link = gdata_entry_look_up_link (entry, GDATA_LINK_ACCESS_CONTROL_LIST);
+new_rule = GDATA_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), domain, gdata_link_get_uri (acl_link),
+                                                          GDATA_ENTRY (rule), NULL, &error));
+
+g_object_unref (rule);
+g_object_unref (entry);
+g_object_unref (service);
+
+if (error != NULL) {
+g_error ("Error inserting access rule: %s", error->message);
+g_error_free (error);
+return;
+}
+
+/* Potentially do something with the new_rule here, such as store its ID for later use. */
+
+g_object_unref (new_rule);
+
+ +
+
+
+
+

Functions

+
+

gdata_access_rule_new ()

+
GDataAccessRule *
+gdata_access_rule_new (const gchar *id);
+

Creates a new GDataAccessRule with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the access rule's ID, or NULL

 
+
+
+

Returns

+

a new GDataAccessRule; unref with g_object_unref()

+
+

Since: 0.3.0

+
+
+
+

gdata_access_rule_get_role ()

+
const gchar *
+gdata_access_rule_get_role (GDataAccessRule *self);
+

Gets the “role” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAccessRule

 
+
+
+

Returns

+

the access rule's role, or NULL

+
+

Since: 0.3.0

+
+
+
+

gdata_access_rule_set_role ()

+
void
+gdata_access_rule_set_role (GDataAccessRule *self,
+                            const gchar *role);
+

Sets the “role” property to role +. role + must be a non-empty string, such as GDATA_ACCESS_ROLE_NONE.

+

Set role + to NULL to unset the property in the access rule.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataAccessRule

 

role

a new role, or NULL

 
+
+

Since: 0.3.0

+
+
+
+

gdata_access_rule_get_scope ()

+
void
+gdata_access_rule_get_scope (GDataAccessRule *self,
+                             const gchar **type,
+                             const gchar **value);
+

Gets the “scope-type” and “scope-value” properties.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataAccessRule

 

type

return location for the scope type, or NULL.

[out callee-allocates][transfer none][allow-none]

value

return location for the scope value, or NULL.

[out callee-allocates][transfer none][allow-none]
+
+

Since: 0.3.0

+
+
+
+

gdata_access_rule_set_scope ()

+
void
+gdata_access_rule_set_scope (GDataAccessRule *self,
+                             const gchar *type,
+                             const gchar *value);
+

Sets the “scope-type” property to type + and the “scope-value” property to value +.

+

Set scope_value + to NULL to unset the “scope-value” property in the access rule. type + cannot +be NULL. scope_value + must be NULL if type + is default, and non-NULL otherwise.

+

See the

+online +documentation for more information. +
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataAccessRule

 

type

a new scope type

 

value

a new scope value, or NULL.

[allow-none]
+
+

Since: 0.3.0

+
+
+
+

gdata_access_rule_get_edited ()

+
gint64
+gdata_access_rule_get_edited (GDataAccessRule *self);
+

Gets the “edited” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAccessRule

 
+
+
+

Returns

+

the UNIX timestamp for the time the access rule was last edited, or -1

+
+

Since: 0.7.0

+
+
+
+

gdata_access_rule_get_key ()

+
const gchar *
+gdata_access_rule_get_key (GDataAccessRule *self);
+

Gets the “key” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAccessRule

 
+
+
+

Returns

+

the access rule's authorisation key, or NULL

+
+

Since: 0.16.0

+
+
+
+

Types and Values

+
+

GDATA_ACCESS_SCOPE_USER

+
#define GDATA_ACCESS_SCOPE_USER "user"
+
+

The GDataAccessRule applies to a single individual, whose e-mail address is given in “scope-value”.

+

Since: 0.7.0

+
+
+
+

GDATA_ACCESS_SCOPE_DOMAIN

+
#define GDATA_ACCESS_SCOPE_DOMAIN "domain"
+
+

The GDataAccessRule applies to all users in a Google Apps For Your Domain domain, given in “scope-value”.

+

Since: 0.7.0

+
+
+
+

GDATA_ACCESS_SCOPE_DEFAULT

+
#define GDATA_ACCESS_SCOPE_DEFAULT "default"
+
+

The GDataAccessRule applies to all users.

+

Since: 0.7.0

+
+
+
+

GDATA_ACCESS_ROLE_NONE

+
#define GDATA_ACCESS_ROLE_NONE "none"
+
+

The users specified by the GDataAccessRule have no rights.

+

Since: 0.7.0

+
+
+
+

GDataAccessRule

+
typedef struct _GDataAccessRule GDataAccessRule;
+

All the fields in the GDataAccessRule structure are private and should never be accessed directly.

+

Since: 0.3.0

+
+
+
+

GDataAccessRuleClass

+
typedef struct {
+} GDataAccessRuleClass;
+
+

All the fields in the GDataAccessRuleClass structure are private and should never be accessed directly.

+

Since: 0.3.0

+
+
+
+

Property Details

+
+

The “edited” property

+
  “edited”                   gint64
+

The last time the access rule was edited. If the rule has not been edited yet, the content indicates the time it was created.

+

For more information, see the +Atom Publishing Protocol specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.7.0

+
+
+
+

The “key” property

+
  “key”                      gchar *
+

An optional authorisation key required to access this item with the given scope. If set, this restricts +access to those principals who have a copy of the key. The key is generated server-side and cannot be +modified by the client. If no authorisation key is set (and hence none is needed for access to the item), +this will be NULL.

+

Flags: Read

+

Default value: NULL

+

Since: 0.16.0

+
+
+
+

The “role” property

+
  “role”                     gchar *
+

The role of the person concerned by this ACL. By default, this can only be GDATA_ACCESS_ROLE_NONE. Services may extend it with +their own namespaced roles.

+

Flags: Read / Write

+

Default value: "none"

+

Since: 0.3.0

+
+
+
+

The “scope-type” property

+
  “scope-type”               gchar *
+

Specifies to whom this access rule applies. For example, GDATA_ACCESS_SCOPE_USER or GDATA_ACCESS_SCOPE_DEFAULT.

+

Flags: Read / Write

+

Default value: "default"

+

Since: 0.3.0

+
+
+
+

The “scope-value” property

+
  “scope-value”              gchar *
+

A value representing the user who is represented by the access rule, such as an +e-mail address for users, or a domain name for domains.

+

This must be NULL if and only if “scope-type” is GDATA_ACCESS_SCOPE_DEFAULT.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.3.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataAuthor.html b/docs/reference/html/GDataAuthor.html new file mode 100644 index 0000000..319dc36 --- /dev/null +++ b/docs/reference/html/GDataAuthor.html @@ -0,0 +1,468 @@ + + + + +GDataAuthor: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataAuthor

+

GDataAuthor — Atom author element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataAuthor * + +gdata_author_new () +
const gchar * + +gdata_author_get_name () +
+void + +gdata_author_set_name () +
const gchar * + +gdata_author_get_uri () +
+void + +gdata_author_set_uri () +
const gchar * + +gdata_author_get_email_address () +
+void + +gdata_author_set_email_address () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *email-addressRead / Write
+gchar *nameRead / Write
+gchar *uriRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataAuthor
 GDataAuthorClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataAuthor
+
+
+
+

Implemented Interfaces

+

+GDataAuthor implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/atom/gdata-author.h>
+
+
+
+

Description

+

GDataAuthor represents a "author" element from the

+Atom specification. + +
+
+

Functions

+
+

gdata_author_new ()

+
GDataAuthor *
+gdata_author_new (const gchar *name,
+                  const gchar *uri,
+                  const gchar *email_address);
+

Creates a new GDataAuthor. More information is available in the Atom specification.

+

name + must be non-NULL and non-empty.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

name

the author's name

 

uri

an IRI describing the author, or NULL.

[allow-none]

email_address

the author's e-mail address, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataAuthor, or NULL; unref with g_object_unref()

+
+
+
+
+

gdata_author_get_name ()

+
const gchar *
+gdata_author_get_name (GDataAuthor *self);
+

Gets the “name” property. The name will always be a non-NULL, non-empty string.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAuthor

 
+
+
+

Returns

+

the author's name

+
+

Since: 0.4.0

+
+
+
+

gdata_author_set_name ()

+
void
+gdata_author_set_name (GDataAuthor *self,
+                       const gchar *name);
+

Sets the “name” property to name +. name + must be non-NULL and non-empty.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataAuthor

 

name

the new name for the author

 
+
+

Since: 0.4.0

+
+
+
+

gdata_author_get_uri ()

+
const gchar *
+gdata_author_get_uri (GDataAuthor *self);
+

Gets the “uri” property. If the URI is non-NULL, it will be non-empty.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAuthor

 
+
+
+

Returns

+

the author's URI, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_author_set_uri ()

+
void
+gdata_author_set_uri (GDataAuthor *self,
+                      const gchar *uri);
+

Sets the “uri” property to uri +. uri + must be NULL or non-empty.

+

Set uri + to NULL to unset the property in the author.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataAuthor

 

uri

the new URI for the author, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_author_get_email_address ()

+
const gchar *
+gdata_author_get_email_address (GDataAuthor *self);
+

Gets the “email-address” property. If the e-mail address is non-NULL, it will be non-empty.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAuthor

 
+
+
+

Returns

+

the author's e-mail address, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_author_set_email_address ()

+
void
+gdata_author_set_email_address (GDataAuthor *self,
+                                const gchar *email_address);
+

Sets the “email-address” property to email_address +. email_address + must be NULL or non-empty.

+

Set email_address + to NULL to unset the property in the author.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataAuthor

 

email_address

the new e-mail address for the author, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDataAuthor

+
typedef struct _GDataAuthor GDataAuthor;
+

All the fields in the GDataAuthor structure are private and should never be accessed directly.

+
+
+
+

GDataAuthorClass

+
typedef struct {
+} GDataAuthorClass;
+
+

All the fields in the GDataAuthorClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “email-address” property

+
  “email-address”            gchar *
+

An e-mail address associated with the person.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “name” property

+
  “name”                     gchar *
+

A human-readable name for the person.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “uri” property

+
  “uri”                      gchar *
+

An IRI associated with the person.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataAuthorizationDomain.html b/docs/reference/html/GDataAuthorizationDomain.html new file mode 100644 index 0000000..edc42fa --- /dev/null +++ b/docs/reference/html/GDataAuthorizationDomain.html @@ -0,0 +1,241 @@ + + + + +GDataAuthorizationDomain: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataAuthorizationDomain

+

GDataAuthorizationDomain — GData authorization domain

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + +
const gchar * + +gdata_authorization_domain_get_service_name () +
const gchar * + +gdata_authorization_domain_get_scope () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + +
+gchar *scopeRead / Write / Construct Only
+gchar *service-nameRead / Write / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataAuthorizationDomain
 GDataAuthorizationDomainClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataAuthorizationDomain
+
+
+
+

Includes

+
#include <gdata/gdata-authorization-domain.h>
+
+
+
+

Description

+

A GDataAuthorizationDomain represents a single data domain which a user can authorize libgdata to access. This might be a domain covering the +whole of the user's Google Contacts account, for example. Typically, GDataServices map to GDataAuthorizationDomains in a one-to-one +fashion, though some services (such as GDataDocumentsService) use multiple authorization domains.

+

The GDataAuthorizationDomainss used by a service can be retrieved using gdata_service_get_authorization_domains(). The set of domains +used by a given service is static and will never change at runtime.

+

GDataAuthorizationDomains are used by a GDataAuthorizer instance to request authorization to interact with data in those domains when +first authenticating and authorizing with the online service. Typically, a given GDataAuthorizer will be passed a set of domains (or a service +type, from which it can retrieve the service's set of domains) at construction time, and will use those domains when initially asking the user for +authorization and whenever the authorization is refreshed afterwards. It's not expected that the set of domains used by a GDataAuthorizer will +change after construction time.

+

Note that it's not expected that GDataAuthorizationDomains will have to be constructed manually. All GDataServices should provide +accessor functions to return instances of all the authorization domains they support.

+
+
+

Functions

+
+

gdata_authorization_domain_get_service_name ()

+
const gchar *
+gdata_authorization_domain_get_service_name
+                               (GDataAuthorizationDomain *self);
+

Returns the name of the service containing the authorization domain. See “service-name” for more details.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAuthorizationDomain

 
+
+
+

Returns

+

name of the service containing the authorization domain

+
+

Since: 0.9.0

+
+
+
+

gdata_authorization_domain_get_scope ()

+
const gchar *
+gdata_authorization_domain_get_scope (GDataAuthorizationDomain *self);
+

Returns a URI detailing the scope of the authorization domain. See “scope” for more details.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataAuthorizationDomain

 
+
+
+

Returns

+

URI detailing the scope of the authorization domain

+
+

Since: 0.9.0

+
+
+
+

Types and Values

+
+

GDataAuthorizationDomain

+
typedef struct _GDataAuthorizationDomain GDataAuthorizationDomain;
+

All the fields in the GDataAuthorizationDomain structure are private and should never be accessed directly.

+

Since: 0.9.0

+
+
+
+

GDataAuthorizationDomainClass

+
typedef struct {
+} GDataAuthorizationDomainClass;
+
+

All the fields in the GDataAuthorizationDomainClass structure are private and should never be accessed directly.

+

Since: 0.9.0

+
+
+
+

Property Details

+
+

The “scope” property

+
  “scope”                    gchar *
+

A URI detailing the scope of the authorization domain, as enumerated in the

+online documentation. +

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.9.0

+
+
+
+

The “service-name” property

+
  “service-name”             gchar *
+

The name of the service which contains the authorization domain, as enumerated in the

+online documentation. +

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.9.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataAuthorizer.html b/docs/reference/html/GDataAuthorizer.html new file mode 100644 index 0000000..5102541 --- /dev/null +++ b/docs/reference/html/GDataAuthorizer.html @@ -0,0 +1,527 @@ + + + + +GDataAuthorizer: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataAuthorizer

+

GDataAuthorizer — GData authorization interface

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataAuthorizer
 GDataAuthorizerInterface
+
+
+

Object Hierarchy

+
    GInterface
+    ╰── GDataAuthorizer
+
+
+
+

Prerequisites

+

+GDataAuthorizer requires + GObject.

+
+
+

Known Implementations

+

+GDataAuthorizer is implemented by + GDataClientLoginAuthorizer, GDataGoaAuthorizer, GDataOAuth1Authorizer and GDataOAuth2Authorizer.

+
+
+

Includes

+
#include <gdata/gdata-authorizer.h>
+
+
+
+

Description

+

The GDataAuthorizer interface provides a uniform way to implement authentication and authorization processes for use by GDataServices. +Client code will construct a new GDataAuthorizer instance of their choosing, such as GDataClientLoginAuthorizer or GDataOAuth2Authorizer, for +the GDataServices which will be used by the client, then authenticates and authorizes with the GDataAuthorizer instead of the +GDataService. The GDataService then uses the GDataAuthorizer to authorize individual network requests using whatever authorization token was +returned to the GDataAuthorizer by the Google Accounts service.

+

All GDataAuthorizer implementations are expected to operate against a set of GDataAuthorizationDomains which are provided to the +authorizer at construction time. These domains specify which data domains the client expects to access using the GDataServices they +have using the GDataAuthorizer instance. Following the principle of least privilege, the set of domains should be the minimum such set of domains +which still allows the client to operate normally. Note that implementations of GDataAuthorizationDomain may display the list of requested +authorization domains to the user for verification before authorization is granted.

+

GDataAuthorizer implementations are provided for some of the standard authorization processes supported by Google for installed applications, as +listed in their online documentation:

+
+

It is quite possible for clients to write their own GDataAuthorizer implementation. For example, if a client already uses OAuth 2.0 and handles +authentication itself, it may want to use its own GDataAuthorizer implementation which simply exposes the client's existing access token to +libgdata and does nothing more.

+

It must be noted that all GDataAuthorizer implementations must be thread safe, as methods such as gdata_authorizer_refresh_authorization() may be +called from any thread (such as the thread performing an asynchronous query operation) at any time.

+

Examples of code using GDataAuthorizer can be found in the documentation for the various implementations of the GDataAuthorizer interface.

+
+
+

Functions

+
+

gdata_authorizer_process_request ()

+
void
+gdata_authorizer_process_request (GDataAuthorizer *self,
+                                  GDataAuthorizationDomain *domain,
+                                  SoupMessage *message);
+

Processes message +, adding all the necessary extra headers and parameters to ensure that it's correctly authenticated and authorized under the +given domain + for the online service. Basically, if a query is not processed by calling this method on it, it will be sent to the online service as +if it's a query from a non-logged-in user. Similarly, if the GDataAuthorizer isn't authenticated or authorized (for domain +), no changes will +be made to the message +.

+

domain + may be NULL if the request doesn't require authorization.

+

This modifies message + in place.

+

This method is thread safe.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataAuthorizer

 

domain

the GDataAuthorizationDomain the query falls under, or NULL.

[allow-none]

message

the query to process

 
+
+

Since: 0.9.0

+
+
+
+

gdata_authorizer_is_authorized_for_domain ()

+
gboolean
+gdata_authorizer_is_authorized_for_domain
+                               (GDataAuthorizer *self,
+                                GDataAuthorizationDomain *domain);
+

Returns whether the GDataAuthorizer instance believes it's currently authorized to access the given domain +. Note that this will not perform any +network requests, and will just look up the result in the GDataAuthorizer's local cache of authorizations. This means that the result may be out +of date, as the server may have since invalidated the authorization. If the GDataAuthorizer class supports timeouts and TTLs on authorizations, +they will not be taken into account; this method effectively returns whether the last successful authorization operation performed on the +GDataAuthorizer included domain + in the list of requested authorization domains.

+

Note that NULL may be passed as the GDataAuthorizer, in which case FALSE will always be returned, regardless of the domain +. This is for +convenience of checking whether a domain is authorized by the GDataAuthorizer returned by gdata_service_get_authorizer(), which may be NULL. +For example:

+
+ + + + + + + +
1
+2
+3
if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (my_service), my_domain) == TRUE) {
+    /<!-- -->* Code to execute only if we're authorized for the given domain *<!-- -->/
+}
+
+ +

+

This method is thread safe.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataAuthorizer, or NULL.

[allow-none]

domain

the GDataAuthorizationDomain to check against

 
+
+
+

Returns

+

TRUE if the GDataAuthorizer has been authorized to access domain +, FALSE otherwise

+
+

Since: 0.9.0

+
+
+
+

gdata_authorizer_refresh_authorization ()

+
gboolean
+gdata_authorizer_refresh_authorization
+                               (GDataAuthorizer *self,
+                                GCancellable *cancellable,
+                                GError **error);
+

Forces the GDataAuthorizer to refresh any authorization tokens it holds with the online service. This should typically be called when a +GDataService query returns GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, and is already called transparently by methods such as +gdata_service_query() and gdata_service_insert_entry() (see their documentation for more details).

+

If re-authorization is successful, it's guaranteed that by the time this method returns, the properties containing the relevant authorization +tokens on the GDataAuthorizer instance will have been updated.

+

If FALSE is returned, error + will be set if (and only if) it's due to a refresh being attempted and failing. If a refresh is not attempted, FALSE +will be returned but error + will not be set.

+

If the GDataAuthorizer has not been previously authenticated or authorized (using the class' specific methods), no authorization will be +attempted, FALSE will be returned immediately and error + will not be set.

+

Some GDataAuthorizer implementations may not support refreshing authorization tokens at all; for example if doing so requires user interaction. +FALSE will be returned immediately in that case and error + will not be set.

+

This method is thread safe.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataAuthorizer

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE if an authorization refresh was attempted and was successful, FALSE if a refresh wasn't attempted or was unsuccessful

+
+

Since: 0.9.0

+
+
+
+

gdata_authorizer_refresh_authorization_async ()

+
void
+gdata_authorizer_refresh_authorization_async
+                               (GDataAuthorizer *self,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Forces the GDataAuthorizer to refresh any authorization tokens it holds with the online service. self + and cancellable + are reffed when this +method is called, so can safely be freed after this method returns.

+

For more details, see gdata_authorizer_refresh_authorization(), which is the synchronous version of this method. If the GDataAuthorizer class +doesn't implement GDataAuthorizerInterface.refresh_authorization_async but does implement GDataAuthorizerInterface.refresh_authorization, the +latter will be called from a new thread to make it asynchronous.

+

When the authorization refresh operation is finished, callback + will be called. You can then call gdata_authorizer_refresh_authorization_finish() +to get the results of the operation.

+

This method is thread safe.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataAuthorizer

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the authorization refresh operation is finished, or NULL.

[allow-none][scope async]

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.0

+
+
+
+

gdata_authorizer_refresh_authorization_finish ()

+
gboolean
+gdata_authorizer_refresh_authorization_finish
+                               (GDataAuthorizer *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finishes an asynchronous authorization refresh operation for the GDataAuthorizer, as started with gdata_authorizer_refresh_authorization_async().

+

This method is thread safe.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataAuthorizer

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE if an authorization refresh was attempted and was successful, FALSE if a refresh wasn't attempted or was unsuccessful

+
+

Since: 0.9.0

+
+
+
+

Types and Values

+
+

GDataAuthorizer

+
typedef struct _GDataAuthorizer GDataAuthorizer;
+

All the fields in the GDataAuthorizer structure are private and should never be accessed directly.

+

Since: 0.9.0

+
+
+
+

GDataAuthorizerInterface

+
typedef struct {
+	GTypeInterface parent;
+
+	void (*process_request) (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message);
+	gboolean (*is_authorized_for_domain) (GDataAuthorizer *self, GDataAuthorizationDomain *domain);
+	gboolean (*refresh_authorization) (GDataAuthorizer *self, GCancellable *cancellable, GError **error);
+	void (*refresh_authorization_async) (GDataAuthorizer *self, GCancellable *cancellable,
+	                                     GAsyncReadyCallback callback, gpointer user_data);
+	gboolean (*refresh_authorization_finish) (GDataAuthorizer *self, GAsyncResult *async_result, GError **error);
+} GDataAuthorizerInterface;
+
+

The class structure for the GDataAuthorizer interface.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GTypeInterface parent;

the parent type

 

process_request ()

a function to append authorization headers to queries before they are submitted to the online service under the given +authorization domain (which may be NULL); this must be implemented and must be thread safe, and must also handle being called multiple times on +the same SoupMessage instance (so must be careful to replace headers rather than append them, for example)

 

is_authorized_for_domain ()

a function to check whether the authorizer is authorized against the given domain; this must be implemented and must +be thread safe

 

refresh_authorization ()

a function to force a refresh of any authorization tokens the authorizer holds, returning TRUE if a refresh +was attempted and was successful, or FALSE if a refresh wasn't attempted or was unsuccessful; if this isn't implemented it's assumed FALSE +would've been returned, if it is implemented it must be thread safe.

[allow-none]

refresh_authorization_async ()

an asynchronous version of refresh_authorization +; if this isn't implemented and refresh_authorization +is, refresh_authorization +will be called in a thread to simulate this function, whereas if this is implemented refresh_authorization_finish +must +also be implemented and both functions must be thread safe.

[allow-none]

refresh_authorization_finish ()

a finish function for the asynchronous version of refresh_authorization +; this must be implemented +exactly if refresh_authorization_async +is implemented, and must be thread safe if it is implemented.

[allow-none]
+
+

Since: 0.9.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataBatchOperation.html b/docs/reference/html/GDataBatchOperation.html new file mode 100644 index 0000000..0b36029 --- /dev/null +++ b/docs/reference/html/GDataBatchOperation.html @@ -0,0 +1,966 @@ + + + + +GDataBatchOperation: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataBatchOperation

+

GDataBatchOperation — GData batch operation object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+GDataAuthorizationDomain *authorization-domainRead / Write / Construct Only
+gchar *feed-uriRead / Write / Construct Only
+GDataService *serviceRead / Write / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
 GDataBatchOperation
 GDataBatchOperationClass
enumGDataBatchOperationType
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataBatchOperation
+
+
+
+

Includes

+
#include <gdata/gdata-batch-operation.h>
+
+
+
+

Description

+

GDataBatchOperation is a transient standalone class which represents and handles a single batch operation request to a service. To make a batch +operation request: create a new GDataBatchOperation; add the required queries, insertions, updates and deletions to the operation using +gdata_batch_operation_add_query(), gdata_batch_operation_add_insertion(), gdata_batch_operation_add_update() and +gdata_batch_operation_add_deletion(), respectively; run the request with gdata_batch_operation_run() or gdata_batch_operation_run_async(); and +handle the results in the callback functions which are invoked by the operation as the results are received and parsed.

+

If authorization is required for any of the requests in the batch operation, the GDataService set in “service” must have +a GDataAuthorizer set as its “authorizer” property, and that authorizer must be authorized for the GDataAuthorizationDomain set +in “authorization-domain”. It's not possible for requests in a single batch operation to be authorized under multiple domains; +in that case, the requests must be split up across several batch operations using different authorization domains.

+

If all of the requests in the batch operation don't require authorization (i.e. they all operate on public data; see the documentation for the +GDataService subclass in question's operations for details of which require authorization), “authorization-domain” can be set +to NULL to save the overhead of sending authorization data to the online service.

+
+

Example 5. Running a Synchronous Operation

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
guint op_id, op_id2;
+GDataBatchOperation *operation;
+GDataContactsContact *contact;
+GDataService *service;
+GDataAuthorizationDomain *domain;
+
+service = create_contacts_service ();
+domain = get_authorization_domain_from_service (service);
+contact = create_new_contact ();
+batch_link = gdata_feed_look_up_link (contacts_feed, GDATA_LINK_BATCH);
+
+operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), domain, gdata_link_get_uri (batch_link));
+
+/* Add to the operation to insert a new contact and query for another one */
+op_id = gdata_batch_operation_add_insertion (operation, GDATA_ENTRY (contact), insertion_cb, user_data);
+op_id2 = gdata_batch_operation_add_query (operation, gdata_entry_get_id (other_contact), GDATA_TYPE_CONTACTS_CONTACT, query_cb, user_data);
+
+g_object_unref (contact);
+g_object_unref (domain);
+g_object_unref (service);
+
+/* Run the operations in a blocking fashion. Ideally, check and free the error as appropriate after running the operation. */
+gdata_batch_operation_run (operation, NULL, &error);
+
+g_object_unref (operation);
+
+static void
+insertion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_id == op_id, operation_type == GDATA_BATCH_OPERATION_INSERTION */
+
+    /* Process the new inserted entry, ideally after checking for errors. Note that the entry should be reffed if it needs to stay
+     * alive after execution of the callback finishes. */
+    process_inserted_entry (entry, user_data);
+}
+
+static void
+query_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_id == op_id2, operation_type == GDATA_BATCH_OPERATION_QUERY */
+
+    /* Process the results of the query, ideally after checking for errors. Note that the entry should be reffed if it needs to
+     * stay alive after execution of the callback finishes. */
+    process_queried_entry (entry, user_data);
+}
+
+ +
+
+
+
+

Functions

+
+

GDataBatchOperationCallback ()

+
void
+(*GDataBatchOperationCallback) (guint operation_id,
+                                GDataBatchOperationType operation_type,
+                                GDataEntry *entry,
+                                GError *error,
+                                gpointer user_data);
+

Callback function called once for each operation in a batch operation run. The operation is identified by operation_id + and operation_type + (where +operation_id + is the ID returned by the relevant call to gdata_batch_operation_add_query(), gdata_batch_operation_add_insertion(), +gdata_batch_operation_add_update() or gdata_batch_operation_add_deletion(), and operation_type + shows which one of the above was called).

+

If the operation was successful, the resulting GDataEntry will be passed in as entry +, and error + will be NULL. Otherwise, entry + will be NULL +and a descriptive error will be in error +. If operation_type + is GDATA_BATCH_OPERATION_DELETION, entry + will always be NULL, and error + will be +NULL or non-NULL as appropriate.

+

If the callback code needs to retain a copy of entry +, it must be referenced (with g_object_ref()). Similarly, error + is owned by the calling code, +and must not be freed.

+

The callback is called in the main thread, and there is no guarantee on the order in which the callbacks for the operations in a run are executed, +or whether they will be called in a timely manner. It is, however, guaranteed that they will all be called before the GAsyncReadyCallback which +signals the completion of the run (if initiated with gdata_batch_operation_run_async()) is called; or gdata_batch_operation_run() returns (if +initiated synchronously).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

operation_id

the operation ID returned from gdata_batch_operation_add_*()

 

operation_type

the type of operation which was requested

 

entry

the result of the operation, or NULL

 

error

a GError describing any error which occurred, or NULL

 

user_data

user data passed to the callback

 
+
+

Since: 0.7.0

+
+
+
+

gdata_batch_operation_add_query ()

+
guint
+gdata_batch_operation_add_query (GDataBatchOperation *self,
+                                 const gchar *id,
+                                 GType entry_type,
+                                 GDataBatchOperationCallback callback,
+                                 gpointer user_data);
+

Add a query to the GDataBatchOperation, to be executed when the operation is run. The query will return a GDataEntry (of subclass type +entry_type +) representing the given entry id +. The ID is of the same format as that returned by gdata_entry_get_id().

+

Note that a single batch operation should not operate on a given GDataEntry more than once, as there's no guarantee about the order in which the +batch operation's operations will be performed.

+

callback + will be called when the GDataBatchOperation is run with gdata_batch_operation_run() (in which case it will be called in the thread which +ran the batch operation), or with gdata_batch_operation_run_async() (in which case it will be called in an idle handler in the main thread). The +operation_id + passed to the callback will match the return value of gdata_batch_operation_add_query(), and the operation_type + will be +GDATA_BATCH_OPERATION_QUERY. If the query was successful, the resulting entry will be passed to the callback function as entry +, and error + will +be NULL. If, however, the query was unsuccessful, entry + will be NULL and error + will contain a GError detailing what went wrong.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataBatchOperation

 

id

the ID of the entry being queried for

 

entry_type

the type of the entry which will be returned

 

callback

a GDataBatchOperationCallback to call when the query is finished, or NULL.

[scope async]

user_data

data to pass to the callback +function.

[closure]
+
+
+

Returns

+

operation ID for the added query, or 0

+
+

Since: 0.7.0

+
+
+
+

gdata_batch_operation_add_insertion ()

+
guint
+gdata_batch_operation_add_insertion (GDataBatchOperation *self,
+                                     GDataEntry *entry,
+                                     GDataBatchOperationCallback callback,
+                                     gpointer user_data);
+

Add an entry to the GDataBatchOperation, to be inserted on the server when the operation is run. The insertion will return the inserted version +of entry +. entry + is reffed by the function, so may be freed after it returns.

+

callback + will be called as specified in the documentation for gdata_batch_operation_add_query(), with an operation_type + of +GDATA_BATCH_OPERATION_INSERTION.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataBatchOperation

 

entry

the GDataEntry to insert

 

callback

a GDataBatchOperationCallback to call when the insertion is finished, or NULL.

[scope async]

user_data

data to pass to the callback +function.

[closure]
+
+
+

Returns

+

operation ID for the added insertion, or 0

+
+

Since: 0.7.0

+
+
+
+

gdata_batch_operation_add_update ()

+
guint
+gdata_batch_operation_add_update (GDataBatchOperation *self,
+                                  GDataEntry *entry,
+                                  GDataBatchOperationCallback callback,
+                                  gpointer user_data);
+

Add an entry to the GDataBatchOperation, to be updated on the server when the operation is run. The update will return the updated version of +entry +. entry + is reffed by the function, so may be freed after it returns.

+

Note that a single batch operation should not operate on a given GDataEntry more than once, as there's no guarantee about the order in which the +batch operation's operations will be performed.

+

callback + will be called as specified in the documentation for gdata_batch_operation_add_query(), with an operation_type + of +GDATA_BATCH_OPERATION_UPDATE.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataBatchOperation

 

entry

the GDataEntry to update

 

callback

a GDataBatchOperationCallback to call when the update is finished, or NULL.

[scope async]

user_data

data to pass to the callback +function.

[closure]
+
+
+

Returns

+

operation ID for the added update, or 0

+
+

Since: 0.7.0

+
+
+
+

gdata_batch_operation_add_deletion ()

+
guint
+gdata_batch_operation_add_deletion (GDataBatchOperation *self,
+                                    GDataEntry *entry,
+                                    GDataBatchOperationCallback callback,
+                                    gpointer user_data);
+

Add an entry to the GDataBatchOperation, to be deleted on the server when the operation is run. entry + is reffed by the function, so may be freed +after it returns.

+

Note that a single batch operation should not operate on a given GDataEntry more than once, as there's no guarantee about the order in which the +batch operation's operations will be performed.

+

callback + will be called as specified in the documentation for gdata_batch_operation_add_query(), with an operation_type + of +GDATA_BATCH_OPERATION_DELETION.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataBatchOperation

 

entry

the GDataEntry to delete

 

callback

a GDataBatchOperationCallback to call when the deletion is finished, or NULL.

[scope async]

user_data

data to pass to the callback +function.

[closure]
+
+
+

Returns

+

operation ID for the added deletion, or 0

+
+

Since: 0.7.0

+
+
+
+

gdata_batch_operation_run ()

+
gboolean
+gdata_batch_operation_run (GDataBatchOperation *self,
+                           GCancellable *cancellable,
+                           GError **error);
+

Run the GDataBatchOperation synchronously. This will send all the operations in the batch operation to the server, and call their respective +callbacks synchronously (i.e. before gdata_batch_operation_run() returns, and in the same thread that called gdata_batch_operation_run()) as the +server returns results for each operation.

+

The callbacks for all of the operations in the batch operation are always guaranteed to be called, even if the batch operation as a whole fails. +Each callback will be called exactly once for each time gdata_batch_operation_run() is called.

+

The return value of the function indicates whether the overall batch operation was successful, and doesn't indicate the status of any of the +operations it comprises. gdata_batch_operation_run() could return TRUE even if all of its operations failed.

+

cancellable + can be used to cancel the entire batch operation any time before or during the network activity. If cancellable + is cancelled +after network activity has finished, gdata_batch_operation_run() will continue and finish as normal.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataBatchOperation

 

cancellable

a GCancellable, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.7.0

+
+
+
+

gdata_batch_operation_run_async ()

+
void
+gdata_batch_operation_run_async (GDataBatchOperation *self,
+                                 GCancellable *cancellable,
+                                 GAsyncReadyCallback callback,
+                                 gpointer user_data);
+

Run the GDataBatchOperation asynchronously. This will send all the operations in the batch operation to the server, and call their respective +callbacks asynchronously (i.e. in idle functions in the main thread, usually after gdata_batch_operation_run_async() has returned) as the +server returns results for each operation. self + is reffed when this function is called, so can safely be unreffed after this function returns.

+

For more details, see gdata_batch_operation_run(), which is the synchronous version of this function.

+

When the entire batch operation is finished, callback + will be called. You can then call gdata_batch_operation_run_finish() to get the results of +the batch operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataBatchOperation

 

cancellable

a GCancellable, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the batch operation is finished, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.7.0

+
+
+
+

gdata_batch_operation_run_finish ()

+
gboolean
+gdata_batch_operation_run_finish (GDataBatchOperation *self,
+                                  GAsyncResult *async_result,
+                                  GError **error);
+

Finishes an asynchronous batch operation run with gdata_batch_operation_run_async().

+

Return values are as for gdata_batch_operation_run().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataBatchOperation

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.7.0

+
+
+
+

gdata_batch_operation_get_service ()

+
GDataService *
+gdata_batch_operation_get_service (GDataBatchOperation *self);
+

Gets the “service” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataBatchOperation

 
+
+
+

Returns

+

the batch operation's attached service.

+

[transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_batch_operation_get_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_batch_operation_get_authorization_domain
+                               (GDataBatchOperation *self);
+

Gets the “authorization-domain” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataBatchOperation

 
+
+
+

Returns

+

the GDataAuthorizationDomain used to authorize the batch operation, or NULL.

+

[transfer none][allow-none]

+
+

Since: 0.9.0

+
+
+
+

gdata_batch_operation_get_feed_uri ()

+
const gchar *
+gdata_batch_operation_get_feed_uri (GDataBatchOperation *self);
+

Gets the “feed-uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataBatchOperation

 
+
+
+

Returns

+

the batch operation's feed URI

+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDataBatchOperation

+
typedef struct _GDataBatchOperation GDataBatchOperation;
+

All the fields in the GDataBatchOperation structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataBatchOperationClass

+
typedef struct {
+} GDataBatchOperationClass;
+
+

All the fields in the GDataBatchOperationClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

enum GDataBatchOperationType

+

Indicates which type of batch operation caused the current GDataBatchOperationCallback to be called.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

GDATA_BATCH_OPERATION_QUERY

+

a query operation

+
 

GDATA_BATCH_OPERATION_INSERTION

+

an insertion operation

+
 

GDATA_BATCH_OPERATION_UPDATE

+

an update operation

+
 

GDATA_BATCH_OPERATION_DELETION

+

a deletion operation

+
 
+
+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “authorization-domain” property

+
  “authorization-domain”     GDataAuthorizationDomain *
+

The authorization domain for the batch operation, against which the “authorizer” for the “service” should be +authorized. This may be NULL if authorization is not needed for any of the requests in the batch operation.

+

All requests in the batch operation must be authorizable under this single authorization domain. If requests need different authorization +domains, they must be performed in different batch operations.

+

Flags: Read / Write / Construct Only

+

Since: 0.9.0

+
+
+
+

The “feed-uri” property

+
  “feed-uri”                 gchar *
+

The feed URI that this batch operation will be sent to.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “service” property

+
  “service”                  GDataService *
+

The service this batch operation is attached to.

+

Flags: Read / Write / Construct Only

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataBatchable.html b/docs/reference/html/GDataBatchable.html new file mode 100644 index 0000000..f1f28a6 --- /dev/null +++ b/docs/reference/html/GDataBatchable.html @@ -0,0 +1,206 @@ + + + + +GDataBatchable: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataBatchable

+

GDataBatchable — GData batch service interface

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+GDataBatchOperation * + +gdata_batchable_create_operation () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataBatchable
 GDataBatchableIface
+
+
+

Object Hierarchy

+
    GInterface
+    ╰── GDataBatchable
+
+
+
+

Prerequisites

+

+GDataBatchable requires + GDataService.

+
+
+

Known Implementations

+

+GDataBatchable is implemented by + GDataCalendarService, GDataContactsService, GDataDocumentsService and GDataYouTubeService.

+
+
+

Includes

+
#include <gdata/gdata-batchable.h>
+
+
+
+

Description

+

GDataBatchable is an interface which can be implemented by GDataServices which support batch operations on their entries. It allows the +creation of a GDataBatchOperation for the service, which allows a set of batch operations to be run.

+
+
+

Functions

+
+

gdata_batchable_create_operation ()

+
GDataBatchOperation *
+gdata_batchable_create_operation (GDataBatchable *self,
+                                  GDataAuthorizationDomain *domain,
+                                  const gchar *feed_uri);
+

Creates a new GDataBatchOperation for the given GDataBatchable service, and with the given feed_uri +. feed_uri + is normally the GDATA_LINK_BATCH +link URI in the appropriate GDataFeed from the service. If authorization will be required to perform any of the requests in the batch operation, +domain + must be non-NULL, and must be an authorization domain which covers all of the requests. Otherwise, domain + may be NULL if authorization +is not required.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataBatchable

 

domain

the GDataAuthorizationDomain to authorize the operation, or NULL.

[allow-none]

feed_uri

the URI to send the batch operation request to

 
+
+
+

Returns

+

a new GDataBatchOperation; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

Types and Values

+
+

GDataBatchable

+
typedef struct _GDataBatchable GDataBatchable;
+

All the fields in the GDataBatchable structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataBatchableIface

+
typedef struct {
+	gboolean (*is_supported) (GDataBatchOperationType operation_type);
+} GDataBatchableIface;
+
+

All the fields in the GDataBatchableIface structure are private and should never be accessed directly.

+
+

Members

+
+++++ + + + + + +

is_supported ()

Determines whether the given GDataBatchOperationType is +supported by this GDataBatchable; if not, operations using it will return +GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION. It is valid for a +GDataBatchable to return FALSE for all GDataBatchOperationTypes if the +server no longer supports batch operations. If this method is not +implemented, it is assumed that all GDataBatchOperationTypes are +supported. Since: 0.17.2.

 
+
+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataCalendarAccessRule.html b/docs/reference/html/GDataCalendarAccessRule.html new file mode 100644 index 0000000..43d3a94 --- /dev/null +++ b/docs/reference/html/GDataCalendarAccessRule.html @@ -0,0 +1,222 @@ + + + + +GDataCalendarAccessRule: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataCalendarAccessRule

+

GDataCalendarAccessRule — GData Calendar access rule object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataAccessRule
+                ╰── GDataCalendarAccessRule
+
+
+
+

Includes

+
#include <gdata/services/calendar/gdata-calendar-access-rule.h>
+
+
+
+

Description

+

GDataCalendarAccessRule is a subclass of GDataAccessRule to represent an +access rule affecting users of a shared calendar in Google Calendar.

+
+
+

Functions

+
+

gdata_calendar_access_rule_new ()

+
GDataCalendarAccessRule *
+gdata_calendar_access_rule_new (const gchar *id);
+

Creates a new GDataCalendarAccessRule with the given ID and default +properties.

+
+

Parameters

+
+++++ + + + + + +

id

the access rule's ID, or NULL

 
+
+
+

Returns

+

a new GDataCalendarAccessRule; unref with +g_object_unref().

+

[transfer full]

+
+

Since: 0.17.2

+
+
+
+

Types and Values

+
+

GDATA_CALENDAR_ACCESS_ROLE_READ

+
#define GDATA_CALENDAR_ACCESS_ROLE_READ "http://schemas.google.com/gCal/2005#read"
+
+

The users specified by the GDataCalendarAccessRule have read-only access to +the calendar.

+

Since: 0.7.0

+
+
+
+

GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY

+
#define GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY "http://schemas.google.com/gCal/2005#freebusy"
+
+

The users specified by the GDataCalendarAccessRule can only see the +free/busy information on the calendar; not event details.

+

Since: 0.7.0

+
+
+
+

GDATA_CALENDAR_ACCESS_ROLE_EDITOR

+
#define GDATA_CALENDAR_ACCESS_ROLE_EDITOR "http://schemas.google.com/gCal/2005#editor"
+
+

The users specified by the GDataCalendarAccessRule have full edit access to +the calendar, except they can’t change the calendar’s access rules.

+

Since: 0.7.0

+
+
+
+

GDATA_CALENDAR_ACCESS_ROLE_OWNER

+
#define GDATA_CALENDAR_ACCESS_ROLE_OWNER "http://schemas.google.com/gCal/2005#owner"
+
+

The users specified by the GDataCalendarAccessRule have full owner access +to the calendar.

+

Since: 0.7.0

+
+
+
+

GDATA_CALENDAR_ACCESS_ROLE_ROOT

+
#define GDATA_CALENDAR_ACCESS_ROLE_ROOT "http://schemas.google.com/gCal/2005#root"
+
+

The users specified by the GDataCalendarAccessRule have full administrator +access to the calendar server. This is only available in Google Apps For +Your Domain.

+

Since: 0.7.0

+
+
+
+

GDataCalendarAccessRule

+
typedef struct _GDataCalendarAccessRule GDataCalendarAccessRule;
+

All the fields in the GDataCalendarAccessRule structure are private and +should never be accessed directly.

+

Since: 0.17.2

+
+
+
+

GDataCalendarAccessRuleClass

+
typedef struct {
+} GDataCalendarAccessRuleClass;
+
+

All the fields in the GDataCalendarAccessRuleClass structure are private +and should never be accessed directly.

+

Since: 0.17.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataCalendarCalendar.html b/docs/reference/html/GDataCalendarCalendar.html new file mode 100644 index 0000000..eb7f62d --- /dev/null +++ b/docs/reference/html/GDataCalendarCalendar.html @@ -0,0 +1,787 @@ + + + + +GDataCalendarCalendar: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataCalendarCalendar

+

GDataCalendarCalendar — GData Calendar calendar object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *access-levelRead
+GDataColor *colorRead / Write
gint64editedRead
gbooleanis-hiddenRead / Write
gbooleanis-selectedRead / Write
guinttimes-cleanedRead
+gchar *timezoneRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataCalendarCalendar
 GDataCalendarCalendarClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataCalendarCalendar
+
+
+
+

Implemented Interfaces

+

+GDataCalendarCalendar implements + GDataAccessHandler.

+
+
+

Includes

+
#include <gdata/services/calendar/gdata-calendar-calendar.h>
+
+
+
+

Description

+

GDataCalendarCalendar is a subclass of GDataEntry to represent a calendar from Google Calendar.

+

GDataCalendarCalendar implements GDataAccessHandler, meaning the access rules to it can be modified using that interface. As well as the +access roles defined for the base GDataAccessRule (e.g. GDATA_ACCESS_ROLE_NONE), GDataCalendarCalendar has its own, such as +GDATA_CALENDAR_ACCESS_ROLE_EDITOR and GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY.

+

For more details of Google Calendar's GData API, see the +online documentation.

+
+

Example 18. Listing Calendars

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
GDataCalendarService *service;
+GDataFeed *feed;
+GList *i;
+GError *error = NULL;
+
+/* Create a service */
+service = create_calendar_service ();
+
+/* Query for all of the calendars the currently authenticated user has access to, including those which they have read-only
+ * access to. */
+feed = gdata_calendar_service_query_all_calendars (service, NULL, NULL, NULL, NULL, &error);
+
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error querying for calendars: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Iterate through the returned calendars and do something with them */
+for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) {
+    const gchar *access_level;
+    gboolean has_write_access;
+    GDataCalendarCalendar *calendar = GDATA_CALENDAR_CALENDAR (i->data);
+
+    /* Determine whether we have write access to the calendar, or just read-only or free/busy access. Note that the access levels
+     * are more detailed than this; see the documentation for gdata_calendar_calendar_get_access_level() for more information. */
+    access_level = gdata_calendar_calendar_get_access_level (calendar);
+    has_write_access = (access_level != NULL && strcmp (access_level, GDATA_CALENDAR_ACCESS_ROLE_EDITOR) == 0) ? TRUE : FALSE;
+
+    /* Do something with the calendar here, such as insert it into a UI */
+}
+
+g_object_unref (feed);
+
+ +
+
+
+
+

Functions

+
+

gdata_calendar_calendar_new ()

+
GDataCalendarCalendar *
+gdata_calendar_calendar_new (const gchar *id);
+

Creates a new GDataCalendarCalendar with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the calendar's ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataCalendarCalendar; unref with g_object_unref()

+
+
+
+
+

gdata_calendar_calendar_get_color ()

+
void
+gdata_calendar_calendar_get_color (GDataCalendarCalendar *self,
+                                   GDataColor *color);
+

Gets the “color” property and puts it in color +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarCalendar

 

color

a GDataColor.

[out caller-allocates]
+
+
+
+
+

gdata_calendar_calendar_set_color ()

+
void
+gdata_calendar_calendar_set_color (GDataCalendarCalendar *self,
+                                   const GDataColor *color);
+

Sets the “color” property to color +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarCalendar

 

color

a new GDataColor

 
+
+
+
+
+

gdata_calendar_calendar_is_hidden ()

+
gboolean
+gdata_calendar_calendar_is_hidden (GDataCalendarCalendar *self);
+

Gets the “is-hidden” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarCalendar

 
+
+
+

Returns

+

TRUE if the calendar is hidden, FALSE otherwise

+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_calendar_set_is_hidden ()

+
void
+gdata_calendar_calendar_set_is_hidden (GDataCalendarCalendar *self,
+                                       gboolean is_hidden);
+

Sets the “is-hidden” property to is_hidden +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarCalendar

 

is_hidden

TRUE to hide the calendar, FALSE otherwise

 
+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_calendar_is_selected ()

+
gboolean
+gdata_calendar_calendar_is_selected (GDataCalendarCalendar *self);
+

Gets the “is-selected” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarCalendar

 
+
+
+

Returns

+

TRUE if the calendar is selected, FALSE otherwise

+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_calendar_set_is_selected ()

+
void
+gdata_calendar_calendar_set_is_selected
+                               (GDataCalendarCalendar *self,
+                                gboolean is_selected);
+

Sets the “is-selected” property to is_selected +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarCalendar

 

is_selected

TRUE to select the calendar, FALSE otherwise

 
+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_calendar_get_timezone ()

+
const gchar *
+gdata_calendar_calendar_get_timezone (GDataCalendarCalendar *self);
+

Gets the “timezone” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarCalendar

 
+
+
+

Returns

+

the calendar's timezone, or NULL

+
+
+
+
+

gdata_calendar_calendar_set_timezone ()

+
void
+gdata_calendar_calendar_set_timezone (GDataCalendarCalendar *self,
+                                      const gchar *_timezone);
+

Sets the “timezone” property to the new timezone, _timezone +.

+

Set _timezone + to NULL to unset the property in the calendar.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarCalendar

 

_timezone

a new timezone, or NULL.

[allow-none]
+
+
+
+
+

gdata_calendar_calendar_get_edited ()

+
gint64
+gdata_calendar_calendar_get_edited (GDataCalendarCalendar *self);
+
+

gdata_calendar_calendar_get_edited has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Unsupported by the online API any more. There is no + replacement; this will always return -1.

+
+

Gets the “edited” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarCalendar

 
+
+
+

Returns

+

the UNIX timestamp for the time the calendar was last edited, or -1

+
+
+
+
+

gdata_calendar_calendar_get_times_cleaned ()

+
guint
+gdata_calendar_calendar_get_times_cleaned
+                               (GDataCalendarCalendar *self);
+
+

gdata_calendar_calendar_get_times_cleaned has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Unsupported by the online API any more. There is no + replacement; this will always return 0.

+
+

Gets the “times-cleaned” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarCalendar

 
+
+
+

Returns

+

the number of times the calendar has been totally emptied

+
+
+
+
+

gdata_calendar_calendar_get_access_level ()

+
const gchar *
+gdata_calendar_calendar_get_access_level
+                               (GDataCalendarCalendar *self);
+

Gets the “access-level” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarCalendar

 
+
+
+

Returns

+

the authenticated user's access level to the calendar, or NULL

+
+
+
+
+

Types and Values

+
+

GDataCalendarCalendar

+
typedef struct _GDataCalendarCalendar GDataCalendarCalendar;
+

All the fields in the GDataCalendarCalendar structure are private and should never be accessed directly.

+
+
+
+

GDataCalendarCalendarClass

+
typedef struct {
+} GDataCalendarCalendarClass;
+
+

All the fields in the GDataCalendarCalendarClass structure are private and should never be accessed directly.

+
+
+
+

Property Details

+
+

The “access-level” property

+
  “access-level”             gchar *
+

Indicates the access level the current user has to the calendar. For example: GDATA_CALENDAR_ACCESS_ROLE_READ or +GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY. The "current user" is the one authenticated against the service's “authorizer”, +or the guest user.

+

Flags: Read

+

Default value: NULL

+
+
+
+

The “color” property

+
  “color”                    GDataColor *
+

The background color used to highlight the calendar in the user’s +browser. This used to be restricted to a limited set of colours, but +since 0.17.2 may be any RGB colour.

+

Flags: Read / Write

+
+
+
+

The “edited” property

+
  “edited”                   gint64
+

The last time the calendar was edited. If the calendar has not been edited yet, the content indicates the time it was created.

+

For more information, see the +Atom Publishing Protocol specification.

+
+

GDataCalendarCalendar:edited has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Unsupported by the online API any more. There +is no replacement; this will always return -1.

+
+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “is-hidden” property

+
  “is-hidden”                gboolean
+

Indicates whether the calendar is visible.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.2.0

+
+
+
+

The “is-selected” property

+
  “is-selected”              gboolean
+

Indicates whether the calendar is selected.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.2.0

+
+
+
+

The “times-cleaned” property

+
  “times-cleaned”            guint
+

The number of times the calendar has been cleared of events.

+
+

GDataCalendarCalendar:times-cleaned has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Unsupported by the online API any more. There + is no replacement; this will always return

+0. +
+

Flags: Read

+

Default value: 0

+
+
+
+

The “timezone” property

+
  “timezone”                 gchar *
+

The timezone in which the calendar's times are given. This is a timezone name in tz database notation: reference.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataCalendarEvent.html b/docs/reference/html/GDataCalendarEvent.html new file mode 100644 index 0000000..9294462 --- /dev/null +++ b/docs/reference/html/GDataCalendarEvent.html @@ -0,0 +1,1644 @@ + + + + +GDataCalendarEvent: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataCalendarEvent

+

GDataCalendarEvent — GData Calendar event object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataCalendarEvent * + +gdata_calendar_event_new () +
+GList * + +gdata_calendar_event_get_people () +
+void + +gdata_calendar_event_add_person () +
+GList * + +gdata_calendar_event_get_places () +
+void + +gdata_calendar_event_add_place () +
+GList * + +gdata_calendar_event_get_times () +
+gboolean + +gdata_calendar_event_get_primary_time () +
+void + +gdata_calendar_event_add_time () +
const gchar * + +gdata_calendar_event_get_recurrence () +
+void + +gdata_calendar_event_set_recurrence () +
+void + +gdata_calendar_event_get_original_event_details () +
+gboolean + +gdata_calendar_event_is_exception () +
+gboolean + +gdata_calendar_event_get_anyone_can_add_self () +
+void + +gdata_calendar_event_set_anyone_can_add_self () +
+gboolean + +gdata_calendar_event_get_guests_can_invite_others () +
+void + +gdata_calendar_event_set_guests_can_invite_others () +
+gboolean + +gdata_calendar_event_get_guests_can_modify () +
+void + +gdata_calendar_event_set_guests_can_modify () +
+gboolean + +gdata_calendar_event_get_guests_can_see_guests () +
+void + +gdata_calendar_event_set_guests_can_see_guests () +
+guint + +gdata_calendar_event_get_sequence () +
+void + +gdata_calendar_event_set_sequence () +
const gchar * + +gdata_calendar_event_get_status () +
+void + +gdata_calendar_event_set_status () +
const gchar * + +gdata_calendar_event_get_transparency () +
+void + +gdata_calendar_event_set_transparency () +
const gchar * + +gdata_calendar_event_get_uid () +
+void + +gdata_calendar_event_set_uid () +
const gchar * + +gdata_calendar_event_get_visibility () +
+void + +gdata_calendar_event_set_visibility () +
+gint64 + +gdata_calendar_event_get_edited () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gbooleananyone-can-add-selfRead / Write
gint64editedRead
gbooleanguests-can-invite-othersRead / Write
gbooleanguests-can-modifyRead / Write
gbooleanguests-can-see-guestsRead / Write
+gchar *original-event-idRead
+gchar *original-event-uriRead
+gchar *recurrenceRead / Write
guintsequenceRead / Write
+gchar *statusRead / Write
+gchar *transparencyRead / Write
+gchar *uidRead / Write
+gchar *visibilityRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataCalendarEvent
 GDataCalendarEventClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataCalendarEvent
+
+
+
+

Includes

+
#include <gdata/services/calendar/gdata-calendar-event.h>
+
+
+
+

Description

+

GDataCalendarEvent is a subclass of GDataEntry to represent an event on a calendar from Google Calendar.

+

For more details of Google Calendar's GData API, see the

+ +online documentation. +
+

Example 19. Adding a New Event to the Default Calendar

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
GDataCalendarService *service;
+GDataCalendarEvent *event, *new_event;
+GDataGDWhere *where;
+GDataGDWho *who;
+GDataGDWhen *when;
+GTimeVal current_time;
+GError *error = NULL;
+
+/* Create a service */
+service = create_calendar_service ();
+
+/* Create the new event */
+event = gdata_calendar_event_new (NULL);
+
+gdata_entry_set_title (GDATA_ENTRY (event), "Event Title");
+gdata_entry_set_content (GDATA_ENTRY (event), "Event description. This should be a few sentences long.");
+gdata_calendar_event_set_status (event, GDATA_GD_EVENT_STATUS_CONFIRMED);
+
+where = gdata_gd_where_new (NULL, "Description of the location", NULL);
+gdata_calendar_event_add_place (event, where);
+g_object_unref (where);
+
+who = gdata_gd_who_new (GDATA_GD_WHO_EVENT_ORGANIZER, "John Smith", "john.smith@gmail.com");
+gdata_calendar_event_add_person (event, who);
+g_object_unref (who);
+
+g_get_current_time (&current_time);
+when = gdata_gd_when_new (current_time.tv_sec, current_time.tv_sec + 3600, FALSE);
+gdata_calendar_event_add_time (event, when);
+g_object_unref (when);
+
+/* Insert the event in the calendar */
+new_event = gdata_calendar_service_insert_event (service, event, NULL, &error);
+
+g_object_unref (event);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error inserting event: %s", error->message);
+    g_error_free (error);
+    return NULL;
+}
+
+/* Do something with the new_event here, such as return it to the user or store its ID for later usage */
+
+g_object_unref (new_event);
+
+ +
+
+
+
+

Functions

+
+

gdata_calendar_event_new ()

+
GDataCalendarEvent *
+gdata_calendar_event_new (const gchar *id);
+

Creates a new GDataCalendarEvent with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the event's ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataCalendarEvent; unref with g_object_unref()

+
+
+
+
+

gdata_calendar_event_get_people ()

+
GList *
+gdata_calendar_event_get_people (GDataCalendarEvent *self);
+

Gets a list of the people attending the event.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

a GList of GDataGDWhos, or NULL.

+

[element-type GData.GDWho][transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_event_add_person ()

+
void
+gdata_calendar_event_add_person (GDataCalendarEvent *self,
+                                 GDataGDWho *who);
+

Adds the person who + to the event as a guest (attendee, organiser, performer, etc.), and increments its reference count.

+

Duplicate people will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

who

a GDataGDWho to add

 
+
+
+
+
+

gdata_calendar_event_get_places ()

+
GList *
+gdata_calendar_event_get_places (GDataCalendarEvent *self);
+

Gets a list of the locations associated with the event.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

a GList of GDataGDWheres, or NULL.

+

[element-type GData.GDWhere][transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_event_add_place ()

+
void
+gdata_calendar_event_add_place (GDataCalendarEvent *self,
+                                GDataGDWhere *where);
+

Adds the place where + to the event as a location and increments its reference count.

+

Duplicate places will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

where

a GDataGDWhere to add

 
+
+
+
+
+

gdata_calendar_event_get_times ()

+
GList *
+gdata_calendar_event_get_times (GDataCalendarEvent *self);
+

Gets a list of the time periods associated with the event.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

a GList of GDataGDWhens, or NULL.

+

[element-type GData.GDWhen][transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_event_get_primary_time ()

+
gboolean
+gdata_calendar_event_get_primary_time (GDataCalendarEvent *self,
+                                       gint64 *start_time,
+                                       gint64 *end_time,
+                                       GDataGDWhen **when);
+

Gets the first time period associated with the event, conveniently returning just its start and +end times if required.

+

If there are no time periods, or more than one time period, associated with the event, FALSE will +be returned, and the parameters will remain unmodified.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

start_time

a gint64 for the start time, or NULL.

[out caller-allocates]

end_time

a gint64 for the end time, or NULL.

[out caller-allocates]

when

a GDataGDWhen for the primary time structure, or NULL.

[out callee-allocates][transfer none]
+
+
+

Returns

+

TRUE if there is only one time period associated with the event, FALSE otherwise

+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_event_add_time ()

+
void
+gdata_calendar_event_add_time (GDataCalendarEvent *self,
+                               GDataGDWhen *when);
+

Adds when + to the event as a time period when the event happens, and increments its reference count.

+

Duplicate times will not be added to the list.

+

Note: gdata_calendar_event_add_time() and gdata_calendar_event_set_recurrence() are mutually +exclusive, as the server doesn't support positive exceptions to recurrence rules. If recurrences +are required, use gdata_calendar_event_set_recurrence(). Note that this means reminders cannot +be set for the event, as they are only supported by GDataGDWhen. No checks are performed for +these forbidden conditions, as to do so would break libgdata's API; if both a recurrence is set +and a specific time is added, the server will return an error when the GDataCalendarEvent is +inserted using gdata_service_insert_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

when

a GDataGDWhen to add

 
+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_event_get_recurrence ()

+
const gchar *
+gdata_calendar_event_get_recurrence (GDataCalendarEvent *self);
+

Gets the “recurrence” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

the event recurrence patterns, or NULL

+
+

Since: 0.3.0

+
+
+
+

gdata_calendar_event_set_recurrence ()

+
void
+gdata_calendar_event_set_recurrence (GDataCalendarEvent *self,
+                                     const gchar *recurrence);
+

Sets the “recurrence” property to the new recurrence, recurrence +.

+

Set recurrence + to NULL to unset the property in the event.

+

Note: gdata_calendar_event_add_time() and gdata_calendar_event_set_recurrence() are mutually +exclusive. See the documentation for gdata_calendar_event_add_time() for details.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

recurrence

a new event recurrence, or NULL.

[allow-none]
+
+

Since: 0.3.0

+
+
+
+

gdata_calendar_event_get_original_event_details ()

+
void
+gdata_calendar_event_get_original_event_details
+                               (GDataCalendarEvent *self,
+                                gchar **event_id,
+                                gchar **event_uri);
+

Gets details of the original event, if this event is an exception to a recurring event. The original +event's ID and the URI of the event's XML are returned in event_id + and event_uri +, respectively.

+

If this event is not an exception to a recurring event, event_id + and event_uri + will be set to NULL. +See gdata_calendar_event_is_exception() to determine more simply whether an event is an exception to a +recurring event.

+

If both event_id + and event_uri + are NULL, this function is a no-op. Otherwise, they should both be +freed with g_free().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

event_id

return location for the original event's ID, or NULL.

[out callee-allocates][transfer full]

event_uri

return location for the original event's URI, or NULL.

[out callee-allocates][transfer full]
+
+

Since: 0.3.0

+
+
+
+

gdata_calendar_event_is_exception ()

+
gboolean
+gdata_calendar_event_is_exception (GDataCalendarEvent *self);
+

Determines whether the event is an exception to a recurring event. If it is, details of the original event +can be retrieved using gdata_calendar_event_get_original_event_details().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

TRUE if the event is an exception, FALSE otherwise

+
+

Since: 0.3.0

+
+
+
+

gdata_calendar_event_get_anyone_can_add_self ()

+
gboolean
+gdata_calendar_event_get_anyone_can_add_self
+                               (GDataCalendarEvent *self);
+

Gets the “anyone-can-add-self” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

TRUE if anyone can add themselves as an attendee to the event, FALSE otherwise

+
+
+
+
+

gdata_calendar_event_set_anyone_can_add_self ()

+
void
+gdata_calendar_event_set_anyone_can_add_self
+                               (GDataCalendarEvent *self,
+                                gboolean anyone_can_add_self);
+

Sets the “anyone-can-add-self” property to anyone_can_add_self +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

anyone_can_add_self

TRUE if anyone can add themselves as an attendee to the event, FALSE otherwise

 
+
+
+
+
+

gdata_calendar_event_get_guests_can_invite_others ()

+
gboolean
+gdata_calendar_event_get_guests_can_invite_others
+                               (GDataCalendarEvent *self);
+

Gets the “guests-can-invite-others” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

TRUE if attendees can invite others to the event, FALSE otherwise

+
+
+
+
+

gdata_calendar_event_set_guests_can_invite_others ()

+
void
+gdata_calendar_event_set_guests_can_invite_others
+                               (GDataCalendarEvent *self,
+                                gboolean guests_can_invite_others);
+

Sets the “guests-can-invite-others” property to guests_can_invite_others +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

guests_can_invite_others

TRUE if attendees can invite others to the event, FALSE otherwise

 
+
+
+
+
+

gdata_calendar_event_get_guests_can_modify ()

+
gboolean
+gdata_calendar_event_get_guests_can_modify
+                               (GDataCalendarEvent *self);
+

Gets the “guests-can-modify” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

TRUE if attendees can modify the original event, FALSE otherwise

+
+
+
+
+

gdata_calendar_event_set_guests_can_modify ()

+
void
+gdata_calendar_event_set_guests_can_modify
+                               (GDataCalendarEvent *self,
+                                gboolean guests_can_modify);
+

Sets the “guests-can-modify” property to guests_can_modify +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

guests_can_modify

TRUE if attendees can modify the original event, FALSE otherwise

 
+
+
+
+
+

gdata_calendar_event_get_guests_can_see_guests ()

+
gboolean
+gdata_calendar_event_get_guests_can_see_guests
+                               (GDataCalendarEvent *self);
+

Gets the “guests-can-see-guests” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

TRUE if attendees can see who's attending the event, FALSE otherwise

+
+
+
+
+

gdata_calendar_event_set_guests_can_see_guests ()

+
void
+gdata_calendar_event_set_guests_can_see_guests
+                               (GDataCalendarEvent *self,
+                                gboolean guests_can_see_guests);
+

Sets the “guests-can-see-guests” property to guests_can_see_guests +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

guests_can_see_guests

TRUE if attendees can see who's attending the event, FALSE otherwise

 
+
+
+
+
+

gdata_calendar_event_get_sequence ()

+
guint
+gdata_calendar_event_get_sequence (GDataCalendarEvent *self);
+

Gets the “sequence” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

the event's sequence number

+
+
+
+
+

gdata_calendar_event_set_sequence ()

+
void
+gdata_calendar_event_set_sequence (GDataCalendarEvent *self,
+                                   guint sequence);
+

Sets the “sequence” property to the new sequence number, sequence +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

sequence

a new sequence number, or 0

 
+
+
+
+
+

gdata_calendar_event_get_status ()

+
const gchar *
+gdata_calendar_event_get_status (GDataCalendarEvent *self);
+

Gets the “status” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

the event status, or NULL

+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_event_set_status ()

+
void
+gdata_calendar_event_set_status (GDataCalendarEvent *self,
+                                 const gchar *status);
+

Sets the “status” property to the new status, status +.

+

Set status + to NULL to unset the property in the event.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

status

a new event status, or NULL.

[allow-none]
+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_event_get_transparency ()

+
const gchar *
+gdata_calendar_event_get_transparency (GDataCalendarEvent *self);
+

Gets the “transparency” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

the event transparency, or NULL

+
+
+
+
+

gdata_calendar_event_set_transparency ()

+
void
+gdata_calendar_event_set_transparency (GDataCalendarEvent *self,
+                                       const gchar *transparency);
+

Sets the “transparency” property to the new transparency, transparency +.

+

Set transparency + to NULL to unset the property in the event.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

transparency

a new event transparency, or NULL.

[allow-none]
+
+
+
+
+

gdata_calendar_event_get_uid ()

+
const gchar *
+gdata_calendar_event_get_uid (GDataCalendarEvent *self);
+

Gets the “uid” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

the event's UID, or NULL

+
+
+
+
+

gdata_calendar_event_set_uid ()

+
void
+gdata_calendar_event_set_uid (GDataCalendarEvent *self,
+                              const gchar *uid);
+

Sets the “uid” property to the new UID, uid +.

+

Set uid + to NULL to unset the property in the event.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

uid

a new event UID, or NULL.

[allow-none]
+
+
+
+
+

gdata_calendar_event_get_visibility ()

+
const gchar *
+gdata_calendar_event_get_visibility (GDataCalendarEvent *self);
+

Gets the “visibility” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

the event visibility, or NULL

+
+
+
+
+

gdata_calendar_event_set_visibility ()

+
void
+gdata_calendar_event_set_visibility (GDataCalendarEvent *self,
+                                     const gchar *visibility);
+

Sets the “visibility” property to the new visibility, visibility +.

+

Set visibility + to NULL to unset the property in the event.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarEvent

 

visibility

a new event visibility, or NULL.

[allow-none]
+
+
+
+
+

gdata_calendar_event_get_edited ()

+
gint64
+gdata_calendar_event_get_edited (GDataCalendarEvent *self);
+

Gets the “edited” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarEvent

 
+
+
+

Returns

+

the UNIX timestamp for the time the event was last edited, or -1

+
+
+
+
+

Types and Values

+
+

GDataCalendarEvent

+
typedef struct _GDataCalendarEvent GDataCalendarEvent;
+

All the fields in the GDataCalendarEvent structure are private and should never be accessed directly.

+
+
+
+

GDataCalendarEventClass

+
typedef struct {
+} GDataCalendarEventClass;
+
+

All the fields in the GDataCalendarEventClass structure are private and should never be accessed directly.

+
+
+
+

Property Details

+
+

The “anyone-can-add-self” property

+
  “anyone-can-add-self”      gboolean
+

Indicates whether anyone can invite themselves to the event, by adding themselves to the attendee list.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “edited” property

+
  “edited”                   gint64
+

The last time the event was edited. If the event has not been edited yet, the content indicates the time it was created.

+

For more information, see the +Atom Publishing Protocol specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “guests-can-invite-others” property

+
  “guests-can-invite-others” gboolean
+

Indicates whether attendees may invite others to the event.

+

For more information, see the GData specification.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “guests-can-modify” property

+
  “guests-can-modify”        gboolean
+

Indicates whether attendees may modify the original event, so that changes are visible to organizers and other attendees. +Otherwise, any changes made by attendees will be restricted to that attendee's calendar.

+

For more information, see the

+ +GData specification. +

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “guests-can-see-guests” property

+
  “guests-can-see-guests”    gboolean
+

Indicates whether attendees can see other people invited to the event.

+

For more information, see the

+ +GData specification. +

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “original-event-id” property

+
  “original-event-id”        gchar *
+

The event ID for the original event, if this event is an exception to a recurring event.

+

Flags: Read

+

Default value: NULL

+

Since: 0.3.0

+
+
+
+

The “original-event-uri” property

+
  “original-event-uri”       gchar *
+

The event URI for the original event, if this event is an exception to a recurring event.

+

Flags: Read

+

Default value: NULL

+

Since: 0.3.0

+
+
+
+

The “recurrence” property

+
  “recurrence”               gchar *
+

Represents the dates and times when a recurring event takes place. The returned string is in iCal format, as a list of properties.

+

For more information, see the +GData specification.

+

Note: gdata_calendar_event_add_time() and gdata_calendar_event_set_recurrence() are mutually +exclusive. See the documentation for gdata_calendar_event_add_time() for details.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.3.0

+
+
+
+

The “sequence” property

+
  “sequence”                 guint
+

The revision sequence number of the event as defined in Section 4.8.7.4 of RFC 2445.

+

Flags: Read / Write

+

Default value: 0

+
+
+
+

The “status” property

+
  “status”                   gchar *
+

The scheduling status of the event. For example: GDATA_GD_EVENT_STATUS_CANCELED or GDATA_GD_EVENT_STATUS_CONFIRMED.

+

For more information, see the +GData specification.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.2.0

+
+
+
+

The “transparency” property

+
  “transparency”             gchar *
+

How the event is marked as consuming time on a calendar. For example: GDATA_GD_EVENT_TRANSPARENCY_OPAQUE or +GDATA_GD_EVENT_TRANSPARENCY_TRANSPARENT.

+

For more information, see the +GData specification.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “uid” property

+
  “uid”                      gchar *
+

The globally unique identifier (UID) of the event as defined in Section 4.8.4.7 of RFC 2445.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “visibility” property

+
  “visibility”               gchar *
+

The event's visibility to calendar users. For example: GDATA_GD_EVENT_VISIBILITY_PUBLIC or GDATA_GD_EVENT_VISIBILITY_DEFAULT.

+

For more information, see the +GData specification.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataCalendarFeed.html b/docs/reference/html/GDataCalendarFeed.html new file mode 100644 index 0000000..d4c5792 --- /dev/null +++ b/docs/reference/html/GDataCalendarFeed.html @@ -0,0 +1,250 @@ + + + + +GDataCalendarFeed: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataCalendarFeed

+

GDataCalendarFeed — GData Calendar feed object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + +
const gchar * + +gdata_calendar_feed_get_timezone () +
+guint + +gdata_calendar_feed_get_times_cleaned () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + +
guinttimes-cleanedRead
+gchar *timezoneRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataCalendarFeed
 GDataCalendarFeedClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataFeed
+            ╰── GDataCalendarFeed
+
+
+
+

Includes

+
#include <gdata/services/calendar/gdata-calendar-feed.h>
+
+
+
+

Description

+

GDataCalendarFeed is a subclass of GDataFeed to represent a results feed from Google Calendar. It adds a couple of +properties which are specific to the Google Calendar API.

+
+
+

Functions

+
+

gdata_calendar_feed_get_timezone ()

+
const gchar *
+gdata_calendar_feed_get_timezone (GDataCalendarFeed *self);
+
+

gdata_calendar_feed_get_timezone has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Unsupported by the online API any more. There is no + replacement; this will always return NULL.

+
+

Gets the “timezone” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarFeed

 
+
+
+

Returns

+

the feed's timezone, or NULL

+
+

Since: 0.3.0

+
+
+
+

gdata_calendar_feed_get_times_cleaned ()

+
guint
+gdata_calendar_feed_get_times_cleaned (GDataCalendarFeed *self);
+
+

gdata_calendar_feed_get_times_cleaned has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Unsupported by the online API any more. There is no + replacement; this will always return NULL.

+
+

Gets the “times-cleaned” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarFeed

 
+
+
+

Returns

+

the number of times the feed has been totally emptied

+
+

Since: 0.3.0

+
+
+
+

Types and Values

+
+

GDataCalendarFeed

+
typedef struct _GDataCalendarFeed GDataCalendarFeed;
+

All the fields in the GDataCalendarFeed structure are private and should never be accessed directly.

+

Since: 0.3.0

+
+
+
+

GDataCalendarFeedClass

+
typedef struct {
+} GDataCalendarFeedClass;
+
+

All the fields in the GDataCalendarFeedClass structure are private and should never be accessed directly.

+

Since: 0.3.0

+
+
+
+

Property Details

+
+

The “times-cleaned” property

+
  “times-cleaned”            guint
+

The number of times the feed has been completely cleared of entries.

+
+

GDataCalendarFeed:times-cleaned has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Unsupported by the online API any more. There + is no replacement; this will always return 0.

+
+

Flags: Read

+

Default value: 0

+

Since: 0.3.0

+
+
+
+

The “timezone” property

+
  “timezone”                 gchar *
+

The timezone in which the feed's times are given. This is a timezone name in tz database notation: reference.

+
+

GDataCalendarFeed:timezone has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Unsupported by the online API any more. There + is no replacement; this will always return NULL.

+
+

Flags: Read

+

Default value: NULL

+

Since: 0.3.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataCalendarQuery.html b/docs/reference/html/GDataCalendarQuery.html new file mode 100644 index 0000000..f6030e6 --- /dev/null +++ b/docs/reference/html/GDataCalendarQuery.html @@ -0,0 +1,1346 @@ + + + + +GDataCalendarQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataCalendarQuery

+

GDataCalendarQuery — GData Calendar query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataCalendarQuery * + +gdata_calendar_query_new () +
+GDataCalendarQuery * + +gdata_calendar_query_new_with_limits () +
+gboolean + +gdata_calendar_query_get_future_events () +
+void + +gdata_calendar_query_set_future_events () +
+gboolean + +gdata_calendar_query_get_single_events () +
+void + +gdata_calendar_query_set_single_events () +
const gchar * + +gdata_calendar_query_get_order_by () +
+void + +gdata_calendar_query_set_order_by () +
const gchar * + +gdata_calendar_query_get_sort_order () +
+void + +gdata_calendar_query_set_sort_order () +
+gint64 + +gdata_calendar_query_get_start_min () +
+void + +gdata_calendar_query_set_start_min () +
+gint64 + +gdata_calendar_query_get_start_max () +
+void + +gdata_calendar_query_set_start_max () +
+gint64 + +gdata_calendar_query_get_recurrence_expansion_start () +
+void + +gdata_calendar_query_set_recurrence_expansion_start () +
+gint64 + +gdata_calendar_query_get_recurrence_expansion_end () +
+void + +gdata_calendar_query_set_recurrence_expansion_end () +
const gchar * + +gdata_calendar_query_get_timezone () +
+void + +gdata_calendar_query_set_timezone () +
+guint + +gdata_calendar_query_get_max_attendees () +
+void + +gdata_calendar_query_set_max_attendees () +
+gboolean + +gdata_calendar_query_show_deleted () +
+void + +gdata_calendar_query_set_show_deleted () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gbooleanfuture-eventsRead / Write
guintmax-attendeesRead / Write
+gchar *order-byRead / Write
gint64recurrence-expansion-endRead / Write
gint64recurrence-expansion-startRead / Write
gbooleanshow-deletedRead / Write
gbooleansingle-eventsRead / Write
+gchar *sort-orderRead / Write
gint64start-maxRead / Write
gint64start-minRead / Write
+gchar *timezoneRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataCalendarQuery
 GDataCalendarQueryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ╰── GDataCalendarQuery
+
+
+
+

Includes

+
#include <gdata/services/calendar/gdata-calendar-query.h>
+
+
+
+

Description

+

GDataCalendarQuery represents a collection of query parameters specific to the Google Calendar service, which go above and beyond +those catered for by GDataQuery.

+

For more information on the custom GData query parameters supported by GDataCalendarQuery, see the online +documentation.

+
+

Example 17. Querying for Events

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
GDataCalendarService *service;
+GDataCalendarCalendar *calendar;
+GDataCalendarQuery *query;
+GDataFeed *feed;
+GTimeVal current_time;
+GList *i;
+GError *error = NULL;
+
+/* Create a service and find a calendar to query in */
+service = create_calendar_service ();
+calendar = get_calendar (service);
+
+/* Create the query to use. We're going to query for events within the next week which match the search term "party",
+ * ordered by last modification time (descending). */
+g_get_current_time (&current_time);
+query = gdata_calendar_query_new_with_limits ("party", current_time.tv_sec, current_time.tv_sec + 7 * 24 * 60 * 60);
+gdata_calendar_query_set_order_by (query, "lastmodified");
+
+/* Execute the query */
+feed = gdata_calendar_service_query_events (service, calendar, query, NULL, NULL, NULL, &error);
+
+g_object_unref (query);
+g_object_unref (calendar);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error querying for events: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Iterate through the returned events and do something with them */
+for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) {
+    GDataCalendarEvent *event = GDATA_CALENDAR_EVENT (i->data);
+
+    /* Do something with the event here, such as insert it into a UI */
+}
+
+g_object_unref (feed);
+
+ +
+
+
+
+

Functions

+
+

gdata_calendar_query_new ()

+
GDataCalendarQuery *
+gdata_calendar_query_new (const gchar *q);
+

Creates a new GDataCalendarQuery with its “q” property set to q +.

+
+

Parameters

+
+++++ + + + + + +

q

a query string, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataCalendarQuery

+
+
+
+
+

gdata_calendar_query_new_with_limits ()

+
GDataCalendarQuery *
+gdata_calendar_query_new_with_limits (const gchar *q,
+                                      gint64 start_min,
+                                      gint64 start_max);
+

Creates a new GDataCalendarQuery with its “q” property set to q +, and the time limits start_min + and start_max + +applied (both in seconds since the UNIX epoch).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

q

a query string, or NULL.

[allow-none]

start_min

a starting time for the event period, or -1

 

start_max

an ending time for the event period, or -1

 
+
+
+

Returns

+

a new GDataCalendarQuery

+
+
+
+
+

gdata_calendar_query_get_future_events ()

+
gboolean
+gdata_calendar_query_get_future_events
+                               (GDataCalendarQuery *self);
+

Gets the “future-events” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the future events property

+
+
+
+
+

gdata_calendar_query_set_future_events ()

+
void
+gdata_calendar_query_set_future_events
+                               (GDataCalendarQuery *self,
+                                gboolean future_events);
+

Sets the “future-events” property of the GDataCalendarQuery to future_events +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

future_events

TRUE to unconditionally show future events, FALSE otherwise

 
+
+
+
+
+

gdata_calendar_query_get_single_events ()

+
gboolean
+gdata_calendar_query_get_single_events
+                               (GDataCalendarQuery *self);
+

Gets the “single-events” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the single events property

+
+
+
+
+

gdata_calendar_query_set_single_events ()

+
void
+gdata_calendar_query_set_single_events
+                               (GDataCalendarQuery *self,
+                                gboolean single_events);
+

Sets the “single-events” property of the GDataCalendarQuery to single_events +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

single_events

TRUE to show recurring events as single events, FALSE otherwise

 
+
+
+
+
+

gdata_calendar_query_get_order_by ()

+
const gchar *
+gdata_calendar_query_get_order_by (GDataCalendarQuery *self);
+

Gets the “order-by” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the order by property, or NULL if it is unset

+
+
+
+
+

gdata_calendar_query_set_order_by ()

+
void
+gdata_calendar_query_set_order_by (GDataCalendarQuery *self,
+                                   const gchar *order_by);
+

Sets the “order-by” property of the GDataCalendarQuery to the new order by string, order_by +.

+

Set order_by + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

order_by

a new order by string, or NULL.

[allow-none]
+
+
+
+
+

gdata_calendar_query_get_sort_order ()

+
const gchar *
+gdata_calendar_query_get_sort_order (GDataCalendarQuery *self);
+
+

gdata_calendar_query_get_sort_order has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Manually sort the results after retrieving them, as this is no longer supported on the server.

+
+

Gets the “sort-order” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the sort order property, or NULL if it is unset

+
+
+
+
+

gdata_calendar_query_set_sort_order ()

+
void
+gdata_calendar_query_set_sort_order (GDataCalendarQuery *self,
+                                     const gchar *sort_order);
+
+

gdata_calendar_query_set_sort_order has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Manually sort the results after retrieving them, as this is no longer supported on the server.

+
+

Sets the “sort-order” property of the GDataCalendarQuery to the new sort order string, sort_order +.

+

Set sort_order + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

sort_order

a new sort order string, or NULL.

[allow-none]
+
+
+
+
+

gdata_calendar_query_get_start_min ()

+
gint64
+gdata_calendar_query_get_start_min (GDataCalendarQuery *self);
+

Gets the “start-min” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the UNIX timestamp (in seconds) for the start-min property, or -1

+
+
+
+
+

gdata_calendar_query_set_start_min ()

+
void
+gdata_calendar_query_set_start_min (GDataCalendarQuery *self,
+                                    gint64 start_min);
+

Sets the “start-min” property of the GDataCalendarQuery +to the new time/date, start_min +.

+

Set start_min + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

start_min

a new minimum start time (in seconds since the UNIX epoch), or -1

 
+
+
+
+
+

gdata_calendar_query_get_start_max ()

+
gint64
+gdata_calendar_query_get_start_max (GDataCalendarQuery *self);
+

Gets the “start-max” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the UNIX timestamp (in seconds) for the start-max property, or -1

+
+
+
+
+

gdata_calendar_query_set_start_max ()

+
void
+gdata_calendar_query_set_start_max (GDataCalendarQuery *self,
+                                    gint64 start_max);
+

Sets the “start-max” property of the GDataCalendarQuery +to the new time/date, start_max +.

+

Set start_max + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

start_max

a new maximum start time (in seconds since the UNIX epoch), or -1

 
+
+
+
+
+

gdata_calendar_query_get_recurrence_expansion_start ()

+
gint64
+gdata_calendar_query_get_recurrence_expansion_start
+                               (GDataCalendarQuery *self);
+
+

gdata_calendar_query_get_recurrence_expansion_start has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Use “single-events” instead, as this is no longer supported on the server.

+
+

Gets the “recurrence-expansion-start” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the UNIX timestamp for the recurrence-expansion-start property, or -1

+
+
+
+
+

gdata_calendar_query_set_recurrence_expansion_start ()

+
void
+gdata_calendar_query_set_recurrence_expansion_start
+                               (GDataCalendarQuery *self,
+                                gint64 start);
+
+

gdata_calendar_query_set_recurrence_expansion_start has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Use “single-events” instead, as this is no longer supported on the server.

+
+

Sets the “recurrence-expansion-start” property of the GDataCalendarQuery +to the new time/date, start +.

+

Set start + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

start

a new start time, or -1

 
+
+
+
+
+

gdata_calendar_query_get_recurrence_expansion_end ()

+
gint64
+gdata_calendar_query_get_recurrence_expansion_end
+                               (GDataCalendarQuery *self);
+
+

gdata_calendar_query_get_recurrence_expansion_end has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Use “single-events” instead, as this is no longer supported on the server.

+
+

Gets the “recurrence-expansion-end” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the UNIX timestamp for the recurrence-expansion-end property, or -1

+
+
+
+
+

gdata_calendar_query_set_recurrence_expansion_end ()

+
void
+gdata_calendar_query_set_recurrence_expansion_end
+                               (GDataCalendarQuery *self,
+                                gint64 end);
+
+

gdata_calendar_query_set_recurrence_expansion_end has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Use “single-events” instead, as this is no longer supported on the server.

+
+

Sets the “recurrence-expansion-end” property of the GDataCalendarQuery +to the new time/date, end +.

+

Set end + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

end

a new end time, or -1

 
+
+
+
+
+

gdata_calendar_query_get_timezone ()

+
const gchar *
+gdata_calendar_query_get_timezone (GDataCalendarQuery *self);
+

Gets the “timezone” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the timezone property, or NULL if it is unset

+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_query_set_timezone ()

+
void
+gdata_calendar_query_set_timezone (GDataCalendarQuery *self,
+                                   const gchar *_timezone);
+

Sets the “timezone” property of the GDataCalendarQuery to the new timezone string, timezone +.

+

Set timezone + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

_timezone

a new timezone string, or NULL.

[allow-none]
+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_query_get_max_attendees ()

+
guint
+gdata_calendar_query_get_max_attendees
+                               (GDataCalendarQuery *self);
+

Gets the “max-attendees” property. If the property is unset, 0 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

the maximum number of attendees, or 0

+
+

Since: 0.9.1

+
+
+
+

gdata_calendar_query_set_max_attendees ()

+
void
+gdata_calendar_query_set_max_attendees
+                               (GDataCalendarQuery *self,
+                                guint max_attendees);
+

Sets the “max-attendees” property of the GDataCalendarQuery to the new value, max_attendees +.

+

Set max_attendees + to 0 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

max_attendees

a new maximum attendee count, or 0

 
+
+

Since: 0.9.1

+
+
+
+

gdata_calendar_query_show_deleted ()

+
gboolean
+gdata_calendar_query_show_deleted (GDataCalendarQuery *self);
+

Gets the “show-deleted” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCalendarQuery

 
+
+
+

Returns

+

TRUE if deleted/cancelled events should be shown, FALSE otherwise

+
+

Since: 0.9.1

+
+
+
+

gdata_calendar_query_set_show_deleted ()

+
void
+gdata_calendar_query_set_show_deleted (GDataCalendarQuery *self,
+                                       gboolean show_deleted);
+

Sets the “show-deleted” property of the GDataCalendarQuery.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCalendarQuery

 

show_deleted

TRUE to show deleted events, FALSE otherwise

 
+
+

Since: 0.9.1

+
+
+
+

Types and Values

+
+

GDataCalendarQuery

+
typedef struct _GDataCalendarQuery GDataCalendarQuery;
+

All the fields in the GDataCalendarQuery structure are private and should never be accessed directly.

+
+
+
+

GDataCalendarQueryClass

+
typedef struct {
+} GDataCalendarQueryClass;
+
+

All the fields in the GDataCalendarQueryClass structure are private and should never be accessed directly.

+
+
+
+

Property Details

+
+

The “future-events” property

+
  “future-events”            gboolean
+

A shortcut to request all events scheduled for the future. Overrides the +“recurrence-expansion-start”, “recurrence-expansion-end”, +“start-min” and “start-max” properties.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “max-attendees” property

+
  “max-attendees”            guint
+

Specifies the maximum number of attendees to list for an event. If the actual number of attendees for an event is greater than this value, +only the current user and the event organiser are listed.

+

Flags: Read / Write

+

Default value: 0

+

Since: 0.9.1

+
+
+
+

The “order-by” property

+
  “order-by”                 gchar *
+

Specifies order of entries in a feed. Supported values are lastmodified and +starttime.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “recurrence-expansion-end” property

+
  “recurrence-expansion-end” gint64
+

Specifies the end of the time period to expand recurring events for, exclusive.

+
+

GDataCalendarQuery:recurrence-expansion-end has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Use “single-events” instead, as this is no longer supported on the server.

+
+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “recurrence-expansion-start” property

+
  “recurrence-expansion-start” gint64
+

Specifies the beginning of the time period to expand recurring events for, inclusive.

+
+

GDataCalendarQuery:recurrence-expansion-start has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Use “single-events” instead, as this is no longer supported on the server.

+
+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “show-deleted” property

+
  “show-deleted”             gboolean
+

Whether to include deleted/cancelled events in the query feed. Deleted events have their “status” property set to +GDATA_GD_EVENT_STATUS_CANCELED. They do not normally appear in query results.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.9.1

+
+
+
+

The “single-events” property

+
  “single-events”            gboolean
+

Indicates whether recurring events should be expanded or represented as a single event.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “sort-order” property

+
  “sort-order”               gchar *
+

Specifies direction of sorting. Supported values are ascending and +descending.

+

By default, results are returned in ascending order.

+
+

GDataCalendarQuery:sort-order has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Manually sort the results after retrieving them, as this is no longer supported on the server.

+
+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “start-max” property

+
  “start-max”                gint64
+

Together with “start-min”, creates a timespan such that only events within the timespan are returned

+

“start-min” is inclusive, while “start-max” is exclusive. Events that overlap the range are +included. Both are specified in seconds since the UNIX epoch.

+

If not specified, the default “start-max” is 2031-01-01.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “start-min” property

+
  “start-min”                gint64
+

Together with “start-max”, creates a timespan such that only events within the timespan are returned.

+

“start-min” is inclusive, while “start-max” is exclusive. Events that overlap the range are +included. Both are specified in seconds since the UNIX epoch.

+

If not specified, the default “start-min” is 1970-01-01.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “timezone” property

+
  “timezone”                 gchar *
+

The current timezone. If this is not specified, all times are returned in UTC.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.2.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataCalendarService.html b/docs/reference/html/GDataCalendarService.html new file mode 100644 index 0000000..9d8a52a --- /dev/null +++ b/docs/reference/html/GDataCalendarService.html @@ -0,0 +1,1162 @@ + + + + +GDataCalendarService: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataCalendarService

+

GDataCalendarService — GData Calendar service object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataCalendarService
 GDataCalendarServiceClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataService
+        ╰── GDataCalendarService
+
+
+
+

Implemented Interfaces

+

+GDataCalendarService implements + GDataBatchable.

+
+
+

Includes

+
#include <gdata/services/calendar/gdata-calendar-service.h>
+
+
+
+

Description

+

GDataCalendarService is a subclass of GDataService for communicating with the GData API of Google Calendar. It supports querying +for, inserting, editing and deleting events from calendars, as well as operations on the calendars themselves.

+

For more details of Google Calendar's GData API, see the

+ +online documentation. +

Each calendar accessible through the service has an access control list (ACL) which defines the level of access to the calendar to each user, and +which users the calendar is shared with. For more information about ACLs for calendars, see the

+online documentation on +sharing calendars. +
+

Example 16. Retrieving the Access Control List for a Calendar

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
GDataCalendarService *service;
+GDataCalendarCalendar *calendar;
+GDataFeed *acl_feed;
+GDataAccessRule *rule, *new_rule;
+GDataLink *acl_link;
+GList *i;
+GError *error = NULL;
+
+/* Create a service and retrieve a calendar to work on */
+service = create_calendar_service ();
+calendar = get_calendar (service);
+
+/* Query the service for the ACL for the given calendar */
+acl_feed = gdata_access_handler_get_rules (GDATA_ACCESS_HANDLER (calendar), GDATA_SERVICE (service), NULL, NULL, NULL, &error);
+
+if (error != NULL) {
+    g_error ("Error getting ACL feed for calendar: %s", error->message);
+    g_error_free (error);
+    g_object_unref (calendar);
+    g_object_unref (service);
+    return;
+}
+
+/* Iterate through the ACL */
+for (i = gdata_feed_get_entries (acl_feed); i != NULL; i = i->next) {
+    const gchar *scope_value;
+
+    rule = GDATA_ACCESS_RULE (i->data);
+
+    /* Do something with the access rule here. As an example, we update the rule applying to test@gmail.com and delete all
+     * the other rules. We then insert another rule for example@gmail.com below. */
+    gdata_access_rule_get_scope (rule, NULL, &scope_value);
+    if (scope_value != NULL && strcmp (scope_value, "test@gmail.com") == 0) {
+        GDataAccessRule *updated_rule;
+
+        /* Update the rule to make test@gmail.com an editor (full read/write access to the calendar, but they can't change
+         * the ACL). */
+        gdata_access_rule_set_role (rule, GDATA_CALENDAR_ACCESS_ROLE_EDITOR);
+        updated_rule = GDATA_ACCESS_RULE (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (rule), NULL, &error));
+
+        if (error != NULL) {
+            g_error ("Error updating access rule for %s: %s", scope_value, error->message);
+            g_error_free (error);
+            g_object_unref (acl_feed);
+            g_object_unref (calendar);
+            g_object_unref (service);
+            return;
+        }
+
+        g_object_unref (updated_rule);
+    } else {
+        /* Delete any rule which doesn't apply to test@gmail.com */
+        gdata_service_delete_entry (GDATA_SERVICE (service), GDATA_ENTRY (rule), NULL, &error);
+
+        if (error != NULL) {
+            g_error ("Error deleting access rule for %s: %s", scope_value, error->message);
+            g_error_free (error);
+            g_object_unref (acl_feed);
+            g_object_unref (calendar);
+            g_object_unref (service);
+            return;
+        }
+    }
+}
+
+g_object_unref (acl_feed);
+
+/* Create and insert a new access rule for example@gmail.com which allows them to view free/busy information for events in the
+ * calendar, but doesn't allow them to view the full event details. */
+rule = gdata_access_rule_new (NULL);
+gdata_access_rule_set_role (rule, GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY);
+gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_USER, "example@gmail.com");
+
+acl_link = gdata_entry_look_up_link (GDATA_ENTRY (calendar), GDATA_LINK_ACCESS_CONTROL_LIST);
+new_rule = GDATA_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), gdata_link_get_uri (acl_link), GDATA_ENTRY (rule),
+                                                          NULL, &error));
+
+g_object_unref (rule);
+g_object_unref (calendar);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error inserting access rule: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+g_object_unref (acl_link);
+
+ +
+

Before version 0.17.2, the Calendar service could be manipulated using +batch operations. That is no longer supported, and any batch operations +created on the calendar will fail.

+
+
+

Functions

+
+

gdata_calendar_service_new ()

+
GDataCalendarService *
+gdata_calendar_service_new (GDataAuthorizer *authorizer);
+

Creates a new GDataCalendarService using the given GDataAuthorizer. If authorizer + is NULL, all requests are made as an unauthenticated user.

+
+

Parameters

+
+++++ + + + + + +

authorizer

a GDataAuthorizer to authorize the service's requests, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataCalendarService, or NULL; unref with g_object_unref()

+
+

Since: 0.9.0

+
+
+
+

gdata_calendar_service_get_primary_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_calendar_service_get_primary_authorization_domain
+                               (void);
+

The primary GDataAuthorizationDomain for interacting with Google Calendar. This will not normally need to be used, as it's used internally +by the GDataCalendarService methods. However, if using the plain GDataService methods to implement custom queries or requests which libgdata +does not support natively, then this domain may be needed to authorize the requests.

+

The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.

+
+

Returns

+

the service's authorization domain.

+

[transfer none]

+
+

Since: 0.9.0

+
+
+
+

gdata_calendar_service_query_all_calendars ()

+
GDataFeed *
+gdata_calendar_service_query_all_calendars
+                               (GDataCalendarService *self,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GError **error);
+

Queries the service to return a list of all calendars from the authenticated account which match the given +query +. It will return all calendars the user has read access to, including primary, secondary and imported +calendars.

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+
+
+
+

gdata_calendar_service_query_all_calendars_async ()

+
void
+gdata_calendar_service_query_all_calendars_async
+                               (GDataCalendarService *self,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service to return a list of all calendars from the authenticated account which match the given +query +. self + and query + are all reffed when this function is called, so can safely be unreffed after +this function returns.

+

For more details, see gdata_calendar_service_query_all_calendars(), which is the synchronous version of +this function, and gdata_service_query_async(), which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_calendar_service_query_own_calendars ()

+
GDataFeed *
+gdata_calendar_service_query_own_calendars
+                               (GDataCalendarService *self,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GError **error);
+

Queries the service to return a list of calendars from the authenticated account which match the given +query +, and the authenticated user owns. (i.e. They have full read/write access to the calendar, as well +as the ability to set permissions on the calendar.)

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+
+
+
+

gdata_calendar_service_query_own_calendars_async ()

+
void
+gdata_calendar_service_query_own_calendars_async
+                               (GDataCalendarService *self,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service to return a list of calendars from the authenticated account which match the given +query +, and the authenticated user owns. self + and query + are all reffed when this function is called, +so can safely be unreffed after this function returns.

+

For more details, see gdata_calendar_service_query_own_calendars(), which is the synchronous version of +this function, and gdata_service_query_async(), which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_calendar_service_query_events ()

+
GDataFeed *
+gdata_calendar_service_query_events (GDataCalendarService *self,
+                                     GDataCalendarCalendar *calendar,
+                                     GDataQuery *query,
+                                     GCancellable *cancellable,
+                                     GDataQueryProgressCallback progress_callback,
+                                     gpointer progress_user_data,
+                                     GError **error);
+

Queries the service to return a list of events in the given calendar +, which match query +.

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

calendar

a GDataCalendarCalendar

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+
+
+
+

gdata_calendar_service_query_events_async ()

+
void
+gdata_calendar_service_query_events_async
+                               (GDataCalendarService *self,
+                                GDataCalendarCalendar *calendar,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service to return a list of events in the given calendar +, which match query +. self +, calendar + and query + are all reffed when this +function is called, so can safely be unreffed after this function returns.

+

Get the results of the query using gdata_service_query_finish() in the callback +.

+

For more details, see gdata_calendar_service_query_events(), which is the synchronous version of this function, and gdata_service_query_async(), +which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

calendar

a GDataCalendarCalendar

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_calendar_service_insert_event ()

+
GDataCalendarEvent *
+gdata_calendar_service_insert_event (GDataCalendarService *self,
+                                     GDataCalendarEvent *event,
+                                     GCancellable *cancellable,
+                                     GError **error);
+
+

gdata_calendar_service_insert_event has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Use gdata_calendar_service_insert_calendar_event() + instead to be able to specify the calendar to add the event to; otherwise + the default calendar will be used.

+
+

Inserts event + by uploading it to the online calendar service.

+

For more details, see gdata_service_insert_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

event

the GDataCalendarEvent to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataCalendarEvent, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.2.0

+
+
+
+

gdata_calendar_service_insert_event_async ()

+
void
+gdata_calendar_service_insert_event_async
+                               (GDataCalendarService *self,
+                                GDataCalendarEvent *event,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+
+

gdata_calendar_service_insert_event_async has been deprecated since version 0.17.2 and should not be used in newly-written code.

+

Use + gdata_calendar_service_insert_calendar_event_async() instead to be able to + specify the calendar to add the event to; otherwise the default calendar + will be used.

+
+

Inserts event + by uploading it to the online calendar service. self + and event + are both reffed when this function is called, so can safely be +unreffed after this function returns.

+

callback + should call gdata_service_insert_entry_finish() to obtain a GDataCalendarEvent representing the inserted event and to check for possible +errors.

+

For more details, see gdata_calendar_service_insert_event(), which is the synchronous version of this function, and +gdata_service_insert_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

event

the GDataCalendarEvent to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.8.0

+
+
+
+

gdata_calendar_service_insert_calendar_event ()

+
GDataCalendarEvent *
+gdata_calendar_service_insert_calendar_event
+                               (GDataCalendarService *self,
+                                GDataCalendarCalendar *calendar,
+                                GDataCalendarEvent *event,
+                                GCancellable *cancellable,
+                                GError **error);
+

gdata_calendar_service_insert_calendar_event is deprecated and should not be used in newly-written code.

+

Inserts event + by uploading it to the online calendar service, adding it to +the specified calendar +.

+

For more details, see gdata_service_insert_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

calendar

the GDataCalendarCalendar to insert the event into

 

event

the GDataCalendarEvent to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataCalendarEvent, or NULL; +unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.17.2

+
+
+
+

gdata_calendar_service_insert_calendar_event_async ()

+
void
+gdata_calendar_service_insert_calendar_event_async
+                               (GDataCalendarService *self,
+                                GDataCalendarCalendar *calendar,
+                                GDataCalendarEvent *event,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Inserts event + by uploading it to the online calendar service, adding it to +the specified calendar +. self + and event + are both reffed when this function +is called, so can safely be unreffed after this function returns.

+

callback + should call gdata_service_insert_entry_finish() to obtain a +GDataCalendarEvent representing the inserted event and to check for possible +errors.

+

For more details, see gdata_calendar_service_insert_event(), which is the +synchronous version of this function, and gdata_service_insert_entry_async(), +which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCalendarService

 

calendar

the GDataCalendarCalendar to insert the event into

 

event

the GDataCalendarEvent to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.17.2

+
+
+
+

Types and Values

+
+

GDataCalendarService

+
typedef struct _GDataCalendarService GDataCalendarService;
+

All the fields in the GDataCalendarService structure are private and should never be accessed directly.

+
+
+
+

GDataCalendarServiceClass

+
typedef struct {
+} GDataCalendarServiceClass;
+
+

All the fields in the GDataCalendarServiceClass structure are private and should never be accessed directly.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataCategory.html b/docs/reference/html/GDataCategory.html new file mode 100644 index 0000000..be68642 --- /dev/null +++ b/docs/reference/html/GDataCategory.html @@ -0,0 +1,524 @@ + + + + +GDataCategory: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataCategory

+

GDataCategory — Atom category element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataCategory * + +gdata_category_new () +
const gchar * + +gdata_category_get_term () +
+void + +gdata_category_set_term () +
const gchar * + +gdata_category_get_scheme () +
+void + +gdata_category_set_scheme () +
const gchar * + +gdata_category_get_label () +
+void + +gdata_category_set_label () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *labelRead / Write
+gchar *schemeRead / Write
+gchar *termRead / Write
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataCategory
+            ╰── GDataYouTubeCategory
+
+
+
+

Implemented Interfaces

+

+GDataCategory implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/atom/gdata-category.h>
+
+
+
+

Description

+

GDataCategory represents a "category" element from the

+Atom specification. + +
+
+

Functions

+
+

gdata_category_new ()

+
GDataCategory *
+gdata_category_new (const gchar *term,
+                    const gchar *scheme,
+                    const gchar *label);
+

Creates a new GDataCategory. More information is available in the Atom specification.

+

term + must be non-NULL and non-empty. scheme + must be NULL or non-empty.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

term

a category identifier

 

scheme

an IRI to define the categorisation scheme, or NULL.

[allow-none]

label

a human-readable label for the category, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataCategory, or NULL; unref with g_object_unref()

+
+
+
+
+

gdata_category_get_term ()

+
const gchar *
+gdata_category_get_term (GDataCategory *self);
+

Gets the “term” property. The term will always be a non-NULL, non-empty string.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCategory

 
+
+
+

Returns

+

the category's term

+
+

Since: 0.4.0

+
+
+
+

gdata_category_set_term ()

+
void
+gdata_category_set_term (GDataCategory *self,
+                         const gchar *term);
+

Sets the “term” property to term +. term + must be non-NULL and non-empty.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCategory

 

term

the new term for the category

 
+
+

Since: 0.4.0

+
+
+
+

gdata_category_get_scheme ()

+
const gchar *
+gdata_category_get_scheme (GDataCategory *self);
+

Gets the “scheme” property. If the scheme is non-NULL, it will be non-empty.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCategory

 
+
+
+

Returns

+

the category's scheme, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_category_set_scheme ()

+
void
+gdata_category_set_scheme (GDataCategory *self,
+                           const gchar *scheme);
+

Sets the “scheme” property to scheme +. scheme + must be NULL or non-empty.

+

Set scheme + to NULL to unset the property in the category.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCategory

 

scheme

the new scheme for the category, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_category_get_label ()

+
const gchar *
+gdata_category_get_label (GDataCategory *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataCategory

 
+
+
+

Returns

+

the category's label, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_category_set_label ()

+
void
+gdata_category_set_label (GDataCategory *self,
+                          const gchar *label);
+

Sets the “label” property to label +.

+

Set label + to NULL to unset the property in the category.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataCategory

 

label

the new label for the category, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_CATEGORY_SCHEMA_LABELS

+
#define GDATA_CATEGORY_SCHEMA_LABELS "http://schemas.google.com/g/2005/labels"
+
+

A schema for categories which label the entry they're applied to in some way, such as starring it. The semantics of the various labels +(such as GDATA_CATEGORY_SCHEMA_LABELS_STARRED) are service-specific.

+

Since: 0.11.0

+
+
+
+

GDATA_CATEGORY_SCHEMA_LABELS_SHARED

+
#define GDATA_CATEGORY_SCHEMA_LABELS_SHARED GDATA_CATEGORY_SCHEMA_LABELS"#shared"
+
+

A term for categories of the GDATA_CATEGORY_SCHEMA_LABELS schema which labels an entry as being “shared”. The semantics of this label are +service-specific, but are obvious for services such as Google Documents.

+

Since: 0.17.0

+
+
+
+

GDATA_CATEGORY_SCHEMA_LABELS_STARRED

+
#define GDATA_CATEGORY_SCHEMA_LABELS_STARRED GDATA_CATEGORY_SCHEMA_LABELS"#starred"
+
+

A term for categories of the GDATA_CATEGORY_SCHEMA_LABELS schema which labels an entry as being “starred”. The semantics of this label are +service-specific, but are obvious for services such as Google Documents.

+

Since: 0.11.0

+
+
+
+

GDATA_CATEGORY_SCHEMA_LABELS_VIEWED

+
#define GDATA_CATEGORY_SCHEMA_LABELS_VIEWED GDATA_CATEGORY_SCHEMA_LABELS"#viewed"
+
+

A term for categories of the GDATA_CATEGORY_SCHEMA_LABELS schema which labels an entry as being “viewed”. The semantics of this label are +service-specific, but are obvious for services such as Google Documents.

+

Since: 0.17.0

+
+
+
+

GDataCategory

+
typedef struct _GDataCategory GDataCategory;
+

All the fields in the GDataCategory structure are private and should never be accessed directly.

+
+
+
+

GDataCategoryClass

+
typedef struct {
+} GDataCategoryClass;
+
+

All the fields in the GDataCategoryClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “label” property

+
  “label”                    gchar *
+

A human-readable label for display in end-user applications.

+

For more information, see the

+ +Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “scheme” property

+
  “scheme”                   gchar *
+

An IRI that identifies a categorization scheme.

+

For more information, see the

+ +Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “term” property

+
  “term”                     gchar *
+

Identifies the category to which the entry or feed belongs.

+

For more information, see the

+ +Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataClientLoginAuthorizer.html b/docs/reference/html/GDataClientLoginAuthorizer.html new file mode 100644 index 0000000..ce52ac0 --- /dev/null +++ b/docs/reference/html/GDataClientLoginAuthorizer.html @@ -0,0 +1,1153 @@ + + + + +GDataClientLoginAuthorizer: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataClientLoginAuthorizer

+

GDataClientLoginAuthorizer — GData ClientLogin authorization interface

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *client-idRead / Write / Construct Only
+gchar *passwordRead
+GProxyResolver *proxy-resolverRead / Write
+SoupURI *proxy-uriRead / Write
guinttimeoutRead / Write
+gchar *usernameRead
+
+
+

Signals

+
+++++ + + + + + +
+gchar*captcha-challengeRun Last
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataClientLoginAuthorizer
+
+
+
+

Implemented Interfaces

+

+GDataClientLoginAuthorizer implements + GDataAuthorizer.

+
+
+

Includes

+
#include <gdata/gdata-client-login-authorizer.h>
+
+
+
+

Description

+

GDataClientLoginAuthorizer provides an implementation of the GDataAuthorizer interface for authentication and authorization using the deprecated

+ClientLogin process. +

As noted, the ClientLogin process is being deprecated in favour of OAuth 2.0. This API is not (yet) deprecated, however. One of the main reasons +for ClientLogin being deprecated is that it cannot support two-factor authentication as now available to Google Accounts. Any account which has +two-factor authentication enabled has to use a service-specific one-time password instead if a client is authenticating with +GDataClientLoginAuthorizer. More documentation about this is

+available online. +

Note that newer services cannot be authenticated against using ClientLogin, +and a GDataOAuth2Authorizer must be used instead.

+

The ClientLogin process is a simple one whereby the user's Google Account username and password are sent over an HTTPS connection to the Google +Account servers (when gdata_client_login_authorizer_authenticate() is called), which return an authorization token. This token is then attached to +all future requests to the online service. A slight complication is that the Google Accounts service may return a CAPTCHA challenge instead of +immediately returning an authorization token. In this case, the “captcha-challenge” signal will be emitted, and the +user's response to the CAPTCHA should be returned by the handler.

+

ClientLogin does not natively support authorization against multiple authorization domains concurrently with a single authorization token, so it +has to be simulated by maintaining multiple authorization tokens if multiple authorization domains are used. This means that proportionally more +network requests are made when gdata_client_login_authorizer_authenticate() is called, which will be proportionally slower. Handling of the +multiple authorization tokens is otherwise transparent to the client.

+

Each authorization token is long lived, so reauthorization is rarely necessary with GDataClientLoginAuthorizer. Consequently, refreshing +authorization using gdata_authorizer_refresh_authorization() is not supported by GDataClientLoginAuthorizer, and will immediately return FALSE +with no error set.

+
+

Example 6. Authenticating Asynchronously Using ClientLogin

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
GDataSomeService *service;
+GDataClientLoginAuthorizer *authorizer;
+
+/* Create an authorizer and authenticate and authorize the service we're using, asynchronously. */
+authorizer = gdata_client_login_authorizer_new ("companyName-applicationName-versionID", GDATA_TYPE_SOME_SERVICE);
+gdata_client_login_authorizer_authenticate_async (authorizer, username, password, cancellable,
+                                                  (GAsyncReadyCallback) authenticate_cb, user_data);
+
+/* Create a service object and link it with the authorizer */
+service = gdata_some_service_new (GDATA_AUTHORIZER (authorizer));
+
+static void
+authenticate_cb (GDataClientLoginAuthorizer *authorizer, GAsyncResult *async_result, gpointer user_data)
+{
+    GError *error = NULL;
+
+    if (gdata_client_login_authorizer_authenticate_finish (authorizer, async_result, &error) == FALSE) {
+        /* Notify the user of all errors except cancellation errors */
+        if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+            g_error ("Authentication failed: %s", error->message);
+        }
+        g_error_free (error);
+        return;
+    }
+
+    /* (The client is now authenticated and authorized against the service.
+     * It can now proceed to execute queries on the service object which require the user to be authenticated.) */
+}
+
+g_object_unref (service);
+g_object_unref (authorizer);
+
+ +
+
+
+
+

Functions

+
+

gdata_client_login_authorizer_new ()

+
GDataClientLoginAuthorizer *
+gdata_client_login_authorizer_new (const gchar *client_id,
+                                   GType service_type);
+

Creates a new GDataClientLoginAuthorizer. The client_id + must be unique for your application, and as registered with Google.

+

The GDataAuthorizationDomains for the given service_type + (i.e. as returned by gdata_service_get_authorization_domains()) are the ones the +user will be logged in to using the provided username and password when gdata_client_login_authorizer_authenticate() is called. Note that the same +username and password will be used for all domains.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client_id

your application's client ID

 

service_type

the GType of a GDataService subclass which the GDataClientLoginAuthorizer will be used with

 
+
+
+

Returns

+

a new GDataClientLoginAuthorizer, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_new_for_authorization_domains ()

+
GDataClientLoginAuthorizer *
+gdata_client_login_authorizer_new_for_authorization_domains
+                               (const gchar *client_id,
+                                GList *authorization_domains);
+

Creates a new GDataClientLoginAuthorizer. The client_id + must be unique for your application, and as registered with Google. This function is +intended to be used only when the default authorization domain list for a single GDataService, as used by gdata_client_login_authorizer_new(), +isn't suitable. For example, this could be because the GDataClientLoginAuthorizer will be used with multiple GDataService subclasses, or because +the client requires a specific set of authorization domains.

+

The specified GDataAuthorizationDomains are the ones the user will be logged in to using the provided username and password when +gdata_client_login_authorizer_authenticate() is called. Note that the same username and password will be used for all domains.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client_id

your application's client ID

 

authorization_domains

a non-empty list of GDataAuthorizationDomains to be +authorized against by the GDataClientLoginAuthorizer.

[element-type GDataAuthorizationDomain][transfer none]
+
+
+

Returns

+

a new GDataClientLoginAuthorizer, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_authenticate ()

+
gboolean
+gdata_client_login_authorizer_authenticate
+                               (GDataClientLoginAuthorizer *self,
+                                const gchar *username,
+                                const gchar *password,
+                                GCancellable *cancellable,
+                                GError **error);
+

Authenticates the GDataClientLoginAuthorizer with the Google Accounts service using username + and password + and authorizes it against all the +service types passed to gdata_client_login_authorizer_new(); i.e. logs into the service with the given user account. username + should be a full +e-mail address (e.g. john.smith@gmail.com). If a full e-mail address is not given, username + will have +@gmail.com appended to create an e-mail address

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

+

If the operation errors or is cancelled part-way through, gdata_authorizer_is_authorized_for_domain() is guaranteed to return FALSE +for all GDataAuthorizationDomains, even if authentication has succeeded for some of them already.

+

A GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_BAD_AUTHENTICATION will be returned if authentication failed due to an incorrect username or password. +Other GDataClientLoginAuthorizerError errors can be returned for other conditions.

+

If the service requires a CAPTCHA to be completed, the “captcha-challenge” signal will be emitted. +The return value from a signal handler for the signal should be a newly allocated string containing the text from the image. If the text is NULL +or empty, authentication will fail with a GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_CAPTCHA_REQUIRED error. Otherwise, authentication will be +automatically and transparently restarted with the new CAPTCHA details.

+

A GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be returned if the server's responses were invalid.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataClientLoginAuthorizer

 

username

the user's username

 

password

the user's password

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE if authentication and authorization was successful against all the services, FALSE otherwise

+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_authenticate_async ()

+
void
+gdata_client_login_authorizer_authenticate_async
+                               (GDataClientLoginAuthorizer *self,
+                                const gchar *username,
+                                const gchar *password,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Authenticates the GDataClientLoginAuthorizer with the Google accounts service using the given username + and password +. self +, username + and +password + are all reffed/copied when this function is called, so can safely be freed after this function returns.

+

For more details, see gdata_client_login_authorizer_authenticate(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_client_login_authorizer_authenticate_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataClientLoginAuthorizer

 

username

the user's username

 

password

the user's password

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_authenticate_finish ()

+
gboolean
+gdata_client_login_authorizer_authenticate_finish
+                               (GDataClientLoginAuthorizer *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finishes an asynchronous authentication operation started with gdata_client_login_authorizer_authenticate_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataClientLoginAuthorizer

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE if authentication was successful, FALSE otherwise

+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_get_client_id ()

+
const gchar *
+gdata_client_login_authorizer_get_client_id
+                               (GDataClientLoginAuthorizer *self);
+

Returns the authorizer's client ID, as specified on constructing the GDataClientLoginAuthorizer.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataClientLoginAuthorizer

 
+
+
+

Returns

+

the authorizer's client ID

+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_get_username ()

+
const gchar *
+gdata_client_login_authorizer_get_username
+                               (GDataClientLoginAuthorizer *self);
+

Returns the username of the currently authenticated user, or NULL if nobody is authenticated.

+

It is not safe to call this while an authentication operation is ongoing.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataClientLoginAuthorizer

 
+
+
+

Returns

+

the username of the currently authenticated user, or NULL

+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_get_password ()

+
const gchar *
+gdata_client_login_authorizer_get_password
+                               (GDataClientLoginAuthorizer *self);
+

Returns the password of the currently authenticated user, or NULL if nobody is authenticated.

+

It is not safe to call this while an authentication operation is ongoing.

+

If libgdata is compiled with libgcr support, the password will be stored in non-pageable memory. Since this function doesn't return +a copy of the password, the returned value is guaranteed to not hit disk. It's advised that any copies of the password made in client programs +also use non-pageable memory.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataClientLoginAuthorizer

 
+
+
+

Returns

+

the password of the currently authenticated user, or NULL

+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_get_proxy_uri ()

+
SoupURI *
+gdata_client_login_authorizer_get_proxy_uri
+                               (GDataClientLoginAuthorizer *self);
+
+

gdata_client_login_authorizer_get_proxy_uri has been deprecated since version 0.15.0 and should not be used in newly-written code.

+

Use gdata_client_login_authorizer_get_proxy_resolver() instead, which gives more flexibility over the proxy used.

+
+

Gets the proxy URI on the GDataClientLoginAuthorizer's SoupSession.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataClientLoginAuthorizer

 
+
+
+

Returns

+

the proxy URI, or NULL; free with soup_uri_free().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_set_proxy_uri ()

+
void
+gdata_client_login_authorizer_set_proxy_uri
+                               (GDataClientLoginAuthorizer *self,
+                                SoupURI *proxy_uri);
+
+

gdata_client_login_authorizer_set_proxy_uri has been deprecated since version 0.15.0 and should not be used in newly-written code.

+

Use gdata_client_login_authorizer_set_proxy_resolver() instead, which gives more flexibility over the proxy used.

+
+

Sets the proxy URI on the SoupSession used internally by the GDataClientLoginAuthorizer. This forces all requests through the given proxy.

+

If proxy_uri + is NULL, no proxy will be used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataClientLoginAuthorizer

 

proxy_uri

the proxy URI, or NULL.

[allow-none]
+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_get_proxy_resolver ()

+
GProxyResolver *
+gdata_client_login_authorizer_get_proxy_resolver
+                               (GDataClientLoginAuthorizer *self);
+

gdata_client_login_authorizer_get_proxy_resolver is deprecated and should not be used in newly-written code.

+

Gets the GProxyResolver on the GDataClientLoginAuthorizer's SoupSession.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataClientLoginAuthorizer

 
+
+
+

Returns

+

a GProxyResolver, or NULL.

+

[transfer none][allow-none]

+
+

Since: 0.15.0

+
+
+
+

gdata_client_login_authorizer_set_proxy_resolver ()

+
void
+gdata_client_login_authorizer_set_proxy_resolver
+                               (GDataClientLoginAuthorizer *self,
+                                GProxyResolver *proxy_resolver);
+

Sets the GProxyResolver on the SoupSession used internally by the given GDataClientLoginAuthorizer.

+

Setting this will clear the “proxy-uri” property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataClientLoginAuthorizer

 

proxy_resolver

a GProxyResolver, or NULL.

[allow-none]
+
+

Since: 0.15.0

+
+
+
+

gdata_client_login_authorizer_get_timeout ()

+
guint
+gdata_client_login_authorizer_get_timeout
+                               (GDataClientLoginAuthorizer *self);
+

Gets the “timeout” property; the network timeout, in seconds.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataClientLoginAuthorizer

 
+
+
+

Returns

+

the timeout, or 0

+
+

Since: 0.9.0

+
+
+
+

gdata_client_login_authorizer_set_timeout ()

+
void
+gdata_client_login_authorizer_set_timeout
+                               (GDataClientLoginAuthorizer *self,
+                                guint timeout);
+

Sets the “timeout” property; the network timeout, in seconds.

+

If timeout + is 0, network operations will never time out.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataClientLoginAuthorizer

 

timeout

the timeout, or 0

 
+
+

Since: 0.9.0

+
+
+
+

Types and Values

+
+

GDataClientLoginAuthorizer

+
typedef struct _GDataClientLoginAuthorizer GDataClientLoginAuthorizer;
+

All the fields in the GDataClientLoginAuthorizer structure are private and should never be accessed directly.

+

Since: 0.9.0

+
+
+
+

GDataClientLoginAuthorizerClass

+
typedef struct {
+} GDataClientLoginAuthorizerClass;
+
+

All the fields in the GDataClientLoginAuthorizerClass structure are private and should never be accessed directly.

+

Since: 0.9.0

+
+
+
+

enum GDataClientLoginAuthorizerError

+

Error codes for authentication and authorization operations on GDataClientLoginAuthorizer. See the

+online ClientLogin documentation for +

more information.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_BAD_AUTHENTICATION

+

The login request used a username or password that is not recognized.

+
 

GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_NOT_VERIFIED

+

The account email address has not been verified. The user will need to access their Google +account directly to resolve the issue before logging in using a non-Google application.

+
 

GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_TERMS_NOT_AGREED

+

The user has not agreed to terms. The user will need to access their Google account directly +to resolve the issue before logging in using a non-Google application.

+
 

GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_CAPTCHA_REQUIRED

+

A CAPTCHA is required. (A response with this error code will also contain an image URI and a +CAPTCHA token.)

+
 

GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DELETED

+

The user account has been deleted.

+
 

GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DISABLED

+

The user account has been disabled.

+
 

GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_SERVICE_DISABLED

+

The user's access to the specified service has been disabled. (The user account may still be +valid.)

+
 

GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_MIGRATED

+

The user's account login details have been migrated to a new system. (This is used for the +transition from the old YouTube login details to the new ones.)

+
 

GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_INVALID_SECOND_FACTOR

+

The user's account requires an application-specific password to be used.

+
 
+
+

Since: 0.9.0

+
+
+
+

Property Details

+
+

The “client-id” property

+
  “client-id”                gchar *
+

A client ID for your application (see the

+reference documentation). +

It is recommended that the ID is of the form company name-application name- +version ID.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.9.0

+
+
+
+

The “password” property

+
  “password”                 gchar *
+

The user's account password for authentication.

+

This will only be set after authentication using gdata_client_login_authorizer_authenticate() is completed successfully. It will +then be set to the password passed to gdata_client_login_authorizer_authenticate(), and a “notify” signal will be emitted. If +authentication fails, it will be set to NULL.

+

If libgdata is compiled with libgcr support, the password will be stored in non-pageable memory. However, if it is retrieved +using g_object_get() (or related functions) it will be copied to non-pageable memory and could end up being written to disk. Accessing +the password using gdata_client_login_authorizer_get_password() will not perform any copies, and so maintains privacy.

+

Flags: Read

+

Default value: NULL

+

Since: 0.9.0

+
+
+
+

The “proxy-resolver” property

+
  “proxy-resolver”           GProxyResolver *
+

The GProxyResolver used to determine a proxy URI. Setting this will clear the “proxy-uri” property.

+

Flags: Read / Write

+

Since: 0.15.0

+
+
+
+

The “proxy-uri” property

+
  “proxy-uri”                SoupURI *
+

The proxy URI used internally for all network requests.

+
+

GDataClientLoginAuthorizer:proxy-uri has been deprecated since version 0.15.0 and should not be used in newly-written code.

+

Use “proxy-resolver” instead, which gives more flexibility over the proxy used.

+
+

Flags: Read / Write

+

Since: 0.9.0

+
+
+
+

The “timeout” property

+
  “timeout”                  guint
+

A timeout, in seconds, for network operations. If the timeout is exceeded, the operation will be cancelled and +GDATA_SERVICE_ERROR_NETWORK_ERROR will be returned.

+

If the timeout is 0, operations will never time out.

+

Flags: Read / Write

+

Default value: 0

+

Since: 0.9.0

+
+
+
+

The “username” property

+
  “username”                 gchar *
+

The user's Google username for authentication. This will always be a full e-mail address.

+

This will only be set after authentication using gdata_client_login_authorizer_authenticate() is completed successfully. It will +then be set to the username passed to gdata_client_login_authorizer_authenticate(), and a “notify” signal will be emitted. If +authentication fails, it will be set to NULL.

+

Flags: Read

+

Default value: NULL

+

Since: 0.9.0

+
+
+
+

Signal Details

+
+

The “captcha-challenge” signal

+
gchar*
+user_function (GDataClientLoginAuthorizer *authorizer,
+               gchar                      *uri,
+               gpointer                    user_data)
+

The “captcha-challenge” signal is emitted during the authentication process if the authorizer requires a CAPTCHA +to be completed. The URI of a CAPTCHA image is given, and the program should display this to the user, and return their response (the text +displayed in the image). There is no timeout imposed by the library for the response.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

authorizer

the GDataClientLoginAuthorizer which received the challenge

 

uri

the URI of the CAPTCHA image to be used

 

user_data

user data set when the signal handler was connected.

 
+
+
+

Returns

+

a newly allocated string containing the text in the CAPTCHA image

+
+

Flags: Run Last

+

Since: 0.9.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataComment.html b/docs/reference/html/GDataComment.html new file mode 100644 index 0000000..71abedb --- /dev/null +++ b/docs/reference/html/GDataComment.html @@ -0,0 +1,113 @@ + + + + +GDataComment: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataComment

+

GDataComment — GData comment object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataComment
 GDataCommentClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataComment
+                ├── GDataPicasaWebComment
+                ╰── GDataYouTubeComment
+
+
+
+

Includes

+
#include <gdata/gdata-comment.h>
+
+
+
+

Description

+

GDataComment is a subclass of GDataEntry to represent a generic comment on an entry. It is returned by the methods implemented in the +GDataCommentable interface.

+

Any class which implements GDataCommentable should have its own concrete subclass of GDataComment which provides service-specific functionality.

+

All subclasses of GDataComment should ensure that the body of a comment is accessible using gdata_entry_get_content(), and that each comment has +at least one GDataAuthor object representing the person who wrote the comment, accessible using gdata_entry_get_authors().

+
+
+

Functions

+

+
+
+

Types and Values

+
+

GDataComment

+
typedef struct _GDataComment GDataComment;
+

All the fields in the GDataComment structure are private and should never be accessed directly.

+

Since: 0.10.0

+
+
+
+

GDataCommentClass

+
typedef struct {
+} GDataCommentClass;
+
+

All the fields in the GDataCommentClass structure are private and should never be accessed directly.

+

Since: 0.10.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataCommentable.html b/docs/reference/html/GDataCommentable.html new file mode 100644 index 0000000..b6f6331 --- /dev/null +++ b/docs/reference/html/GDataCommentable.html @@ -0,0 +1,909 @@ + + + + +GDataCommentable: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataCommentable

+

GDataCommentable — GData commentable interface

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataCommentable
 GDataCommentableInterface
+
+
+

Object Hierarchy

+
    GInterface
+    ╰── GDataCommentable
+
+
+
+

Prerequisites

+

+GDataCommentable requires + GDataEntry.

+
+
+

Known Implementations

+

+GDataCommentable is implemented by + GDataPicasaWebFile and GDataYouTubeVideo.

+
+
+

Includes

+
#include <gdata/gdata-commentable.h>
+
+
+
+

Description

+

GDataCommentable is an interface which can be implemented by commentable objects: objects which support having comments added to them by users, +such as videos and photos.

+

Comments may be queried, added and deleted. Note that they may not be edited.

+

GDataCommentable objects may not support all operations on comments, on an instance-by-instance basis (i.e. it's an invalid assumption that if, +for example, one GDataYouTubeVideo doesn't support adding comments all other GDataYouTubeVideos don't support adding comments either). +Specific documentation for a particular type of GDataCommentable may state otherwise, though.

+
+

Example 10. Querying for Comments

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
GDataService *service;
+GDataCommentable *commentable;
+
+/* Create a service */
+service = create_service ();
+
+/* Retrieve the GDataCommentable which is going to be queried. This may be, for example, a GDataYouTubeVideo. */
+commentable = get_commentable ();
+
+/* Start the async. query for the comments. */
+gdata_commentable_query_comments_async (commentable, service, NULL, NULL, NULL, NULL, NULL, (GAsyncReadyCallback) query_comments_cb, NULL);
+
+g_object_unref (service);
+g_object_unref (commentable);
+
+static void
+query_comments_cb (GDataCommentable *commentable, GAsyncResult *result, gpointer user_data)
+{
+    GDataFeed *comment_feed;
+    GList *comments, *i;
+    GError *error = NULL;
+
+    comment_feed = gdata_commentable_query_comments_finish (commentable, result, &error);
+
+    if (error != NULL) {
+        /* Error! */
+        g_error ("Error querying comments: %s", error->message);
+        g_error_free (error);
+        return;
+    }
+
+    /* Examine the comments. */
+    comments = gdata_feed_get_entries (comment_feed);
+    for (i = comments; i != NULL; i = i->next) {
+        /* Note that this will actually be a subclass of GDataComment,
+         * such as GDataYouTubeComment or GDataPicasaWebComment. */
+        GDataComment *comment = GDATA_COMMENT (i->data);
+        GDataAuthor *author;
+
+        /* Note that in practice it might not always be safe to assume that a comment always has an author. */
+        author = GDATA_AUTHOR (gdata_entry_get_authors (GDATA_ENTRY (comment))->data);
+
+        g_message ("Comment by %s (%s): %s",
+                   gdata_author_get_name (author),
+                   gdata_author_get_uri (author),
+                   gdata_entry_get_content (GDATA_ENTRY (comment)));
+    }
+
+    g_object_unref (comment_feed);
+}
+
+ +
+
+
+
+

Functions

+
+

gdata_commentable_query_comments ()

+
GDataFeed *
+gdata_commentable_query_comments (GDataCommentable *self,
+                                  GDataService *service,
+                                  GDataQuery *query,
+                                  GCancellable *cancellable,
+                                  GDataQueryProgressCallback progress_callback,
+                                  gpointer progress_user_data,
+                                  GError **error);
+

Retrieves a GDataFeed containing the GDataComments representing the comments on the GDataCommentable which match the given query +.

+

If the GDataCommentable doesn't support commenting, NULL will be returned and error + will be set to GDATA_SERVICE_ERROR_FORBIDDEN. This is in +contrast to if it does support commenting but hasn't had any comments added yet, in which case an empty GDataFeed will be returned and no error +will be set.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCommentable

 

service

a GDataService representing the service with which the object's comments will be manipulated

 

query

a GDataQuery with query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when a comment is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of GDataComments, or NULL; unref with g_object_unref().

+

[transfer full][allow-none]

+
+

Since: 0.10.0

+
+
+
+

gdata_commentable_query_comments_async ()

+
void
+gdata_commentable_query_comments_async
+                               (GDataCommentable *self,
+                                GDataService *service,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Retrieves a GDataFeed containing the GDataComments representing the comments on the GDataCommentable which match the given query +. +self +, service + and query + are all reffed when this method is called, so can safely be freed after this method returns.

+

For more details, see gdata_commentable_query_comments(), which is the synchronous version of this method.

+

When the operation is finished, callback + will be called. You can then call gdata_commentable_query_comments_finish() to get the results of the +operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCommentable

 

service

a GDataService representing the service with which the object's comments will be manipulated

 

query

a GDataQuery with query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when a comment is loaded, +or NULL.

[allow-none][scope notified][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

a function to call when progress_callback +will not be called any more, or NULL; this function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.10.0

+
+
+
+

gdata_commentable_query_comments_finish ()

+
GDataFeed *
+gdata_commentable_query_comments_finish
+                               (GDataCommentable *self,
+                                GAsyncResult *result,
+                                GError **error);
+

Finishes an asynchronous comment query operation started with gdata_commentable_query_comments_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataCommentable

 

result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of GDataComments, or NULL; unref with g_object_unref().

+

[transfer full][allow-none]

+
+

Since: 0.10.0

+
+
+
+

gdata_commentable_insert_comment ()

+
GDataComment *
+gdata_commentable_insert_comment (GDataCommentable *self,
+                                  GDataService *service,
+                                  GDataComment *comment_,
+                                  GCancellable *cancellable,
+                                  GError **error);
+

Adds comment + to the GDataCommentable.

+

If the GDataCommentable doesn't support commenting, NULL will be returned and error + will be set to GDATA_SERVICE_ERROR_FORBIDDEN.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCommentable

 

service

a GDataService with which the comment will be added

 

comment_

a new comment to be added to the GDataCommentable

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

the added GDataComment, or NULL; unref with g_object_unref().

+

[transfer full][allow-none]

+
+

Since: 0.10.0

+
+
+
+

gdata_commentable_insert_comment_async ()

+
void
+gdata_commentable_insert_comment_async
+                               (GDataCommentable *self,
+                                GDataService *service,
+                                GDataComment *comment_,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Adds comment + to the GDataCommentable. self +, service + and comment_ + are all reffed when this method is called, so can safely be freed after this +method returns.

+

For more details, see gdata_commentable_insert_comment(), which is the synchronous version of this method.

+

When the operation is finished, callback + will be called. You can then call gdata_commentable_insert_comment_finish() to get the results of the +operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCommentable

 

service

a GDataService with which the comment will be added

 

comment_

a new comment to be added to the GDataCommentable

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the operation is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.10.0

+
+
+
+

gdata_commentable_insert_comment_finish ()

+
GDataComment *
+gdata_commentable_insert_comment_finish
+                               (GDataCommentable *self,
+                                GAsyncResult *result,
+                                GError **error);
+

Finishes an asynchronous comment insertion operation started with gdata_commentable_insert_comment_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataCommentable

 

result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

the added GDataComment, or NULL; unref with g_object_unref().

+

[transfer full][allow-none]

+
+

Since: 0.10.0

+
+
+
+

gdata_commentable_delete_comment ()

+
gboolean
+gdata_commentable_delete_comment (GDataCommentable *self,
+                                  GDataService *service,
+                                  GDataComment *comment_,
+                                  GCancellable *cancellable,
+                                  GError **error);
+

Deletes comment + from the GDataCommentable.

+

If the given comment + isn't deletable (either because the service doesn't support deleting comments at all, or because this particular comment +is not deletable due to having insufficient permissions), GDATA_SERVICE_ERROR_FORBIDDEN will be set in error + and FALSE will be returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCommentable

 

service

a GDataService with which the comment will be deleted

 

comment_

a comment to be deleted

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE if the comment was successfully deleted, FALSE otherwise

+
+

Since: 0.10.0

+
+
+
+

gdata_commentable_delete_comment_async ()

+
void
+gdata_commentable_delete_comment_async
+                               (GDataCommentable *self,
+                                GDataService *service,
+                                GDataComment *comment_,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Deletes comment + from the GDataCommentable. self +, service + and comment_ + are all reffed when this method is called, so can safely be freed after +this method returns.

+

For more details, see gdata_commentable_delete_comment(), which is the synchronous version of this method.

+

When the operation is finished, callback + will be called. You can then call gdata_commentable_delete_comment_finish() to get the results of the +operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataCommentable

 

service

a GDataService with which the comment will be deleted

 

comment_

a comment to be deleted

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the operation is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.10.0

+
+
+
+

gdata_commentable_delete_comment_finish ()

+
gboolean
+gdata_commentable_delete_comment_finish
+                               (GDataCommentable *self,
+                                GAsyncResult *result,
+                                GError **error);
+

Finishes an asynchronous comment deletion operation started with gdata_commentable_delete_comment_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataCommentable

 

result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE if the comment was successfully deleted, FALSE otherwise

+
+

Since: 0.10.0

+
+
+
+

Types and Values

+
+

GDataCommentable

+
typedef struct _GDataCommentable GDataCommentable;
+

All the fields in the GDataCommentable structure are private and should never be accessed directly

+

Since: 0.10.0

+
+
+
+

GDataCommentableInterface

+
typedef struct {
+	GTypeInterface parent;
+
+	GType comment_type;
+
+	GDataAuthorizationDomain *(*get_authorization_domain) (GDataCommentable *self);
+
+	gchar *(*get_query_comments_uri) (GDataCommentable *self);
+	gchar *(*get_insert_comment_uri) (GDataCommentable *self, GDataComment *comment);
+	gboolean (*is_comment_deletable) (GDataCommentable *self, GDataComment *comment);
+} GDataCommentableInterface;
+
+

The interface structure for the GDataCommentable interface.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GTypeInterface parent;

the parent type

 

GType comment_type;

the GType of the comment class (subclass of GDataComment) to use for query results from this commentable object

 

get_authorization_domain ()

a function to return the GDataAuthorizationDomain to be used for all operations on the comments +belonging to this commentable object; not implementing this function is equivalent to returning NULL from it, which signifies that operations on the +comments don't require authorization.

[allow-none]

get_query_comments_uri ()

a function that returns the URI of a GDataFeed of comments from a commentable object, or NULL if the given commentable +object doesn't support commenting; free with g_free()

 

get_insert_comment_uri ()

a function that returns the URI to add new comments to the commentable object, or NULL if the given commentable object +doesn't support adding comments; free with g_free()

 

is_comment_deletable ()

a function that returns TRUE if the given comment may be deleted, FALSE otherwise

 
+
+

Since: 0.10.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataComparable.html b/docs/reference/html/GDataComparable.html new file mode 100644 index 0000000..92da7a5 --- /dev/null +++ b/docs/reference/html/GDataComparable.html @@ -0,0 +1,210 @@ + + + + +GDataComparable: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataComparable

+

GDataComparable — GData comparable interface

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+gint + +gdata_comparable_compare () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataComparable
 GDataComparableIface
+
+
+

Object Hierarchy

+
    GInterface
+    ╰── GDataComparable
+
+
+ +
+

Includes

+
#include <gdata/gdata-comparable.h>
+
+
+
+

Description

+

GDataComparable is an interface which can be implemented by any object which needs to be compared to another object of the same type or of a +derived type.

+

When implementing the interface, classes must implement the compare_with function, and the implementation must be

+pure +. + +
+
+

Functions

+
+

gdata_comparable_compare ()

+
gint
+gdata_comparable_compare (GDataComparable *self,
+                          GDataComparable *other);
+

Compares the two objects, returning -1 if self + is "less than" other + by some metric, 0 +if they're equal, or 1 if self + is "greater than" other +.

+

NULL values are handled gracefully, with 0 returned if both self + and other + are NULL,

+-1 if self is NULL and 1 if other is NULL. +

The other + object must be of the same type as self +, or of a type derived from self +'s type.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataComparable, or NULL.

[allow-none]

other

another GDataComparable of the same type, or NULL.

[allow-none]
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDataComparable

+
typedef struct _GDataComparable GDataComparable;
+

All the fields in the GDataComparable structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataComparableIface

+
typedef struct {
+	GTypeInterface parent;
+
+	gint (*compare_with) (GDataComparable *self, GDataComparable *other);
+} GDataComparableIface;
+
+

The class structure for the GDataComparable interface.

+
+

Members

+
+++++ + + + + + + + + + + + + +

GTypeInterface parent;

the parent type

 

compare_with ()

compares the object with an other +object of the same type, returning -1 if the object is "less than" +the other object, 0 if they're equal, or 1 if the object is "greater than" the other. The +function can assume that neither self +or other +will be NULL, and that both have correct types. The function must be pure.

 
+
+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataContactsContact.html b/docs/reference/html/GDataContactsContact.html new file mode 100644 index 0000000..562b24c --- /dev/null +++ b/docs/reference/html/GDataContactsContact.html @@ -0,0 +1,4641 @@ + + + + +GDataContactsContact: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataContactsContact

+

GDataContactsContact — GData Contacts contact object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataContactsContact * + +gdata_contacts_contact_new () +
+GDataGDName * + +gdata_contacts_contact_get_name () +
+void + +gdata_contacts_contact_set_name () +
const gchar * + +gdata_contacts_contact_get_short_name () +
+void + +gdata_contacts_contact_set_short_name () +
const gchar * + +gdata_contacts_contact_get_initials () +
+void + +gdata_contacts_contact_set_initials () +
const gchar * + +gdata_contacts_contact_get_maiden_name () +
+void + +gdata_contacts_contact_set_maiden_name () +
const gchar * + +gdata_contacts_contact_get_nickname () +
+void + +gdata_contacts_contact_set_nickname () +
const gchar * + +gdata_contacts_contact_get_file_as () +
+void + +gdata_contacts_contact_set_file_as () +
+gboolean + +gdata_contacts_contact_get_birthday () +
+void + +gdata_contacts_contact_set_birthday () +
const gchar * + +gdata_contacts_contact_get_gender () +
+void + +gdata_contacts_contact_set_gender () +
const gchar * + +gdata_contacts_contact_get_mileage () +
+void + +gdata_contacts_contact_set_mileage () +
const gchar * + +gdata_contacts_contact_get_occupation () +
+void + +gdata_contacts_contact_set_occupation () +
const gchar * + +gdata_contacts_contact_get_subject () +
+void + +gdata_contacts_contact_set_subject () +
const gchar * + +gdata_contacts_contact_get_priority () +
+void + +gdata_contacts_contact_set_priority () +
const gchar * + +gdata_contacts_contact_get_sensitivity () +
+void + +gdata_contacts_contact_set_sensitivity () +
const gchar * + +gdata_contacts_contact_get_directory_server () +
+void + +gdata_contacts_contact_set_directory_server () +
const gchar * + +gdata_contacts_contact_get_billing_information () +
+void + +gdata_contacts_contact_set_billing_information () +
+GList * + +gdata_contacts_contact_get_email_addresses () +
+GDataGDEmailAddress * + +gdata_contacts_contact_get_primary_email_address () +
+void + +gdata_contacts_contact_add_email_address () +
+void + +gdata_contacts_contact_remove_all_email_addresses () +
+GList * + +gdata_contacts_contact_get_im_addresses () +
+GDataGDIMAddress * + +gdata_contacts_contact_get_primary_im_address () +
+void + +gdata_contacts_contact_add_im_address () +
+void + +gdata_contacts_contact_remove_all_im_addresses () +
+GList * + +gdata_contacts_contact_get_postal_addresses () +
+GDataGDPostalAddress * + +gdata_contacts_contact_get_primary_postal_address () +
+void + +gdata_contacts_contact_add_postal_address () +
+void + +gdata_contacts_contact_remove_all_postal_addresses () +
+GList * + +gdata_contacts_contact_get_phone_numbers () +
+GDataGDPhoneNumber * + +gdata_contacts_contact_get_primary_phone_number () +
+void + +gdata_contacts_contact_add_phone_number () +
+void + +gdata_contacts_contact_remove_all_phone_numbers () +
+GList * + +gdata_contacts_contact_get_organizations () +
+GDataGDOrganization * + +gdata_contacts_contact_get_primary_organization () +
+void + +gdata_contacts_contact_add_organization () +
+void + +gdata_contacts_contact_remove_all_organizations () +
+void + +gdata_contacts_contact_add_jot () +
+GList * + +gdata_contacts_contact_get_jots () +
+void + +gdata_contacts_contact_remove_all_jots () +
+void + +gdata_contacts_contact_add_relation () +
+GList * + +gdata_contacts_contact_get_relations () +
+void + +gdata_contacts_contact_remove_all_relations () +
+void + +gdata_contacts_contact_add_website () +
+GList * + +gdata_contacts_contact_get_websites () +
+GDataGContactWebsite * + +gdata_contacts_contact_get_primary_website () +
+void + +gdata_contacts_contact_remove_all_websites () +
+void + +gdata_contacts_contact_add_event () +
+GList * + +gdata_contacts_contact_get_events () +
+void + +gdata_contacts_contact_remove_all_events () +
+void + +gdata_contacts_contact_add_calendar () +
+GList * + +gdata_contacts_contact_get_calendars () +
+GDataGContactCalendar * + +gdata_contacts_contact_get_primary_calendar () +
+void + +gdata_contacts_contact_remove_all_calendars () +
+void + +gdata_contacts_contact_add_external_id () +
+GList * + +gdata_contacts_contact_get_external_ids () +
+void + +gdata_contacts_contact_remove_all_external_ids () +
+void + +gdata_contacts_contact_add_hobby () +
+GList * + +gdata_contacts_contact_get_hobbies () +
+void + +gdata_contacts_contact_remove_all_hobbies () +
+void + +gdata_contacts_contact_add_language () +
+GList * + +gdata_contacts_contact_get_languages () +
+void + +gdata_contacts_contact_remove_all_languages () +
+GList * + +gdata_contacts_contact_get_groups () +
+void + +gdata_contacts_contact_add_group () +
+void + +gdata_contacts_contact_remove_group () +
+gboolean + +gdata_contacts_contact_is_group_deleted () +
const gchar * + +gdata_contacts_contact_get_extended_property () +
+GHashTable * + +gdata_contacts_contact_get_extended_properties () +
+gboolean + +gdata_contacts_contact_set_extended_property () +
const gchar * + +gdata_contacts_contact_get_user_defined_field () +
+GHashTable * + +gdata_contacts_contact_get_user_defined_fields () +
+void + +gdata_contacts_contact_set_user_defined_field () +
+gint64 + +gdata_contacts_contact_get_edited () +
+gboolean + +gdata_contacts_contact_is_deleted () +
const gchar * + +gdata_contacts_contact_get_photo_etag () +
+guint8 * + +gdata_contacts_contact_get_photo () +
+void + +gdata_contacts_contact_get_photo_async () +
+guint8 * + +gdata_contacts_contact_get_photo_finish () +
+gboolean + +gdata_contacts_contact_set_photo () +
+void + +gdata_contacts_contact_set_photo_async () +
+gboolean + +gdata_contacts_contact_set_photo_finish () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *billing-informationRead / Write
+GDate *birthdayRead / Write
gbooleanbirthday-has-yearRead / Write
gbooleandeletedRead
+gchar *directory-serverRead / Write
gint64editedRead
+gchar *file-asRead / Write
+gchar *genderRead / Write
+gchar *initialsRead / Write
+gchar *maiden-nameRead / Write
+gchar *mileageRead / Write
+GDataGDName *nameRead / Write
+gchar *nicknameRead / Write
+gchar *occupationRead / Write
+gchar *photo-etagRead
+gchar *priorityRead / Write
+gchar *sensitivityRead / Write
+gchar *short-nameRead / Write
+gchar *subjectRead / Write
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataContactsContact
+
+
+
+

Includes

+
#include <gdata/services/contacts/gdata-contacts-contact.h>
+
+
+
+

Description

+

GDataContactsContact is a subclass of GDataEntry to represent a contact from a Google address book.

+

For more details of Google Contacts' GData API, see the +online documentation.

+

In addition to all the standard properties available for a contact, GDataContactsContact supports two kinds of additional property: extended +properties and user-defined fields. Extended properties, set with gdata_contacts_contact_set_extended_property() and retrieved with +gdata_contacts_contact_get_extended_property(), are provided as a method of storing client-specific data which shouldn't be seen or be editable +by the user, such as IDs and cache times. User-defined fields, set with gdata_contacts_contact_set_user_defined_field() and retrieved with +gdata_contacts_contact_get_user_defined_field(), store fields defined by the user, and editable by them in the interface (both the interface of +the appliation using libgdata, and the Google Contacts web interface).

+
+

Example 23. Getting a Contact's Photo

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
GDataContactsService *service;
+GDataContactsContact *contact;
+guint8 *data;
+gchar *content_type = NULL;
+gsize length = 0;
+GError *error = NULL;
+
+/* Create a service and return the contact whose photo we're getting. */
+service = create_contacts_service ();
+contact = query_user_for_contact (service);
+
+/* Get the photo. This should almost always be done asynchronously. */
+data = gdata_contacts_contact_get_photo (contact, service, &length, &content_type, NULL, &error);
+
+g_object_unref (contact);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error getting a contact's photo: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Do something with the photo, stored in data, length and content_type. */
+
+g_free (content_type);
+g_free (data);
+
+ +
+
+

Example 24. Setting a Contact's Photo

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
GDataContactsService *service;
+GDataContactsContact *contact;
+guint8 *data;
+gchar *content_type = NULL;
+gsize length = 0;
+GError *error = NULL;
+
+/* Create a service and return the contact whose photo we're getting, as well as the details of the new photo. */
+service = create_contacts_service ();
+contact = query_user_for_contact (service);
+data = query_user_for_new_photo (contact, &content_type, &length);
+
+/* Set the photo. This should almost always be done asynchronously. To delete the photo, just pass NULL as the photo data. */
+gdata_contacts_contact_set_photo (contact, service, data, length, content_type, NULL, &error);
+
+g_free (data);
+g_free (content_type);
+g_object_unref (contact);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error setting a contact's photo: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+ +
+
+

Example 25. Updating a Contact's Details

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
GDataContactsService *service;
+GDataContactsContact *contact, *updated_contact;
+GDataGDEmailAddress *email_address;
+GDataGDIMAddress *im_address;
+GError *error = NULL;
+
+/* Create a service and return the contact whose details we're updating. */
+service = create_contacts_service ();
+contact = query_user_for_contact (service);
+
+/* Update the contact's details. We set their nickname to "Fat Tony", add a new e-mail address, and replace all their existing IM
+ * addresses with a single new one. */
+gdata_contacts_contact_set_nickname (contact, "Fat Tony");
+
+email_address = gdata_gd_email_address_new ("tony@gmail.com", GDATA_GD_EMAIL_ADDRESS_HOME, NULL, FALSE);
+gdata_contacts_contact_add_email_address (contact, email_address);
+g_object_unref (email_address);
+
+gdata_contacts_contact_remove_all_im_addresses (contact);
+im_address = gdata_gd_im_address_new ("tony.work@gmail.com", GDATA_GD_IM_PROTOCOL_GOOGLE_TALK, GDATA_GD_IM_ADDRESS_WORK, NULL, TRUE);
+gdata_contacts_contact_add_im_address (contact, im_address);
+g_object_unref (im_address);
+
+/* Send the updated contact to the server */
+updated_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (contact), NULL, &error));
+
+g_object_unref (contact);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error updating a contact's details: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Do something with the updated contact, such as update them in the UI, or store their ID for future use. */
+
+g_object_unref (updated_contact);
+
+ +
+
+
+
+

Functions

+
+

gdata_contacts_contact_new ()

+
GDataContactsContact *
+gdata_contacts_contact_new (const gchar *id);
+

Creates a new GDataContactsContact with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the contact's ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataContactsContact; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_name ()

+
GDataGDName *
+gdata_contacts_contact_get_name (GDataContactsContact *self);
+

Gets the “name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the contact's name, or NULL.

+

[transfer none]

+
+

Since: 0.5.0

+
+
+
+

gdata_contacts_contact_set_name ()

+
void
+gdata_contacts_contact_set_name (GDataContactsContact *self,
+                                 GDataGDName *name);
+

Sets the “name” property to name +, and increments its reference count.

+

name + must not be NULL, though all its properties may be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

name

the new GDataGDName

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_short_name ()

+
const gchar *
+gdata_contacts_contact_get_short_name (GDataContactsContact *self);
+

Gets the “short-name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the contact's short name, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_short_name ()

+
void
+gdata_contacts_contact_set_short_name (GDataContactsContact *self,
+                                       const gchar *short_name);
+

Sets the “short-name” property to short_name +.

+

If short_name + is NULL, the contact's short name will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

short_name

the contact's new short name, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_initials ()

+
const gchar *
+gdata_contacts_contact_get_initials (GDataContactsContact *self);
+

Gets the “initials” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the initials of the contact, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_initials ()

+
void
+gdata_contacts_contact_set_initials (GDataContactsContact *self,
+                                     const gchar *initials);
+

Sets the “initials” property to initials +.

+

If initials + is NULL, the contact's initials will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

initials

the new initials of the contact, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_maiden_name ()

+
const gchar *
+gdata_contacts_contact_get_maiden_name
+                               (GDataContactsContact *self);
+

Gets the “maiden-name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the maiden name of the contact, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_maiden_name ()

+
void
+gdata_contacts_contact_set_maiden_name
+                               (GDataContactsContact *self,
+                                const gchar *maiden_name);
+

Sets the “maiden-name” property to maiden_name +.

+

If maiden_name + is NULL, the contact's maiden name will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

maiden_name

the new maiden name of the contact, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_nickname ()

+
const gchar *
+gdata_contacts_contact_get_nickname (GDataContactsContact *self);
+

Gets the “nickname” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the contact's nickname, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_nickname ()

+
void
+gdata_contacts_contact_set_nickname (GDataContactsContact *self,
+                                     const gchar *nickname);
+

Sets the “nickname” property to nickname +.

+

If nickname + is NULL, the contact's nickname will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

nickname

the new nickname, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_file_as ()

+
const gchar *
+gdata_contacts_contact_get_file_as (GDataContactsContact *self);
+

Gets the “file-as” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the name the contact's filed under, or NULL

+
+

Since: 0.11.0

+
+
+
+

gdata_contacts_contact_set_file_as ()

+
void
+gdata_contacts_contact_set_file_as (GDataContactsContact *self,
+                                    const gchar *file_as);
+

Sets the “file-as” property to file_as +.

+

If file_as + is NULL, the contact will be filed under their full name.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

file_as

the new name to file the contact under, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_birthday ()

+
gboolean
+gdata_contacts_contact_get_birthday (GDataContactsContact *self,
+                                     GDate *birthday);
+

Gets the “birthday” and “birthday-has-year” properties. If birthday + is non-NULL, +“birthday” is returned in it. The function returns the value of “birthday-has-year”, +which specifies whether the year in birthday + is meaningful. Contacts may not have the year of their birth set, in which +case, the function would return FALSE, and the year in birthday + should be ignored.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

birthday

return location for the birthday, or NULL.

[allow-none][out caller-allocates]
+
+
+

Returns

+

whether the contact's birthday has the year set

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_birthday ()

+
void
+gdata_contacts_contact_set_birthday (GDataContactsContact *self,
+                                     GDate *birthday,
+                                     gboolean birthday_has_year);
+

Sets the “birthday” property to birthday + and the “birthday-has-year” property to birthday_has_year +. +See gdata_contacts_contact_get_birthday() for an explanation of the interation between these two properties.

+

If birthday + is NULL, the contact's birthday will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataContactsContact

 

birthday

the new birthday, or NULL.

[allow-none]

birthday_has_year

TRUE if birthday +'s year is relevant, FALSE otherwise

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_gender ()

+
const gchar *
+gdata_contacts_contact_get_gender (GDataContactsContact *self);
+

Gets the “gender” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the gender of the contact, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_gender ()

+
void
+gdata_contacts_contact_set_gender (GDataContactsContact *self,
+                                   const gchar *gender);
+

Sets the “gender” property to gender +.

+

If gender + is NULL, the contact's gender will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

gender

the new gender of the contact, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_mileage ()

+
const gchar *
+gdata_contacts_contact_get_mileage (GDataContactsContact *self);
+

Gets the “mileage” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a mileage associated with the contact, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_mileage ()

+
void
+gdata_contacts_contact_set_mileage (GDataContactsContact *self,
+                                    const gchar *mileage);
+

Sets the “mileage” property to mileage +.

+

If mileage + is NULL, the contact's mileage will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

mileage

the new mileage associated with the contact, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_occupation ()

+
const gchar *
+gdata_contacts_contact_get_occupation (GDataContactsContact *self);
+

Gets the “occupation” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the contact's occupation, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_occupation ()

+
void
+gdata_contacts_contact_set_occupation (GDataContactsContact *self,
+                                       const gchar *occupation);
+

Sets the “occupation” property to occupation +.

+

If occupation + is NULL, the contact's occupation will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

occupation

the contact's new occupation, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_subject ()

+
const gchar *
+gdata_contacts_contact_get_subject (GDataContactsContact *self);
+

Gets the “subject” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the contact's subject, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_subject ()

+
void
+gdata_contacts_contact_set_subject (GDataContactsContact *self,
+                                    const gchar *subject);
+

Sets the “subject” property to subject +.

+

If subject + is NULL, the contact's subject will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

subject

the contact's new subject, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_priority ()

+
const gchar *
+gdata_contacts_contact_get_priority (GDataContactsContact *self);
+

Gets the “priority” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the contact's priority, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_priority ()

+
void
+gdata_contacts_contact_set_priority (GDataContactsContact *self,
+                                     const gchar *priority);
+

Sets the “priority” property to priority +.

+

If priority + is NULL, the contact's priority will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

priority

the contact's new priority, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_sensitivity ()

+
const gchar *
+gdata_contacts_contact_get_sensitivity
+                               (GDataContactsContact *self);
+

Gets the “sensitivity” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the contact's sensitivity, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_sensitivity ()

+
void
+gdata_contacts_contact_set_sensitivity
+                               (GDataContactsContact *self,
+                                const gchar *sensitivity);
+

Sets the “sensitivity” property to sensitivity +.

+

If sensitivity + is NULL, the contact's sensitivity will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

sensitivity

the contact's new sensitivity, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_directory_server ()

+
const gchar *
+gdata_contacts_contact_get_directory_server
+                               (GDataContactsContact *self);
+

Gets the “directory-server” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the name or address of a directory server associated with the contact, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_directory_server ()

+
void
+gdata_contacts_contact_set_directory_server
+                               (GDataContactsContact *self,
+                                const gchar *directory_server);
+

Sets the “directory-server” property to directory_server +.

+

If directory_server + is NULL, the contact's directory server will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

directory_server

the new name or address of a directory server associated with the contact, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_billing_information ()

+
const gchar *
+gdata_contacts_contact_get_billing_information
+                               (GDataContactsContact *self);
+

Gets the “billing-information” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the contact's billing information, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_billing_information ()

+
void
+gdata_contacts_contact_set_billing_information
+                               (GDataContactsContact *self,
+                                const gchar *billing_information);
+

Sets the “billing-information” property to billing_information +.

+

If billing_information + is NULL, the contact's billing information will be removed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

billing_information

the new billing information for the contact, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_email_addresses ()

+
GList *
+gdata_contacts_contact_get_email_addresses
+                               (GDataContactsContact *self);
+

Gets a list of the e-mail addresses owned by the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGDEmailAddresses, or NULL.

+

[element-type GData.GDEmailAddress][transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_primary_email_address ()

+
GDataGDEmailAddress *
+gdata_contacts_contact_get_primary_email_address
+                               (GDataContactsContact *self);
+

Gets the contact's primary e-mail address, if one exists.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GDataGDEmailAddress, or NULL.

+

[transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_add_email_address ()

+
void
+gdata_contacts_contact_add_email_address
+                               (GDataContactsContact *self,
+                                GDataGDEmailAddress *email_address);
+

Adds an e-mail address to the contact's list of e-mail addresses and increments its reference count.

+

Note that only one e-mail address per contact may be marked as "primary". Insertion and update operations +(with gdata_contacts_service_insert_contact()) will return an error if more than one e-mail address +is marked as primary.

+

Duplicate e-mail addresses will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

email_address

a GDataGDEmailAddress to add

 
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_remove_all_email_addresses ()

+
void
+gdata_contacts_contact_remove_all_email_addresses
+                               (GDataContactsContact *self);
+

Removes all e-mail addresses from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.4.0

+
+
+
+

gdata_contacts_contact_get_im_addresses ()

+
GList *
+gdata_contacts_contact_get_im_addresses
+                               (GDataContactsContact *self);
+

Gets a list of the IM addresses owned by the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGDIMAddresses, or NULL.

+

[element-type GData.GDIMAddress][transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_primary_im_address ()

+
GDataGDIMAddress *
+gdata_contacts_contact_get_primary_im_address
+                               (GDataContactsContact *self);
+

Gets the contact's primary IM address, if one exists.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GDataGDIMAddress, or NULL.

+

[transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_add_im_address ()

+
void
+gdata_contacts_contact_add_im_address (GDataContactsContact *self,
+                                       GDataGDIMAddress *im_address);
+

Adds an IM (instant messaging) address to the contact's list of IM addresses and increments its reference count.

+

Note that only one IM address per contact may be marked as "primary". Insertion and update operations +(with gdata_contacts_service_insert_contact()) will return an error if more than one IM address +is marked as primary.

+

Duplicate IM addresses will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

im_address

a GDataGDIMAddress to add

 
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_remove_all_im_addresses ()

+
void
+gdata_contacts_contact_remove_all_im_addresses
+                               (GDataContactsContact *self);
+

Removes all IM addresses from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.4.0

+
+
+
+

gdata_contacts_contact_get_postal_addresses ()

+
GList *
+gdata_contacts_contact_get_postal_addresses
+                               (GDataContactsContact *self);
+

Gets a list of the postal addresses owned by the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGDPostalAddresses, or NULL.

+

[element-type GData.GDPostalAddress][transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_primary_postal_address ()

+
GDataGDPostalAddress *
+gdata_contacts_contact_get_primary_postal_address
+                               (GDataContactsContact *self);
+

Gets the contact's primary postal address, if one exists.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GDataGDPostalAddress, or NULL.

+

[transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_add_postal_address ()

+
void
+gdata_contacts_contact_add_postal_address
+                               (GDataContactsContact *self,
+                                GDataGDPostalAddress *postal_address);
+

Adds a postal address to the contact's list of postal addresses and increments its reference count.

+

Note that only one postal address per contact may be marked as "primary". Insertion and update operations +(with gdata_contacts_service_insert_contact()) will return an error if more than one postal address +is marked as primary.

+

Duplicate postal addresses will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

postal_address

a GDataGDPostalAddress to add

 
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_remove_all_postal_addresses ()

+
void
+gdata_contacts_contact_remove_all_postal_addresses
+                               (GDataContactsContact *self);
+

Removes all postal addresses from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.4.0

+
+
+
+

gdata_contacts_contact_get_phone_numbers ()

+
GList *
+gdata_contacts_contact_get_phone_numbers
+                               (GDataContactsContact *self);
+

Gets a list of the phone numbers owned by the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGDPhoneNumbers, or NULL.

+

[element-type GData.GDPhoneNumber][transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_primary_phone_number ()

+
GDataGDPhoneNumber *
+gdata_contacts_contact_get_primary_phone_number
+                               (GDataContactsContact *self);
+

Gets the contact's primary phone number, if one exists.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GDataGDPhoneNumber, or NULL.

+

[transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_add_phone_number ()

+
void
+gdata_contacts_contact_add_phone_number
+                               (GDataContactsContact *self,
+                                GDataGDPhoneNumber *phone_number);
+

Adds a phone number to the contact's list of phone numbers and increments its reference count

+

Note that only one phone number per contact may be marked as "primary". Insertion and update operations +(with gdata_contacts_service_insert_contact()) will return an error if more than one phone number +is marked as primary.

+

Duplicate phone numbers will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

phone_number

a GDataGDPhoneNumber to add

 
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_remove_all_phone_numbers ()

+
void
+gdata_contacts_contact_remove_all_phone_numbers
+                               (GDataContactsContact *self);
+

Removes all phone numbers from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.4.0

+
+
+
+

gdata_contacts_contact_get_organizations ()

+
GList *
+gdata_contacts_contact_get_organizations
+                               (GDataContactsContact *self);
+

Gets a list of the organizations to which the contact belongs.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGDOrganizations, or NULL.

+

[element-type GData.GDOrganization][transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_primary_organization ()

+
GDataGDOrganization *
+gdata_contacts_contact_get_primary_organization
+                               (GDataContactsContact *self);
+

Gets the contact's primary organization, if one exists.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GDataGDOrganization, or NULL.

+

[transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_add_organization ()

+
void
+gdata_contacts_contact_add_organization
+                               (GDataContactsContact *self,
+                                GDataGDOrganization *organization);
+

Adds an organization to the contact's list of organizations (e.g. employers) and increments its reference count.

+

Note that only one organization per contact may be marked as "primary". Insertion and update operations +(with gdata_contacts_service_insert_contact()) will return an error if more than one organization +is marked as primary.

+

Duplicate organizations will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

organization

a GDataGDOrganization to add

 
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_remove_all_organizations ()

+
void
+gdata_contacts_contact_remove_all_organizations
+                               (GDataContactsContact *self);
+

Removes all organizations from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.4.0

+
+
+
+

gdata_contacts_contact_add_jot ()

+
void
+gdata_contacts_contact_add_jot (GDataContactsContact *self,
+                                GDataGContactJot *jot);
+

Adds a jot to the contact's list of jots and increments its reference count.

+

Duplicate jots will be added to the list, and multiple jots with the same relation type can be added to a single contact.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

jot

a GDataGContactJot to add

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_jots ()

+
GList *
+gdata_contacts_contact_get_jots (GDataContactsContact *self);
+

Gets a list of the jots attached to the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGContactJots, or NULL.

+

[element-type GData.GContactJot][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_remove_all_jots ()

+
void
+gdata_contacts_contact_remove_all_jots
+                               (GDataContactsContact *self);
+

Removes all jots from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_add_relation ()

+
void
+gdata_contacts_contact_add_relation (GDataContactsContact *self,
+                                     GDataGContactRelation *relation);
+

Adds a relation to the contact's list of relations and increments its reference count.

+

Duplicate relations will be added to the list, and multiple relations with the same relation type can be added to a single contact. +Though it may not make sense for some relation types to be repeated, adding them is allowed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

relation

a GDataGContactRelation to add

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_relations ()

+
GList *
+gdata_contacts_contact_get_relations (GDataContactsContact *self);
+

Gets a list of the relations of the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGContactRelations, or NULL.

+

[element-type GData.GContactRelation][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_remove_all_relations ()

+
void
+gdata_contacts_contact_remove_all_relations
+                               (GDataContactsContact *self);
+

Removes all relations from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_add_website ()

+
void
+gdata_contacts_contact_add_website (GDataContactsContact *self,
+                                    GDataGContactWebsite *website);
+

Adds a website to the contact's list of websites and increments its reference count.

+

Duplicate websites will not be added to the list, though the same URI may appear in several GDataGContactWebsites with different +relation types or labels.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

website

a GDataGContactWebsite to add

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_websites ()

+
GList *
+gdata_contacts_contact_get_websites (GDataContactsContact *self);
+

Gets a list of the websites of the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGContactWebsites, or NULL.

+

[element-type GData.GContactWebsite][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_primary_website ()

+
GDataGContactWebsite *
+gdata_contacts_contact_get_primary_website
+                               (GDataContactsContact *self);
+

Gets the contact's primary website, if one exists.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GDataGContactWebsite, or NULL.

+

[transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_remove_all_websites ()

+
void
+gdata_contacts_contact_remove_all_websites
+                               (GDataContactsContact *self);
+

Removes all websites from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_add_event ()

+
void
+gdata_contacts_contact_add_event (GDataContactsContact *self,
+                                  GDataGContactEvent *event);
+

Adds an event to the contact's list of events and increments its reference count.

+

Duplicate events will be added to the list, and multiple events with the same event type can be added to a single contact. +Though it may not make sense for some event types to be repeated, adding them is allowed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

event

a GDataGContactEvent to add

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_events ()

+
GList *
+gdata_contacts_contact_get_events (GDataContactsContact *self);
+

Gets a list of the events of the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGContactEvents, or NULL.

+

[element-type GData.GContactEvent][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_remove_all_events ()

+
void
+gdata_contacts_contact_remove_all_events
+                               (GDataContactsContact *self);
+

Removes all events from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_add_calendar ()

+
void
+gdata_contacts_contact_add_calendar (GDataContactsContact *self,
+                                     GDataGContactCalendar *calendar);
+

Adds a calendar to the contact's list of calendars and increments its reference count.

+

Duplicate calendars will not be added to the list, though the same URI may appear in several GDataGContactCalendars with different +relation types or labels.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

calendar

a GDataGContactCalendar to add

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_calendars ()

+
GList *
+gdata_contacts_contact_get_calendars (GDataContactsContact *self);
+

Gets a list of the calendars of the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGContactCalendars, or NULL.

+

[element-type GData.GContactCalendar][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_primary_calendar ()

+
GDataGContactCalendar *
+gdata_contacts_contact_get_primary_calendar
+                               (GDataContactsContact *self);
+

Gets the contact's primary calendar, if one exists.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GDataGContactCalendar, or NULL.

+

[transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_remove_all_calendars ()

+
void
+gdata_contacts_contact_remove_all_calendars
+                               (GDataContactsContact *self);
+

Removes all calendars from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_add_external_id ()

+
void
+gdata_contacts_contact_add_external_id
+                               (GDataContactsContact *self,
+                                GDataGContactExternalID *external_id);
+

Adds an external ID to the contact's list of external IDs and increments its reference count.

+

Duplicate IDs will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

external_id

a GDataGContactExternalID to add

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_external_ids ()

+
GList *
+gdata_contacts_contact_get_external_ids
+                               (GDataContactsContact *self);
+

Gets a list of the external IDs of the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGContactExternalIDs, or NULL.

+

[element-type GData.GContactExternalID][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_remove_all_external_ids ()

+
void
+gdata_contacts_contact_remove_all_external_ids
+                               (GDataContactsContact *self);
+

Removes all external IDs from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_add_hobby ()

+
void
+gdata_contacts_contact_add_hobby (GDataContactsContact *self,
+                                  const gchar *hobby);
+

Adds a hobby to the contact's list of hobbies, copying it in the process.

+

Duplicate hobbies will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

hobby

a hobby to add

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_hobbies ()

+
GList *
+gdata_contacts_contact_get_hobbies (GDataContactsContact *self);
+

Gets a list of the hobbies of the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of hobby strings, or NULL.

+

[element-type utf8][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_remove_all_hobbies ()

+
void
+gdata_contacts_contact_remove_all_hobbies
+                               (GDataContactsContact *self);
+

Removes all hobbies from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_add_language ()

+
void
+gdata_contacts_contact_add_language (GDataContactsContact *self,
+                                     GDataGContactLanguage *language);
+

Adds a language to the contact's list of languages and increments its reference count.

+

Duplicate languages will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

language

a GDataGContactLanguage to add

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_languages ()

+
GList *
+gdata_contacts_contact_get_languages (GDataContactsContact *self);
+

Gets a list of the languages of the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of GDataGContactLanguages, or NULL.

+

[element-type GData.GContactLanguage][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_remove_all_languages ()

+
void
+gdata_contacts_contact_remove_all_languages
+                               (GDataContactsContact *self);
+

Removes all languages from the contact.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_groups ()

+
GList *
+gdata_contacts_contact_get_groups (GDataContactsContact *self);
+

Gets a list of the groups to which the contact belongs.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GList of constant group ID URIs, or NULL; free with g_list_free().

+

[element-type utf8][transfer container]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_add_group ()

+
void
+gdata_contacts_contact_add_group (GDataContactsContact *self,
+                                  const gchar *href);
+

Adds the contact to the given group. href + should be a URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

href

the group's ID URI

 
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_remove_group ()

+
void
+gdata_contacts_contact_remove_group (GDataContactsContact *self,
+                                     const gchar *href);
+

Removes the contact from the given group. href + should be a URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

href

the group's ID URI

 
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_is_group_deleted ()

+
gboolean
+gdata_contacts_contact_is_group_deleted
+                               (GDataContactsContact *self,
+                                const gchar *href);
+

Returns whether the contact has recently been removed from the given group on the server. This +will always return FALSE unless “show-deleted” has been set to +TRUE for the query which returned the contact.

+

If you've just removed a contact from a group locally using gdata_contacts_contact_remove_group(), FALSE will still be returned by this function, +as the change hasn't been sent to the server.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

href

the group's ID URI

 
+
+
+

Returns

+

TRUE if the contact has recently been removed from the group, FALSE otherwise

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_extended_property ()

+
const gchar *
+gdata_contacts_contact_get_extended_property
+                               (GDataContactsContact *self,
+                                const gchar *name);
+

Gets the value of an extended property of the contact. Each contact can have up to 10 client-set extended +properties to store data of the client's choosing.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

name

the property name; an arbitrary, unique string

 
+
+
+

Returns

+

the property's value, or NULL

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_extended_properties ()

+
GHashTable *
+gdata_contacts_contact_get_extended_properties
+                               (GDataContactsContact *self);
+

Gets the full list of extended properties of the contact; a hash table mapping property name to value.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GHashTable of extended properties.

+

[transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_contacts_contact_set_extended_property ()

+
gboolean
+gdata_contacts_contact_set_extended_property
+                               (GDataContactsContact *self,
+                                const gchar *name,
+                                const gchar *value);
+

Sets the value of a contact's extended property. Extended property names are unique (but of the client's choosing), +and reusing the same property name will result in the old value of that property being overwritten.

+

To unset a property, set value + to NULL or an empty string.

+

A contact may have up to 10 extended properties, and each should be reasonably small (i.e. not a photo or ringtone). +For more information, see the online documentation. +FALSE will be returned if you attempt to add more than 10 extended properties.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataContactsContact

 

name

the property name; an arbitrary, unique string

 

value

the property value, or NULL.

[allow-none]
+
+
+

Returns

+

TRUE if the property was updated or deleted successfully, FALSE otherwise

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_user_defined_field ()

+
const gchar *
+gdata_contacts_contact_get_user_defined_field
+                               (GDataContactsContact *self,
+                                const gchar *name);
+

Gets the value of a user-defined field of the contact. User-defined fields are settable by the user through the Google Contacts web interface, +in contrast to extended properties, which are visible and settable only through the GData interface.

+

The name + of the field may not be NULL, but may be an empty string.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsContact

 

name

the field name; an arbitrary, case-sensitive, unique string

 
+
+
+

Returns

+

the field's value, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_user_defined_fields ()

+
GHashTable *
+gdata_contacts_contact_get_user_defined_fields
+                               (GDataContactsContact *self);
+

Gets the full list of user-defined fields of the contact; a hash table mapping field name to value.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

a GHashTable of user-defined fields.

+

[transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_set_user_defined_field ()

+
void
+gdata_contacts_contact_set_user_defined_field
+                               (GDataContactsContact *self,
+                                const gchar *name,
+                                const gchar *value);
+

Sets the value of a contact's user-defined field. User-defined field names are unique (but of the client's choosing), +and reusing the same field name will result in the old value of that field being overwritten.

+

The name + of the field may not be NULL, but may be an empty string.

+

To unset a field, set value + to NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataContactsContact

 

name

the field name; an arbitrary, case-sensitive, unique string

 

value

the field value, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_contact_get_edited ()

+
gint64
+gdata_contacts_contact_get_edited (GDataContactsContact *self);
+

Gets the “edited” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the UNIX timestamp for the time the contact was last edited, or -1

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_is_deleted ()

+
gboolean
+gdata_contacts_contact_is_deleted (GDataContactsContact *self);
+

Returns whether the contact has recently been deleted. This will always return +FALSE unless “show-deleted” has been set to +TRUE for the query which returned the contact; then this function will return +TRUE only if the contact has been deleted.

+

If a contact has been deleted, no other information is available about it. This +is designed to allow contacts to be deleted from local address books using +incremental updates from the server (e.g. with “updated-min” and +“show-deleted”).

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

TRUE if the contact has been deleted, FALSE otherwise

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_contact_get_photo_etag ()

+
const gchar *
+gdata_contacts_contact_get_photo_etag (GDataContactsContact *self);
+

Returns the ETag for the contact's attached photo, if it exists. If it does exist, the contact's photo can be retrieved using +gdata_contacts_contact_get_photo(). If it doesn't exist, NULL will be returned, and the contact doesn't have a photo (so calling +gdata_contacts_contact_get_photo() will also return NULL)

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsContact

 
+
+
+

Returns

+

the contact's photo's ETag if it exists, NULL otherwise

+
+

Since: 0.9.0

+
+
+
+

gdata_contacts_contact_get_photo ()

+
guint8 *
+gdata_contacts_contact_get_photo (GDataContactsContact *self,
+                                  GDataContactsService *service,
+                                  gsize *length,
+                                  gchar **content_type,
+                                  GCancellable *cancellable,
+                                  GError **error);
+

Downloads and returns the contact's photo, if they have one. If the contact doesn't +have a photo (i.e. gdata_contacts_contact_get_photo_etag() returns NULL), NULL is returned, but +no error is set in error +.

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

+

If there is an error getting the photo, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsContact

 

service

a GDataContactsService

 

length

return location for the image length, in bytes.

[out caller-allocates]

content_type

return location for the image's content type, or NULL; free with g_free().

[out callee-allocates][transfer full][allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

the image data, or NULL; free with g_free().

+

[transfer full][array length=length]

+
+

Since: 0.8.0

+
+
+
+

gdata_contacts_contact_get_photo_async ()

+
void
+gdata_contacts_contact_get_photo_async
+                               (GDataContactsContact *self,
+                                GDataContactsService *service,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Downloads and returns the contact's photo, if they have one, asynchronously. self + and service + are both reffed when this function is called, so +can safely be unreffed after this function returns.

+

When the operation is finished, callback + will be called. You can then call gdata_contacts_contact_get_photo_finish() to get the results of the +operation.

+

For more details, see gdata_contacts_contact_get_photo(), which is the synchronous version of this function.

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned by gdata_contacts_contact_get_photo_finish().

+

If there is an error getting the photo, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned by gdata_contacts_contact_get_photo_finish().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsContact

 

service

a GDataContactsService

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the photo has been retrieved, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.8.0

+
+
+
+

gdata_contacts_contact_get_photo_finish ()

+
guint8 *
+gdata_contacts_contact_get_photo_finish
+                               (GDataContactsContact *self,
+                                GAsyncResult *async_result,
+                                gsize *length,
+                                gchar **content_type,
+                                GError **error);
+

Finishes an asynchronous contact photo retrieval operation started with gdata_contacts_contact_get_photo_async(). If the contact doesn't have a +photo (i.e. gdata_contacts_contact_get_photo_etag() returns NULL), NULL is returned, but no error is set in error +.

+

If there is an error getting the photo, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. length + will be set to

+0 and content_type will be set to NULL. +
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsContact

 

async_result

a GAsyncResult

 

length

return location for the image length, in bytes.

[out caller-allocates]

content_type

return location for the image's content type, or NULL; free with g_free().

[out callee-allocates][transfer full][allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

the image data, or NULL; free with g_free().

+

[transfer full][array length=length]

+
+

Since: 0.8.0

+
+
+
+

gdata_contacts_contact_set_photo ()

+
gboolean
+gdata_contacts_contact_set_photo (GDataContactsContact *self,
+                                  GDataContactsService *service,
+                                  const guint8 *data,
+                                  gsize length,
+                                  const gchar *content_type,
+                                  GCancellable *cancellable,
+                                  GError **error);
+

Sets the contact's photo to data + or, if data + is NULL, deletes the contact's photo. content_type + must be specified if data + is non-NULL.

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

+

If there is an error setting the photo, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsContact

 

service

a GDataContactsService

 

data

the image data, or NULL.

[allow-none]

length

the image length, in bytes

 

content_type

the content type of the image, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.8.0

+
+
+
+

gdata_contacts_contact_set_photo_async ()

+
void
+gdata_contacts_contact_set_photo_async
+                               (GDataContactsContact *self,
+                                GDataContactsService *service,
+                                const guint8 *data,
+                                gsize length,
+                                const gchar *content_type,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Sets the contact's photo to data + or, if data + is NULL, deletes the contact's photo. content_type + must be specified if data + is non-NULL. self +, +service +, data + and content_type + are all reffed and copied when this function is called, so can safely be unreffed after this function returns.

+

When the operation is finished, callback + will be called. You can then call gdata_contacts_contact_set_photo_finish() to get the results of the +operation.

+

For more details, see gdata_contacts_contact_set_photo(), which is the synchronous version of this function.

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned by gdata_contacts_contact_set_photo_finish().

+

If there is an error setting the photo, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned by gdata_contacts_contact_set_photo_finish().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsContact

 

service

a GDataContactsService

 

data

the image data, or NULL.

[allow-none]

length

the image length, in bytes

 

content_type

the content type of the image, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the photo has been set, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.8.0

+
+
+
+

gdata_contacts_contact_set_photo_finish ()

+
gboolean
+gdata_contacts_contact_set_photo_finish
+                               (GDataContactsContact *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finishes an asynchronous contact photo setting operation started with gdata_contacts_contact_set_photo_async().

+

If there is an error setting the photo, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataContactsContact

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.8.0

+
+
+
+

Types and Values

+
+

GDATA_CONTACTS_GENDER_MALE

+
#define GDATA_CONTACTS_GENDER_MALE "male"
+
+

The contact is male.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_GENDER_FEMALE

+
#define GDATA_CONTACTS_GENDER_FEMALE "female"
+
+

The contact is female.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_PRIORITY_LOW

+
#define GDATA_CONTACTS_PRIORITY_LOW "low"
+
+

The contact is of low importance.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_PRIORITY_NORMAL

+
#define GDATA_CONTACTS_PRIORITY_NORMAL "normal"
+
+

The contact is of normal importance.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_PRIORITY_HIGH

+
#define GDATA_CONTACTS_PRIORITY_HIGH "high"
+
+

The contact is of high importance.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL

+
#define GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL "confidential"
+
+

The contact's data is confidential.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_SENSITIVITY_NORMAL

+
#define GDATA_CONTACTS_SENSITIVITY_NORMAL "normal"
+
+

The contact's data is of normal sensitivity.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_SENSITIVITY_PERSONAL

+
#define GDATA_CONTACTS_SENSITIVITY_PERSONAL "personal"
+
+

The contact's data is personal.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_SENSITIVITY_PRIVATE

+
#define GDATA_CONTACTS_SENSITIVITY_PRIVATE "private"
+
+

The contact's data is private.

+

Since: 0.7.0

+
+
+
+

GDataContactsContact

+
typedef struct _GDataContactsContact GDataContactsContact;
+

All the fields in the GDataContactsContact structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataContactsContactClass

+
typedef struct {
+} GDataContactsContactClass;
+
+

All the fields in the GDataContactsContactClass structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

Property Details

+
+

The “billing-information” property

+
  “billing-information”      gchar *
+

Billing information for the contact, such as their billing name and address.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “birthday” property

+
  “birthday”                 GDate *
+

The contact's birthday.

+

Flags: Read / Write

+

Since: 0.7.0

+
+
+
+

The “birthday-has-year” property

+
  “birthday-has-year”        gboolean
+

Whether the contact's birthday includes their year of birth.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.7.0

+
+
+
+

The “deleted” property

+
  “deleted”                  gboolean
+

Whether the entry has been deleted.

+

Flags: Read

+

Default value: FALSE

+

Since: 0.2.0

+
+
+
+

The “directory-server” property

+
  “directory-server”         gchar *
+

The name or address of a directory server associated with the contact.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “edited” property

+
  “edited”                   gint64
+

The last time the contact was edited. If the contact has not been edited yet, the content indicates the time it was created.

+

For more information, see the +Atom Publishing Protocol specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.2.0

+
+
+
+

The “file-as” property

+
  “file-as”                  gchar *
+

The name to file the contact under for sorting purposes.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.11.0

+
+
+
+

The “gender” property

+
  “gender”                   gchar *
+

The gender of the contact. For example: GDATA_CONTACTS_GENDER_MALE or GDATA_CONTACTS_GENDER_FEMALE.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “initials” property

+
  “initials”                 gchar *
+

The initials of the contact.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “maiden-name” property

+
  “maiden-name”              gchar *
+

The maiden name of the contact.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “mileage” property

+
  “mileage”                  gchar *
+

A mileage associated with the contact, such as one for reimbursement purposes. It can be in any format.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “name” property

+
  “name”                     GDataGDName *
+

The contact's name in a structured representation.

+

Flags: Read / Write

+

Since: 0.5.0

+
+
+
+

The “nickname” property

+
  “nickname”                 gchar *
+

The contact's chosen nickname.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “occupation” property

+
  “occupation”               gchar *
+

The contact's occupation.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “photo-etag” property

+
  “photo-etag”               gchar *
+

The ETag of the contact's photo, if the contact has a photo; NULL otherwise.

+

Flags: Read

+

Default value: NULL

+

Since: 0.9.0

+
+
+
+

The “priority” property

+
  “priority”                 gchar *
+

The contact's importance. For example: GDATA_CONTACTS_PRIORITY_NORMAL or GDATA_CONTACTS_PRIORITY_HIGH.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “sensitivity” property

+
  “sensitivity”              gchar *
+

The sensitivity of the contact's data. For example: GDATA_CONTACTS_SENSITIVITY_NORMAL or GDATA_CONTACTS_SENSITIVITY_PRIVATE.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “short-name” property

+
  “short-name”               gchar *
+

A short name for the contact. This should be used for contracted versions of the contact's actual name, +whereas “nickname” should be used for nicknames.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “subject” property

+
  “subject”                  gchar *
+

The subject of the contact. (i.e. The contact's relevance to the address book.)

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataContactsGroup.html b/docs/reference/html/GDataContactsGroup.html new file mode 100644 index 0000000..29e7781 --- /dev/null +++ b/docs/reference/html/GDataContactsGroup.html @@ -0,0 +1,625 @@ + + + + +GDataContactsGroup: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataContactsGroup

+

GDataContactsGroup — GData Contacts group object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
gbooleandeletedRead
gint64editedRead
+gchar *system-group-idRead
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataContactsGroup
+
+
+
+

Includes

+
#include <gdata/services/contacts/gdata-contacts-group.h>
+
+
+
+

Description

+

GDataContactsGroup is a subclass of GDataEntry to represent a group from a Google address book.

+

For more details of Google Contacts' GData API, see the

+online documentation. +

The user-set name of the group is stored in the “title” property, retrievable using gdata_entry_get_title(). Note that for system groups +(see “system-group-id”), this group name is provided by Google, and is not localised. Clients should provide their own localised +group names for the system groups.

+

In addition to all the standard properties available for a group, GDataContactsGroup supports an additional kind of property: extended +properties. Extended properties, set with gdata_contacts_group_set_extended_property() and retrieved with +gdata_contacts_group_get_extended_property(), are provided as a method of storing client-specific data which shouldn't be seen or be editable +by the user, such as IDs and cache times.

+
+

Example 26. Adding a New Group

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
GDataContactsService *service;
+GDataContactsGroup *group, *updated_group;
+GDataContactsContact *contact, *updated_contact;
+GError *error = NULL;
+
+/* Create a service and return a contact to add to the new group. */
+service = create_contacts_service ();
+contact = query_user_for_contact (service);
+
+/* Create the new group */
+group = gdata_contacts_group_new (NULL);
+gdata_entry_set_title (GDATA_ENTRY (group), "Group Name");
+
+/* Insert the group on the server */
+updated_group = gdata_contacts_service_insert_group (service, group, NULL, &error);
+
+g_object_unref (group);
+
+if (error != NULL) {
+    g_error ("Error adding a group: %s", error->message);
+    g_error_free (error);
+    g_object_unref (contact);
+    g_object_unref (service);
+    return;
+}
+
+/* Add the contact to the new group. */
+gdata_contacts_contact_add_group (contact, gdata_entry_get_id (GDATA_ENTRY (updated_group)));
+
+g_object_unref (updated_group);
+
+/* Update the contact on the server */
+updated_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (contact), NULL, &error));
+
+g_object_unref (contact);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error updating contact: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Do something with the updated contact, such as update them in the UI, or store their ID for future use. */
+
+g_object_unref (updated_contact);
+
+ +
+
+
+
+

Functions

+
+

gdata_contacts_group_new ()

+
GDataContactsGroup *
+gdata_contacts_group_new (const gchar *id);
+

Creates a new GDataContactsGroup with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the group's ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataContactsGroup; unref with g_object_unref()

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_group_get_edited ()

+
gint64
+gdata_contacts_group_get_edited (GDataContactsGroup *self);
+

Gets the “edited” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsGroup

 
+
+
+

Returns

+

the UNIX timestamp for the time the file was last edited, or -1

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_group_is_deleted ()

+
gboolean
+gdata_contacts_group_is_deleted (GDataContactsGroup *self);
+

Returns whether the group has recently been deleted. This will always return FALSE unless “show-deleted” has been set to TRUE +for the query which returned the group; then this function will return TRUE only if the group has been deleted.

+

If a group has been deleted, no other information is available about it. This is designed to allow groups to be deleted from local address +books using incremental updates from the server (e.g. with “updated-min” and “show-deleted”).

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsGroup

 
+
+
+

Returns

+

TRUE if the group has been deleted, FALSE otherwise

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_group_get_system_group_id ()

+
const gchar *
+gdata_contacts_group_get_system_group_id
+                               (GDataContactsGroup *self);
+

Gets the “system-group-id” property. If the group is not a system group, NULL will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsGroup

 
+
+
+

Returns

+

the group's system group ID, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_group_get_extended_property ()

+
const gchar *
+gdata_contacts_group_get_extended_property
+                               (GDataContactsGroup *self,
+                                const gchar *name);
+

Gets the value of an extended property of the group. Each group can have up to 10 client-set extended properties to store data of the client's +choosing.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsGroup

 

name

the property name; an arbitrary, unique string

 
+
+
+

Returns

+

the property's value, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_group_get_extended_properties ()

+
GHashTable *
+gdata_contacts_group_get_extended_properties
+                               (GDataContactsGroup *self);
+

Gets the full list of extended properties of the group; a hash table mapping property name to value.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsGroup

 
+
+
+

Returns

+

a GHashTable of extended properties.

+

[transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_group_set_extended_property ()

+
gboolean
+gdata_contacts_group_set_extended_property
+                               (GDataContactsGroup *self,
+                                const gchar *name,
+                                const gchar *value);
+

Sets the value of a group's extended property. Extended property names are unique (but of the client's choosing), and reusing the same property +name will result in the old value of that property being overwritten.

+

To unset a property, set value + to NULL or an empty string.

+

A group may have up to 10 extended properties, and each should be reasonably small (i.e. not a photo or ringtone). For more information, see the

+online documentation. +

FALSE will be returned if you attempt to add more than 10 extended properties.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataContactsGroup

 

name

the property name; an arbitrary, unique string

 

value

the property value, or NULL.

[allow-none]
+
+
+

Returns

+

TRUE if the property was updated or deleted successfully, FALSE otherwise

+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDATA_CONTACTS_GROUP_CONTACTS

+
#define GDATA_CONTACTS_GROUP_CONTACTS "Contacts"
+
+

The system group ID for the "My Contacts" system group.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_GROUP_FRIENDS

+
#define GDATA_CONTACTS_GROUP_FRIENDS "Friends"
+
+

The system group ID for the "Friends" system group.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_GROUP_FAMILY

+
#define GDATA_CONTACTS_GROUP_FAMILY "Family"
+
+

The system group ID for the "Family" system group.

+

Since: 0.7.0

+
+
+
+

GDATA_CONTACTS_GROUP_COWORKERS

+
#define GDATA_CONTACTS_GROUP_COWORKERS "Coworkers"
+
+

The system group ID for the "Coworkers" system group.

+

Since: 0.7.0

+
+
+
+

GDataContactsGroup

+
typedef struct _GDataContactsGroup GDataContactsGroup;
+

All the fields in the GDataContactsGroup structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataContactsGroupClass

+
typedef struct {
+} GDataContactsGroupClass;
+
+

All the fields in the GDataContactsGroupClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “deleted” property

+
  “deleted”                  gboolean
+

Whether the entry has been deleted.

+

Flags: Read

+

Default value: FALSE

+

Since: 0.7.0

+
+
+
+

The “edited” property

+
  “edited”                   gint64
+

The last time the group was edited. If the group has not been edited yet, the content indicates the time it was created.

+

For more information, see the +Atom Publishing Protocol specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.7.0

+
+
+
+

The “system-group-id” property

+
  “system-group-id”          gchar *
+

The system group ID for this group, if it's a system group. If the group is not a system group, this is NULL. Otherwise, it is one of the +four system group IDs: GDATA_CONTACTS_GROUP_CONTACTS, GDATA_CONTACTS_GROUP_FRIENDS, GDATA_CONTACTS_GROUP_FAMILY and +GDATA_CONTACTS_GROUP_COWORKERS.

+

If this is non-NULL, the group name stored in “title” will not be localised, so clients should provide localised group names of +their own for each of the system groups. Whether a group is a system group should be detected solely on the basis of the value of this +property, not by comparing the group name (“title”) or entry ID (“id”). The entry ID is not the same as the system +group ID.

+

Flags: Read

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataContactsQuery.html b/docs/reference/html/GDataContactsQuery.html new file mode 100644 index 0000000..8535e36 --- /dev/null +++ b/docs/reference/html/GDataContactsQuery.html @@ -0,0 +1,676 @@ + + + + +GDataContactsQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataContactsQuery

+

GDataContactsQuery — GData Contacts query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataContactsQuery * + +gdata_contacts_query_new () +
+GDataContactsQuery * + +gdata_contacts_query_new_with_limits () +
const gchar * + +gdata_contacts_query_get_order_by () +
+void + +gdata_contacts_query_set_order_by () +
const gchar * + +gdata_contacts_query_get_sort_order () +
+void + +gdata_contacts_query_set_sort_order () +
+gboolean + +gdata_contacts_query_show_deleted () +
+void + +gdata_contacts_query_set_show_deleted () +
const gchar * + +gdata_contacts_query_get_group () +
+void + +gdata_contacts_query_set_group () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
+gchar *groupRead / Write
+gchar *order-byRead / Write
gbooleanshow-deletedRead / Write
+gchar *sort-orderRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataContactsQuery
 GDataContactsQueryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ╰── GDataContactsQuery
+
+
+
+

Includes

+
#include <gdata/services/contacts/gdata-contacts-query.h>
+
+
+
+

Description

+

GDataContactsQuery represents a collection of query parameters specific to the Google Contacts service, which go above and beyond +those catered for by GDataQuery.

+

For more information on the custom GData query parameters supported by GDataContactsQuery, see the online documentation.

+
+

Example 22. Querying for Contacts

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
GDataContactsService *service;
+gchar *group_id;
+GDataContactsQuery *query;
+GDataFeed *feed;
+GList *i;
+GError *error = NULL;
+
+/* Create a service and return the group we're querying within. */
+service = create_contacts_service ();
+group_id = query_user_for_group (service);
+
+/* Create the query to use. We're going to query for contacts which match the search term "John" within a given group,
+ * including deleted contacts. The group is specified by its ID. */
+query = gdata_contacts_query_new ("John");
+gdata_contacts_query_set_show_deleted (query, TRUE);
+gdata_contacts_query_set_group (query, group_id);
+
+g_free (group_id);
+
+/* Execute the query */
+feed = gdata_contacts_service_query_contacts (service, query, NULL, NULL, NULL, &error);
+
+g_object_unref (query);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error querying for contacts: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Iterate through the returned contacts and do something with them */
+for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) {
+    GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (i->data);
+
+    /* Do something with the contact here, such as insert it into a UI */
+}
+
+g_object_unref (feed);
+
+ +
+
+
+
+

Functions

+
+

gdata_contacts_query_new ()

+
GDataContactsQuery *
+gdata_contacts_query_new (const gchar *q);
+

Creates a new GDataContactsQuery with its “q” property set to q +.

+
+

Parameters

+
+++++ + + + + + +

q

a query string, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataContactsQuery

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_query_new_with_limits ()

+
GDataContactsQuery *
+gdata_contacts_query_new_with_limits (const gchar *q,
+                                      guint start_index,
+                                      guint max_results);
+

Creates a new GDataContactsQuery with its “q” property set to q +, and the limits start_index + and max_results + +applied.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

q

a query string, or NULL.

[allow-none]

start_index

a one-based start index for the results, or 0

 

max_results

the maximum number of results to return, or 0

 
+
+
+

Returns

+

a new GDataContactsQuery

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_query_get_order_by ()

+
const gchar *
+gdata_contacts_query_get_order_by (GDataContactsQuery *self);
+

Gets the “order-by” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsQuery

 
+
+
+

Returns

+

the order by property, or NULL if it is unset

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_query_set_order_by ()

+
void
+gdata_contacts_query_set_order_by (GDataContactsQuery *self,
+                                   const gchar *order_by);
+

Sets the “order-by” property of the GDataContactsQuery to the new order by string, order_by +.

+

Set order_by + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsQuery

 

order_by

a new order by string, or NULL.

[allow-none]
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_query_get_sort_order ()

+
const gchar *
+gdata_contacts_query_get_sort_order (GDataContactsQuery *self);
+

Gets the “sort-order” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsQuery

 
+
+
+

Returns

+

the sort order property, or NULL if it is unset

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_query_set_sort_order ()

+
void
+gdata_contacts_query_set_sort_order (GDataContactsQuery *self,
+                                     const gchar *sort_order);
+

Sets the “sort-order” property of the GDataContactsQuery to the new sort order string, sort_order +.

+

Set sort_order + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsQuery

 

sort_order

a new sort order string, or NULL.

[allow-none]
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_query_show_deleted ()

+
gboolean
+gdata_contacts_query_show_deleted (GDataContactsQuery *self);
+

Gets the “show-deleted” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsQuery

 
+
+
+

Returns

+

TRUE if deleted contacts should be shown, FALSE otherwise

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_query_set_show_deleted ()

+
void
+gdata_contacts_query_set_show_deleted (GDataContactsQuery *self,
+                                       gboolean show_deleted);
+

Sets the “show-deleted” property of the GDataContactsQuery.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsQuery

 

show_deleted

TRUE to show deleted contacts, FALSE otherwise

 
+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_query_get_group ()

+
const gchar *
+gdata_contacts_query_get_group (GDataContactsQuery *self);
+

Gets the “group” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataContactsQuery

 
+
+
+

Returns

+

the group property, or NULL if it is unset

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_query_set_group ()

+
void
+gdata_contacts_query_set_group (GDataContactsQuery *self,
+                                const gchar *group);
+

Sets the “group” property of the GDataContactsQuery to the new group ID URI, group +.

+

Set group + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataContactsQuery

 

group

a new group ID URI, or NULL.

[allow-none]
+
+

Since: 0.2.0

+
+
+
+

Types and Values

+
+

GDataContactsQuery

+
typedef struct _GDataContactsQuery GDataContactsQuery;
+

All the fields in the GDataContactsQuery structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataContactsQueryClass

+
typedef struct {
+} GDataContactsQueryClass;
+
+

All the fields in the GDataContactsQueryClass structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

Property Details

+
+

The “group” property

+
  “group”                    gchar *
+

Constrains the results to only those belonging to the group specified. The value of this parameter +should be a group ID URI.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.2.0

+
+
+
+

The “order-by” property

+
  “order-by”                 gchar *
+

Sorting criterion. The only supported value is lastmodified.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.2.0

+
+
+
+

The “show-deleted” property

+
  “show-deleted”             gboolean
+

Whether to include deleted contacts in the query feed. Deleted contacts return TRUE +from gdata_contacts_contact_is_deleted(), and have no other information. They do not +normally appear in query results.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.2.0

+
+
+
+

The “sort-order” property

+
  “sort-order”               gchar *
+

Sorting order direction. Can be either ascending or descending.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.2.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataContactsService.html b/docs/reference/html/GDataContactsService.html new file mode 100644 index 0000000..09b6094 --- /dev/null +++ b/docs/reference/html/GDataContactsService.html @@ -0,0 +1,975 @@ + + + + +GDataContactsService: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataContactsService

+

GDataContactsService — GData Contacts service object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataContactsService
 GDataContactsServiceClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataService
+        ╰── GDataContactsService
+
+
+
+

Implemented Interfaces

+

+GDataContactsService implements + GDataBatchable.

+
+
+

Includes

+
#include <gdata/services/contacts/gdata-contacts-service.h>
+
+
+
+

Description

+

GDataContactsService is a subclass of GDataService for communicating with the GData API of Google Contacts. It supports querying +for, inserting, editing and deleting contacts from a Google address book.

+

For more details of Google Contacts' GData API, see the +online documentation.

+
+

Example 20. Querying for Groups

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
GDataContactsService *service;
+GDataFeed *feed;
+GList *i;
+GError *error = NULL;
+
+/* Create a service */
+service = create_contacts_service ();
+
+/* Query for groups */
+feed = gdata_contacts_service_query_groups (service, NULL, NULL, NULL, NULL, &error);
+
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error querying for groups: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Iterate through the returned groups and do something with them */
+for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) {
+    const gchar *system_group_id, *group_name;
+    gboolean is_system_group;
+    GDataContactsGroup *group = GDATA_CONTACTS_GROUP (i->data);
+
+    /* Determine whether the group's a system group. If so, you should use the system group ID to provide your application's own
+     * translations of the group name, as it's not translated. */
+    system_group_id = gdata_contacts_group_get_system_group_id (group);
+    is_system_group = (system_group_id != NULL) ? TRUE : FALSE;
+    group_name = (is_system_group == TRUE) ? get_group_name_for_system_group_id (system_group_id)
+                                           : gdata_entry_get_title (GDATA_ENTRY (group));
+
+    /* Do something with the group here, such as insert it into a UI. Note that system groups are not allowed to be deleted,
+     * so you may want to make certain parts of your UI insensitive accordingly if the group is a system group. */
+}
+
+g_object_unref (feed);
+
+ +
+

The Contacts service can be manipulated using batch operations, too. See the

+online documentation on batch +operations for more information. +
+

Example 21. Performing a Batch Operation on Contacts

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
GDataContactsService *service;
+GDataBatchOperation *operation;
+GDataFeed *feed;
+GDataLink *batch_link;
+GList *i;
+GError *error = NULL;
+
+/* Create a service */
+service = create_contacts_service ();
+
+/* Create the batch operation; this requires that we have done a query first so that we can get the batch link */
+feed = do_some_query (service);
+batch_link = gdata_feed_look_up_link (feed, GDATA_LINK_BATCH);
+operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_link_get_uri (batch_link));
+g_object_unref (feed);
+
+gdata_batch_operation_add_query (operation, contact_entry_id_to_query, GDATA_TYPE_CONTACTS_CONTACT,
+                                 (GDataBatchOperationCallback) batch_query_cb, user_data);
+gdata_batch_operation_add_insertion (operation, new_entry, (GDataBatchOperationCallback) batch_insertion_cb, user_data);
+gdata_batch_operation_add_update (operation, old_entry, (GDataBatchOperationCallback) batch_update_cb, user_data);
+gdata_batch_operation_add_deletion (operation, entry_to_delete, (GDataBatchOperationCallback) batch_deletion_cb, user_data);
+
+/* Run the batch operation and handle the results in the various callbacks */
+gdata_test_batch_operation_run (operation, NULL, &error);
+
+g_object_unref (operation);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error running batch operation: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+static void
+batch_query_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_type == GDATA_BATCH_OPERATION_QUERY */
+    /* Reference and do something with the returned entry. */
+}
+
+static void
+batch_insertion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_type == GDATA_BATCH_OPERATION_INSERTION */
+    /* Reference and do something with the returned entry. */
+}
+
+static void
+batch_update_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_type == GDATA_BATCH_OPERATION_UPDATE */
+    /* Reference and do something with the returned entry. */
+}
+
+static void
+batch_deletion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_type == GDATA_BATCH_OPERATION_DELETION, entry == NULL */
+}
+
+ +
+
+
+
+

Functions

+
+

gdata_contacts_service_new ()

+
GDataContactsService *
+gdata_contacts_service_new (GDataAuthorizer *authorizer);
+

Creates a new GDataContactsService using the given GDataAuthorizer. If authorizer + is NULL, all requests are made as an unauthenticated user.

+
+

Parameters

+
+++++ + + + + + +

authorizer

a GDataAuthorizer to authorize the service's requests, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataContactsService, or NULL; unref with g_object_unref()

+
+

Since: 0.9.0

+
+
+
+

gdata_contacts_service_get_primary_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_contacts_service_get_primary_authorization_domain
+                               (void);
+

The primary GDataAuthorizationDomain for interacting with Google Contacts. This will not normally need to be used, as it's used internally +by the GDataContactsService methods. However, if using the plain GDataService methods to implement custom queries or requests which libgdata +does not support natively, then this domain may be needed to authorize the requests.

+

The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.

+
+

Returns

+

the service's authorization domain.

+

[transfer none]

+
+

Since: 0.9.0

+
+
+
+

gdata_contacts_service_query_contacts ()

+
GDataFeed *
+gdata_contacts_service_query_contacts (GDataContactsService *self,
+                                       GDataQuery *query,
+                                       GCancellable *cancellable,
+                                       GDataQueryProgressCallback progress_callback,
+                                       gpointer progress_user_data,
+                                       GError **error);
+

Queries the service to return a list of contacts matching the given query +.

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_service_query_contacts_async ()

+
void
+gdata_contacts_service_query_contacts_async
+                               (GDataContactsService *self,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service to return a list of contacts matching the given query +. self + and +query + are all reffed when this function is called, so can safely be unreffed after this function returns.

+

For more details, see gdata_contacts_service_query_contacts(), which is the synchronous version of this function, +and gdata_service_query_async(), which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_contacts_service_insert_contact ()

+
GDataContactsContact *
+gdata_contacts_service_insert_contact (GDataContactsService *self,
+                                       GDataContactsContact *contact,
+                                       GCancellable *cancellable,
+                                       GError **error);
+

Inserts contact + by uploading it to the online contacts service.

+

For more details, see gdata_service_insert_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsService

 

contact

the GDataContactsContact to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataContactsContact, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.2.0

+
+
+
+

gdata_contacts_service_insert_contact_async ()

+
void
+gdata_contacts_service_insert_contact_async
+                               (GDataContactsService *self,
+                                GDataContactsContact *contact,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Inserts contact + by uploading it to the online contacts service. self + and contact + are both reffed when this function is called, so can safely be +unreffed after this function returns.

+

callback + should call gdata_service_insert_entry_finish() to obtain a GDataContactsContact representing the inserted contact and to check for +possible errors.

+

For more details, see gdata_contacts_service_insert_contact(), which is the synchronous version of this function, +and gdata_service_insert_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsService

 

contact

the GDataContactsContact to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_service_query_groups ()

+
GDataFeed *
+gdata_contacts_service_query_groups (GDataContactsService *self,
+                                     GDataQuery *query,
+                                     GCancellable *cancellable,
+                                     GDataQueryProgressCallback progress_callback,
+                                     gpointer progress_user_data,
+                                     GError **error);
+

Queries the service to return a list of groups matching the given query +.

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_service_query_groups_async ()

+
void
+gdata_contacts_service_query_groups_async
+                               (GDataContactsService *self,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service to return a list of groups matching the given query +. self + and query + are all reffed when this function is called, so can +safely be unreffed after this function returns.

+

For more details, see gdata_contacts_service_query_groups(), which is the synchronous version of this function, and gdata_service_query_async(), +which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_contacts_service_insert_group ()

+
GDataContactsGroup *
+gdata_contacts_service_insert_group (GDataContactsService *self,
+                                     GDataContactsGroup *group,
+                                     GCancellable *cancellable,
+                                     GError **error);
+

Inserts a new contact group described by group +. The user must be authenticated to use this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsService

 

group

a GDataContactsGroup to create on the server

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

the inserted GDataContactsGroup; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.7.0

+
+
+
+

gdata_contacts_service_insert_group_async ()

+
void
+gdata_contacts_service_insert_group_async
+                               (GDataContactsService *self,
+                                GDataContactsGroup *group,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Inserts a new contact group described by group +. The user must be authenticated to use this function. self + and group + are both reffed when this +function is called, so can safely be unreffed after this function returns.

+

callback + should call gdata_service_insert_entry_finish() to obtain a GDataContactsGroup representing the inserted group and to check for possible +errors.

+

For more details, see gdata_contacts_service_insert_group(), which is the synchronous version of this function, and +gdata_service_insert_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataContactsService

 

group

the GDataContactsGroup to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDataContactsService

+
typedef struct _GDataContactsService GDataContactsService;
+

All the fields in the GDataContactsService structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataContactsServiceClass

+
typedef struct {
+} GDataContactsServiceClass;
+
+

All the fields in the GDataContactsServiceClass structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsAccessRule.html b/docs/reference/html/GDataDocumentsAccessRule.html new file mode 100644 index 0000000..050e5ff --- /dev/null +++ b/docs/reference/html/GDataDocumentsAccessRule.html @@ -0,0 +1,156 @@ + + + + +GDataDocumentsAccessRule: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsAccessRule

+

GDataDocumentsAccessRule — GData Documents access rule object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataDocumentsAccessRule
 GDataDocumentsAccessRuleClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataAccessRule
+                ╰── GDataDocumentsAccessRule
+
+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-access-rule.h>
+
+
+
+

Description

+

GDataDocumentsAccessRule is a subclass of GDataAccessRule to represent an +access rule affecting users of a Google Documents entry.

+
+
+

Functions

+
+

gdata_documents_access_rule_new ()

+
GDataDocumentsAccessRule *
+gdata_documents_access_rule_new (const gchar *id);
+

Creates a new GDataDocumentsAccessRule with the given ID and default +properties.

+
+

Parameters

+
+++++ + + + + + +

id

the access rule's ID, or NULL

 
+
+
+

Returns

+

a new GDataDocumentsAccessRule; unref with +g_object_unref().

+

[transfer full]

+
+

Since: 0.17.2

+
+
+
+

Types and Values

+
+

GDataDocumentsAccessRule

+
typedef struct _GDataDocumentsAccessRule GDataDocumentsAccessRule;
+

All the fields in the GDataDocumentsAccessRule structure are private and +should never be accessed directly.

+

Since: 0.17.2

+
+
+
+

GDataDocumentsAccessRuleClass

+
typedef struct {
+} GDataDocumentsAccessRuleClass;
+
+

All the fields in the GDataDocumentsAccessRuleClass structure are private +and should never be accessed directly.

+

Since: 0.17.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsDocument.html b/docs/reference/html/GDataDocumentsDocument.html new file mode 100644 index 0000000..97479b1 --- /dev/null +++ b/docs/reference/html/GDataDocumentsDocument.html @@ -0,0 +1,717 @@ + + + + +GDataDocumentsDocument: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsDocument

+

GDataDocumentsDocument — GData documents document object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataDocumentsDocument
 GDataDocumentsDocumentClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataDocumentsEntry
+                ╰── GDataDocumentsDocument
+                    ├── GDataDocumentsDrawing
+                    ├── GDataDocumentsPdf
+                    ├── GDataDocumentsPresentation
+                    ├── GDataDocumentsSpreadsheet
+                    ╰── GDataDocumentsText
+
+
+
+

Implemented Interfaces

+

+GDataDocumentsDocument implements + GDataAccessHandler.

+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-document.h>
+
+
+
+

Description

+

GDataDocumentsDocument is a subclass of GDataDocumentsEntry to represent an arbitrary Google Drive document (i.e. an arbitrary file which +isn't a Google Documents presentation, text document, PDF, drawing or spreadsheet). It is subclassed by GDataDocumentsPresentation, GDataDocumentsText, +GDataDocumentsPdf, GDataDocumentsDrawing and GDataDocumentsSpreadsheet, which represent those specific types of Google Document, respectively.

+

GDataDocumentsDocument used to be abstract, but was made instantiable in version 0.13.0 to allow for arbitrary file uploads. This can be achieved +by setting “convert” to FALSE when making an upload using gdata_documents_service_upload_document_resumable(). See the +documentation for GDataDocumentsUploadQuery for an example.

+

It should be noted that GDataDocumentsDocument should only be used to represent arbitrary files; its subclasses should be used any time a standard +Google Document (spreadsheet, text document, presentation, etc.) is to be represented.

+

For more details of Google Drive’s GData API, see the

+online documentation. +
+

Example 33. Downloading a Document

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
GDataDocumentsService *service;
+GDataDocumentsDocument *document;
+GFile *destination_file;
+const gchar *download_format;
+GDataDownloadStream *download_stream;
+GFileOutputStream *output_stream;
+GError *error = NULL;
+
+/* Create a service and retrieve the document to download and the file and format to save the download in */
+service = create_youtube_service ();
+document = get_document_to_download (service);
+destination_file = query_user_for_destination_file (document);
+download_format = query_user_for_download_format (document);
+
+/* Create the download stream */
+download_stream = gdata_documents_document_download (document, service, download_format, NULL, &error);
+
+g_object_unref (document);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error creating download stream: %s", error->message);
+    g_error_free (error);
+    g_object_unref (destination_file);
+    return;
+}
+
+/* Create the file output stream */
+output_stream = g_file_replace (destination_file, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, NULL, &error);
+
+g_object_unref (destination_file);
+
+if (error != NULL) {
+    g_error ("Error creating destination file: %s", error->message);
+    g_error_free (error);
+    g_object_unref (download_stream);
+    return;
+}
+
+/* Download the document. This should almost always be done asynchronously. */
+g_output_stream_splice (G_OUTPUT_STREAM (output_stream), G_INPUT_STREAM (download_stream),
+                        G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error);
+
+g_object_unref (output_stream);
+g_object_unref (download_stream);
+
+if (error != NULL) {
+    g_error ("Error downloading document: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+ +
+

Each document accessible through the service has an access control list (ACL) which defines the level of access to the document to each user, and +which users the document is shared with. For more information about ACLs for documents, see the online +documentation on sharing documents.

+
+

Example 34. Retrieving the Access Control List for a Document

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
GDataDocumentsService *service;
+GDataDocumentsDocument *document;
+GDataFeed *acl_feed;
+GDataAccessRule *rule, *new_rule;
+GDataLink *acl_link;
+GList *i;
+GError *error = NULL;
+
+/* Create a service and retrieve a document to work on */
+service = create_documents_service ();
+document = get_document (service);
+
+/* Query the service for the ACL for the given document */
+acl_feed = gdata_access_handler_get_rules (GDATA_ACCESS_HANDLER (document), GDATA_SERVICE (service), NULL, NULL, NULL, &error);
+
+if (error != NULL) {
+    g_error ("Error getting ACL feed for document: %s", error->message);
+    g_error_free (error);
+    g_object_unref (document);
+    g_object_unref (service);
+    return;
+}
+
+/* Iterate through the ACL */
+for (i = gdata_feed_get_entries (acl_feed); i != NULL; i = i->next) {
+    const gchar *scope_value;
+
+    rule = GDATA_ACCESS_RULE (i->data);
+
+    /* Do something with the access rule here. As an example, we update the rule applying to test@gmail.com and delete all
+     * the other rules. We then insert another rule for example@gmail.com below. */
+    gdata_access_rule_get_scope (rule, NULL, &scope_value);
+    if (scope_value != NULL && strcmp (scope_value, "test@gmail.com") == 0) {
+        GDataAccessRule *updated_rule;
+
+        /* Update the rule to make test@gmail.com a writer (full read/write access to the document, but they can't change
+         * the ACL or delete the document). */
+        gdata_access_rule_set_role (rule, GDATA_DOCUMENTS_ACCESS_ROLE_WRITER);
+        updated_rule = GDATA_ACCESS_RULE (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (rule), NULL, &error));
+
+        if (error != NULL) {
+            g_error ("Error updating access rule for %s: %s", scope_value, error->message);
+            g_error_free (error);
+            g_object_unref (acl_feed);
+            g_object_unref (document);
+            g_object_unref (service);
+            return;
+        }
+
+        g_object_unref (updated_rule);
+    } else {
+        /* Delete any rule which doesn't apply to test@gmail.com */
+        gdata_service_delete_entry (GDATA_SERVICE (service), GDATA_ENTRY (rule), NULL, &error);
+
+        if (error != NULL) {
+            g_error ("Error deleting access rule for %s: %s", scope_value, error->message);
+            g_error_free (error);
+            g_object_unref (acl_feed);
+            g_object_unref (document);
+            g_object_unref (service);
+            return;
+        }
+    }
+}
+
+g_object_unref (acl_feed);
+
+/* Create and insert a new access rule for example@gmail.com which allows them read-only access to the document. */
+rule = gdata_access_rule_new (NULL);
+gdata_access_rule_set_role (rule, GDATA_DOCUMENTS_ACCESS_ROLE_READER);
+gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_USER, "example@gmail.com");
+
+acl_link = gdata_entry_look_up_link (GDATA_ENTRY (document), GDATA_LINK_ACCESS_CONTROL_LIST);
+new_rule = GDATA_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), gdata_link_get_uri (acl_link), GDATA_ENTRY (rule),
+                                                          NULL, &error));
+
+g_object_unref (rule);
+g_object_unref (document);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error inserting access rule: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+g_object_unref (acl_link);
+
+ +
+
+
+
+

Functions

+
+

gdata_documents_document_new ()

+
GDataDocumentsDocument *
+gdata_documents_document_new (const gchar *id);
+

Creates a new GDataDocumentsDocument with the given entry ID (“id”).

+
+

Parameters

+
+++++ + + + + + +

id

the entry's ID (not the document ID), or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataDocumentsDocument, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.13.0

+
+
+
+

gdata_documents_document_download ()

+
GDataDownloadStream *
+gdata_documents_document_download (GDataDocumentsDocument *self,
+                                   GDataDocumentsService *service,
+                                   const gchar *export_format,
+                                   GCancellable *cancellable,
+                                   GError **error);
+

Downloads and returns the document file represented by the GDataDocumentsDocument. If the document doesn't exist, NULL is returned, but no error +is set in error +.

+

export_format + should be the file extension of the desired output format for the document, from the list accepted by Google Documents. For example: +GDATA_DOCUMENTS_PRESENTATION_PDF, GDATA_DOCUMENTS_SPREADSHEET_ODS or GDATA_DOCUMENTS_TEXT_ODT.

+

If self + is a GDataDocumentsSpreadsheet, only the first grid, or sheet, in the spreadsheet will be downloaded for some export formats. To download +a specific a specific grid, use gdata_documents_spreadsheet_get_download_uri() with GDataDownloadStream to download the grid manually. See the

+GData protocol +specification for more information. +

To get the content type of the downloaded file, gdata_download_stream_get_content_type() can be called on the returned GDataDownloadStream. +Calling gdata_download_stream_get_content_length() on the stream will not return a meaningful result, however, as the stream is encoded in chunks, +rather than by content length.

+

In order to cancel the download, a GCancellable passed in to cancellable + must be cancelled using g_cancellable_cancel(). Cancelling the individual +GInputStream operations on the GDataDownloadStream will not cancel the entire download; merely the read or close operation in question. See the +“cancellable” for more details.

+

If the given export_format + is unrecognised or not supported for this document, GDATA_SERVICE_ERROR_NOT_FOUND will be returned.

+

If service + isn't authenticated, a GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED will be returned.

+

If there is an error getting the document, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsDocument

 

service

a GDataDocumentsService

 

export_format

the format in which the document should be exported

 

cancellable

a GCancellable for the entire download stream, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataDownloadStream to download the document with, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_documents_document_get_download_uri ()

+
gchar *
+gdata_documents_document_get_download_uri
+                               (GDataDocumentsDocument *self,
+                                const gchar *export_format);
+

Builds and returns the download URI for the given GDataDocumentsDocument in the desired format. Note that directly downloading the document using +this URI isn't possible, as authentication is required. You should instead use gdata_download_stream_new() with the URI, and use the resulting +GInputStream.

+

export_format + should be the file extension of the desired output format for the document, from the list accepted by Google Documents. For example: +GDATA_DOCUMENTS_PRESENTATION_PDF, GDATA_DOCUMENTS_SPREADSHEET_ODS or GDATA_DOCUMENTS_TEXT_ODT.

+

If the export_format + is not recognised or not supported for this document, NULL is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataDocumentsDocument

 

export_format

the format in which the document should be exported when downloaded

 
+
+
+

Returns

+

the download URI, or NULL; free with g_free().

+

[nullable]

+
+

Since: 0.7.0

+
+
+
+

gdata_documents_document_get_thumbnail_uri ()

+
const gchar *
+gdata_documents_document_get_thumbnail_uri
+                               (GDataDocumentsDocument *self);
+

Gets the URI of the thumbnail for the GDataDocumentsDocument. If no thumbnail exists for the document, NULL will be returned.

+

The thumbnail may then be downloaded using a GDataDownloadStream.

+
+

Example 35. Downloading a Document Thumbnail

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
GDataDocumentsService *service;
+const gchar *thumbnail_uri;
+GCancellable *cancellable;
+GdkPixbuf *pixbuf;
+GError *error = NULL;
+
+service = get_my_documents_service ();
+thumbnail_uri = gdata_documents_document_get_thumbnail_uri (my_document);
+cancellable = g_cancellable_new ();
+
+/* Prepare a download stream */
+download_stream = GDATA_DOWNLOAD_STREAM (gdata_download_stream_new (GDATA_SERVICE (service), NULL, thumbnail_uri, cancellable));
+
+/* Download into a new GdkPixbuf. This can be cancelled using 'cancellable'. */
+pixbuf = gdk_pixbuf_new_from_stream (G_INPUT_STREAM (download_stream), NULL, &error);
+
+if (error != NULL) {
+    /* Handle the error. */
+    g_error_free (error);
+}
+
+g_object_unref (download_stream);
+g_object_unref (cancellable);
+
+/* Do something with the GdkPixbuf. */
+
+g_object_unref (pixbuf);
+
+ +
+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsDocument

 
+
+
+

Returns

+

the URI of the document's thumbnail, or NULL.

+

[allow-none]

+
+

Since: 0.13.1

+
+
+
+

Types and Values

+
+

GDataDocumentsDocument

+
typedef struct _GDataDocumentsDocument GDataDocumentsDocument;
+

All the fields in the GDataDocumentsDocument structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataDocumentsDocumentClass

+
typedef struct {
+} GDataDocumentsDocumentClass;
+
+

All the fields in the GDataDocumentsDocumentClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsDrawing.html b/docs/reference/html/GDataDocumentsDrawing.html new file mode 100644 index 0000000..c5e065b --- /dev/null +++ b/docs/reference/html/GDataDocumentsDrawing.html @@ -0,0 +1,222 @@ + + + + +GDataDocumentsDrawing: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsDrawing

+

GDataDocumentsDrawing — GData Documents drawing object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+GDataDocumentsDrawing * + +gdata_documents_drawing_new () +
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataDocumentsEntry
+                ╰── GDataDocumentsDocument
+                    ╰── GDataDocumentsDrawing
+
+
+
+

Implemented Interfaces

+

+GDataDocumentsDrawing implements + GDataAccessHandler.

+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-drawing.h>
+
+
+
+

Description

+

GDataDocumentsDrawing is a subclass of GDataDocumentsDocument to represent a drawing document from Google Documents.

+

For more details of Google Drive's GData API, see the

+online documentation. + +
+
+

Functions

+
+

gdata_documents_drawing_new ()

+
GDataDocumentsDrawing *
+gdata_documents_drawing_new (const gchar *id);
+

Creates a new GDataDocumentsDrawing with the given entry ID (“id”).

+
+

Parameters

+
+++++ + + + + + +

id

the entry's ID (not the document ID of the drawing document), or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataDocumentsDrawing, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.13.1

+
+
+
+

Types and Values

+
+

GDATA_DOCUMENTS_DRAWING_JPEG

+
#define GDATA_DOCUMENTS_DRAWING_JPEG "jpeg"
+
+

The export format for JPEG image format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.13.1

+
+
+
+

GDATA_DOCUMENTS_DRAWING_PDF

+
#define GDATA_DOCUMENTS_DRAWING_PDF "pdf"
+
+

The export format for Portable Document Format (PDF).

+

For more information, see the

+ +GData protocol specification. +

Since: 0.13.1

+
+
+
+

GDATA_DOCUMENTS_DRAWING_PNG

+
#define GDATA_DOCUMENTS_DRAWING_PNG "png"
+
+

The export format for Portable Network Graphics (PNG) image format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.13.1

+
+
+
+

GDATA_DOCUMENTS_DRAWING_SVG

+
#define GDATA_DOCUMENTS_DRAWING_SVG "svg"
+
+

The export format for Scalable Vector Graphics (SVG) image format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.13.1

+
+
+
+

GDataDocumentsDrawing

+
typedef struct _GDataDocumentsDrawing GDataDocumentsDrawing;
+

All the fields in the GDataDocumentsDrawing structure are private and should never be accessed directly.

+

Since: 0.13.1

+
+
+
+

GDataDocumentsDrawingClass

+
typedef struct {
+} GDataDocumentsDrawingClass;
+
+

All the fields in the GDataDocumentsDrawingClass structure are private and should never be accessed directly.

+

Since: 0.13.1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsEntry.html b/docs/reference/html/GDataDocumentsEntry.html new file mode 100644 index 0000000..f1f19a8 --- /dev/null +++ b/docs/reference/html/GDataDocumentsEntry.html @@ -0,0 +1,854 @@ + + + + +GDataDocumentsEntry: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsEntry

+

GDataDocumentsEntry — GData document object abstract class

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *document-idRead
gint64editedRead
gint64file-sizeRead
gbooleanis-deletedRead / Write
+GDataAuthor *last-modified-byRead
gint64last-viewedRead
gint64quota-usedRead
+gchar *resource-idRead
gbooleanwriters-can-inviteRead / Write
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataDocumentsEntry
+                ├── GDataDocumentsDocument
+                ╰── GDataDocumentsFolder
+
+
+
+

Implemented Interfaces

+

+GDataDocumentsEntry implements + GDataAccessHandler.

+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-entry.h>
+
+
+
+

Description

+

GDataDocumentsEntry is a subclass of GDataEntry to represent a Google Drive entry, which is then further subclassed +to give specific document types.

+

GDataDocumentsEntry implements GDataAccessHandler, meaning the access rules to it can be modified using that interface. As well as the +access roles defined for the base GDataAccessRule (e.g. GDATA_ACCESS_ROLE_NONE), GDataDocumentsEntry has its own, such as +GDATA_DOCUMENTS_ACCESS_ROLE_OWNER and GDATA_DOCUMENTS_ACCESS_ROLE_READER.

+

Documents can (confusingly) be referenced by three different types of IDs: their entry ID, their resource ID and their document ID (untyped resource +ID). Each is a substring of the previous ones (i.e. the entry ID contains the resource ID, which in turn contains the document ID). The resource ID +and document ID should almost always be considered as internal, and thus entry IDs (“id”) should normally be used to uniquely identify +documents. For more information, see “resource-id”.

+

For more details of Google Drive's GData API, see the

+online documentation. +
+

Example 32. Moving an Entry Between Folders

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
GDataDocumentsService *service;
+GDataDocumentsEntry *entry, *intermediate_entry, *updated_entry;
+GDataDocumentsFolder *old_folder, *new_folder;
+GError *error = NULL;
+
+/* Create a service */
+service = create_documents_service ();
+
+/* Get the entry, the folder it's being moved out of, and the folder it's being moved into. The entry can either be a document or
+ * another folder, allowing hierarchies of folders to be constructed. */
+entry = query_user_for_entry (service);
+old_folder = query_user_for_old_folder (service);
+new_folder = query_user_for_new_folder (service);
+
+/* Add the entry to the new folder */
+intermediate_entry = gdata_documents_service_add_entry_to_folder (service, entry, new_folder, NULL, &error);
+
+g_object_unref (entry);
+g_object_unref (new_folder);
+
+if (error != NULL) {
+    g_error ("Error adding entry to new folder: %s", error->message);
+    g_error_free (error);
+    g_object_unref (old_folder);
+    g_object_unref (service);
+    return;
+}
+
+/* Remove the entry from the old folder */
+updated_entry = gdata_documents_service_remove_entry_from_folder (service, intermediate_entry, old_folder, NULL, &error);
+
+g_object_unref (intermediate_entry);
+g_object_unref (old_folder);
+g_object_unref (service);
+
+if (error != NULL) {
+    /* Note that you might want to attempt to remove the intermediate_entry from the new_folder in this error case, so that
+     * the operation is aborted cleanly. */
+    g_error ("Error removing entry from previous folder: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Do something with the updated entry */
+
+g_object_unref (updated_entry);
+
+ +
+
+
+
+

Functions

+
+

gdata_documents_entry_get_path ()

+
gchar *
+gdata_documents_entry_get_path (GDataDocumentsEntry *self);
+

Builds a path for the GDataDocumentsEntry, starting from a root node and traversing the folders containing the document, then ending with the +document's ID.

+

An example path would be: /folder_id1/folder_id2/document_id.

+

Note: the path is based on the entry/document IDs of the folders (“id”) and document (“document-id”), +and not the entries' human-readable names (“title”).

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

the folder hierarchy path containing the document, or NULL; free with g_free()

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_entry_get_resource_id ()

+
const gchar *
+gdata_documents_entry_get_resource_id (GDataDocumentsEntry *self);
+

Gets the “resource-id” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

the document's resource ID

+
+

Since: 0.11.0

+
+
+
+

gdata_documents_entry_get_document_id ()

+
const gchar *
+gdata_documents_entry_get_document_id (GDataDocumentsEntry *self);
+
+

gdata_documents_entry_get_document_id has been deprecated since version 0.11.0 and should not be used in newly-written code.

+

Use gdata_documents_entry_get_resource_id() instead. See “document-id”.

+
+

Gets the “document-id” property. The

+online GData Documentation

refers to these as “untyped resource IDs”.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

the document's document ID

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_entry_get_edited ()

+
gint64
+gdata_documents_entry_get_edited (GDataDocumentsEntry *self);
+
+

gdata_documents_entry_get_edited has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

Use gdata_entry_get_updated() instead. See “edited”.

+
+

Gets the “edited” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

the UNIX timestamp for the time the document was last edited, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_entry_get_last_modified_by ()

+
GDataAuthor *
+gdata_documents_entry_get_last_modified_by
+                               (GDataDocumentsEntry *self);
+

Gets the “last-modified-by” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

the author who last modified the document.

+

[transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_entry_get_last_viewed ()

+
gint64
+gdata_documents_entry_get_last_viewed (GDataDocumentsEntry *self);
+

gdata_documents_entry_get_last_viewed is deprecated and should not be used in newly-written code.

+

Gets the “last-viewed” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

the UNIX timestamp for the time the document was last viewed, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_entry_get_quota_used ()

+
goffset
+gdata_documents_entry_get_quota_used (GDataDocumentsEntry *self);
+

Gets the “quota-used” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

the number of quota bytes used by the document

+
+

Since: 0.13.0

+
+
+
+

gdata_documents_entry_get_file_size ()

+
goffset
+gdata_documents_entry_get_file_size (GDataDocumentsEntry *self);
+

Gets the “file-size” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

the size of the document in bytes

+
+

Since: 0.17.7

+
+
+
+

gdata_documents_entry_writers_can_invite ()

+
gboolean
+gdata_documents_entry_writers_can_invite
+                               (GDataDocumentsEntry *self);
+

Gets the “writers-can-invite” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

TRUE if writers can invite other people to edit the document, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_entry_set_writers_can_invite ()

+
void
+gdata_documents_entry_set_writers_can_invite
+                               (GDataDocumentsEntry *self,
+                                gboolean writers_can_invite);
+

Sets the “writers-can-invite” property to writers_can_invite +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataDocumentsEntry

 

writers_can_invite

TRUE if writers can invite other people to edit the document, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_documents_entry_is_deleted ()

+
gboolean
+gdata_documents_entry_is_deleted (GDataDocumentsEntry *self);
+

Gets the “is-deleted” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsEntry

 
+
+
+

Returns

+

TRUE if the document has been deleted, FALSE otherwise

+
+

Since: 0.5.0

+
+
+
+

Types and Values

+
+

GDATA_DOCUMENTS_ACCESS_ROLE_OWNER

+
#define GDATA_DOCUMENTS_ACCESS_ROLE_OWNER "owner"
+
+

The users specified by the GDataAccessRule have full owner access to the document. This allows them to modify the access rules and delete +the document, amongst other things.

+

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_ACCESS_ROLE_WRITER

+
#define GDATA_DOCUMENTS_ACCESS_ROLE_WRITER "writer"
+
+

The users specified by the GDataAccessRule have write access to the document. They cannot modify the access rules or delete the document.

+

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_ACCESS_ROLE_READER

+
#define GDATA_DOCUMENTS_ACCESS_ROLE_READER "reader"
+
+

The users specified by the GDataAccessRule have read-only access to the document.

+

Since: 0.7.0

+
+
+
+

GDataDocumentsEntry

+
typedef struct _GDataDocumentsEntry GDataDocumentsEntry;
+

All the fields in the GDataDocumentsEntry structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataDocumentsEntryClass

+
typedef struct {
+} GDataDocumentsEntryClass;
+
+

All the fields in the GDataDocumentsEntryClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “document-id” property

+
  “document-id”              gchar *
+

The document ID of the document, which is different from its entry ID (GDataEntry:id). The

+online GData +Documentation refers to these as “untyped resource IDs”. +
+

GDataDocumentsEntry:document-id has been deprecated since version 0.11.0 and should not be used in newly-written code.

+

This a substring of the “resource-id”, which is more general and should be used instead.

+
+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “edited” property

+
  “edited”                   gint64
+

The last time the document was edited. If the document has not been edited yet, the content indicates the time it was created.

+
+

GDataDocumentsEntry:edited has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is identical to “updated”.

+
+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “file-size” property

+
  “file-size”                gint64
+

The size of the document. This is only set for non-document files. +Standard formats, such as GDataDocumentsText, +GDataDocumentsSpreadsheet and GDataDocumentsFolder are not binary +data and so have no size. Measured in bytes.

+

Flags: Read

+

Allowed values: >= 0

+

Default value: 0

+

Since: 0.17.7

+
+
+
+

The “is-deleted” property

+
  “is-deleted”               gboolean
+

Indicates whether the document entry has been deleted (moved to the trash). Deleted documents will only +appear in query results if the “show-deleted” property is TRUE.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.5.0

+
+
+
+

The “last-modified-by” property

+
  “last-modified-by”         GDataAuthor *
+

Indicates the author of the last modification.

+

Flags: Read

+

Since: 0.4.0

+
+
+
+

The “last-viewed” property

+
  “last-viewed”              gint64
+

The last time the document was viewed.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “quota-used” property

+
  “quota-used”               gint64
+

The amount of user quota the document is occupying. Currently, only arbitrary files consume file space quota (whereas standard document +formats, such as GDataDocumentsText, GDataDocumentsSpreadsheet and GDataDocumentsFolder don't). Measured in bytes.

+

This property will be 0 for documents which aren't consuming any quota.

+

Flags: Read

+

Allowed values: >= 0

+

Default value: 0

+

Since: 0.13.0

+
+
+
+

The “resource-id” property

+
  “resource-id”              gchar *
+

The resource ID of the document. This should not normally need to be used in client code, and is mostly for internal use. To uniquely +identify a given document or folder, use its “id”.

+

Resource IDs have the form: +document|drawing|pdf|spreadsheet|presentation|folder:untyped resource ID; whereas +entry IDs have the form: +https://docs.google.com/feeds/id/resource ID in version 3 of the API.

+

For more information, see the

+Google Documents +API reference. +

Flags: Read

+

Default value: NULL

+

Since: 0.11.0

+
+
+
+

The “writers-can-invite” property

+
  “writers-can-invite”       gboolean
+

Indicates whether the document entry writers can invite others to edit the document.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsFeed.html b/docs/reference/html/GDataDocumentsFeed.html new file mode 100644 index 0000000..aa06fbe --- /dev/null +++ b/docs/reference/html/GDataDocumentsFeed.html @@ -0,0 +1,110 @@ + + + + +GDataDocumentsFeed: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsFeed

+

GDataDocumentsFeed — GData documents feed object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataDocumentsFeed
 GDataDocumentsFeedClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataFeed
+            ╰── GDataDocumentsFeed
+
+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-feed.h>
+
+
+
+

Description

+

GDataDocumentsFeed is a list of entries (GDataDocumentsEntry subclasses) returned as the result of a query to a GDataDocumentsService, +or given as the input to another operation on the online service.

+

Each GDataDocumentsEntry represents a single object on the Google Documents online service, such as a text document, presentation document, +spreadsheet document or a folder, and the GDataDocumentsFeed represents a collection of those objects.

+
+
+

Functions

+

+
+
+

Types and Values

+
+

GDataDocumentsFeed

+
typedef struct _GDataDocumentsFeed GDataDocumentsFeed;
+

All the fields in the GDataDocumentsFeed structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataDocumentsFeedClass

+
typedef struct {
+} GDataDocumentsFeedClass;
+
+

All the fields in the GDataDocumentsFeedClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsFolder.html b/docs/reference/html/GDataDocumentsFolder.html new file mode 100644 index 0000000..897bab8 --- /dev/null +++ b/docs/reference/html/GDataDocumentsFolder.html @@ -0,0 +1,250 @@ + + + + +GDataDocumentsFolder: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsFolder

+

GDataDocumentsFolder — GData documents folder object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+GDataDocumentsFolder * + +gdata_documents_folder_new () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataDocumentsFolder
 GDataDocumentsFolderClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataDocumentsEntry
+                ╰── GDataDocumentsFolder
+
+
+
+

Implemented Interfaces

+

+GDataDocumentsFolder implements + GDataAccessHandler.

+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-folder.h>
+
+
+
+

Description

+

GDataDocumentsFolder is a subclass of GDataDocumentsEntry to represent a folder from Google Documents.

+

For more details of Google Drive's GData API, see the

+online documentation. +
+

Example 36. Adding a Folder

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
GDataAuthorizationDomain *domain;
+GDataDocumentsService *service;
+GDataDocumentsFolder *folder, *new_folder, *parent_folder;
+GError *error = NULL;
+
+domain = gdata_documents_service_get_primary_authorization_domain ();
+
+/* Create a service */
+service = create_documents_service ();
+
+parent_folder = GDATA_DOCUMENTS_FOLDER (gdata_service_query_single_entry (GDATA_SERVICE (service), domain, "root", NULL,
+                                                                          GDATA_TYPE_DOCUMENTS_FOLDER, NULL, &error));
+if (error != NULL) {
+g_error ("Error getting root folder");
+g_error_free (error);
+return;
+}
+
+/* Create the new folder */
+folder = gdata_documents_folder_new (NULL);
+gdata_entry_set_title (GDATA_ENTRY (folder), "Folder Name");
+
+/* Insert the folder */
+new_folder = GDATA_DOCUMENTS_FOLDER (gdata_documents_service_add_entry_to_folder (GDATA_SERVICE (service), GDATA_DOCUMENTS_ENTRY (folder),
+parent_folder, NULL, &error));
+
+g_object_unref (folder);
+g_object_unref (parent_folder);
+g_object_unref (service);
+
+if (error != NULL) {
+g_error ("Error inserting new folder: %s", error->message);
+g_error_free (error);
+return;
+}
+
+/* Do something with the new folder, such as store its ID for future use */
+
+g_object_unref (new_folder);
+
+ +
+
+
+
+

Functions

+
+

gdata_documents_folder_new ()

+
GDataDocumentsFolder *
+gdata_documents_folder_new (const gchar *id);
+

Creates a new GDataDocumentsFolder with the given entry ID (“id”).

+
+

Parameters

+
+++++ + + + + + +

id

the entry's ID (not the document ID of the folder), or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataDocumentsFolder, or NULL; unref with g_object_unref()

+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDataDocumentsFolder

+
typedef struct _GDataDocumentsFolder GDataDocumentsFolder;
+

All the fields in the GDataDocumentsFolder structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataDocumentsFolderClass

+
typedef struct {
+} GDataDocumentsFolderClass;
+
+

All the fields in the GDataDocumentsFolderClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsMetadata.html b/docs/reference/html/GDataDocumentsMetadata.html new file mode 100644 index 0000000..332375a --- /dev/null +++ b/docs/reference/html/GDataDocumentsMetadata.html @@ -0,0 +1,236 @@ + + + + +GDataDocumentsMetadata: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsMetadata

+

GDataDocumentsMetadata — GData document service metadata class

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Properties

+
+++++ + + + + + + + + + + + + +
gint64quota-totalRead
gint64quota-usedRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataDocumentsMetadata
 GDataDocumentsMetadataClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataDocumentsMetadata
+
+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-metadata.h>
+
+
+
+

Description

+

GDataDocumentsMetadata is a subclass of GDataParsable to represent Google Drive service metadata.

+

For more details of Google Documents' GData API, see the

+online documentation. + +
+
+

Functions

+
+

gdata_documents_metadata_get_quota_total ()

+
goffset
+gdata_documents_metadata_get_quota_total
+                               (GDataDocumentsMetadata *self);
+

Gets the “quota-total” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsMetadata

 
+
+
+

Returns

+

the number of quota bytes available in total. Returns -1 if +there is no quota limit.

+
+

Since: 0.17.9

+
+
+
+

gdata_documents_metadata_get_quota_used ()

+
goffset
+gdata_documents_metadata_get_quota_used
+                               (GDataDocumentsMetadata *self);
+

Gets the “quota-used” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsMetadata

 
+
+
+

Returns

+

the number of quota bytes used by the documents service

+
+

Since: 0.17.9

+
+
+
+

Types and Values

+
+

GDataDocumentsMetadata

+
typedef struct _GDataDocumentsMetadata GDataDocumentsMetadata;
+

All the fields in the GDataDocumentsMetadata structure are private and should never be accessed directly.

+

Since: 0.17.9

+
+
+
+

GDataDocumentsMetadataClass

+
typedef struct {
+} GDataDocumentsMetadataClass;
+
+

All the fields in the GDataDocumentsMetadataClass structure are private and should never be accessed directly.

+

Since: 0.17.9

+
+
+
+

Property Details

+
+

The “quota-total” property

+
  “quota-total”              gint64
+

The user quota limit across all services. Measured in bytes.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: 0

+

Since: 0.17.9

+
+
+
+

The “quota-used” property

+
  “quota-used”               gint64
+

The amount of user quota used up across all services. Measured in bytes.

+

Flags: Read

+

Allowed values: >= 0

+

Default value: 0

+

Since: 0.17.9

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsPdf.html b/docs/reference/html/GDataDocumentsPdf.html new file mode 100644 index 0000000..ff959d3 --- /dev/null +++ b/docs/reference/html/GDataDocumentsPdf.html @@ -0,0 +1,162 @@ + + + + +GDataDocumentsPdf: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsPdf

+

GDataDocumentsPdf — GData Documents pdf object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+GDataDocumentsPdf * + +gdata_documents_pdf_new () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataDocumentsPdf
 GDataDocumentsPdfClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataDocumentsEntry
+                ╰── GDataDocumentsDocument
+                    ╰── GDataDocumentsPdf
+
+
+
+

Implemented Interfaces

+

+GDataDocumentsPdf implements + GDataAccessHandler.

+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-pdf.h>
+
+
+
+

Description

+

GDataDocumentsPdf is a subclass of GDataDocumentsDocument to represent a PDF document from Google Documents.

+

For more details of Google Drive's GData API, see the

+online documentation. + +
+
+

Functions

+
+

gdata_documents_pdf_new ()

+
GDataDocumentsPdf *
+gdata_documents_pdf_new (const gchar *id);
+

Creates a new GDataDocumentsPdf with the given entry ID (“id”).

+
+

Parameters

+
+++++ + + + + + +

id

the entry's ID (not the document ID of the pdf document), or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataDocumentsPdf, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.13.3

+
+
+
+

Types and Values

+
+

GDataDocumentsPdf

+
typedef struct _GDataDocumentsPdf GDataDocumentsPdf;
+

All the fields in the GDataDocumentsPdf structure are private and should never be accessed directly.

+

Since: 0.13.3

+
+
+
+

GDataDocumentsPdfClass

+
typedef struct {
+} GDataDocumentsPdfClass;
+
+

All the fields in the GDataDocumentsPdfClass structure are private and should never be accessed directly.

+

Since: 0.13.3

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsPresentation.html b/docs/reference/html/GDataDocumentsPresentation.html new file mode 100644 index 0000000..f15fb02 --- /dev/null +++ b/docs/reference/html/GDataDocumentsPresentation.html @@ -0,0 +1,243 @@ + + + + +GDataDocumentsPresentation: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsPresentation

+

GDataDocumentsPresentation — GData documents presentation object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataDocumentsEntry
+                ╰── GDataDocumentsDocument
+                    ╰── GDataDocumentsPresentation
+
+
+
+

Implemented Interfaces

+

+GDataDocumentsPresentation implements + GDataAccessHandler.

+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-presentation.h>
+
+
+
+

Description

+

GDataDocumentsPresentation is a subclass of GDataDocumentsDocument to represent a Google Documents presentation.

+

For more details of Google Drive's GData API, see the

+online documentation. + +
+
+

Functions

+
+

gdata_documents_presentation_new ()

+
GDataDocumentsPresentation *
+gdata_documents_presentation_new (const gchar *id);
+

Creates a new GDataDocumentsPresentation with the given entry ID (“id”).

+
+

Parameters

+
+++++ + + + + + +

id

the entry's ID (not the document ID of the presentation), or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataDocumentsPresentation, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_DOCUMENTS_PRESENTATION_PDF

+
#define GDATA_DOCUMENTS_PRESENTATION_PDF "pdf"
+
+

The export format for Portable Document Format (PDF).

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_PRESENTATION_PNG

+
#define GDATA_DOCUMENTS_PRESENTATION_PNG "png"
+
+

The export format for Portable Network Graphics (PNG) image format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_PRESENTATION_PPT

+
#define GDATA_DOCUMENTS_PRESENTATION_PPT "ppt"
+
+

The export format for Microsoft PowerPoint (PPT) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_PRESENTATION_SWF

+
#define GDATA_DOCUMENTS_PRESENTATION_SWF "swf"
+
+
+

GDATA_DOCUMENTS_PRESENTATION_SWF is deprecated and should not be used in newly-written code.

+

SWF export has been deprecated in the protocol due to low demand for it; PDF export (using GDATA_DOCUMENTS_PRESENTATION_PDF) is +recommended instead. (Since: 0.11.0.)

+
+

The export format for Adobe Flash (SWF) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_PRESENTATION_TXT

+
#define GDATA_DOCUMENTS_PRESENTATION_TXT "txt"
+
+

GDATA_DOCUMENTS_PRESENTATION_TXT is deprecated and should not be used in newly-written code.

+

The export format for plain text format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDataDocumentsPresentation

+
typedef struct _GDataDocumentsPresentation GDataDocumentsPresentation;
+

All the fields in the GDataDocumentsPresentation structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataDocumentsPresentationClass

+
typedef struct {
+} GDataDocumentsPresentationClass;
+
+

All the fields in the GDataDocumentsPresentationClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsQuery.html b/docs/reference/html/GDataDocumentsQuery.html new file mode 100644 index 0000000..3c82c56 --- /dev/null +++ b/docs/reference/html/GDataDocumentsQuery.html @@ -0,0 +1,891 @@ + + + + +GDataDocumentsQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsQuery

+

GDataDocumentsQuery — GData Documents query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gbooleanexact-titleRead / Write
+gchar *folder-idRead / Write
gbooleanshow-deletedRead / Write
gbooleanshow-foldersRead / Write
+gchar *titleRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataDocumentsQuery
 GDataDocumentsQueryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ╰── GDataDocumentsQuery
+
+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-query.h>
+
+
+
+

Description

+

GDataDocumentsQuery represents a collection of query parameters specific to the Google Documents service, which go above and beyond +those catered for by GDataQuery.

+

For more information on the custom GData query parameters supported by GDataDocumentsQuery, see the online documentation.

+
+

Example 30. Querying for Documents

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
GDataDocumentsService *service;
+GDataDocumentsQuery *query;
+GDataFeed *feed;
+GTimeVal current_time;
+GList *i;
+GError *error = NULL;
+
+/* Create a service */
+service = create_documents_service ();
+
+/* Create the query to use. We're going to query for the last 10 documents modified by example@gmail.com in the past week, including
+ * deleted documents. */
+query = gdata_documents_query_new_with_limits (NULL, 0, 10);
+
+gdata_documents_query_add_collaborator (query, "example@gmail.com");
+gdata_documents_query_set_show_deleted (query, TRUE);
+
+g_get_current_time (&current_time);
+gdata_query_set_updated_min (GDATA_QUERY (query), current_time.tv_sec - 7 * 24 * 60 * 60);
+gdata_query_set_updated_max (GDATA_QUERY (query), current_time.tv_sec);
+
+/* Execute the query */
+feed = gdata_documents_service_query_documents (service, query, NULL, NULL, NULL, &error);
+
+g_object_unref (query);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error querying for documents: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Iterate through the returned documents and do something with them */
+for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) {
+    GDataDocumentsDocument *document = GDATA_DOCUMENTS_DOCUMENT (i->data);
+
+    /* Do something with the document here, such as insert it into a UI */
+}
+
+g_object_unref (feed);
+
+ +
+
+
+
+

Functions

+
+

gdata_documents_query_new ()

+
GDataDocumentsQuery *
+gdata_documents_query_new (const gchar *q);
+

Creates a new GDataDocumentsQuery with its “q” property set to q +.

+
+

Parameters

+
+++++ + + + + + +

q

a query string, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataDocumentsQuery

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_new_with_limits ()

+
GDataDocumentsQuery *
+gdata_documents_query_new_with_limits (const gchar *q,
+                                       guint start_index,
+                                       guint max_results);
+

Creates a new GDataDocumentsQuery with its “q” property set to q +, and the limits start_index + and max_results + +applied.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

q

a query string, or NULL.

[allow-none]

start_index

a one-based start index for the results, or 0

 

max_results

the maximum number of results to return, or 0

 
+
+
+

Returns

+

a new GDataDocumentsQuery

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_show_deleted ()

+
gboolean
+gdata_documents_query_show_deleted (GDataDocumentsQuery *self);
+

Gets the “show_deleted” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsQuery

 
+
+
+

Returns

+

TRUE if the request should return deleted entries, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_set_show_deleted ()

+
void
+gdata_documents_query_set_show_deleted
+                               (GDataDocumentsQuery *self,
+                                gboolean show_deleted);
+

Sets the “show_deleted” property to show_deleted +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataDocumentsQuery

 

show_deleted

TRUE if the request should return deleted entries, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_show_folders ()

+
gboolean
+gdata_documents_query_show_folders (GDataDocumentsQuery *self);
+

Gets the “show-folders” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsQuery

 
+
+
+

Returns

+

TRUE if the request should return folders, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_set_show_folders ()

+
void
+gdata_documents_query_set_show_folders
+                               (GDataDocumentsQuery *self,
+                                gboolean show_folders);
+

Sets the “show-folders” property to show_folders.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataDocumentsQuery

 

show_folders

TRUE if the request should return folders, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_get_folder_id ()

+
const gchar *
+gdata_documents_query_get_folder_id (GDataDocumentsQuery *self);
+

Gets the “folder-id” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsQuery

 
+
+
+

Returns

+

the ID of the folder to be queried, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_set_folder_id ()

+
void
+gdata_documents_query_set_folder_id (GDataDocumentsQuery *self,
+                                     const gchar *folder_id);
+

Sets the “folder-id” property to folder_id +.

+

Set folder_id + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataDocumentsQuery

 

folder_id

the ID of the folder to be queried, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_get_title ()

+
const gchar *
+gdata_documents_query_get_title (GDataDocumentsQuery *self);
+

Gets the “title” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsQuery

 
+
+
+

Returns

+

the title (or title fragment) being queried for, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_get_exact_title ()

+
gboolean
+gdata_documents_query_get_exact_title (GDataDocumentsQuery *self);
+

Gets the “exact-title” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsQuery

 
+
+
+

Returns

+

TRUE if the query matches the exact title of documents with “title”, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_set_title ()

+
void
+gdata_documents_query_set_title (GDataDocumentsQuery *self,
+                                 const gchar *title,
+                                 gboolean exact_title);
+

Sets the “title” property to title +.

+

Set title + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsQuery

 

title

the title (or title fragment) to query for, or NULL.

[allow-none]

exact_title

TRUE if the query should match the exact title +, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_get_collaborator_addresses ()

+
GList *
+gdata_documents_query_get_collaborator_addresses
+                               (GDataDocumentsQuery *self);
+

Gets a list of GDataGDEmailAddresses of the document collaborators whose documents will be queried.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsQuery

 
+
+
+

Returns

+

a list of GDataGDEmailAddresses of the collaborators concerned by the +query, or NULL.

+

[element-type GData.GDEmailAddress][transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_add_collaborator ()

+
void
+gdata_documents_query_add_collaborator
+                               (GDataDocumentsQuery *self,
+                                const gchar *email_address);
+

Add email_address + as a GDataGDEmailAddress to the list of collaborators whose edited documents will be queried.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataDocumentsQuery

 

email_address

the e-mail address of the collaborator to add

 
+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_get_reader_addresses ()

+
GList *
+gdata_documents_query_get_reader_addresses
+                               (GDataDocumentsQuery *self);
+

Gets a list of GDataGDEmailAddresses of the document readers whose documents will be queried.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsQuery

 
+
+
+

Returns

+

a list of GDataGDEmailAddresses of the readers concerned by the query, +or NULL.

+

[element-type GData.GDEmailAddress][transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_query_add_reader ()

+
void
+gdata_documents_query_add_reader (GDataDocumentsQuery *self,
+                                  const gchar *email_address);
+

Add email_address + as a GDataGDEmailAddress to the list of readers, the documents readable by whom will be queried.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataDocumentsQuery

 

email_address

the e-mail address of the reader to add

 
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDataDocumentsQuery

+
typedef struct _GDataDocumentsQuery GDataDocumentsQuery;
+

All the fields in the GDataDocumentsQuery structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataDocumentsQueryClass

+
typedef struct {
+} GDataDocumentsQueryClass;
+
+

All the fields in the GDataDocumentsQueryClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “exact-title” property

+
  “exact-title”              gboolean
+

Specifies whether the query should search for an exact title match for the “title” parameter.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “folder-id” property

+
  “folder-id”                gchar *
+

Specifies the ID of the folder in which to search.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “show-deleted” property

+
  “show-deleted”             gboolean
+

A shortcut to request all documents that have been deleted.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “show-folders” property

+
  “show-folders”             gboolean
+

Specifies if the request also returns folders.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “title” property

+
  “title”                    gchar *
+

A title (or title fragment) to be searched for. If “exact-title” is TRUE, an exact +title match will be searched for, otherwise substring matches will also be returned.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsService.html b/docs/reference/html/GDataDocumentsService.html new file mode 100644 index 0000000..bfc7da9 --- /dev/null +++ b/docs/reference/html/GDataDocumentsService.html @@ -0,0 +1,2032 @@ + + + + +GDataDocumentsService: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsService

+

GDataDocumentsService — GData Documents service object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataDocumentsService * + +gdata_documents_service_new () +
+GDataAuthorizationDomain * + +gdata_documents_service_get_primary_authorization_domain () +
+GDataAuthorizationDomain * + +gdata_documents_service_get_spreadsheet_authorization_domain () +
+GDataDocumentsMetadata * + +gdata_documents_service_get_metadata () +
+void + +gdata_documents_service_get_metadata_async () +
+GDataDocumentsMetadata * + +gdata_documents_service_get_metadata_finish () +
+GDataDocumentsFeed * + +gdata_documents_service_query_documents () +
+void + +gdata_documents_service_query_documents_async () +
+GDataUploadStream * + +gdata_documents_service_upload_document () +
+GDataUploadStream * + +gdata_documents_service_upload_document_resumable () +
+GDataUploadStream * + +gdata_documents_service_update_document () +
+GDataUploadStream * + +gdata_documents_service_update_document_resumable () +
+GDataDocumentsDocument * + +gdata_documents_service_finish_upload () +
+GDataDocumentsDocument * + +gdata_documents_service_copy_document () +
+void + +gdata_documents_service_copy_document_async () +
+GDataDocumentsDocument * + +gdata_documents_service_copy_document_finish () +
+GDataDocumentsEntry * + +gdata_documents_service_add_entry_to_folder () +
+void + +gdata_documents_service_add_entry_to_folder_async () +
+GDataDocumentsEntry * + +gdata_documents_service_add_entry_to_folder_finish () +
+GDataDocumentsEntry * + +gdata_documents_service_remove_entry_from_folder () +
+void + +gdata_documents_service_remove_entry_from_folder_async () +
+GDataDocumentsEntry * + +gdata_documents_service_remove_entry_from_folder_finish () +
+gchar * + +gdata_documents_service_get_upload_uri () +
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataService
+        ╰── GDataDocumentsService
+
+
+
+

Implemented Interfaces

+

+GDataDocumentsService implements + GDataBatchable.

+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-service.h>
+
+
+
+

Description

+

GDataDocumentsService is a subclass of GDataService for communicating with the GData API of Google Drive. It supports querying +for, inserting, editing and deleting documents, as well as a folder hierarchy. +The API is named ‘documents’ rather than ‘drive’ as it used to use the Google +Documents API, which has since been deprecated.

+

For more details of Google Drive's GData API, see the

+ +online documentation. +

Fore more details about the spreadsheet downloads handling, see the

+ +online explanation about the problem. +
+

Example 27. Uploading a Document from Disk

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
GDataDocumentsService *service;
+GDataDocumentsDocument *document, *uploaded_document;
+GFile *document_file;
+GDataDocumentsFolder *destination_folder;
+GFileInfo *file_info;
+const gchar *slug, *content_type;
+GFileInputStream *file_stream;
+GDataUploadStream *upload_stream;
+GError *error = NULL;
+
+/* Create a service */
+service = create_documents_service ();
+
+/* Get the document file to upload and the folder to upload it into */
+document_file = g_file_new_for_path ("document.odt");
+destination_folder = query_user_for_destination_folder (service);
+
+/* Get the file's display name and content type */
+file_info = g_file_query_info (document_file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+                               G_FILE_QUERY_INFO_NONE, NULL, &error);
+
+if (error != NULL) {
+    g_error ("Error getting document file information: %s", error->message);
+    g_error_free (error);
+    g_object_unref (destination_folder);
+    g_object_unref (document_file);
+    g_object_unref (service);
+    return;
+}
+
+slug = g_file_info_get_display_name (file_info);
+content_type = g_file_info_get_content_type (file_info);
+
+/* Get an input stream for the file */
+file_stream = g_file_read (document_file, NULL, &error);
+
+g_object_unref (document_file);
+
+if (error != NULL) {
+    g_error ("Error getting document file stream: %s", error->message);
+    g_error_free (error);
+    g_object_unref (file_info);
+    g_object_unref (destination_folder);
+    g_object_unref (service);
+    return;
+}
+
+/* Create the document metadata to upload */
+document = gdata_documents_text_new (NULL);
+gdata_entry_set_title (GDATA_ENTRY (document), "Document Title");
+
+/* Get an upload stream for the document */
+upload_stream = gdata_documents_service_upload_document (service, document, slug, content_type, destination_folder, NULL, &error);
+
+g_object_unref (document);
+g_object_unref (file_info);
+g_object_unref (destination_folder);
+
+if (error != NULL) {
+    g_error ("Error getting upload stream: %s", error->message);
+    g_error_free (error);
+    g_object_unref (file_stream);
+    g_object_unref (service);
+    return;
+}
+
+/* Upload the document. This is a blocking operation, and should normally be done asynchronously. */
+g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), G_INPUT_STREAM (file_stream),
+                        G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error);
+
+g_object_unref (file_stream);
+
+if (error != NULL) {
+    g_error ("Error splicing streams: %s", error->message);
+    g_error_free (error);
+    g_object_unref (upload_stream);
+    g_object_unref (service);
+    return;
+}
+
+/* Finish off the upload by parsing the returned updated document metadata entry */
+uploaded_document = gdata_documents_service_finish_upload (service, upload_stream, &error);
+
+g_object_unref (upload_stream);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error uploading document: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Do something with the uploaded document */
+
+g_object_unref (uploaded_document);
+
+ +
+

The Drive service can be manipulated using batch operations, too. See the

+online documentation on batch +operations for more information. +
+

Example 28. Performing a Batch Operation on Documents

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
GDataDocumentsService *service;
+GDataBatchOperation *operation;
+GDataFeed *feed;
+GDataLink *batch_link;
+GList *i;
+GError *error = NULL;
+
+/* Create a service */
+service = create_documents_service ();
+
+/* Create the batch operation; this requires that we have done a query first so that we can get the batch link */
+feed = do_some_query (service);
+batch_link = gdata_feed_look_up_link (feed, GDATA_LINK_BATCH);
+operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_link_get_uri (batch_link));
+g_object_unref (feed);
+
+gdata_batch_operation_add_query (operation, presentation_entry_id_to_query, GDATA_TYPE_DOCUMENTS_PRESENTATION,
+                                 (GDataBatchOperationCallback) batch_query_cb, user_data);
+gdata_batch_operation_add_insertion (operation, new_entry, (GDataBatchOperationCallback) batch_insertion_cb, user_data);
+gdata_batch_operation_add_update (operation, old_entry, (GDataBatchOperationCallback) batch_update_cb, user_data);
+gdata_batch_operation_add_deletion (operation, entry_to_delete, (GDataBatchOperationCallback) batch_deletion_cb, user_data);
+
+/* Run the batch operation and handle the results in the various callbacks */
+gdata_test_batch_operation_run (operation, NULL, &error);
+
+g_object_unref (operation);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error running batch operation: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+static void
+batch_query_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_type == GDATA_BATCH_OPERATION_QUERY */
+    /* Reference and do something with the returned entry. */
+}
+
+static void
+batch_insertion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_type == GDATA_BATCH_OPERATION_INSERTION */
+    /* Reference and do something with the returned entry. */
+}
+
+static void
+batch_update_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_type == GDATA_BATCH_OPERATION_UPDATE */
+    /* Reference and do something with the returned entry. */
+}
+
+static void
+batch_deletion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data)
+{
+    /* operation_type == GDATA_BATCH_OPERATION_DELETION, entry == NULL */
+}
+
+ +
+

Starred documents are denoted by being in the GDATA_CATEGORY_SCHEMA_LABELS_STARRED category of the GDATA_CATEGORY_SCHEMA_LABELS schema. Documents +can be starred or unstarred simply by adding or removing this category from them and updating the document:

+
+

Example 29. Starring a Document

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
GDataDocumentsService *service;
+GDataDocumentsEntry *document, *updated_document;
+GDataCategory *starred_category;
+GError *error = NULL;
+
+/* Create a service and retrieve the document to be starred */
+service = create_documents_service ();
+document = get_document_to_be_starred (service);
+
+/* Add the “starred” category to the document */
+starred_category = gdata_category_new (GDATA_CATEGORY_SCHEMA_LABELS_STARRED, GDATA_CATEGORY_SCHEMA_LABELS, "starred");
+gdata_entry_add_category (GDATA_ENTRY (document), starred_category);
+g_object_unref (starred_category);
+
+/* Propagate the updated document to the server */
+updated_document = GDATA_DOCUMENTS_ENTRY (gdata_service_update_entry (GDATA_SERVICE (service),
+                                                                      gdata_documents_service_get_primary_authorization_domain (),
+                                                                      GDATA_ENTRY (document), NULL, &error));
+
+g_object_unref (document);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error starring document: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Do something with the newly-starred document, like update it in the UI */
+
+g_object_unref (updated_document);
+
+ +
+
+
+
+

Functions

+
+

gdata_documents_service_new ()

+
GDataDocumentsService *
+gdata_documents_service_new (GDataAuthorizer *authorizer);
+

Creates a new GDataDocumentsService using the given GDataAuthorizer. If authorizer + is NULL, all requests are made as an unauthenticated user.

+
+

Parameters

+
+++++ + + + + + +

authorizer

a GDataAuthorizer to authorize the service's requests, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataDocumentsService, or NULL; unref with g_object_unref()

+
+

Since: 0.9.0

+
+
+
+

gdata_documents_service_get_primary_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_documents_service_get_primary_authorization_domain
+                               (void);
+

The primary GDataAuthorizationDomain for interacting with Google Documents. This will not normally need to be used, as it's used internally +by the GDataDocumentsService methods. However, if using the plain GDataService methods to implement custom queries or requests which libgdata +does not support natively, then this domain may be needed to authorize the requests.

+

The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.

+
+

Returns

+

the service's authorization domain.

+

[transfer none]

+
+

Since: 0.9.0

+
+
+
+

gdata_documents_service_get_spreadsheet_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_documents_service_get_spreadsheet_authorization_domain
+                               (void);
+

The GDataAuthorizationDomain for interacting with spreadsheet data. This will not normally need to be used, as it's automatically used internally +by the GDataDocumentsService methods. However, if using the plain GDataService methods to implement custom queries or requests which libgdata +does not support natively, then this domain may be needed to authorize the requests which pertain to the Google Spreadsheets Data API, such as +requests to download or upload spreadsheet documents.

+

The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.

+
+

Returns

+

the service's authorization domain.

+

[transfer none]

+
+

Since: 0.9.0

+
+
+
+

gdata_documents_service_get_metadata ()

+
GDataDocumentsMetadata *
+gdata_documents_service_get_metadata (GDataDocumentsService *self,
+                                      GCancellable *cancellable,
+                                      GError **error);
+

Gets a GDataDocumentsMetadata object containing metadata about the documents +service itself, like how large the user quota is.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

the service's metadata object; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.17.9

+
+
+
+

gdata_documents_service_get_metadata_async ()

+
void
+gdata_documents_service_get_metadata_async
+                               (GDataDocumentsService *self,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Gets a GDataDocumentsMetadata object containing metadata about the documents +service itself, like how large the user quota is.

+

For more details, see gdata_documents_service_get_metadata(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_documents_service_get_metadata_finish() to get the results +of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the operation is finished, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.17.9

+
+
+
+

gdata_documents_service_get_metadata_finish ()

+
GDataDocumentsMetadata *
+gdata_documents_service_get_metadata_finish
+                               (GDataDocumentsService *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finish an asynchronous operation to get a GDataDocumentsMetadata started with gdata_documents_service_get_metadata_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

the service's metadata object; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.17.9

+
+
+
+

gdata_documents_service_query_documents ()

+
GDataDocumentsFeed *
+gdata_documents_service_query_documents
+                               (GDataDocumentsService *self,
+                                GDataDocumentsQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GError **error);
+

Queries the service to return a list of documents matching the given query +. Note that query + has to be a GDataDocumentsQuery, rather than just +a GDataQuery, as it uses the folder ID specified in “folder-id”.

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

query

a GDataDocumentsQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataDocumentsFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_service_query_documents_async ()

+
void
+gdata_documents_service_query_documents_async
+                               (GDataDocumentsService *self,
+                                GDataDocumentsQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service to return a list of documents matching the given query +. self + and +query + are both reffed when this function is called, so can safely be unreffed after this function returns.

+

For more details, see gdata_documents_service_query_documents(), which is the synchronous version of this function, +and gdata_service_query_async(), which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

query

a GDataDocumentsQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_documents_service_upload_document ()

+
GDataUploadStream *
+gdata_documents_service_upload_document
+                               (GDataDocumentsService *self,
+                                GDataDocumentsDocument *document,
+                                const gchar *slug,
+                                const gchar *content_type,
+                                GDataDocumentsFolder *folder,
+                                GCancellable *cancellable,
+                                GError **error);
+

Uploads a document to Google Documents, using the properties from document + and the document data written to the resulting GDataUploadStream. If +the document data does not need to be provided at the moment, just the metadata, use gdata_service_insert_entry() instead (e.g. in the case of +creating a new, empty file to be edited at a later date).

+

This performs a non-resumable upload, unlike gdata_documents_service_upload_document(). This means that errors during transmission will cause the +upload to fail, and the entire document will have to be re-uploaded. It is recommended that gdata_documents_service_upload_document_resumable() +be used instead.

+

If document + is NULL, only the document data will be uploaded. The new document entry will be named using slug +, and will have default metadata.

+

The stream returned by this function should be written to using the standard GOutputStream methods, asychronously or synchronously. Once the stream +is closed (using g_output_stream_close()), gdata_documents_service_finish_upload() should be called on it to parse and return the updated +GDataDocumentsDocument for the document. This must be done, as document + isn't updated in-place.

+

In order to cancel the upload, a GCancellable passed in to cancellable + must be cancelled using g_cancellable_cancel(). Cancelling the individual +GOutputStream operations on the GDataUploadStream will not cancel the entire upload; merely the write or close operation in question. See the +“cancellable” for more details.

+

Any upload errors will be thrown by the stream methods, and may come from the GDataServiceError domain.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

an authenticated GDataDocumentsService

 

document

the GDataDocumentsDocument to insert, or NULL.

[allow-none]

slug

the filename to give to the uploaded document

 

content_type

the content type of the uploaded data

 

folder

the folder to which the document should be uploaded, or NULL.

[allow-none]

cancellable

a GCancellable for the entire upload stream, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataUploadStream to write the document data to, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_documents_service_upload_document_resumable ()

+
GDataUploadStream *
+gdata_documents_service_upload_document_resumable
+                               (GDataDocumentsService *self,
+                                GDataDocumentsDocument *document,
+                                const gchar *slug,
+                                const gchar *content_type,
+                                goffset content_length,
+                                GDataDocumentsUploadQuery *query,
+                                GCancellable *cancellable,
+                                GError **error);
+

Uploads a document to Google Documents, using the properties from document + and the document data written to the resulting GDataUploadStream. If +the document data does not need to be provided at the moment, just the metadata, use gdata_service_insert_entry() instead (e.g. in the case of +creating a new, empty file to be edited at a later date).

+

Unlike gdata_documents_service_upload_document(), this method performs a

+resumable upload which allows for correction of +

transmission errors without re-uploading the entire file. Use of this method is preferred over gdata_documents_service_upload_document().

+

If document + is NULL, only the document data will be uploaded. The new document entry will be named using slug +, and will have default metadata.

+

If non-NULL, the query + specifies parameters for the upload, such as a GDataDocumentsFolder to upload the document into; and whether to treat +the document as an opaque file, or convert it to a standard format. If query + is NULL, the document will be uploaded into the root folder, and +automatically converted to a standard format. No OCR or automatic language translation will be performed by default.

+

If query + is non-NULL and “convert” is FALSE, document + must be an instance of GDataDocumentsDocument. Otherwise, +document + must be a subclass of it, such as GDataDocumentsPresentation.

+

The stream returned by this function should be written to using the standard GOutputStream methods, asychronously or synchronously. Once the stream +is closed (using g_output_stream_close()), gdata_documents_service_finish_upload() should be called on it to parse and return the updated +GDataDocumentsDocument for the document. This must be done, as document + isn't updated in-place.

+

In order to cancel the upload, a GCancellable passed in to cancellable + must be cancelled using g_cancellable_cancel(). Cancelling the individual +GOutputStream operations on the GDataUploadStream will not cancel the entire upload; merely the write or close operation in question. See the +“cancellable” for more details.

+

Any upload errors will be thrown by the stream methods, and may come from the GDataServiceError domain.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

an authenticated GDataDocumentsService

 

document

the GDataDocumentsDocument to insert, or NULL.

[allow-none]

slug

the filename to give to the uploaded document

 

content_type

the content type of the uploaded data

 

content_length

the size (in bytes) of the file being uploaded

 

query

a query specifying parameters for the upload, or NULL.

[allow-none]

cancellable

a GCancellable for the entire upload stream, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataUploadStream to write the document data to, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.13.0

+
+
+
+

gdata_documents_service_update_document ()

+
GDataUploadStream *
+gdata_documents_service_update_document
+                               (GDataDocumentsService *self,
+                                GDataDocumentsDocument *document,
+                                const gchar *slug,
+                                const gchar *content_type,
+                                GCancellable *cancellable,
+                                GError **error);
+

Update the document using the properties from document + and the document data written to the resulting GDataUploadStream. If the document data does +not need to be changed, just the metadata, use gdata_service_update_entry() instead.

+

This performs a non-resumable upload, unlike gdata_documents_service_update_document(). This means that errors during transmission will cause the +upload to fail, and the entire document will have to be re-uploaded. It is recommended that gdata_documents_service_update_document_resumable() +be used instead.

+

The stream returned by this function should be written to using the standard GOutputStream methods, asychronously or synchronously. Once the stream +is closed (using g_output_stream_close()), gdata_documents_service_finish_upload() should be called on it to parse and return the updated +GDataDocumentsDocument for the document. This must be done, as document + isn't updated in-place.

+

In order to cancel the update, a GCancellable passed in to cancellable + must be cancelled using g_cancellable_cancel(). Cancelling the individual +GOutputStream operations on the GDataUploadStream will not cancel the entire update; merely the write or close operation in question. See the +“cancellable” for more details.

+

Any upload errors will be thrown by the stream methods, and may come from the GDataServiceError domain.

+

For more information, see gdata_service_update_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

document

the GDataDocumentsDocument to update

 

slug

the filename to give to the uploaded document

 

content_type

the content type of the uploaded data

 

cancellable

a GCancellable for the entire upload stream, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataUploadStream to write the document data to; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_documents_service_update_document_resumable ()

+
GDataUploadStream *
+gdata_documents_service_update_document_resumable
+                               (GDataDocumentsService *self,
+                                GDataDocumentsDocument *document,
+                                const gchar *slug,
+                                const gchar *content_type,
+                                goffset content_length,
+                                GCancellable *cancellable,
+                                GError **error);
+

Update the document using the properties from document + and the document data written to the resulting GDataUploadStream. If the document data does +not need to be changed, just the metadata, use gdata_service_update_entry() instead.

+

Unlike gdata_documents_service_update_document(), this method performs a

+resumable upload which allows for correction of +

transmission errors without re-uploading the entire file. Use of this method is preferred over gdata_documents_service_update_document().

+

The stream returned by this function should be written to using the standard GOutputStream methods, asychronously or synchronously. Once the stream +is closed (using g_output_stream_close()), gdata_documents_service_finish_upload() should be called on it to parse and return the updated +GDataDocumentsDocument for the document. This must be done, as document + isn't updated in-place.

+

In order to cancel the update, a GCancellable passed in to cancellable + must be cancelled using g_cancellable_cancel(). Cancelling the individual +GOutputStream operations on the GDataUploadStream will not cancel the entire update; merely the write or close operation in question. See the +“cancellable” for more details.

+

Any upload errors will be thrown by the stream methods, and may come from the GDataServiceError domain.

+

For more information, see gdata_service_update_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

document

the GDataDocumentsDocument to update

 

slug

the filename to give to the uploaded document

 

content_type

the content type of the uploaded data

 

content_length

the size (in bytes) of the file being uploaded

 

cancellable

a GCancellable for the entire upload stream, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataUploadStream to write the document data to; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.13.0

+
+
+
+

gdata_documents_service_finish_upload ()

+
GDataDocumentsDocument *
+gdata_documents_service_finish_upload (GDataDocumentsService *self,
+                                       GDataUploadStream *upload_stream,
+                                       GError **error);
+

Finish off a document upload or update operation started by gdata_documents_service_upload_document() or gdata_documents_service_update_document(), +parsing the result and returning the new or updated GDataDocumentsDocument.

+

If an error occurred during the upload or update operation, it will have been returned during the operation (e.g. by g_output_stream_splice() or one +of the other stream methods). In such a case, NULL will be returned but error + will remain unset. error + is only set in the case that the server +indicates that the operation was successful, but an error is encountered in parsing the result sent by the server.

+

In the case that no GDataDocumentsDocument was passed (to gdata_documents_service_upload_document() or gdata_documents_service_update_document()) +when starting the operation, GDATA_DOCUMENTS_SERVICE_ERROR_INVALID_CONTENT_TYPE will be thrown in error + if the content type of the uploaded data +could not be mapped to a document type with which to interpret the response from the server.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

upload_stream

the GDataUploadStream from the operation

 

error

a GError, or NULL

 
+
+
+

Returns

+

the new or updated GDataDocumentsDocument, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_documents_service_copy_document ()

+
GDataDocumentsDocument *
+gdata_documents_service_copy_document (GDataDocumentsService *self,
+                                       GDataDocumentsDocument *document,
+                                       GCancellable *cancellable,
+                                       GError **error);
+

Copy the given document +, producing a duplicate document in the same folder and returning its GDataDocumentsDocument.

+

Errors from GDataServiceError can be returned for exceptional conditions, as determined by the server.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

an authenticated GDataDocumentsService

 

document

the GDataDocumentsDocument to copy

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

the duplicate GDataDocumentsDocument, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.13.1

+
+
+
+

gdata_documents_service_copy_document_async ()

+
void
+gdata_documents_service_copy_document_async
+                               (GDataDocumentsService *self,
+                                GDataDocumentsDocument *document,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Copy the given document +, producing a duplicate document in the same folder and returning its GDataDocumentsDocument. self + and document + are +both reffed when this function is called, so can safely be unreffed after this function returns.

+

For more details, see gdata_documents_service_copy_document(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_documents_service_copy_document_finish() to get the results +of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

document

the GDataDocumentsDocument to copy

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the operation is finished, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.13.1

+
+
+
+

gdata_documents_service_copy_document_finish ()

+
GDataDocumentsDocument *
+gdata_documents_service_copy_document_finish
+                               (GDataDocumentsService *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finish an asynchronous operation to copy a GDataDocumentsDocument started with gdata_documents_service_copy_document_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

the duplicate GDataDocumentsDocument, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.13.1

+
+
+
+

gdata_documents_service_add_entry_to_folder ()

+
GDataDocumentsEntry *
+gdata_documents_service_add_entry_to_folder
+                               (GDataDocumentsService *self,
+                                GDataDocumentsEntry *entry,
+                                GDataDocumentsFolder *folder,
+                                GCancellable *cancellable,
+                                GError **error);
+

Add the given entry + to the specified folder +, and return an updated GDataDocumentsEntry for entry +. If the entry + is already in another folder, +a copy will be added to the new folder. The copy and original will have different IDs. Note that entry + can't be a GDataDocumentsFolder that +already exists on the server. It can be a new GDataDocumentsFolder, or a GDataDocumentsDocument that is either new or already present on the +server.

+

Errors from GDataServiceError can be returned for exceptional conditions, as determined by the server.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

an authenticated GDataDocumentsService

 

entry

the GDataDocumentsEntry to copy

 

folder

the GDataDocumentsFolder to copy entry +into

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataDocumentsEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_documents_service_add_entry_to_folder_async ()

+
void
+gdata_documents_service_add_entry_to_folder_async
+                               (GDataDocumentsService *self,
+                                GDataDocumentsEntry *entry,
+                                GDataDocumentsFolder *folder,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Add the given entry + to the specified folder +. self +, entry + and folder + are all reffed when this function is called, so can safely be unreffed +after this function returns.

+

For more details, see gdata_documents_service_add_entry_to_folder(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_documents_service_add_entry_to_folder_finish() to get the results +of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

entry

the GDataDocumentsEntry to add to folder +

 

folder

the GDataDocumentsFolder to add entry +to

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the operation is finished, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.8.0

+
+
+
+

gdata_documents_service_add_entry_to_folder_finish ()

+
GDataDocumentsEntry *
+gdata_documents_service_add_entry_to_folder_finish
+                               (GDataDocumentsService *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finish an asynchronous operation to add a GDataDocumentsEntry to a folder started with gdata_documents_service_add_entry_to_folder_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataDocumentsEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_documents_service_remove_entry_from_folder ()

+
GDataDocumentsEntry *
+gdata_documents_service_remove_entry_from_folder
+                               (GDataDocumentsService *self,
+                                GDataDocumentsEntry *entry,
+                                GDataDocumentsFolder *folder,
+                                GCancellable *cancellable,
+                                GError **error);
+

Remove the given entry + from folder +, and return an updated GDataDocumentsEntry for entry +. entry + will remain a member of any other folders it's +currently in. Note that entry + can be either a GDataDocumentsDocument or a GDataDocumentsFolder.

+

Errors from GDataServiceError can be returned for exceptional conditions, as determined by the server.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

entry

the GDataDocumentsEntry to remove

 

folder

the GDataDocumentsFolder from which we should remove entry +

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataDocumentsEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_documents_service_remove_entry_from_folder_async ()

+
void
+gdata_documents_service_remove_entry_from_folder_async
+                               (GDataDocumentsService *self,
+                                GDataDocumentsEntry *entry,
+                                GDataDocumentsFolder *folder,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Remove the given entry + from the specified folder +. self +, entry + and folder + are all reffed when this function is called, so can safely be unreffed +after this function returns.

+

For more details, see gdata_documents_service_remove_entry_from_folder(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_documents_service_remove_entry_from_folder_finish() to get the +results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

entry

the GDataDocumentsEntry to remove from folder +

 

folder

the GDataDocumentsFolder to remove entry +from

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the operation is finished, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.8.0

+
+
+
+

gdata_documents_service_remove_entry_from_folder_finish ()

+
GDataDocumentsEntry *
+gdata_documents_service_remove_entry_from_folder_finish
+                               (GDataDocumentsService *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finish an asynchronous operation to remove a GDataDocumentsEntry from a folder started with +gdata_documents_service_remove_entry_from_folder_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataDocumentsEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_documents_service_get_upload_uri ()

+
gchar *
+gdata_documents_service_get_upload_uri
+                               (GDataDocumentsFolder *folder);
+

Gets the upload URI for documents for the service.

+

If folder + is NULL, the URI will be the one to upload documents to the "root" folder.

+
+

Parameters

+
+++++ + + + + + +

folder

the GDataDocumentsFolder into which to upload the document, or NULL.

[allow-none]
+
+
+

Returns

+

the URI permitting the upload of documents to folder +, or NULL; free with g_free()

+
+

Since: 0.5.0

+
+
+
+

Types and Values

+
+

GDataDocumentsService

+
typedef struct _GDataDocumentsService GDataDocumentsService;
+

All the fields in the GDataDocumentsService structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataDocumentsServiceClass

+
typedef struct {
+} GDataDocumentsServiceClass;
+
+

All the fields in the GDataDocumentsServiceClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

enum GDataDocumentsServiceError

+

Error codes for GDataDocumentsService operations.

+
+

Members

+
+++++ + + + + + +

GDATA_DOCUMENTS_SERVICE_ERROR_INVALID_CONTENT_TYPE

+

the content type of a provided file was invalid

+
 
+
+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsSpreadsheet.html b/docs/reference/html/GDataDocumentsSpreadsheet.html new file mode 100644 index 0000000..d11b284 --- /dev/null +++ b/docs/reference/html/GDataDocumentsSpreadsheet.html @@ -0,0 +1,418 @@ + + + + +GDataDocumentsSpreadsheet: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsSpreadsheet

+

GDataDocumentsSpreadsheet — GData Documents spreadsheet object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataDocumentsEntry
+                ╰── GDataDocumentsDocument
+                    ╰── GDataDocumentsSpreadsheet
+
+
+
+

Implemented Interfaces

+

+GDataDocumentsSpreadsheet implements + GDataAccessHandler.

+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-spreadsheet.h>
+
+
+
+

Description

+

GDataDocumentsSpreadsheet is a subclass of GDataDocumentsDocument to represent a spreadsheet from Google Documents.

+

For more details of Google Drive's GData API, see the

+online documentation. +
+

Example 37. Downloading a Specific Sheet of a Spreadsheet

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
GDataDocumentsService *service;
+GDataDocumentsSpreadsheet *spreadsheet;
+GFile *destination_file;
+guint gid;
+gchar *download_uri;
+GDataDownloadStream *download_stream;
+GFileOutputStream *output_stream;
+GError *error = NULL;
+
+/* Create a service and retrieve the spreadsheet and sheet index (GID) to download and the file to save the download in */
+service = create_youtube_service ();
+spreadsheet = get_document_to_download (service);
+destination_file = query_user_for_destination_file (spreadsheet);
+gid = query_user_for_gid (spreadsheet);
+
+/* Create the download stream */
+download_uri = gdata_documents_spreadsheet_get_download_uri (spreadsheet, GDATA_DOCUMENTS_SPREADSHEET_CSV, gid);
+download_stream = GDATA_DOWNLOAD_STREAM (gdata_download_stream_new (service, gdata_documents_service_get_spreadsheet_authorization_domain (),
+                                                                    download_uri, NULL));
+g_free (download_uri);
+
+g_object_unref (spreadsheet);
+g_object_unref (service);
+
+/* Create the file output stream */
+output_stream = g_file_replace (destination_file, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, NULL, &error);
+
+g_object_unref (destination_file);
+
+if (error != NULL) {
+    g_error ("Error creating destination file: %s", error->message);
+    g_error_free (error);
+    g_object_unref (download_stream);
+    return;
+}
+
+/* Download the document. This should almost always be done asynchronously. */
+g_output_stream_splice (G_OUTPUT_STREAM (output_stream), G_INPUT_STREAM (download_stream),
+                        G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error);
+
+g_object_unref (output_stream);
+g_object_unref (download_stream);
+
+if (error != NULL) {
+    g_error ("Error downloading spreadsheet: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+ +
+
+
+
+

Functions

+
+

gdata_documents_spreadsheet_new ()

+
GDataDocumentsSpreadsheet *
+gdata_documents_spreadsheet_new (const gchar *id);
+

Creates a new GDataDocumentsSpreadsheet with the given entry ID (“id”).

+
+

Parameters

+
+++++ + + + + + +

id

the entry's ID (not the document ID of the spreadsheet), or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataDocumentsSpreadsheet, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.4.0

+
+
+
+

gdata_documents_spreadsheet_get_download_uri ()

+
gchar *
+gdata_documents_spreadsheet_get_download_uri
+                               (GDataDocumentsSpreadsheet *self,
+                                const gchar *export_format,
+                                gint gid);
+

Builds and returns the download URI for the given GDataDocumentsSpreadsheet in the desired format. Note that directly downloading +the document using this URI isn't possible, as authentication is required. You should instead use gdata_download_stream_new() with +the URI, and use the resulting GInputStream.

+

When requesting a "csv", "tsv", "pdf" or

+"html" file you may specify an additional parameter called gid which indicates which grid, or sheet, you wish to get +

(the index is 0-based, so GID 1 actually refers to the second sheet on a given +spreadsheet).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataDocumentsSpreadsheet

 

export_format

the format in which the spreadsheet should be exported when downloaded

 

gid

the 0-based sheet ID to download, or -1

 
+
+
+

Returns

+

the download URI; free with g_free()

+
+

Since: 0.5.0

+
+
+
+

Types and Values

+
+

GDATA_DOCUMENTS_SPREADSHEET_CSV

+
#define GDATA_DOCUMENTS_SPREADSHEET_CSV "csv"
+
+

The export format for Comma-Separated Values (CSV) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_SPREADSHEET_HTML

+
#define GDATA_DOCUMENTS_SPREADSHEET_HTML "html"
+
+

The export format for HyperText Markup Language (HTML) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_SPREADSHEET_ODS

+
#define GDATA_DOCUMENTS_SPREADSHEET_ODS "ods"
+
+

The export format for OpenDocument Spreadsheet (ODS) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_SPREADSHEET_PDF

+
#define GDATA_DOCUMENTS_SPREADSHEET_PDF "pdf"
+
+

The export format for Portable Document Format (PDF).

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_SPREADSHEET_TSV

+
#define GDATA_DOCUMENTS_SPREADSHEET_TSV "tsv"
+
+

The export format for Tab-Separated Values (TSV) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_SPREADSHEET_XLS

+
#define GDATA_DOCUMENTS_SPREADSHEET_XLS "xls"
+
+

The export format for Microsoft Excel spreadsheet (XLS) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDataDocumentsSpreadsheet

+
typedef struct _GDataDocumentsSpreadsheet GDataDocumentsSpreadsheet;
+

All the fields in the GDataDocumentsSpreadsheet structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataDocumentsSpreadsheetClass

+
typedef struct {
+} GDataDocumentsSpreadsheetClass;
+
+

All the fields in the GDataDocumentsSpreadsheetClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsText.html b/docs/reference/html/GDataDocumentsText.html new file mode 100644 index 0000000..971ec0f --- /dev/null +++ b/docs/reference/html/GDataDocumentsText.html @@ -0,0 +1,297 @@ + + + + +GDataDocumentsText: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsText

+

GDataDocumentsText — GData Documents text object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+GDataDocumentsText * + +gdata_documents_text_new () +
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataDocumentsEntry
+                ╰── GDataDocumentsDocument
+                    ╰── GDataDocumentsText
+
+
+
+

Implemented Interfaces

+

+GDataDocumentsText implements + GDataAccessHandler.

+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-text.h>
+
+
+
+

Description

+

GDataDocumentsText is a subclass of GDataDocumentsDocument to represent a text document from Google Documents.

+

For more details of Google Drive's GData API, see the

+online documentation. + +
+
+

Functions

+
+

gdata_documents_text_new ()

+
GDataDocumentsText *
+gdata_documents_text_new (const gchar *id);
+

Creates a new GDataDocumentsText with the given entry ID (“id”).

+
+

Parameters

+
+++++ + + + + + +

id

the entry's ID (not the document ID of the text document), or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataDocumentsText, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_DOCUMENTS_TEXT_DOC

+
#define GDATA_DOCUMENTS_TEXT_DOC "doc"
+
+

The export format for Microsoft Word (DOC) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_TEXT_HTML

+
#define GDATA_DOCUMENTS_TEXT_HTML "html"
+
+

The export format for HyperText Markup Language (HTML) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_TEXT_JPEG

+
#define GDATA_DOCUMENTS_TEXT_JPEG "jpeg"
+
+

The export format for JPEG image format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.13.0

+
+
+
+

GDATA_DOCUMENTS_TEXT_ODT

+
#define GDATA_DOCUMENTS_TEXT_ODT "odt"
+
+

The export format for OpenDocument Text (ODT) format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_TEXT_PDF

+
#define GDATA_DOCUMENTS_TEXT_PDF "pdf"
+
+

The export format for Portable Document Format (PDF).

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_TEXT_PNG

+
#define GDATA_DOCUMENTS_TEXT_PNG "png"
+
+

The export format for Portable Network Graphics (PNG) image format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_TEXT_RTF

+
#define GDATA_DOCUMENTS_TEXT_RTF "rtf"
+
+

The export format for Rich Text Format (RTF).

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_TEXT_TXT

+
#define GDATA_DOCUMENTS_TEXT_TXT "txt"
+
+

The export format for plain text format.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDATA_DOCUMENTS_TEXT_ZIP

+
#define GDATA_DOCUMENTS_TEXT_ZIP "zip"
+
+

The export format for a ZIP archive containing images and exported HTML.

+

For more information, see the

+ +GData protocol specification. +

Since: 0.7.0

+
+
+
+

GDataDocumentsText

+
typedef struct _GDataDocumentsText GDataDocumentsText;
+

All the fields in the GDataDocumentsText structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataDocumentsTextClass

+
typedef struct {
+} GDataDocumentsTextClass;
+
+

All the fields in the GDataDocumentsTextClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDocumentsUploadQuery.html b/docs/reference/html/GDataDocumentsUploadQuery.html new file mode 100644 index 0000000..f6581ee --- /dev/null +++ b/docs/reference/html/GDataDocumentsUploadQuery.html @@ -0,0 +1,593 @@ + + + + +GDataDocumentsUploadQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDocumentsUploadQuery

+

GDataDocumentsUploadQuery — GData Documents upload query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Properties

+
+++++ + + + + + + + + + + + + +
gbooleanconvertRead / Write
+GDataDocumentsFolder *folderRead / Write
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataDocumentsUploadQuery
+
+
+
+

Includes

+
#include <gdata/services/documents/gdata-documents-upload-query.h>
+
+
+
+

Description

+

GDataDocumentsUploadQuery is a collection of parameters for document uploads to Google Documents, allowing various options to be set when uploading +a document for the first time. For example, the destination folder for the uploaded document may be specified; or whether to automatically convert +the document to a common format.

+

GDataDocumentsUploadQuery is designed as an object (rather than a fixed struct or set of function arguments) to allow for easy additions of new +Google Documents features in the future.

+
+

Example 31. Uploading an Arbitrary File from Disk

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
GDataDocumentsService *service;
+GDataDocumentsDocument *document, *uploaded_document;
+GFile *arbitrary_file;
+GFileInfo *file_info;
+const gchar *slug, *content_type;
+goffset file_size;
+GDataDocumentsUploadQuery *upload_query;
+GFileInputStream *file_stream;
+GDataUploadStream *upload_stream;
+GError *error = NULL;
+
+/* Create a service. */
+service = create_documents_service ();
+
+/* Get the file to upload. */
+arbitrary_file = g_file_new_for_path ("arbitrary-file.bin");
+
+/* Get the file's display name, content type and size. */
+file_info = g_file_query_info (arbitrary_file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+                               G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, NULL, &error);
+
+if (error != NULL) {
+    g_error ("Error getting arbitrary file information: %s", error->message);
+    g_error_free (error);
+    g_object_unref (arbitrary_file);
+    g_object_unref (service);
+    return;
+}
+
+slug = g_file_info_get_display_name (file_info);
+content_type = g_file_info_get_content_type (file_info);
+file_size = g_file_info_get_size (file_info);
+
+/* Get an input stream for the file. */
+file_stream = g_file_read (arbitrary_file, NULL, &error);
+
+g_object_unref (arbitrary_file);
+
+if (error != NULL) {
+    g_error ("Error getting arbitrary file stream: %s", error->message);
+    g_error_free (error);
+    g_object_unref (file_info);
+    g_object_unref (service);
+    return;
+}
+
+/* Create the file metadata to upload. */
+document = gdata_documents_document_new (NULL);
+gdata_entry_set_title (GDATA_ENTRY (document), "Title for My Arbitrary File");
+
+/* Build the upload query and set the upload to not be converted to a standard format. */
+upload_query = gdata_documents_upload_query_new ();
+gdata_documents_upload_query_set_convert (upload_query, FALSE);
+
+/* Get an upload stream for the file. */
+upload_stream = gdata_documents_service_upload_document_resumable (service, document, slug, content_type, file_size, upload_query, NULL, &error);
+
+g_object_unref (upload_query);
+g_object_unref (document);
+g_object_unref (file_info);
+
+if (error != NULL) {
+    g_error ("Error getting upload stream: %s", error->message);
+    g_error_free (error);
+    g_object_unref (file_stream);
+    g_object_unref (service);
+    return;
+}
+
+/* Upload the document. This is a blocking operation, and should normally be done asynchronously. */
+g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), G_INPUT_STREAM (file_stream),
+                        G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error);
+
+g_object_unref (file_stream);
+
+if (error != NULL) {
+    g_error ("Error splicing streams: %s", error->message);
+    g_error_free (error);
+    g_object_unref (upload_stream);
+    g_object_unref (service);
+    return;
+}
+
+/* Finish off the upload by parsing the returned updated document metadata entry. */
+uploaded_document = gdata_documents_service_finish_upload (service, upload_stream, &error);
+
+g_object_unref (upload_stream);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error uploading file: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Do something with the uploaded document. */
+
+g_object_unref (uploaded_document);
+
+ +
+
+
+
+

Functions

+
+

gdata_documents_upload_query_new ()

+
GDataDocumentsUploadQuery *
+gdata_documents_upload_query_new (void);
+

Constructs a new empty GDataDocumentsUploadQuery.

+
+

Returns

+

a new GDataDocumentsUploadQuery; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.13.0

+
+
+
+

gdata_documents_upload_query_build_uri ()

+
gchar *
+gdata_documents_upload_query_build_uri
+                               (GDataDocumentsUploadQuery *self);
+

Builds an upload URI suitable for passing to gdata_upload_stream_new_resumable() in order to upload a document to Google Documents as described in +the

+ +online documentation. +
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsUploadQuery

 
+
+
+

Returns

+

a complete upload URI; free with g_free().

+

[transfer full]

+
+

Since: 0.13.0

+
+
+
+

gdata_documents_upload_query_get_folder ()

+
GDataDocumentsFolder *
+gdata_documents_upload_query_get_folder
+                               (GDataDocumentsUploadQuery *self);
+

Gets “folder”.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsUploadQuery

 
+
+
+

Returns

+

the folder to upload into, or NULL.

+

[allow-none][transfer none]

+
+

Since: 0.13.0

+
+
+
+

gdata_documents_upload_query_set_folder ()

+
void
+gdata_documents_upload_query_set_folder
+                               (GDataDocumentsUploadQuery *self,
+                                GDataDocumentsFolder *folder);
+

Sets “folder” to folder +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataDocumentsUploadQuery

 

folder

a new folder to upload into, or NULL.

[allow-none][transfer none]
+
+

Since: 0.13.0

+
+
+
+

gdata_documents_upload_query_get_convert ()

+
gboolean
+gdata_documents_upload_query_get_convert
+                               (GDataDocumentsUploadQuery *self);
+

Gets “convert”.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDocumentsUploadQuery

 
+
+
+

Returns

+

TRUE to convert documents to common formats, FALSE to upload them unmodified

+
+

Since: 0.13.0

+
+
+
+

gdata_documents_upload_query_set_convert ()

+
void
+gdata_documents_upload_query_set_convert
+                               (GDataDocumentsUploadQuery *self,
+                                gboolean convert);
+

Sets “convert” to convert +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataDocumentsUploadQuery

 

convert

TRUE to convert documents to common formats, FALSE to upload them unmodified

 
+
+

Since: 0.13.0

+
+
+
+

Types and Values

+
+

GDataDocumentsUploadQuery

+
typedef struct _GDataDocumentsUploadQuery GDataDocumentsUploadQuery;
+

All the fields in the GDataDocumentsUploadQuery structure are private and should never be accessed directly.

+

Since: 0.13.0

+
+
+
+

GDataDocumentsUploadQueryClass

+
typedef struct {
+} GDataDocumentsUploadQueryClass;
+
+

All the fields in the GDataDocumentsUploadQueryClass structure are private and should never be accessed directly.

+

Since: 0.13.0

+
+
+
+

Property Details

+
+

The “convert” property

+
  “convert”                  gboolean
+

TRUE to automatically convert the uploaded document into a standard format (such as a text document, spreadsheet, presentation, etc.). +FALSE to upload the document without converting it; this allows for arbitrary files to be uploaded to Google Documents.

+

For more information, see the

+online documentation. +

Note that uploading with this property set to FALSE will only have an effect when using gdata_documents_service_update_document_resumable() +and not gdata_documents_service_update_document(). Additionally, the GDataDocumentsDocument passed to +gdata_documents_service_update_document_resumable() must be a GDataDocumentsDocument if this property is FALSE, and a subclass of it +otherwise.

+

Flags: Read / Write

+

Default value: TRUE

+

Since: 0.13.0

+
+
+
+

The “folder” property

+
  “folder”                   GDataDocumentsFolder *
+

Folder to upload the document into. If this is NULL, the document will be uploaded into the root folder.

+

Flags: Read / Write

+

Since: 0.13.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataDownloadStream.html b/docs/reference/html/GDataDownloadStream.html new file mode 100644 index 0000000..70d9028 --- /dev/null +++ b/docs/reference/html/GDataDownloadStream.html @@ -0,0 +1,632 @@ + + + + +GDataDownloadStream: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataDownloadStream

+

GDataDownloadStream — GData download stream object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GInputStream * + +gdata_download_stream_new () +
+GDataService * + +gdata_download_stream_get_service () +
+GDataAuthorizationDomain * + +gdata_download_stream_get_authorization_domain () +
+GCancellable * + +gdata_download_stream_get_cancellable () +
const gchar * + +gdata_download_stream_get_download_uri () +
const gchar * + +gdata_download_stream_get_content_type () +
+gssize + +gdata_download_stream_get_content_length () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataAuthorizationDomain *authorization-domainRead / Write / Construct Only
+GCancellable *cancellableRead / Write / Construct Only
glongcontent-lengthRead
+gchar *content-typeRead
+gchar *download-uriRead / Write / Construct Only
+GDataService *serviceRead / Write / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataDownloadStream
 GDataDownloadStreamClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GInputStream
+        ╰── GDataDownloadStream
+
+
+
+

Implemented Interfaces

+

+GDataDownloadStream implements + GSeekable.

+
+
+

Includes

+
#include <gdata/gdata-download-stream.h>
+
+
+
+

Description

+

GDataDownloadStream is a GInputStream subclass to allow downloading of files from GData services with authorization from a GDataService under +the given GDataAuthorizationDomain. If authorization is not required to perform the download, a GDataAuthorizationDomain doesn't have to be +specified.

+

Once a GDataDownloadStream is instantiated with gdata_download_stream_new(), the standard GInputStream API can be used on the stream to download +the file. Network communication may not actually begin until the first call to g_input_stream_read(), so having a GDataDownloadStream around is no +guarantee that the file is being downloaded.

+

The content type and length of the file being downloaded are made available through “content-type” and +“content-length” as soon as the appropriate data is received from the server. Connect to the +“notify” content-type and content-length details to be notified as +soon as the data is available.

+

The entire download operation can be cancelled using the GCancellable instance provided to gdata_download_stream_new(), or returned by +gdata_download_stream_get_cancellable(). Cancelling this at any time will cause all future GInputStream method calls to return +G_IO_ERROR_CANCELLED. If any GInputStream methods are in the process of being called, they will be cancelled and return G_IO_ERROR_CANCELLED as +soon as possible.

+

Note that cancelling an individual method call (such as a call to g_input_stream_read()) using the GCancellable parameter of the method will not +cancel the download as a whole — just that particular method call. In the case of g_input_stream_read(), this will cause it to successfully return +any data that it has in memory at the moment (up to the requested number of bytes), or return a G_IO_ERROR_CANCELLED if it was blocking on receiving +data from the network. This is also the behaviour of g_input_stream_read() when the download operation as a whole is cancelled.

+

In the case of g_input_stream_close(), the call will return immediately if network activity hasn't yet started. If it has, the network activity will +be cancelled, regardless of whether the call to g_input_stream_close() is cancelled. Cancelling a pending call to g_input_stream_close() (either +using the method's GCancellable, or by cancelling the download stream as a whole) will cause it to stop waiting for the network activity to finish, +and return G_IO_ERROR_CANCELLED immediately. Network activity will continue to be shut down in the background.

+

If the server returns an error message (for example, if the user is not correctly authenticated/authorized or doesn't have suitable permissions to +download from the given URI), it will be returned as a GDataServiceError by the first call to g_input_stream_read().

+
+

Example 2. Downloading to a File

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
GDataService *service;
+GDataAuthorizationDomain *domain;
+GCancellable *cancellable;
+GInputStream *download_stream;
+GOutputStream *output_stream;
+
+/* Create the download stream */
+service = create_my_service ();
+domain = get_my_authorization_domain_from_service (service);
+cancellable = g_cancellable_new (); /* cancel this to cancel the entire download operation */
+download_stream = gdata_download_stream_new (service, domain, download_uri, cancellable);
+output_stream = create_file_and_return_output_stream ();
+
+/* Perform the download asynchronously */
+g_output_stream_splice_async (output_stream, download_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
+                              G_PRIORITY_DEFAULT, NULL, (GAsyncReadyCallback) download_splice_cb, NULL);
+
+g_object_unref (output_stream);
+g_object_unref (download_stream);
+g_object_unref (cancellable);
+g_object_unref (domain);
+g_object_unref (service);
+
+static void
+download_splice_cb (GOutputStream *output_stream, GAsyncResult *result, gpointer user_data)
+{
+    GError *error = NULL;
+
+    g_output_stream_splice_finish (output_stream, result, &error);
+
+    if (error != NULL && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) == FALSE)) {
+        /* Error downloading the file; potentially an I/O error (GIOError), or an error response from the server
+         * (GDataServiceError). You might want to delete the newly created file because of the error. */
+        g_error ("Error downloading file: %s", error->message);
+        g_error_free (error);
+    }
+}
+
+ +
+
+
+
+

Functions

+
+

gdata_download_stream_new ()

+
GInputStream *
+gdata_download_stream_new (GDataService *service,
+                           GDataAuthorizationDomain *domain,
+                           const gchar *download_uri,
+                           GCancellable *cancellable);
+

Creates a new GDataDownloadStream, allowing a file to be downloaded from a GData service using standard GInputStream API.

+

As well as the standard GIO errors, calls to the GInputStream API on a GDataDownloadStream can also return any relevant specific error from +GDataServiceError, or GDATA_SERVICE_ERROR_PROTOCOL_ERROR in the general case.

+

If a GCancellable is provided in cancellable +, the download operation may be cancelled at any time from another thread using g_cancellable_cancel(). +In this case, any ongoing network activity will be stopped, and any pending or future calls to GInputStream API on the GDataDownloadStream will +return G_IO_ERROR_CANCELLED. Note that the GCancellable objects which can be passed to individual GInputStream operations will not cancel the +download operation proper if cancelled — they will merely cancel that API call. The only way to cancel the download operation completely is using +this cancellable +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

service

a GDataService

 

domain

the GDataAuthorizationDomain to authorize the download, or NULL.

[allow-none]

download_uri

the URI to download; this must be HTTPS

 

cancellable

a GCancellable for the entire download stream, or NULL.

[allow-none]
+
+
+

Returns

+

a new GInputStream, or NULL; unref with g_object_unref()

+
+

Since: 0.9.0

+
+
+
+

gdata_download_stream_get_service ()

+
GDataService *
+gdata_download_stream_get_service (GDataDownloadStream *self);
+

Gets the service used to authorize the download, as passed to gdata_download_stream_new().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDownloadStream

 
+
+
+

Returns

+

the GDataService used to authorize the download.

+

[transfer none]

+
+

Since: 0.5.0

+
+
+
+

gdata_download_stream_get_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_download_stream_get_authorization_domain
+                               (GDataDownloadStream *self);
+

Gets the authorization domain used to authorize the download, as passed to gdata_download_stream_new(). It may be NULL if authorization is not +needed for the download.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDownloadStream

 
+
+
+

Returns

+

the GDataAuthorizationDomain used to authorize the download, or NULL.

+

[transfer none][allow-none]

+
+

Since: 0.9.0

+
+
+
+

gdata_download_stream_get_cancellable ()

+
GCancellable *
+gdata_download_stream_get_cancellable (GDataDownloadStream *self);
+

Gets the GCancellable for the entire download operation, “cancellable”.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDownloadStream

 
+
+
+

Returns

+

the GCancellable for the entire download operation.

+

[transfer none]

+
+

Since: 0.8.0

+
+
+
+

gdata_download_stream_get_download_uri ()

+
const gchar *
+gdata_download_stream_get_download_uri
+                               (GDataDownloadStream *self);
+

Gets the URI of the file being downloaded, as passed to gdata_download_stream_new().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDownloadStream

 
+
+
+

Returns

+

the URI of the file being downloaded

+
+

Since: 0.5.0

+
+
+
+

gdata_download_stream_get_content_type ()

+
const gchar *
+gdata_download_stream_get_content_type
+                               (GDataDownloadStream *self);
+

Gets the content type of the file being downloaded. If the Content-Type header has not yet +been received, NULL will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDownloadStream

 
+
+
+

Returns

+

the content type of the file being downloaded, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_download_stream_get_content_length ()

+
gssize
+gdata_download_stream_get_content_length
+                               (GDataDownloadStream *self);
+

Gets the length (in bytes) of the file being downloaded. If the Content-Length header has not yet +been received from the server, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataDownloadStream

 
+
+
+

Returns

+

the content length of the file being downloaded, or -1

+
+

Since: 0.5.0

+
+
+
+

Types and Values

+
+

GDataDownloadStream

+
typedef struct _GDataDownloadStream GDataDownloadStream;
+

All the fields in the GDataDownloadStream structure are private and should never be accessed directly.

+

Since: 0.5.0

+
+
+
+

GDataDownloadStreamClass

+
typedef struct {
+} GDataDownloadStreamClass;
+
+

All the fields in the GDataDownloadStreamClass structure are private and should never be accessed directly.

+

Since: 0.5.0

+
+
+
+

Property Details

+
+

The “authorization-domain” property

+
  “authorization-domain”     GDataAuthorizationDomain *
+

The authorization domain for the download, against which the “authorizer” for the “service” should be +authorized. This may be NULL if authorization is not needed for the download.

+

Flags: Read / Write / Construct Only

+

Since: 0.9.0

+
+
+
+

The “cancellable” property

+
  “cancellable”              GCancellable *
+

An optional cancellable used to cancel the entire download operation. If a GCancellable instance isn't provided for this property at +construction time (i.e. to gdata_download_stream_new()), one will be created internally and can be retrieved using +gdata_download_stream_get_cancellable() and used to cancel the download operation with g_cancellable_cancel() just as if it was passed to +gdata_download_stream_new().

+

If the download operation is cancelled using this GCancellable, any ongoing network activity will be stopped, and any pending or future +calls to GInputStream API on the GDataDownloadStream will return G_IO_ERROR_CANCELLED. Note that the GCancellable objects which can be +passed to individual GInputStream operations will not cancel the download operation proper if cancelled — they will merely cancel that API +call. The only way to cancel the download operation completely is using “cancellable”.

+

Flags: Read / Write / Construct Only

+

Since: 0.8.0

+
+
+
+

The “content-length” property

+
  “content-length”           glong
+

The length (in bytes) of the file being downloaded. This will initially be -1, and will be populated as soon as +the appropriate header is received from the server. Its value will never change after this.

+

Note that change notifications for this property (“notify” emissions) may be emitted in threads other than the one which created +the GDataDownloadStream. It is the client's responsibility to ensure that any notification signal handlers are either multi-thread safe +or marshal the notification to the thread which owns the GDataDownloadStream as appropriate.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.5.0

+
+
+
+

The “content-type” property

+
  “content-type”             gchar *
+

The content type of the file being downloaded. This will initially be NULL, and will be populated as soon as the appropriate header is +received from the server. Its value will never change after this.

+

Note that change notifications for this property (“notify” emissions) may be emitted in threads other than the one which created +the GDataDownloadStream. It is the client's responsibility to ensure that any notification signal handlers are either multi-thread safe +or marshal the notification to the thread which owns the GDataDownloadStream as appropriate.

+

Flags: Read

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “download-uri” property

+
  “download-uri”             gchar *
+

The URI of the file to download. This must be HTTPS.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “service” property

+
  “service”                  GDataService *
+

The service which is used to authorize the download, and to which the download relates.

+

Flags: Read / Write / Construct Only

+

Since: 0.5.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataEntry.html b/docs/reference/html/GDataEntry.html new file mode 100644 index 0000000..1094f20 --- /dev/null +++ b/docs/reference/html/GDataEntry.html @@ -0,0 +1,1249 @@ + + + + +GDataEntry: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataEntry

+

GDataEntry — GData entry object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataEntry * + +gdata_entry_new () +
const gchar * + +gdata_entry_get_title () +
+void + +gdata_entry_set_title () +
const gchar * + +gdata_entry_get_summary () +
+void + +gdata_entry_set_summary () +
const gchar * + +gdata_entry_get_id () +
const gchar * + +gdata_entry_get_etag () +
const gchar * + +gdata_entry_get_content () +
+void + +gdata_entry_set_content () +
const gchar * + +gdata_entry_get_content_uri () +
+void + +gdata_entry_set_content_uri () +
+gint64 + +gdata_entry_get_published () +
+gint64 + +gdata_entry_get_updated () +
+GList * + +gdata_entry_get_authors () +
+void + +gdata_entry_add_author () +
+void + +gdata_entry_add_category () +
+GList * + +gdata_entry_get_categories () +
+void + +gdata_entry_add_link () +
+gboolean + +gdata_entry_remove_link () +
+GDataLink * + +gdata_entry_look_up_link () +
+GList * + +gdata_entry_look_up_links () +
+gboolean + +gdata_entry_is_inserted () +
const gchar * + +gdata_entry_get_rights () +
+void + +gdata_entry_set_rights () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *contentRead / Write
+gchar *content-uriRead / Write
+gchar *etagRead / Write / Construct Only
+gchar *idRead / Write / Construct Only
gbooleanis-insertedRead
gint64publishedRead
+gchar *rightsRead / Write
+gchar *summaryRead / Write
+gchar *titleRead / Write
gint64updatedRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataEntry
 GDataEntryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ├── GDataAccessRule
+            ├── GDataCalendarCalendar
+            ├── GDataCalendarEvent
+            ├── GDataComment
+            ├── GDataContactsContact
+            ├── GDataContactsGroup
+            ├── GDataDocumentsEntry
+            ├── GDataFreebaseResult
+            ├── GDataPicasaWebAlbum
+            ├── GDataPicasaWebFile
+            ├── GDataPicasaWebUser
+            ├── GDataTasksTask
+            ├── GDataTasksTasklist
+            ╰── GDataYouTubeVideo
+
+
+
+

Known Derived Interfaces

+

+GDataEntry is required by + GDataAccessHandler and GDataCommentable.

+
+
+

Includes

+
#include <gdata/gdata-entry.h>
+
+
+
+

Description

+

GDataEntry represents a single object on the online service, such as a playlist, video or calendar event. It is a snapshot of the +state of that object at the time of querying the service, so modifications made to a GDataEntry will not be automatically or +magically propagated to the server.

+
+
+

Functions

+
+

gdata_entry_new ()

+
GDataEntry *
+gdata_entry_new (const gchar *id);
+

Creates a new GDataEntry with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the entry's ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataEntry; unref with g_object_unref()

+
+
+
+
+

gdata_entry_get_title ()

+
const gchar *
+gdata_entry_get_title (GDataEntry *self);
+

Returns the title of the entry. This will never be NULL, but may be an empty string.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

the entry's title

+
+
+
+
+

gdata_entry_set_title ()

+
void
+gdata_entry_set_title (GDataEntry *self,
+                       const gchar *title);
+

Sets the title of the entry.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

title

the new entry title, or NULL.

[allow-none]
+
+
+
+
+

gdata_entry_get_summary ()

+
const gchar *
+gdata_entry_get_summary (GDataEntry *self);
+

Returns the summary of the entry.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

the entry's summary, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_entry_set_summary ()

+
void
+gdata_entry_set_summary (GDataEntry *self,
+                         const gchar *summary);
+

Sets the summary of the entry.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

summary

the new entry summary, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_entry_get_id ()

+
const gchar *
+gdata_entry_get_id (GDataEntry *self);
+

Returns the URN ID of the entry; a unique and permanent identifier for the object the entry represents.

+

The ID may be NULL if and only if the GDataEntry has been newly created, and hasn't yet been inserted on the server.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

the entry's ID, or NULL.

+

[nullable]

+
+
+
+
+

gdata_entry_get_etag ()

+
const gchar *
+gdata_entry_get_etag (GDataEntry *self);
+

Returns the ETag of the entry; a unique identifier for each version of the entry. For more information, see the

+online documentation. +

The ETag will never be empty; it's either NULL or a valid ETag.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

the entry's ETag, or NULL.

+

[nullable]

+
+

Since: 0.2.0

+
+
+
+

gdata_entry_get_content ()

+
const gchar *
+gdata_entry_get_content (GDataEntry *self);
+

Returns the textual content in this entry. If the content in this entry is pointed to by a URI, NULL will be returned; the content URI will be +returned by gdata_entry_get_content_uri().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

the entry's content, or NULL

+
+
+
+
+

gdata_entry_set_content ()

+
void
+gdata_entry_set_content (GDataEntry *self,
+                         const gchar *content);
+

Sets the entry's content to content +. This unsets “content-uri”.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

content

the new content for the entry, or NULL.

[allow-none]
+
+
+
+
+

gdata_entry_get_content_uri ()

+
const gchar *
+gdata_entry_get_content_uri (GDataEntry *self);
+

Returns a URI pointing to the content of this entry. If the content in this entry is stored directly, NULL will be returned; the content will be +returned by gdata_entry_get_content().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

a URI pointing to the entry's content, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_entry_set_content_uri ()

+
void
+gdata_entry_set_content_uri (GDataEntry *self,
+                             const gchar *content_uri);
+

Sets the URI pointing to the entry's content to content +. This unsets “content”.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

content_uri

the new URI pointing to the content for the entry, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_entry_get_published ()

+
gint64
+gdata_entry_get_published (GDataEntry *self);
+

Gets the time the entry was originally published.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

the UNIX timestamp for the original publish time of the entry

+
+
+
+
+

gdata_entry_get_updated ()

+
gint64
+gdata_entry_get_updated (GDataEntry *self);
+

Gets the time the entry was last updated.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

the UNIX timestamp for the last update of the entry

+
+
+
+
+

gdata_entry_get_authors ()

+
GList *
+gdata_entry_get_authors (GDataEntry *self);
+

Gets a list of the GDataAuthors for this entry.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

a GList of GDataAuthors.

+

[element-type GData.Author][transfer none]

+
+

Since: 0.7.0

+
+
+
+

gdata_entry_add_author ()

+
void
+gdata_entry_add_author (GDataEntry *self,
+                        GDataAuthor *author);
+

Adds author + to the list of authors in the given GDataEntry and increments its reference count.

+

Duplicate authors will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

author

a GDataAuthor to add

 
+
+
+
+
+

gdata_entry_add_category ()

+
void
+gdata_entry_add_category (GDataEntry *self,
+                          GDataCategory *category);
+

Adds category + to the list of categories in the given GDataEntry, and increments its reference count.

+

Duplicate categories will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

category

a GDataCategory to add

 
+
+
+
+
+

gdata_entry_get_categories ()

+
GList *
+gdata_entry_get_categories (GDataEntry *self);
+

Gets a list of the GDataCategorys containing this entry.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

a GList of GDataCategorys.

+

[element-type GData.Category][transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_entry_add_link ()

+
void
+gdata_entry_add_link (GDataEntry *self,
+                      GDataLink *_link);
+

Adds _link + to the list of links in the given GDataEntry and increments its reference count.

+

Duplicate links will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

_link

a GDataLink to add

 
+
+
+
+
+

gdata_entry_remove_link ()

+
gboolean
+gdata_entry_remove_link (GDataEntry *self,
+                         GDataLink *_link);
+

Removes _link + from the list of links in the given GDataEntry and decrements its reference count (since the GDataEntry held a reference to it +while it was in the list).

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

_link

a GDataLink to remove

 
+
+
+

Returns

+

TRUE if _link +was found in the GDataEntry and removed, FALSE if it was not found

+
+

Since: 0.10.0

+
+
+
+

gdata_entry_look_up_link ()

+
GDataLink *
+gdata_entry_look_up_link (GDataEntry *self,
+                          const gchar *rel);
+

Looks up a link by relation type from the list of links in the entry. If the link has one of the standard Atom relation types, +use one of the defined rel + values, instead of a static string. e.g. GDATA_LINK_EDIT or GDATA_LINK_SELF.

+

In the rare event of requiring a list of links with the same rel + value, use gdata_entry_look_up_links().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

rel

the value of the rel attribute of the desired link

 
+
+
+

Returns

+

a GDataLink, or NULL if one was not found.

+

[transfer none]

+
+

Since: 0.1.1

+
+
+
+

gdata_entry_look_up_links ()

+
GList *
+gdata_entry_look_up_links (GDataEntry *self,
+                           const gchar *rel);
+

Looks up a list of links by relation type from the list of links in the entry. If the links have one of the standard Atom +relation types, use one of the defined rel + values, instead of a static string. e.g. GDATA_LINK_EDIT or GDATA_LINK_SELF.

+

If you will only use the first link found, consider calling gdata_entry_look_up_link() instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

rel

the value of the rel attribute of the desired links

 
+
+
+

Returns

+

a GList of GDataLinks, or NULL if none were found; free the list with +g_list_free().

+

[element-type GData.Link][transfer container]

+
+

Since: 0.4.0

+
+
+
+

gdata_entry_is_inserted ()

+
gboolean
+gdata_entry_is_inserted (GDataEntry *self);
+

Returns whether the entry is marked as having been inserted on (uploaded to) the server already.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

TRUE if the entry has been inserted already, FALSE otherwise

+
+
+
+
+

gdata_entry_get_rights ()

+
const gchar *
+gdata_entry_get_rights (GDataEntry *self);
+

Returns the rights pertaining to the entry, or NULL if not set.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataEntry

 
+
+
+

Returns

+

the entry's rights information

+
+

Since: 0.5.0

+
+
+
+

gdata_entry_set_rights ()

+
void
+gdata_entry_set_rights (GDataEntry *self,
+                        const gchar *rights);
+

Sets the rights for this entry.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataEntry

 

rights

the new rights, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

Types and Values

+
+

GDataEntry

+
typedef struct _GDataEntry GDataEntry;
+

All the fields in the GDataEntry structure are private and should never be accessed directly.

+
+
+
+

GDataEntryClass

+
typedef struct {
+	GDataParsableClass parent;
+
+	gchar *(*get_entry_uri) (const gchar *id); /* G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC */
+	const gchar *kind_term;
+} GDataEntryClass;
+
+

The class structure for the GDataEntry type.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GDataParsableClass parent;

the parent class

 

get_entry_uri ()

a function to build the entry URI for the entry, given its entry ID; free the URI with g_free()

 

const gchar *kind_term;

+

the term for this entry's kind category (see the

+documentation on kinds)
 
+
+
+
+
+

Property Details

+
+

The “content” property

+
  “content”                  gchar *
+

The content of the entry. This is mutually exclusive with “content”.

+

For more information, see the Atom specification.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “content-uri” property

+
  “content-uri”              gchar *
+

A URI pointing to the location of the content of the entry. This is mutually exclusive with “content”.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “etag” property

+
  “etag”                     gchar *
+

An identifier for a particular version of the entry. This changes every time the entry on the server changes, and can be used +for conditional retrieval and locking.

+

For more information, see the +GData specification.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.2.0

+
+
+
+

The “id” property

+
  “id”                       gchar *
+

A permanent, universally unique identifier for the entry, in IRI form. This is NULL for new entries (i.e. ones which haven't yet been +inserted on the server, created with gdata_entry_new()), and a non-empty IRI string for all other entries.

+

For more information, see the +Atom specification.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+
+
+
+

The “is-inserted” property

+
  “is-inserted”              gboolean
+

Whether the entry has been inserted on the server. This is FALSE for entries which have just been created using gdata_entry_new() and +TRUE for entries returned from the server by queries. It is set to TRUE when an entry is inserted using gdata_service_insert_entry().

+

Flags: Read

+

Default value: FALSE

+
+
+
+

The “published” property

+
  “published”                gint64
+

The date and time the entry was first published or made available.

+

For more information, see the Atom specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “rights” property

+
  “rights”                   gchar *
+

The ownership rights pertaining to the entry.

+

For more information, see the Atom specification.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “summary” property

+
  “summary”                  gchar *
+

A short summary, abstract, or excerpt of the entry.

+

For more information, see the Atom specification.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “title” property

+
  “title”                    gchar *
+

A human-readable title for the entry.

+

For more information, see the Atom specification.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “updated” property

+
  “updated”                  gint64
+

The date and time when the entry was most recently updated significantly.

+

For more information, see the Atom specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataFeed.html b/docs/reference/html/GDataFeed.html new file mode 100644 index 0000000..ecf84e9 --- /dev/null +++ b/docs/reference/html/GDataFeed.html @@ -0,0 +1,1019 @@ + + + + +GDataFeed: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataFeed

+

GDataFeed — GData feed object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
const gchar * + +gdata_feed_get_title () +
const gchar * + +gdata_feed_get_subtitle () +
const gchar * + +gdata_feed_get_id () +
const gchar * + +gdata_feed_get_etag () +
+GList * + +gdata_feed_get_authors () +
+GList * + +gdata_feed_get_categories () +
+GList * + +gdata_feed_get_entries () +
+GDataEntry * + +gdata_feed_look_up_entry () +
+GDataGenerator * + +gdata_feed_get_generator () +
+GList * + +gdata_feed_get_links () +
+GDataLink * + +gdata_feed_look_up_link () +
const gchar * + +gdata_feed_get_logo () +
const gchar * + +gdata_feed_get_icon () +
+gint64 + +gdata_feed_get_updated () +
const gchar * + +gdata_feed_get_rights () +
+guint + +gdata_feed_get_start_index () +
+guint + +gdata_feed_get_total_results () +
+guint + +gdata_feed_get_items_per_page () +
const gchar * + +gdata_feed_get_next_page_token () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *etagRead
+GDataGenerator *generatorRead
+gchar *iconRead
+gchar *idRead
guintitems-per-pageRead
+gchar *logoRead
+gchar *next-page-tokenRead
+gchar *rightsRead
guintstart-indexRead
+gchar *subtitleRead
+gchar *titleRead
guinttotal-resultsRead
gint64updatedRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataFeed
 GDataFeedClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataFeed
+            ├── GDataCalendarFeed
+            ├── GDataDocumentsFeed
+            ├── GDataPicasaWebFeed
+            ╰── GDataYouTubeFeed
+
+
+
+

Includes

+
#include <gdata/gdata-feed.h>
+
+
+
+

Description

+

GDataFeed is a list of entries (GDataEntry) returned as the result of a query to a GDataService, or given as the input to another +operation on the online service. It also has pieces of data associated with the query on the GDataService, such as the query title +or timestamp when it was last updated.

+

Each GDataEntry represents a single object on the online service, such as a playlist, video or calendar entry, and the GDataFeed +represents a collection of similar objects.

+
+
+

Functions

+
+

gdata_feed_get_title ()

+
const gchar *
+gdata_feed_get_title (GDataFeed *self);
+

Returns the title of the feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the feed's title

+
+
+
+
+

gdata_feed_get_subtitle ()

+
const gchar *
+gdata_feed_get_subtitle (GDataFeed *self);
+

Returns the subtitle of the feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the feed's subtitle, or NULL

+
+
+
+
+

gdata_feed_get_id ()

+
const gchar *
+gdata_feed_get_id (GDataFeed *self);
+

Returns the feed's unique and permanent URN ID.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the feed's ID

+
+
+
+
+

gdata_feed_get_etag ()

+
const gchar *
+gdata_feed_get_etag (GDataFeed *self);
+

Returns the feed's unique ETag for this version.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the feed's ETag

+
+

Since: 0.2.0

+
+
+
+

gdata_feed_get_authors ()

+
GList *
+gdata_feed_get_authors (GDataFeed *self);
+

Returns a list of the authors listed in this feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

a GList of GDataAuthors.

+

[element-type GData.Author][transfer none]

+
+
+
+
+

gdata_feed_get_categories ()

+
GList *
+gdata_feed_get_categories (GDataFeed *self);
+

Returns a list of the categories listed in this feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

a GList of GDataCategorys.

+

[element-type GData.Category][transfer none]

+
+
+
+
+

gdata_feed_get_entries ()

+
GList *
+gdata_feed_get_entries (GDataFeed *self);
+

Returns a list of the entries contained in this feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

a GList of GDataEntrys.

+

[element-type GData.Entry][transfer none]

+
+
+
+
+

gdata_feed_look_up_entry ()

+
GDataEntry *
+gdata_feed_look_up_entry (GDataFeed *self,
+                          const gchar *id);
+

Returns the entry in the feed with the given id +, if found.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataFeed

 

id

the entry's ID

 
+
+
+

Returns

+

the GDataEntry, or NULL.

+

[transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_feed_get_generator ()

+
GDataGenerator *
+gdata_feed_get_generator (GDataFeed *self);
+

Returns details about the software which generated the feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

a GDataGenerator, or NULL.

+

[transfer none]

+
+
+
+
+

gdata_feed_get_links ()

+
GList *
+gdata_feed_get_links (GDataFeed *self);
+

Returns a list of the links listed in this feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

a GList of GDataLinks.

+

[element-type GData.Link][transfer none]

+
+
+
+
+

gdata_feed_look_up_link ()

+
GDataLink *
+gdata_feed_look_up_link (GDataFeed *self,
+                         const gchar *rel);
+

Looks up a link by “relation-type” value from the list of links in the feed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataFeed

 

rel

the value of the “relation-type” property of the desired link

 
+
+
+

Returns

+

a GDataLink, or NULL if one was not found.

+

[transfer none]

+
+

Since: 0.1.1

+
+
+
+

gdata_feed_get_logo ()

+
const gchar *
+gdata_feed_get_logo (GDataFeed *self);
+

Returns the logo URI of the feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the feed's logo URI, or NULL

+
+
+
+
+

gdata_feed_get_icon ()

+
const gchar *
+gdata_feed_get_icon (GDataFeed *self);
+

Returns the icon URI of the feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the feed's icon URI, or NULL

+
+

Since: 0.6.0

+
+
+
+

gdata_feed_get_updated ()

+
gint64
+gdata_feed_get_updated (GDataFeed *self);
+

Gets the time the feed was last updated.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the UNIX timestamp for the time the feed was last updated

+
+
+
+
+

gdata_feed_get_rights ()

+
const gchar *
+gdata_feed_get_rights (GDataFeed *self);
+

Returns the rights pertaining to the entire feed, or NULL if not set.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the feed's rights information

+
+

Since: 0.7.0

+
+
+
+

gdata_feed_get_start_index ()

+
guint
+gdata_feed_get_start_index (GDataFeed *self);
+

Returns the one-based start index of the results feed in the result set.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the one-based start index, or 0

+
+
+
+
+

gdata_feed_get_total_results ()

+
guint
+gdata_feed_get_total_results (GDataFeed *self);
+

Returns the total number of results in the result set, including results on other +pages. If this is zero, the total number is unknown.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the total number of results, or 0

+
+
+
+
+

gdata_feed_get_items_per_page ()

+
guint
+gdata_feed_get_items_per_page (GDataFeed *self);
+

Returns the number of items per results page feed.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the number of items per results page feed, or 0

+
+
+
+
+

gdata_feed_get_next_page_token ()

+
const gchar *
+gdata_feed_get_next_page_token (GDataFeed *self);
+

Returns the next page token for a query result, or NULL if not set. +This is “next-page-token”. The page token might not be set if there +is no next page, or if this service does not use token based paging (for +example, if it uses page number or offset based paging instead). Most more +recent services use token based paging.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFeed

 
+
+
+

Returns

+

the next page token.

+

[nullable]

+
+

Since: 0.17.7

+
+
+
+

Types and Values

+
+

GDataFeed

+
typedef struct _GDataFeed GDataFeed;
+

All the fields in the GDataFeed structure are private and should never be accessed directly.

+
+
+
+

GDataFeedClass

+
typedef struct {
+} GDataFeedClass;
+
+

All the fields in the GDataFeedClass structure are private and should never be accessed directly.

+
+
+
+

Property Details

+
+

The “etag” property

+
  “etag”                     gchar *
+

The unique ETag for this version of the feed. See the

+online documentation for +

more information.

+

Flags: Read

+

Default value: NULL

+

Since: 0.2.0

+
+
+
+

The “generator” property

+
  “generator”                GDataGenerator *
+

Details of the software used to generate the feed.

+

API reference: +atom:generator

+

Flags: Read

+
+
+
+

The “icon” property

+
  “icon”                     gchar *
+

The URI of an icon for the feed.

+

API reference:

+atom:icon

Flags: Read

+

Default value: NULL

+

Since: 0.6.0

+
+
+
+

The “id” property

+
  “id”                       gchar *
+

The unique and permanent URN ID for the feed.

+

API reference: atom:id

+

Flags: Read

+

Default value: NULL

+
+
+
+

The “items-per-page” property

+
  “items-per-page”           guint
+

The number of items per results page feed.

+

API reference:

+ +openSearch:itemsPerPage

Flags: Read

+

Default value: 0

+
+
+
+

The “logo” property

+
  “logo”                     gchar *
+

The URI of a logo for the feed.

+

API reference: atom:logo

+

Flags: Read

+

Default value: NULL

+
+
+
+

The “next-page-token” property

+
  “next-page-token”          gchar *
+

The next page token for feeds. Pass this to +gdata_query_set_page_token() to advance to the next page when +querying APIs which use page tokens rather than page numbers or +offsets.

+

Flags: Read

+

Default value: NULL

+

Since: 0.17.7

+
+
+
+

The “rights” property

+
  “rights”                   gchar *
+

The ownership rights pertaining to the entire feed.

+

For more information, see the Atom specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “start-index” property

+
  “start-index”              guint
+

The one-based index of the first item in the results feed.

+

This should not be used manually for pagination. Instead, use a GDataQuery and call its gdata_query_next_page() +or gdata_query_previous_page() functions before making the query to the service.

+

API reference: +openSearch:startIndex

+

Flags: Read

+

Allowed values: >= 1

+

Default value: 1

+
+
+
+

The “subtitle” property

+
  “subtitle”                 gchar *
+

The subtitle of the feed.

+

API reference: atom:subtitle

+

Flags: Read

+

Default value: NULL

+
+
+
+

The “title” property

+
  “title”                    gchar *
+

The title of the feed.

+

API reference:

+atom:title

Flags: Read

+

Default value: NULL

+
+
+
+

The “total-results” property

+
  “total-results”            guint
+

The number of items in the result set for the feed, including those on other pages. If this is zero, the total number is unknown.

+

This should not be used manually for pagination. Instead, use a GDataQuery and call its gdata_query_next_page() +or gdata_query_previous_page() functions before making the query to the service.

+

API reference:

+ +openSearch:totalResults

Flags: Read

+

Allowed values: <= 1000000

+

Default value: 0

+
+
+
+

The “updated” property

+
  “updated”                  gint64
+

The time the feed was last updated.

+

API reference: +atom:updated

+

Flags: Read

+

Allowed values: >= 0

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataFreebaseQuery.html b/docs/reference/html/GDataFreebaseQuery.html new file mode 100644 index 0000000..117bd40 --- /dev/null +++ b/docs/reference/html/GDataFreebaseQuery.html @@ -0,0 +1,248 @@ + + + + +GDataFreebaseQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataFreebaseQuery

+

GDataFreebaseQuery — GData Freebase query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + +
+GDataFreebaseQuery * + +gdata_freebase_query_new () +
+GDataFreebaseQuery * + +gdata_freebase_query_new_from_variant () +
+
+
+

Properties

+
+++++ + + + + + +
+GVariant *variantRead / Write / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataFreebaseQuery
 GDataFreebaseQueryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ╰── GDataFreebaseQuery
+
+
+
+

Includes

+
#include <gdata/services/freebase/gdata-freebase-query.h>
+
+
+
+

Description

+

GDataFreebaseQuery represents a MQL query specific to the Google Freebase service.

+

This implementation of GDataQuery respects the gdata_query_set_max_results() call.

+

For more details of Google Freebase API, see the +online documentation.

+
+
+

Functions

+
+

gdata_freebase_query_new ()

+
GDataFreebaseQuery *
+gdata_freebase_query_new (const gchar *mql);
+
+

gdata_freebase_query_new has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates a new GDataFreebaseQuery with the MQL query provided in mql +. MQL +is a JSON-based query language, analogous to SPARQL. To learn more about MQL, +see the +MQL overview and +cookbook.

+

For detailed information on Freebase schemas, The "Schema" +section on the main site allows for natural search and navigation through the multiple data properties and domains.

+
+

Parameters

+
+++++ + + + + + +

mql

a MQL query string

 
+
+
+

Returns

+

a new GDataFreebaseQuery.

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_query_new_from_variant ()

+
GDataFreebaseQuery *
+gdata_freebase_query_new_from_variant (GVariant *variant);
+
+

gdata_freebase_query_new_from_variant has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates a new GDataFreebaseQuery with the MQL query provided in a serialized form as variant + +of type "a{smv}" containing the JSON data tree of a MQL query. One convenient way +to build the variant is using json_gvariant_serialize() from a JsonNode. For more information +about MQL, see gdata_freebase_query_new().

+

GDataFreebaseQuery takes ownership on variant +, if it has a floating reference, it will be sunk. +Otherwise an extra reference will be added.

+
+

Parameters

+
+++++ + + + + + +

variant

a variant containing the MQL query structure

 
+
+
+

Returns

+

a new GDataFreebaseQuery.

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

Types and Values

+
+

GDataFreebaseQuery

+
typedef struct _GDataFreebaseQuery GDataFreebaseQuery;
+

GDataFreebaseQuery is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseQuery structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseQueryClass

+
typedef struct {
+} GDataFreebaseQueryClass;
+
+

GDataFreebaseQueryClass is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseQueryClass structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

Property Details

+
+

The “variant” property

+
  “variant”                  GVariant *
+

Variant containing the MQL query. The variant is a very generic container of type "a{smv}", +containing (possibly nested) Freebase schema types and values.

+
+

GDataFreebaseQuery:variant has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Flags: Read / Write / Construct Only

+

Allowed values: GVariant<a{smv}>

+

Default value: NULL

+

Since: 0.15.1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataFreebaseResult.html b/docs/reference/html/GDataFreebaseResult.html new file mode 100644 index 0000000..a53ca3b --- /dev/null +++ b/docs/reference/html/GDataFreebaseResult.html @@ -0,0 +1,222 @@ + + + + +GDataFreebaseResult: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataFreebaseResult

+

GDataFreebaseResult — GData Freebase result object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + +
+GDataFreebaseResult * + +gdata_freebase_result_new () +
+GVariant * + +gdata_freebase_result_dup_variant () +
+
+
+

Properties

+
+++++ + + + + + +
+GVariant *variantRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataFreebaseResult
 GDataFreebaseResultClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataFreebaseResult
+                ├── GDataFreebaseSearchResult
+                ╰── GDataFreebaseTopicResult
+
+
+
+

Includes

+
#include <gdata/services/freebase/gdata-freebase-result.h>
+
+
+
+

Description

+

GDataFreebaseResult is a subclass of GDataEntry to represent the result of a Google Freebase MQL query.

+

For more details of Google Freebase API, see the +online documentation.

+
+
+

Functions

+
+

gdata_freebase_result_new ()

+
GDataFreebaseResult *
+gdata_freebase_result_new (void);
+
+

gdata_freebase_result_new has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates a new GDataFreebaseResult.

+
+

Returns

+

a new GDataFreebaseResult; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_result_dup_variant ()

+
GVariant *
+gdata_freebase_result_dup_variant (GDataFreebaseResult *self);
+
+

gdata_freebase_result_dup_variant has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Gets the result serialized as a GVariant of type "a{smv}", containing the JSON +data tree. This variant can be alternatively processed through json_gvariant_serialize().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFreebaseResult

 
+
+
+

Returns

+

the serialized result, or NULL; unref with g_variant_unref().

+

[allow-none][transfer full]

+
+

Since: 0.15.1

+
+
+
+

Types and Values

+
+

GDataFreebaseResult

+
typedef struct _GDataFreebaseResult GDataFreebaseResult;
+

GDataFreebaseResult is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseResult structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseResultClass

+
typedef struct {
+} GDataFreebaseResultClass;
+
+

GDataFreebaseResultClass is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseResultClass structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

Property Details

+
+

The “variant” property

+
  “variant”                  GVariant *
+

Variant containing the MQL result. The variant is a very generic container of type "a{smv}", +containing (possibly nested) Freebase schema types and values.

+
+

GDataFreebaseResult:variant has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Flags: Read

+

Allowed values: GVariant<a{smv}>

+

Default value: NULL

+

Since: 0.15.1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataFreebaseSearchQuery.html b/docs/reference/html/GDataFreebaseSearchQuery.html new file mode 100644 index 0000000..08a57de --- /dev/null +++ b/docs/reference/html/GDataFreebaseSearchQuery.html @@ -0,0 +1,628 @@ + + + + +GDataFreebaseSearchQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataFreebaseSearchQuery

+

GDataFreebaseSearchQuery — GData Freebase query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Properties

+
+++++ + + + + + + + + + + + + +
+gchar *languageRead / Write
gbooleanstemmedRead / Write
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ╰── GDataFreebaseSearchQuery
+
+
+
+

Includes

+
#include <gdata/services/freebase/gdata-freebase-query.h>
+
+
+
+

Description

+

GDataFreebaseQuery represents a collection of query parameters specific to the Google Freebase service. +a GDataFreebaseQuery is built on top of a search term, further filters can be set on the search query +through gdata_freebase_search_query_add_filter() or gdata_freebase_search_query_add_location(). The filters +can be nested in sublevels, created through gdata_freebase_search_query_open_filter() +and gdata_freebase_search_query_close_filter().

+

For more details of Google Freebase API, see the +online documentation.

+
+
+

Functions

+
+

gdata_freebase_search_query_new ()

+
GDataFreebaseSearchQuery *
+gdata_freebase_search_query_new (const gchar *search_terms);
+
+

gdata_freebase_search_query_new has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates a new GDataFreebaseSearchQuery prepared to search for Freebase elements that +match the given search_terms +. Further filters on the query can be set through +gdata_freebase_search_query_add_filter() or gdata_freebase_search_query_add_location().

+
+

Parameters

+
+++++ + + + + + +

search_terms

string to search for

 
+
+
+

Returns

+

a new GDataFreebaseSearchQuery; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_query_set_language ()

+
void
+gdata_freebase_search_query_set_language
+                               (GDataFreebaseSearchQuery *self,
+                                const gchar *lang);
+
+

gdata_freebase_search_query_set_language has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Sets the language used, both on the search terms and the results. If unset, +the locale preferences will be respected.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataFreebaseSearchQuery

 

lang

Language used on the search terms and results, in ISO-639-1 format, or NULL to unset.

[allow-none]
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_query_get_language ()

+
const gchar *
+gdata_freebase_search_query_get_language
+                               (GDataFreebaseSearchQuery *self);
+
+

gdata_freebase_search_query_get_language has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Gets the language set on the search query, or NULL if unset.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFreebaseSearchQuery

 
+
+
+

Returns

+

The language used on the query.

+

[allow-none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_query_set_stemmed ()

+
void
+gdata_freebase_search_query_set_stemmed
+                               (GDataFreebaseSearchQuery *self,
+                                gboolean stemmed);
+
+

gdata_freebase_search_query_set_stemmed has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Sets whether stemming is performed on the provided search terms. If stemmed + is TRUE, +words like eg. "natural", "naturally" or "nature" would be all reduced to the root "natur" +for search purposes.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataFreebaseSearchQuery

 

stemmed

TRUE to perform stemming on the search results

 
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_query_get_stemmed ()

+
gboolean
+gdata_freebase_search_query_get_stemmed
+                               (GDataFreebaseSearchQuery *self);
+
+

gdata_freebase_search_query_get_stemmed has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns whether the GDataFreebaseSearchQuery will perform stemming on the search terms.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFreebaseSearchQuery

 
+
+
+

Returns

+

TRUE if the GDataFreebaseSearchQuery performs stemming

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_query_open_filter ()

+
void
+gdata_freebase_search_query_open_filter
+                               (GDataFreebaseSearchQuery *self,
+                                GDataFreebaseSearchFilterType filter_type);
+
+

gdata_freebase_search_query_open_filter has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Opens a container of filter rules, those are applied according to the behavior specified by filter_type +. +Every call to this function must be paired by a call to gdata_freebase_search_query_close_filter().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataFreebaseSearchQuery

 

filter_type

filter type

 
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_query_close_filter ()

+
void
+gdata_freebase_search_query_close_filter
+                               (GDataFreebaseSearchQuery *self);
+
+

gdata_freebase_search_query_close_filter has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Closes a filter level.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFreebaseSearchQuery

 
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_query_add_filter ()

+
void
+gdata_freebase_search_query_add_filter
+                               (GDataFreebaseSearchQuery *self,
+                                const gchar *property,
+                                const gchar *value);
+
+

gdata_freebase_search_query_add_filter has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Adds a property filter to the query. property filters are always nested in +containers, opened and closed through gdata_freebase_search_query_open_filter() +and gdata_freebase_search_query_close_filter().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataFreebaseSearchQuery

 

property

Freebase property ID

 

value

match string

 
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_query_add_location ()

+
void
+gdata_freebase_search_query_add_location
+                               (GDataFreebaseSearchQuery *self,
+                                guint64 radius,
+                                gdouble lat,
+                                gdouble lon);
+
+

gdata_freebase_search_query_add_location has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Adds a geolocation filter to the query. location filters are always nested in +containers, opened and closed through gdata_freebase_search_query_open_filter() +and gdata_freebase_search_query_close_filter().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataFreebaseSearchQuery

 

radius

radius in meters

 

lat

latitude

 

lon

longitude

 
+
+

Since: 0.15.1

+
+
+
+

Types and Values

+
+

GDataFreebaseSearchQuery

+
typedef struct _GDataFreebaseSearchQuery GDataFreebaseSearchQuery;
+

GDataFreebaseSearchQuery is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseSearchQuery structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseSearchQueryClass

+
typedef struct {
+} GDataFreebaseSearchQueryClass;
+
+

GDataFreebaseSearchQueryClass is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseSearchQueryClass structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

enum GDataFreebaseSearchFilterType

+

GDataFreebaseSearchFilterType is deprecated and should not be used in newly-written code.

+

Search filter container types.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GDATA_FREEBASE_SEARCH_FILTER_ALL

+

all enclosed elements must match, logically an AND

+
 

GDATA_FREEBASE_SEARCH_FILTER_ANY

+

any of the enclosed elements must match, logically an OR

+
 

GDATA_FREEBASE_SEARCH_FILTER_NOT

+

the match is inverted.

+
 
+
+

Since: 0.15.1

+
+
+
+

Property Details

+
+

The “language” property

+
  “language”                 gchar *
+

Language used for search results, in ISO-639-1 format.

+
+

GDataFreebaseSearchQuery:language has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.15.1

+
+
+
+

The “stemmed” property

+
  “stemmed”                  gboolean
+

Whether word stemming should happen on the search terms. If this property is enabled, +words like eg. "natural", "naturally" or "nature" would be all reduced to the root "natur" +for search purposes.

+
+

GDataFreebaseSearchQuery:stemmed has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.15.1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataFreebaseSearchResult.html b/docs/reference/html/GDataFreebaseSearchResult.html new file mode 100644 index 0000000..c1bd9e7 --- /dev/null +++ b/docs/reference/html/GDataFreebaseSearchResult.html @@ -0,0 +1,572 @@ + + + + +GDataFreebaseSearchResult: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataFreebaseSearchResult

+

GDataFreebaseSearchResult — GData Freebase search result object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GBoxed
+    ╰── GDataFreebaseSearchResultItem
+    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataFreebaseResult
+                ╰── GDataFreebaseSearchResult
+
+
+
+

Includes

+
#include <gdata/services/freebase/gdata-freebase-result.h>
+
+
+
+

Description

+

GDataFreebaseSearchResult is a subclass of GDataEntry to represent the result of a Freebase search query.

+

For more details of Google Freebase API, see the +online documentation.

+
+
+

Functions

+
+

gdata_freebase_search_result_new ()

+
GDataFreebaseSearchResult *
+gdata_freebase_search_result_new (void);
+
+

gdata_freebase_search_result_new has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates a new GDataFreebaseSearchResult with the given ID and default properties.

+
+

Returns

+

a new GDataFreebaseSearchResult; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_get_num_items ()

+
guint
+gdata_freebase_search_result_get_num_items
+                               (GDataFreebaseSearchResult *self);
+
+

gdata_freebase_search_result_get_num_items has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the number of items contained in this result.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFreebaseSearchResult

 
+
+
+

Returns

+

The number of items

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_get_total_hits ()

+
guint
+gdata_freebase_search_result_get_total_hits
+                               (GDataFreebaseSearchResult *self);
+
+

gdata_freebase_search_result_get_total_hits has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the total number of hits found for the search query.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFreebaseSearchResult

 
+
+
+

Returns

+

the total number of hits.

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_get_item ()

+
const GDataFreebaseSearchResultItem *
+gdata_freebase_search_result_get_item (GDataFreebaseSearchResult *self,
+                                       guint i);
+
+

gdata_freebase_search_result_get_item has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Gets an item from the search result.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataFreebaseSearchResult

 

i

number of item to retrieve

 
+
+
+

Returns

+

a search result item, or NULL on invalid item.

+

[transfer none][allow-none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_item_get_mid ()

+
const gchar *
+gdata_freebase_search_result_item_get_mid
+                               (const GDataFreebaseSearchResultItem *item);
+
+

gdata_freebase_search_result_item_get_mid has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the machine-encoded ID (MID) of the search result item. Elements may +have a single MID, as opposed to the potentially multiple Freebase IDs that +may point to it. MIDs are usable interchangeably with Freebase IDs.

+
+

Parameters

+
+++++ + + + + + +

item

a GDataFreebaseSearchResultItem

 
+
+
+

Returns

+

The result item MID.

+

[transfer none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_item_get_id ()

+
const gchar *
+gdata_freebase_search_result_item_get_id
+                               (const GDataFreebaseSearchResultItem *item);
+
+

gdata_freebase_search_result_item_get_id has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the Freebase ID of the search result item.

+
+

Parameters

+
+++++ + + + + + +

item

a GDataFreebaseSearchResultItem

 
+
+
+

Returns

+

The search result item Freebase ID.

+

[transfer none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_item_get_name ()

+
const gchar *
+gdata_freebase_search_result_item_get_name
+                               (const GDataFreebaseSearchResultItem *item);
+
+

gdata_freebase_search_result_item_get_name has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the human readable name of the search result item.

+
+

Parameters

+
+++++ + + + + + +

item

a GDataFreebaseSearchResultItem

 
+
+
+

Returns

+

The human readable name of the item.

+

[transfer none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_item_get_language ()

+
const gchar *
+gdata_freebase_search_result_item_get_language
+                               (const GDataFreebaseSearchResultItem *item);
+
+

gdata_freebase_search_result_item_get_language has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Gets the language of this search result item, in ISO-639-1 format.

+
+

Parameters

+
+++++ + + + + + +

item

a GDataFreebaseSearchResultItem

 
+
+
+

Returns

+

The language of the search result item.

+

[transfer none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_item_get_notable_id ()

+
const gchar *
+gdata_freebase_search_result_item_get_notable_id
+                               (const GDataFreebaseSearchResultItem *item);
+
+

gdata_freebase_search_result_item_get_notable_id has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

If this search result item is notable in an specific topic, this function +returns the Freebase ID of this topic.

+
+

Parameters

+
+++++ + + + + + +

item

a GDataFreebaseSearchResultItem

 
+
+
+

Returns

+

The topic the result item is most notable of, or NULL.

+

[transfer none][allow-none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_item_get_notable_name ()

+
const gchar *
+gdata_freebase_search_result_item_get_notable_name
+                               (const GDataFreebaseSearchResultItem *item);
+
+

gdata_freebase_search_result_item_get_notable_name has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

If this search result item is notable in an specific topic, this function +returns the human readable name of this topic.

+
+

Parameters

+
+++++ + + + + + +

item

a GDataFreebaseSearchResultItem

 
+
+
+

Returns

+

The human readable topic name, or NULL.

+

[transfer none][allow-none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_search_result_item_get_score ()

+
gdouble
+gdata_freebase_search_result_item_get_score
+                               (const GDataFreebaseSearchResultItem *item);
+
+

gdata_freebase_search_result_item_get_score has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the score of this search result item. The higher, the more relevant this +item seems, given the search terms.

+
+

Parameters

+
+++++ + + + + + +

item

a GDataFreebaseSearchResultItem

 
+
+
+

Returns

+

the result item score.

+
+

Since: 0.15.1

+
+
+
+

Types and Values

+
+

GDataFreebaseSearchResult

+
typedef struct _GDataFreebaseSearchResult GDataFreebaseSearchResult;
+

GDataFreebaseSearchResult is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseSearchResult structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseSearchResultClass

+
typedef struct {
+} GDataFreebaseSearchResultClass;
+
+

GDataFreebaseSearchResultClass is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseSearchResultClass structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseSearchResultItem

+
typedef struct _GDataFreebaseSearchResultItem GDataFreebaseSearchResultItem;
+

GDataFreebaseSearchResultItem is deprecated and should not be used in newly-written code.

+

Opaque struct holding data for a single search result item.

+

Since: 0.15.1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataFreebaseService.html b/docs/reference/html/GDataFreebaseService.html new file mode 100644 index 0000000..030757b --- /dev/null +++ b/docs/reference/html/GDataFreebaseService.html @@ -0,0 +1,708 @@ + + + + +GDataFreebaseService: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataFreebaseService

+

GDataFreebaseService — GData Freebase service object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Properties

+
+++++ + + + + + +
+gchar *developer-keyRead / Write / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataFreebaseService
 GDataFreebaseServiceClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataService
+        ╰── GDataFreebaseService
+
+
+
+

Includes

+
#include <gdata/services/freebase/gdata-freebase-service.h>
+
+
+
+

Description

+

GDataFreebaseService is a subclass of GDataService for communicating with the Google Freebase API. It supports queries +in MQL format, that allows highly flexible queries on any topic. MQL is a JSON based query language, MQL requests consist +of a mix of defined and empty values for types in the Freebase schema, those "placeholder" values will be filled in on the +reply. For more information and examples, see the +MQL overview page.

+

For more details of Google Freebase API, see the +online documentation.

+

Since August 2016, Google has retired Freebase, +so all of these APIs will return an error if used; and should be considered +deprecated.

+
+
+

Functions

+
+

gdata_freebase_service_new ()

+
GDataFreebaseService *
+gdata_freebase_service_new (const gchar *developer_key,
+                            GDataAuthorizer *authorizer);
+
+

gdata_freebase_service_new has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates a new GDataFreebaseService using the given GDataAuthorizer. If authorizer + is NULL, all requests are made as an unauthenticated user. +Having both developer_key + and authorizer + set to NULL is allowed, but this should be reserved for debugging situations, as there is a certain +key-less quota for those purposes. If this service is used on any code intended to be deployed, one or both of developer_key + and authorizer + +should be non-NULL and valid.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

developer_key

developer key to use the API, or NULL.

[allow-none]

authorizer

a GDataAuthorizer to authorize the service's requests, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataFreebaseService; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_service_get_primary_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_freebase_service_get_primary_authorization_domain
+                               (void);
+
+

gdata_freebase_service_get_primary_authorization_domain has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

The primary GDataAuthorizationDomain for interacting with Freebase. This will not normally need to be used, as it's used internally +by the GDataFreebaseService methods. However, if using the plain GDataService methods to implement custom queries or requests which libgdata +does not support natively, then this domain may be needed to authorize the requests.

+

The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.

+
+

Returns

+

the service's authorization domain.

+

[transfer none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_service_query ()

+
GDataFreebaseResult *
+gdata_freebase_service_query (GDataFreebaseService *self,
+                              GDataFreebaseQuery *query,
+                              GCancellable *cancellable,
+                              GError **error);
+
+

gdata_freebase_service_query has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Performs a MQL query on the service, you can find out more about MQL in the online MQL documentation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataFreebaseService

 

query

a GDataFreebaseQuery with the MQL query

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

a GDataFreebaseResult containing the query result; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_service_query_async ()

+
void
+gdata_freebase_service_query_async (GDataFreebaseService *self,
+                                    GDataFreebaseQuery *query,
+                                    GCancellable *cancellable,
+                                    GAsyncReadyCallback callback,
+                                    gpointer user_data);
+
+

gdata_freebase_service_query_async has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Performs a MQL query on the service. self + and query + are all reffed when this function is called, so can safely +be unreffed after this function returns. When the query is replied, or fails, callback + will be executed, and +the result can be obtained through gdata_service_query_single_entry_finish().

+

For more details, see gdata_freebase_service_query(), which is the synchronous version of +this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataFreebaseService

 

query

a GDataFreebaseQuery with the MQL query

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_service_get_topic ()

+
GDataFreebaseTopicResult *
+gdata_freebase_service_get_topic (GDataFreebaseService *self,
+                                  GDataFreebaseTopicQuery *query,
+                                  GCancellable *cancellable,
+                                  GError **error);
+
+

gdata_freebase_service_get_topic has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Queries information about a topic, identified through a Freebase ID. You can find out more about topic queries in the

+online documentation. +
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataFreebaseService

 

query

a GDataFreebaseTopicQuery containing the topic ID

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

a GDataFreebaseTopicResult containing information about the topic; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_service_get_topic_async ()

+
void
+gdata_freebase_service_get_topic_async
+                               (GDataFreebaseService *self,
+                                GDataFreebaseTopicQuery *query,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+
+

gdata_freebase_service_get_topic_async has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Queries information about a topic, identified through a Freebase ID. self + and query + are all reffed when this +function is called, so can safely be unreffed after this function returns. When the query is replied, or fails, +callback + will be executed, and the result can be obtained through gdata_service_query_single_entry_finish().

+

For more details, see gdata_freebase_service_get_topic(), which is the synchronous version of +this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataFreebaseService

 

query

a GDataFreebaseQuery with the MQL query

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_service_search ()

+
GDataFreebaseSearchResult *
+gdata_freebase_service_search (GDataFreebaseService *self,
+                               GDataFreebaseSearchQuery *query,
+                               GCancellable *cancellable,
+                               GError **error);
+
+

gdata_freebase_service_search has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Performs a search for any given search term, filters can be set on query + to narrow down the results. The results returned +are ordered by relevance. You can find out more about topic queries in the

+online documentation. +
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataFreebaseService

 

query

a GDataFreebaseSearchQuery containing the topic ID

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

a GDataFreebaseSearchResult containing the results for the given search query; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_service_search_async ()

+
void
+gdata_freebase_service_search_async (GDataFreebaseService *self,
+                                     GDataFreebaseSearchQuery *query,
+                                     GCancellable *cancellable,
+                                     GAsyncReadyCallback callback,
+                                     gpointer user_data);
+
+

gdata_freebase_service_search_async has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Performs a search for any given search term. self + and query + are all reffed when this +function is called, so can safely be unreffed after this function returns.

+

For more details, see gdata_freebase_service_search(), which is the synchronous version of +this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataFreebaseService

 

query

a GDataFreebaseQuery with the MQL query

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_service_get_image ()

+
GInputStream *
+gdata_freebase_service_get_image (GDataFreebaseService *self,
+                                  GDataFreebaseTopicValue *value,
+                                  GCancellable *cancellable,
+                                  guint max_width,
+                                  guint max_height,
+                                  GError **error);
+
+

gdata_freebase_service_get_image has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates an input stream to an image object returned in a topic query. If max_width + and max_height + +are unspecified (i.e. set to 0), the image returned will be the smallest available.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataFreebaseService

 

value

a GDataFreebaseTopicValue from a topic result

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

max_width

maximum width of the image returned, or 0

 

max_height

maximum height of the image returned, or 0

 

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

a GInputStream opened to the image; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

Types and Values

+
+

GDataFreebaseService

+
typedef struct _GDataFreebaseService GDataFreebaseService;
+

GDataFreebaseService is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseService structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseServiceClass

+
typedef struct {
+} GDataFreebaseServiceClass;
+
+

GDataFreebaseServiceClass is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseServiceClass structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

Property Details

+
+

The “developer-key” property

+
  “developer-key”            gchar *
+

The developer key your application has registered with the Freebase API. For more information, see the online documentation.

+
+

GDataFreebaseService:developer-key has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.15.1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataFreebaseTopicQuery.html b/docs/reference/html/GDataFreebaseTopicQuery.html new file mode 100644 index 0000000..2e49cf3 --- /dev/null +++ b/docs/reference/html/GDataFreebaseTopicQuery.html @@ -0,0 +1,390 @@ + + + + +GDataFreebaseTopicQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataFreebaseTopicQuery

+

GDataFreebaseTopicQuery — GData Freebase topic query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+GDataFreebaseTopicQuery * + +gdata_freebase_topic_query_new () +
+void + +gdata_freebase_topic_query_set_filter () +
const gchar * const * + +gdata_freebase_topic_query_get_filter () +
+void + +gdata_freebase_topic_query_set_language () +
const gchar * + +gdata_freebase_topic_query_get_language () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + +
GStrvfilterRead / Write
+gchar *languageRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataFreebaseTopicQuery
 GDataFreebaseTopicQueryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ╰── GDataFreebaseTopicQuery
+
+
+
+

Includes

+
#include <gdata/services/freebase/gdata-freebase-topic-query.h>
+
+
+
+

Description

+

GDataFreebaseTopicQuery represents a Freebase topic query. The topic query happens on a single Freebase ID, +given in gdata_freebase_topic_query_new(), the reply returns all known information in Freebase for that given ID. +For more documentation and examples, see the +Topic response API documentation

+

This implementation of GDataQuery respects the gdata_query_set_max_results() and gdata_query_set_updated_max() calls.

+

For more details of Google Freebase API, see the +online documentation.

+
+
+

Functions

+
+

gdata_freebase_topic_query_new ()

+
GDataFreebaseTopicQuery *
+gdata_freebase_topic_query_new (const gchar *id);
+
+

gdata_freebase_topic_query_new has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates a new GDataFreebaseTopicQuery for the given Freebase ID. Those can be +obtained programmatically through gdata_freebase_search_result_item_get_id() or +embedded in the result of a gdata_freebase_service_query() call.

+
+

Parameters

+
+++++ + + + + + +

id

a Freebase ID or MID

 
+
+
+

Returns

+

a new GDataFreebaseTopicQuery.

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_query_set_filter ()

+
void
+gdata_freebase_topic_query_set_filter (GDataFreebaseTopicQuery *self,
+                                       const gchar * const *filter);
+
+

gdata_freebase_topic_query_set_filter has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Sets a filter on the properties to be returned by the GDataFreebaseTopicQuery, a filter string usually contains either +a specific property (eg. "/common/topic/description", or "/computer/software/first_released"), or a property domain +(eg. "/common/topic", or "/computer"), all properties pertaining to the domain will be returned through the +GDataFreebaseTopicResult in the latter case. Other special strings can be passed as filter strings, those are documented +in the Topic API overview

+

If multiple filter strings are set, the result will contain all information necessary to satisfy each of those individually. +If no filter is set, the "commons" special value will be implicitly assumed, which returns a reasonably complete data set.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataFreebaseTopicQuery

 

filter

NULL-terminated array of filter strings, or NULL to unset.

[array zero-terminated=1][allow-none]
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_query_get_filter ()

+
const gchar * const *
+gdata_freebase_topic_query_get_filter (GDataFreebaseTopicQuery *self);
+
+

gdata_freebase_topic_query_get_filter has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Gets the filter set on the topic query, or NULL if unset.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFreebaseTopicQuery

 
+
+
+

Returns

+

The filter used on the query.

+

[array zero-terminated=1][transfer none][allow-none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_query_set_language ()

+
void
+gdata_freebase_topic_query_set_language
+                               (GDataFreebaseTopicQuery *self,
+                                const gchar *lang);
+
+

gdata_freebase_topic_query_set_language has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Sets the language used in the topic query. If unset, +the locale preferences will be respected.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataFreebaseTopicQuery

 

lang

language used on the topic query, in ISO-639-1 format, or NULL to unset the language.

[allow-none]
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_query_get_language ()

+
const gchar *
+gdata_freebase_topic_query_get_language
+                               (GDataFreebaseTopicQuery *self);
+
+

gdata_freebase_topic_query_get_language has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Gets the language set on the topic query, or NULL if unset.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFreebaseTopicQuery

 
+
+
+

Returns

+

The language used on the query.

+

[allow-none]

+
+

Since: 0.15.1

+
+
+
+

Types and Values

+
+

GDataFreebaseTopicQuery

+
typedef struct _GDataFreebaseTopicQuery GDataFreebaseTopicQuery;
+

GDataFreebaseTopicQuery is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseTopicQuery structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseTopicQueryClass

+
typedef struct {
+} GDataFreebaseTopicQueryClass;
+
+

GDataFreebaseTopicQueryClass is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseTopicQueryClass structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

Property Details

+
+

The “filter” property

+
  “filter”                   GStrv
+

Array of properties (eg. "/common/topic/description", or "/computer/software/first_released"), or property +domains (eg. "/common/topic", or "/computer") to be used as filter.

+
+

GDataFreebaseTopicQuery:filter has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Flags: Read / Write

+

Since: 0.15.1

+
+
+
+

The “language” property

+
  “language”                 gchar *
+

Language used for topic values in the result, in ISO-639-1 format.

+
+

GDataFreebaseTopicQuery:language has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.15.1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataFreebaseTopicResult.html b/docs/reference/html/GDataFreebaseTopicResult.html new file mode 100644 index 0000000..8adba00 --- /dev/null +++ b/docs/reference/html/GDataFreebaseTopicResult.html @@ -0,0 +1,1130 @@ + + + + +GDataFreebaseTopicResult: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataFreebaseTopicResult

+

GDataFreebaseTopicResult — GData Freebase topic result object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataFreebaseTopicResult * + +gdata_freebase_topic_result_new () +
+GDataFreebaseTopicObject * + +gdata_freebase_topic_result_dup_object () +
+GDataFreebaseTopicObject * + +gdata_freebase_topic_object_ref () +
+void + +gdata_freebase_topic_object_unref () +
+GPtrArray * + +gdata_freebase_topic_object_list_properties () +
const gchar * + +gdata_freebase_topic_object_get_id () +
+guint64 + +gdata_freebase_topic_object_get_property_count () +
+guint64 + +gdata_freebase_topic_object_get_property_hits () +
+GDataFreebaseTopicValue * + +gdata_freebase_topic_object_get_property_value () +
+GDataFreebaseTopicValue * + +gdata_freebase_topic_value_ref () +
+void + +gdata_freebase_topic_value_unref () +
const gchar * + +gdata_freebase_topic_value_get_property () +
const gchar * + +gdata_freebase_topic_value_get_text () +
const gchar * + +gdata_freebase_topic_value_get_language () +
const gchar * + +gdata_freebase_topic_value_get_creator () +
+gint64 + +gdata_freebase_topic_value_get_timestamp () +
+GType + +gdata_freebase_topic_value_get_value_type () +
+void + +gdata_freebase_topic_value_copy_value () +
+gint64 + +gdata_freebase_topic_value_get_int () +
+gdouble + +gdata_freebase_topic_value_get_double () +
const gchar * + +gdata_freebase_topic_value_get_string () +
const GDataFreebaseTopicObject * + +gdata_freebase_topic_value_get_object () +
+gboolean + +gdata_freebase_topic_value_is_image () +
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GBoxed
+    ├── GDataFreebaseTopicObject
+    ╰── GDataFreebaseTopicValue
+    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataFreebaseResult
+                ╰── GDataFreebaseTopicResult
+
+
+
+

Includes

+
#include <gdata/services/freebase/gdata-freebase-topic-result.h>
+
+
+
+

Description

+

GDataFreebaseTopicResult is a subclass of GDataFreebaseResult that contains all or a subset of the information +contained in Freebase about the Freebase ID given to the GDataFreebaseTopicQuery.

+

For more details of Google Freebase API, see the +online documentation.

+
+
+

Functions

+
+

gdata_freebase_topic_result_new ()

+
GDataFreebaseTopicResult *
+gdata_freebase_topic_result_new (void);
+
+

gdata_freebase_topic_result_new has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates a new GDataFreebaseTopicResult with the given ID and default properties.

+
+

Returns

+

a new GDataFreebaseTopicResult; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_result_dup_object ()

+
GDataFreebaseTopicObject *
+gdata_freebase_topic_result_dup_object
+                               (GDataFreebaseTopicResult *self);
+
+

gdata_freebase_topic_result_dup_object has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns a reference to the root GDataFreebaseTopicObject containing the +topic query results.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataFreebaseTopicResult

 
+
+
+

Returns

+

A new reference on the result object, unref with +gdata_freebase_topic_object_unref().

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_object_ref ()

+
GDataFreebaseTopicObject *
+gdata_freebase_topic_object_ref (GDataFreebaseTopicObject *object);
+
+

gdata_freebase_topic_object_ref has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates and returns a new reference on object +.

+
+

Parameters

+
+++++ + + + + + +

object

a GDataFreebaseTopicObject

 
+
+
+

Returns

+

object +, with an extra reference.

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_object_unref ()

+
void
+gdata_freebase_topic_object_unref (GDataFreebaseTopicObject *object);
+
+

gdata_freebase_topic_object_unref has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Removes a reference from object +. If the reference count drops to 0, +the object is freed.

+
+

Parameters

+
+++++ + + + + + +

object

a GDataFreebaseTopicResult.

[transfer full]
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_object_list_properties ()

+
GPtrArray *
+gdata_freebase_topic_object_list_properties
+                               (const GDataFreebaseTopicObject *object);
+
+

gdata_freebase_topic_object_list_properties has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the list of Freebase properties described by object +.

+
+

Parameters

+
+++++ + + + + + +

object

a GDataFreebaseTopicObject

 
+
+
+

Returns

+

An array of property names, free with g_ptr_array_unref().

+

[transfer container][element-type gchar*]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_object_get_id ()

+
const gchar *
+gdata_freebase_topic_object_get_id (const GDataFreebaseTopicObject *object);
+
+

gdata_freebase_topic_object_get_id has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Gets the Freebase ID for this specific object.

+
+

Parameters

+
+++++ + + + + + +

object

a GDataFreebaseTopicObject

 
+
+
+

Returns

+

the Freebase ID of this object.

+

[transfer none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_object_get_property_count ()

+
guint64
+gdata_freebase_topic_object_get_property_count
+                               (const GDataFreebaseTopicObject *object,
+                                const gchar *property);
+
+

gdata_freebase_topic_object_get_property_count has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the number of values that object + holds for the given property +. If object + +contains no information about property +, 0 is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

object

a GDataFreebaseTopicObject

 

property

a property name contained in object +

 
+
+
+

Returns

+

The number of values contained for property +

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_object_get_property_hits ()

+
guint64
+gdata_freebase_topic_object_get_property_hits
+                               (const GDataFreebaseTopicObject *object,
+                                const gchar *property);
+
+

gdata_freebase_topic_object_get_property_hits has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the total number of hits that the Freebase database stores +for this object, this number either equals or is greater than +gdata_freebase_topic_object_get_property_count(), the query limit +can be controlled through gdata_query_set_max_results() on the topic +query.

+

If object + contains no information about property +, 0 is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

object

a GDataFreebaseTopicObject

 

property

a property name contained in object +

 
+
+
+

Returns

+

the total number of hits for this property

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_object_get_property_value ()

+
GDataFreebaseTopicValue *
+gdata_freebase_topic_object_get_property_value
+                               (const GDataFreebaseTopicObject *object,
+                                const gchar *property,
+                                gint64 item);
+
+

gdata_freebase_topic_object_get_property_value has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Gets the value that object + stores for this property +/item + pair, as a generic +GDataFreebaseTopicValue. If object + contains no information about property +, +or item + is outside the [0..gdata_freebase_topic_object_get_property_count() - 1] +range, NULL is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

object

a GDataFreebaseTopicObject

 

property

a property name contained in object +

 

item

item number to retrieve from property +

 
+
+
+

Returns

+

the value for this property/item.

+

[allow-none][transfer none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_ref ()

+
GDataFreebaseTopicValue *
+gdata_freebase_topic_value_ref (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_ref has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Creates and returns a new reference on value +.

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

value +, with an extra reference.

+

[transfer full]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_unref ()

+
void
+gdata_freebase_topic_value_unref (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_unref has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Removes a reference from value +. If the reference count drops to 0, +the object is freed.

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue.

[transfer full]
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_property ()

+
const gchar *
+gdata_freebase_topic_value_get_property
+                               (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_property has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the property name that this value describes

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

the property name of value +

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_text ()

+
const gchar *
+gdata_freebase_topic_value_get_text (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_text has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns a textual representation of this value, this is either +the value contained transformed to a string, or a concatenation +of subvalues for compound types.

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

a textual representation of value +

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_language ()

+
const gchar *
+gdata_freebase_topic_value_get_language
+                               (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_language has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the language used in the content of value +

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

the language value +is written in

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_creator ()

+
const gchar *
+gdata_freebase_topic_value_get_creator
+                               (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_creator has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the Freebase ID of the user that created this value.

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

the creator of this value, as a Freebase ID

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_timestamp ()

+
gint64
+gdata_freebase_topic_value_get_timestamp
+                               (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_timestamp has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the time at which this value was created in the Freebase database. +It's a UNIX timestamp in seconds since the epoch. If value + has no timestamp, +-1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

value

GDataFreebaseTopicValue

 
+
+
+

Returns

+

The creation time of value +, or -1

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_value_type ()

+
GType
+gdata_freebase_topic_value_get_value_type
+                               (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_value_type has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns the GType of the real value held in value +.

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

the GType of the contained value

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_copy_value ()

+
void
+gdata_freebase_topic_value_copy_value (GDataFreebaseTopicValue *value,
+                                       GValue *gvalue);
+
+

gdata_freebase_topic_value_copy_value has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Copies in gvalue + the value held in value +. the GValue must be later freed through g_value_unset()

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

value

a GDataFreebaseTopicValue

 

gvalue

an empty GValue.

[out caller-allocates][transfer full]
+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_int ()

+
gint64
+gdata_freebase_topic_value_get_int (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_int has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns a gint64 value held in value +. It is only valid to call this if the GType is a G_TYPE_INT64

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

the gint64 value

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_double ()

+
gdouble
+gdata_freebase_topic_value_get_double (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_double has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns a gdouble value held in value +. It is only valid to call this if the GType is a G_TYPE_DOUBLE

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

the gdouble value

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_string ()

+
const gchar *
+gdata_freebase_topic_value_get_string (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_string has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns a string value held in value +. It is only valid to call this if the GType is a G_TYPE_STRING

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

the string value

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_get_object ()

+
const GDataFreebaseTopicObject *
+gdata_freebase_topic_value_get_object (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_get_object has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns a compound/complex object held in value +. It is only valid to call this if the GType is a +GDATA_TYPE_FREEBASE_TOPIC_OBJECT.

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

the compound value as a GDataFreebaseTopicObject.

+

[transfer none]

+
+

Since: 0.15.1

+
+
+
+

gdata_freebase_topic_value_is_image ()

+
gboolean
+gdata_freebase_topic_value_is_image (GDataFreebaseTopicValue *value);
+
+

gdata_freebase_topic_value_is_image has been deprecated since version 0.17.7 and should not be used in newly-written code.

+

Google Freebase has been permanently shut down.

+
+

Returns true if value + holds a freebase image object, on such values it +will be valid to call gdata_freebase_service_get_image() to get a stream +to the image itself.

+
+

Parameters

+
+++++ + + + + + +

value

a GDataFreebaseTopicValue

 
+
+
+

Returns

+

Whether value +holds a Freebase image object

+
+

Since: 0.15.1

+
+
+
+

Types and Values

+
+

GDataFreebaseTopicResult

+
typedef struct _GDataFreebaseTopicResult GDataFreebaseTopicResult;
+

GDataFreebaseTopicResult is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseTopicResult structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseTopicResultClass

+
typedef struct {
+} GDataFreebaseTopicResultClass;
+
+

GDataFreebaseTopicResultClass is deprecated and should not be used in newly-written code.

+

All the fields in the GDataFreebaseTopicResultClass structure are private and should never be accessed directly.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseTopicObject

+
typedef struct _GDataFreebaseTopicObject GDataFreebaseTopicObject;
+

GDataFreebaseTopicObject is deprecated and should not be used in newly-written code.

+

Opaque struct containing a Freebase topic object. This object may contain one or more +GDataFreebaseTopicValue structs, which may in turn contain nested GDataFreebaseTopicObject +structs to express complex data.

+

Since: 0.15.1

+
+
+
+

GDataFreebaseTopicValue

+
typedef struct _GDataFreebaseTopicValue GDataFreebaseTopicValue;
+

GDataFreebaseTopicValue is deprecated and should not be used in newly-written code.

+

Opaque struct containing a value of a Freebase topic object. This struct may contain a simple +value (integers, doubles, strings...) or complex values, expressed through a GDataFreebaseTopicObject.

+

Since: 0.15.1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGContactCalendar.html b/docs/reference/html/GDataGContactCalendar.html new file mode 100644 index 0000000..579c63e --- /dev/null +++ b/docs/reference/html/GDataGContactCalendar.html @@ -0,0 +1,614 @@ + + + + +GDataGContactCalendar: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGContactCalendar

+

GDataGContactCalendar — gContact calendar element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGContactCalendar * + +gdata_gcontact_calendar_new () +
const gchar * + +gdata_gcontact_calendar_get_uri () +
+void + +gdata_gcontact_calendar_set_uri () +
const gchar * + +gdata_gcontact_calendar_get_relation_type () +
+void + +gdata_gcontact_calendar_set_relation_type () +
const gchar * + +gdata_gcontact_calendar_get_label () +
+void + +gdata_gcontact_calendar_set_label () +
+gboolean + +gdata_gcontact_calendar_is_primary () +
+void + +gdata_gcontact_calendar_set_is_primary () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
gbooleanis-primaryRead / Write
+gchar *labelRead / Write
+gchar *relation-typeRead / Write
+gchar *uriRead / Write
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGContactCalendar
+
+
+
+

Implemented Interfaces

+

+GDataGContactCalendar implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gcontact/gdata-gcontact-calendar.h>
+
+
+
+

Description

+

GDataGContactCalendar represents a "calendarLink" element from the

+gContact specification. + +
+
+

Functions

+
+

gdata_gcontact_calendar_new ()

+
GDataGContactCalendar *
+gdata_gcontact_calendar_new (const gchar *uri,
+                             const gchar *relation_type,
+                             const gchar *label,
+                             gboolean is_primary);
+

Creates a new GDataGContactCalendar. More information is available in the gContact specification.

+

Exactly one of relation_type + and label + should be provided; the other must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

uri

the URI of the calendar

 

relation_type

the type of calendar, or NULL.

[allow-none]

label

a free-form label for the calendar, or NULL.

[allow-none]

is_primary

TRUE if this calendar is its owner's primary calendar, FALSE otherwise

 
+
+
+

Returns

+

a new GDataGContactCalendar; unref with g_object_unref()

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_calendar_get_uri ()

+
const gchar *
+gdata_gcontact_calendar_get_uri (GDataGContactCalendar *self);
+

Gets the “uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactCalendar

 
+
+
+

Returns

+

the calendar's URI

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_calendar_set_uri ()

+
void
+gdata_gcontact_calendar_set_uri (GDataGContactCalendar *self,
+                                 const gchar *uri);
+

Sets the “uri” property to uri +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactCalendar

 

uri

the new URI for the calendar

 
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_calendar_get_relation_type ()

+
const gchar *
+gdata_gcontact_calendar_get_relation_type
+                               (GDataGContactCalendar *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactCalendar

 
+
+
+

Returns

+

the type of the relation, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_calendar_set_relation_type ()

+
void
+gdata_gcontact_calendar_set_relation_type
+                               (GDataGContactCalendar *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +, +such as GDATA_GCONTACT_CALENDAR_HOME or GDATA_GCONTACT_CALENDAR_FREE_BUSY.

+

If relation_type + is NULL, the relation type will be unset. When the GDataGContactCalendar is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactCalendar

 

relation_type

the new type for the calendar, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_calendar_get_label ()

+
const gchar *
+gdata_gcontact_calendar_get_label (GDataGContactCalendar *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactCalendar

 
+
+
+

Returns

+

a free-form label for the calendar, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_calendar_set_label ()

+
void
+gdata_gcontact_calendar_set_label (GDataGContactCalendar *self,
+                                   const gchar *label);
+

Sets the “label” property to label +.

+

If label + is NULL, the label will be unset. When the GDataGContactCalendar is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactCalendar

 

label

the new free-form label for the calendar, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_calendar_is_primary ()

+
gboolean
+gdata_gcontact_calendar_is_primary (GDataGContactCalendar *self);
+

Gets the “is-primary” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactCalendar

 
+
+
+

Returns

+

TRUE if this is the contact's primary calendar, FALSE otherwise

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_calendar_set_is_primary ()

+
void
+gdata_gcontact_calendar_set_is_primary
+                               (GDataGContactCalendar *self,
+                                gboolean is_primary);
+

Sets the “is-primary” property to is_primary +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactCalendar

 

is_primary

TRUE if this is the contact's primary calendar, FALSE otherwise

 
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDATA_GCONTACT_CALENDAR_HOME

+
#define GDATA_GCONTACT_CALENDAR_HOME "home"
+
+

The relation type URI for a contact's home calendar.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_CALENDAR_WORK

+
#define GDATA_GCONTACT_CALENDAR_WORK "work"
+
+

The relation type URI for a contact's work calendar.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_CALENDAR_FREE_BUSY

+
#define GDATA_GCONTACT_CALENDAR_FREE_BUSY "free-busy"
+
+

The relation type URI for a contact's free/busy calendar.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDataGContactCalendar

+
typedef struct _GDataGContactCalendar GDataGContactCalendar;
+

All the fields in the GDataGContactCalendar structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataGContactCalendarClass

+
typedef struct {
+} GDataGContactCalendarClass;
+
+

All the fields in the GDataGContactCalendarClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “is-primary” property

+
  “is-primary”               gboolean
+

Indicates which calendar out of a group is primary.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.7.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A free-form string that identifies the type of calendar. It is mutually exclusive with “relation-type”.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of calendar. It is mutually exclusive with “label”. +Examples are GDATA_GCONTACT_CALENDAR_HOME or GDATA_GCONTACT_CALENDAR_FREE_BUSY.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “uri” property

+
  “uri”                      gchar *
+

The URI of the calendar.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGContactEvent.html b/docs/reference/html/GDataGContactEvent.html new file mode 100644 index 0000000..98bc451 --- /dev/null +++ b/docs/reference/html/GDataGContactEvent.html @@ -0,0 +1,500 @@ + + + + +GDataGContactEvent: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGContactEvent

+

GDataGContactEvent — gContact event element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGContactEvent * + +gdata_gcontact_event_new () +
+void + +gdata_gcontact_event_get_date () +
+void + +gdata_gcontact_event_set_date () +
const gchar * + +gdata_gcontact_event_get_relation_type () +
+void + +gdata_gcontact_event_set_relation_type () +
const gchar * + +gdata_gcontact_event_get_label () +
+void + +gdata_gcontact_event_set_label () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+GDate *dateRead / Write
+gchar *labelRead / Write
+gchar *relation-typeRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
#defineGDATA_GCONTACT_EVENT_ANNIVERSARY
#defineGDATA_GCONTACT_EVENT_OTHER
 GDataGContactEvent
 GDataGContactEventClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGContactEvent
+
+
+
+

Includes

+
#include <gdata/gcontact/gdata-gcontact-event.h>
+
+
+
+

Description

+

GDataGContactEvent represents a "event" element from the

+gContact specification. + +
+
+

Functions

+
+

gdata_gcontact_event_new ()

+
GDataGContactEvent *
+gdata_gcontact_event_new (const GDate *date,
+                          const gchar *relation_type,
+                          const gchar *label);
+

Creates a new GDataGContactEvent. More information is available in the gContact specification.

+

Exactly one of relation_type + and label + should be provided; the other must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

date

the date of the event

 

relation_type

the relationship between the event and its owner, or NULL.

[allow-none]

label

a human-readable label for the event, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataGContactEvent; unref with g_object_unref()

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_event_get_date ()

+
void
+gdata_gcontact_event_get_date (GDataGContactEvent *self,
+                               GDate *date);
+

Gets the “date” property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactEvent

 

date

return location for the date of the event.

[out caller-allocates]
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_event_set_date ()

+
void
+gdata_gcontact_event_set_date (GDataGContactEvent *self,
+                               const GDate *date);
+

Sets the “date” property to date +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactEvent

 

date

the new date for the event

 
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_event_get_relation_type ()

+
const gchar *
+gdata_gcontact_event_get_relation_type
+                               (GDataGContactEvent *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactEvent

 
+
+
+

Returns

+

the event's relation type, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_event_set_relation_type ()

+
void
+gdata_gcontact_event_set_relation_type
+                               (GDataGContactEvent *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type + +such as GDATA_GCONTACT_EVENT_ANNIVERSARY or GDATA_GCONTACT_EVENT_OTHER.

+

If relation_type + is NULL, the relation type will be unset. When the GDataGContactEvent is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactEvent

 

relation_type

the new relation type for the event, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_event_get_label ()

+
const gchar *
+gdata_gcontact_event_get_label (GDataGContactEvent *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactEvent

 
+
+
+

Returns

+

the event's label, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_event_set_label ()

+
void
+gdata_gcontact_event_set_label (GDataGContactEvent *self,
+                                const gchar *label);
+

Sets the “label” property to label +.

+

If label + is NULL, the label will be unset. When the GDataGContactEvent is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactEvent

 

label

the new label for the event, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDATA_GCONTACT_EVENT_ANNIVERSARY

+
#define GDATA_GCONTACT_EVENT_ANNIVERSARY "anniversary"
+
+

The relation type URI for an anniversary event.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_EVENT_OTHER

+
#define GDATA_GCONTACT_EVENT_OTHER "other"
+
+

The relation type URI for a miscellaneous event.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDataGContactEvent

+
typedef struct _GDataGContactEvent GDataGContactEvent;
+

All the fields in the GDataGContactEvent structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataGContactEventClass

+
typedef struct {
+} GDataGContactEventClass;
+
+

All the fields in the GDataGContactEventClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “date” property

+
  “date”                     GDate *
+

The date of the event.

+

For more information, see the

+GContact specification. +

Flags: Read / Write

+

Since: 0.7.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A simple string value used to name this event. It is mutually exclusive with “relation-type”. +It allows UIs to display a label such as "Wedding anniversary".

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of event. It is mutually exclusive with “label”. +Examples are GDATA_GCONTACT_EVENT_ANNIVERSARY or GDATA_GCONTACT_EVENT_OTHER.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGContactExternalID.html b/docs/reference/html/GDataGContactExternalID.html new file mode 100644 index 0000000..157a362 --- /dev/null +++ b/docs/reference/html/GDataGContactExternalID.html @@ -0,0 +1,530 @@ + + + + +GDataGContactExternalID: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGContactExternalID

+

GDataGContactExternalID — gContact externalId element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGContactExternalID * + +gdata_gcontact_external_id_new () +
const gchar * + +gdata_gcontact_external_id_get_value () +
+void + +gdata_gcontact_external_id_set_value () +
const gchar * + +gdata_gcontact_external_id_get_relation_type () +
+void + +gdata_gcontact_external_id_set_relation_type () +
const gchar * + +gdata_gcontact_external_id_get_label () +
+void + +gdata_gcontact_external_id_set_label () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *labelRead / Write
+gchar *relation-typeRead / Write
+gchar *valueRead / Write
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGContactExternalID
+
+
+
+

Implemented Interfaces

+

+GDataGContactExternalID implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gcontact/gdata-gcontact-external-id.h>
+
+
+
+

Description

+

GDataGContactExternalID represents an "externalId" element from the

+gContact specification. + +
+
+

Functions

+
+

gdata_gcontact_external_id_new ()

+
GDataGContactExternalID *
+gdata_gcontact_external_id_new (const gchar *value,
+                                const gchar *relation_type,
+                                const gchar *label);
+

Creates a new GDataGContactExternalID. More information is available in the gContact specification.

+

Exactly one of relation_type + and label + should be provided; the other must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

value

the value of the external ID

 

relation_type

the type of external ID, or NULL.

[allow-none]

label

a free-form label for the external ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataGContactExternalID; unref with g_object_unref()

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_external_id_get_value ()

+
const gchar *
+gdata_gcontact_external_id_get_value (GDataGContactExternalID *self);
+

Gets the “value” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactExternalID

 
+
+
+

Returns

+

the external ID's value

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_external_id_set_value ()

+
void
+gdata_gcontact_external_id_set_value (GDataGContactExternalID *self,
+                                      const gchar *value);
+

Sets the “value” property to value +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactExternalID

 

value

the new value for the external ID

 
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_external_id_get_relation_type ()

+
const gchar *
+gdata_gcontact_external_id_get_relation_type
+                               (GDataGContactExternalID *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactExternalID

 
+
+
+

Returns

+

the type of the relation, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_external_id_set_relation_type ()

+
void
+gdata_gcontact_external_id_set_relation_type
+                               (GDataGContactExternalID *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +, +such as GDATA_GCONTACT_EXTERNAL_ID_NETWORK or GDATA_GCONTACT_EXTERNAL_ID_ACCOUNT.

+

If relation_type + is NULL, the relation type will be unset. When the GDataGContactExternalID is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactExternalID

 

relation_type

the new type for the external ID, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_external_id_get_label ()

+
const gchar *
+gdata_gcontact_external_id_get_label (GDataGContactExternalID *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactExternalID

 
+
+
+

Returns

+

a free-form label for the external ID, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_external_id_set_label ()

+
void
+gdata_gcontact_external_id_set_label (GDataGContactExternalID *self,
+                                      const gchar *label);
+

Sets the “label” property to label +.

+

If label + is NULL, the label will be unset. When the GDataGContactExternalID is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactExternalID

 

label

the new free-form label for the external ID, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDATA_GCONTACT_EXTERNAL_ID_ACCOUNT

+
#define GDATA_GCONTACT_EXTERNAL_ID_ACCOUNT "account"
+
+

The relation type URI for an account number identifier.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_EXTERNAL_ID_CUSTOMER

+
#define GDATA_GCONTACT_EXTERNAL_ID_CUSTOMER "customer"
+
+

The relation type URI for a customer identifier.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_EXTERNAL_ID_NETWORK

+
#define GDATA_GCONTACT_EXTERNAL_ID_NETWORK "network"
+
+

The relation type URI for a network identifier.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_EXTERNAL_ID_ORGANIZATION

+
#define GDATA_GCONTACT_EXTERNAL_ID_ORGANIZATION "organization"
+
+

The relation type URI for an identifier related to an organization the contact is associated with.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDataGContactExternalID

+
typedef struct _GDataGContactExternalID GDataGContactExternalID;
+

All the fields in the GDataGContactExternalID structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataGContactExternalIDClass

+
typedef struct {
+} GDataGContactExternalIDClass;
+
+

All the fields in the GDataGContactExternalIDClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “label” property

+
  “label”                    gchar *
+

A free-form string that identifies the type of external ID. It is mutually exclusive with “relation-type”.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of external ID. It is mutually exclusive with “label”. +Examples are GDATA_GCONTACT_EXTERNAL_ID_NETWORK or GDATA_GCONTACT_EXTERNAL_ID_ACCOUNT.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “value” property

+
  “value”                    gchar *
+

The value of the external ID.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGContactJot.html b/docs/reference/html/GDataGContactJot.html new file mode 100644 index 0000000..5b3ddc8 --- /dev/null +++ b/docs/reference/html/GDataGContactJot.html @@ -0,0 +1,428 @@ + + + + +GDataGContactJot: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGContactJot

+

GDataGContactJot — gContact jot element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+GDataGContactJot * + +gdata_gcontact_jot_new () +
const gchar * + +gdata_gcontact_jot_get_content () +
+void + +gdata_gcontact_jot_set_content () +
const gchar * + +gdata_gcontact_jot_get_relation_type () +
+void + +gdata_gcontact_jot_set_relation_type () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + +
+gchar *contentRead / Write
+gchar *relation-typeRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGDATA_GCONTACT_JOT_HOME
#defineGDATA_GCONTACT_JOT_KEYWORDS
#defineGDATA_GCONTACT_JOT_OTHER
#defineGDATA_GCONTACT_JOT_USER
#defineGDATA_GCONTACT_JOT_WORK
 GDataGContactJot
 GDataGContactJotClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGContactJot
+
+
+
+

Includes

+
#include <gdata/gcontact/gdata-gcontact-jot.h>
+
+
+
+

Description

+

GDataGContactJot represents a "jot" element from the

+gContact specification. + +
+
+

Functions

+
+

gdata_gcontact_jot_new ()

+
GDataGContactJot *
+gdata_gcontact_jot_new (const gchar *content,
+                        const gchar *relation_type);
+

Creates a new GDataGContactJot. More information is available in the gContact specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

content

the content of the jot

 

relation_type

the relationship between the jot and its owner

 
+
+
+

Returns

+

a new GDataGContactJot; unref with g_object_unref()

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_jot_get_content ()

+
const gchar *
+gdata_gcontact_jot_get_content (GDataGContactJot *self);
+

Gets the “content” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactJot

 
+
+
+

Returns

+

the jot's content

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_jot_set_content ()

+
void
+gdata_gcontact_jot_set_content (GDataGContactJot *self,
+                                const gchar *content);
+

Sets the “content” property to content +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactJot

 

content

the new content

 
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_jot_get_relation_type ()

+
const gchar *
+gdata_gcontact_jot_get_relation_type (GDataGContactJot *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactJot

 
+
+
+

Returns

+

the jot's relation type

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_jot_set_relation_type ()

+
void
+gdata_gcontact_jot_set_relation_type (GDataGContactJot *self,
+                                      const gchar *relation_type);
+

Sets the “relation-type” property to relation_type + +such as GDATA_GCONTACT_JOT_HOME or GDATA_GCONTACT_JOT_OTHER.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactJot

 

relation_type

the new relation type for the jot, or NULL

 
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDATA_GCONTACT_JOT_HOME

+
#define GDATA_GCONTACT_JOT_HOME "home"
+
+

The relation type URI for a jot about a contact's home.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_JOT_KEYWORDS

+
#define GDATA_GCONTACT_JOT_KEYWORDS "keywords"
+
+

The relation type URI for a jot with keywords about a contact.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_JOT_OTHER

+
#define GDATA_GCONTACT_JOT_OTHER "other"
+
+

The relation type URI for a jot about an other facet of a contact.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_JOT_USER

+
#define GDATA_GCONTACT_JOT_USER "user"
+
+

The relation type URI for a jot about the relationship between a contact and the user.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_JOT_WORK

+
#define GDATA_GCONTACT_JOT_WORK "work"
+
+

The relation type URI for a jot about a contact's work.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDataGContactJot

+
typedef struct _GDataGContactJot GDataGContactJot;
+

All the fields in the GDataGContactJot structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataGContactJotClass

+
typedef struct {
+} GDataGContactJotClass;
+
+

All the fields in the GDataGContactJotClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “content” property

+
  “content”                  gchar *
+

The content of the jot.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of jot. Examples are GDATA_GCONTACT_JOT_HOME or GDATA_GCONTACT_JOT_OTHER.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGContactLanguage.html b/docs/reference/html/GDataGContactLanguage.html new file mode 100644 index 0000000..9c98d46 --- /dev/null +++ b/docs/reference/html/GDataGContactLanguage.html @@ -0,0 +1,373 @@ + + + + +GDataGContactLanguage: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGContactLanguage

+

GDataGContactLanguage — gContact language element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+GDataGContactLanguage * + +gdata_gcontact_language_new () +
const gchar * + +gdata_gcontact_language_get_code () +
+void + +gdata_gcontact_language_set_code () +
const gchar * + +gdata_gcontact_language_get_label () +
+void + +gdata_gcontact_language_set_label () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + +
+gchar *codeRead / Write
+gchar *labelRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataGContactLanguage
 GDataGContactLanguageClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGContactLanguage
+
+
+
+

Implemented Interfaces

+

+GDataGContactLanguage implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gcontact/gdata-gcontact-language.h>
+
+
+
+

Description

+

GDataGContactLanguage represents a "language" element from the

+gContact specification. + +
+
+

Functions

+
+

gdata_gcontact_language_new ()

+
GDataGContactLanguage *
+gdata_gcontact_language_new (const gchar *code,
+                             const gchar *label);
+

Creates a new GDataGContactLanguage. More information is available in the gContact specification.

+

Exactly one of code + and label + should be provided; the other must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

code

the language code, or NULL.

[allow-none]

label

a free-form label for the language, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataGContactLanguage; unref with g_object_unref()

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_language_get_code ()

+
const gchar *
+gdata_gcontact_language_get_code (GDataGContactLanguage *self);
+

Gets the “code” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactLanguage

 
+
+
+

Returns

+

the language's code, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_language_set_code ()

+
void
+gdata_gcontact_language_set_code (GDataGContactLanguage *self,
+                                  const gchar *code);
+

Sets the “code” property to code +.

+

If code + is NULL, the code will be unset. When the GDataGContactLanguage is used in a query, however, +exactly one of “code” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactLanguage

 

code

the new code for the language, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_language_get_label ()

+
const gchar *
+gdata_gcontact_language_get_label (GDataGContactLanguage *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactLanguage

 
+
+
+

Returns

+

a free-form label for the language, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_language_set_label ()

+
void
+gdata_gcontact_language_set_label (GDataGContactLanguage *self,
+                                   const gchar *label);
+

Sets the “label” property to label +.

+

If label + is NULL, the label will be unset. When the GDataGContactLanguage is used in a query, however, +exactly one of “code” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactLanguage

 

label

the new free-form label for the language, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDataGContactLanguage

+
typedef struct _GDataGContactLanguage GDataGContactLanguage;
+

All the fields in the GDataGContactLanguage structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataGContactLanguageClass

+
typedef struct {
+} GDataGContactLanguageClass;
+
+

All the fields in the GDataGContactLanguageClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “code” property

+
  “code”                     gchar *
+

A code identifying the language, conforming to the IETF BCP 47 specification. It is mutually exclusive with “label”.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A free-form string that identifies the language. It is mutually exclusive with “code”.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGContactRelation.html b/docs/reference/html/GDataGContactRelation.html new file mode 100644 index 0000000..c9b4b77 --- /dev/null +++ b/docs/reference/html/GDataGContactRelation.html @@ -0,0 +1,663 @@ + + + + +GDataGContactRelation: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGContactRelation

+

GDataGContactRelation — gContact relation element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGContactRelation * + +gdata_gcontact_relation_new () +
const gchar * + +gdata_gcontact_relation_get_name () +
+void + +gdata_gcontact_relation_set_name () +
const gchar * + +gdata_gcontact_relation_get_relation_type () +
+void + +gdata_gcontact_relation_set_relation_type () +
const gchar * + +gdata_gcontact_relation_get_label () +
+void + +gdata_gcontact_relation_set_label () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *labelRead / Write
+gchar *nameRead / Write
+gchar *relation-typeRead / Write
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGContactRelation
+
+
+
+

Includes

+
#include <gdata/gcontact/gdata-gcontact-relation.h>
+
+
+
+

Description

+

GDataGContactRelation represents a "relation" element from the

+gContact specification. + +
+
+

Functions

+
+

gdata_gcontact_relation_new ()

+
GDataGContactRelation *
+gdata_gcontact_relation_new (const gchar *name,
+                             const gchar *relation_type,
+                             const gchar *label);
+

Creates a new GDataGContactRelation. More information is available in the gContact specification.

+

Exactly one of relation_type + and label + should be provided; the other must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

name

the name of the relation

 

relation_type

the type of relation, or NULL.

[allow-none]

label

a free-form label for the type of relation, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataGContactRelation; unref with g_object_unref()

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_relation_get_name ()

+
const gchar *
+gdata_gcontact_relation_get_name (GDataGContactRelation *self);
+

Gets the “name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactRelation

 
+
+
+

Returns

+

the relation's name

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_relation_set_name ()

+
void
+gdata_gcontact_relation_set_name (GDataGContactRelation *self,
+                                  const gchar *name);
+

Sets the “name” property to name +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactRelation

 

name

the new name for the relation.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_relation_get_relation_type ()

+
const gchar *
+gdata_gcontact_relation_get_relation_type
+                               (GDataGContactRelation *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactRelation

 
+
+
+

Returns

+

the type of the relation, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_relation_set_relation_type ()

+
void
+gdata_gcontact_relation_set_relation_type
+                               (GDataGContactRelation *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +, +such as GDATA_GCONTACT_RELATION_MANAGER or GDATA_GCONTACT_RELATION_CHILD.

+

If relation_type + is NULL, the relation type will be unset. When the GDataGContactRelation is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactRelation

 

relation_type

the new type for the relation, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_relation_get_label ()

+
const gchar *
+gdata_gcontact_relation_get_label (GDataGContactRelation *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactRelation

 
+
+
+

Returns

+

a free-form label for the type of the relation, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_relation_set_label ()

+
void
+gdata_gcontact_relation_set_label (GDataGContactRelation *self,
+                                   const gchar *label);
+

Sets the “label” property to label +.

+

If label + is NULL, the label will be unset. When the GDataGContactRelation is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactRelation

 

label

the new free-form type for the relation, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDATA_GCONTACT_RELATION_ASSISTANT

+
#define GDATA_GCONTACT_RELATION_ASSISTANT "assistant"
+
+

The relation type URI for a contact's assistant.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_BROTHER

+
#define GDATA_GCONTACT_RELATION_BROTHER "brother"
+
+

The relation type URI for a contact's brother.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_CHILD

+
#define GDATA_GCONTACT_RELATION_CHILD "child"
+
+

The relation type URI for a contact's child.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_DOMESTIC_PARTNER

+
#define GDATA_GCONTACT_RELATION_DOMESTIC_PARTNER "domestic-partner"
+
+

The relation type URI for a contact's domestic partner.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_FATHER

+
#define GDATA_GCONTACT_RELATION_FATHER "father"
+
+

The relation type URI for a contact's father.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_FRIEND

+
#define GDATA_GCONTACT_RELATION_FRIEND "friend"
+
+

The relation type URI for a contact's friend.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_MANAGER

+
#define GDATA_GCONTACT_RELATION_MANAGER "manager"
+
+

The relation type URI for a contact's manager.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_MOTHER

+
#define GDATA_GCONTACT_RELATION_MOTHER "mother"
+
+

The relation type URI for a contact's mother.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_PARENT

+
#define GDATA_GCONTACT_RELATION_PARENT "parent"
+
+

The relation type URI for a contact's parent.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_PARTNER

+
#define GDATA_GCONTACT_RELATION_PARTNER "partner"
+
+

The relation type URI for a contact's business partner.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_REFERRER

+
#define GDATA_GCONTACT_RELATION_REFERRER "referred-by"
+
+

The relation type URI for a contact's referrer.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_RELATIVE

+
#define GDATA_GCONTACT_RELATION_RELATIVE "relative"
+
+

The relation type URI for a contact's (general) family relative.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_SISTER

+
#define GDATA_GCONTACT_RELATION_SISTER "sister"
+
+

The relation type URI for a contact's sister.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_RELATION_SPOUSE

+
#define GDATA_GCONTACT_RELATION_SPOUSE "spouse"
+
+

The relation type URI for a contact's spouse.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDataGContactRelation

+
typedef struct _GDataGContactRelation GDataGContactRelation;
+

All the fields in the GDataGContactRelation structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataGContactRelationClass

+
typedef struct {
+} GDataGContactRelationClass;
+
+

All the fields in the GDataGContactRelationClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “label” property

+
  “label”                    gchar *
+

A free-form string that identifies the type of relation. It is mutually exclusive with “relation-type”.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “name” property

+
  “name”                     gchar *
+

The name of the relation. It need not be a full name, and there need not be a contact representing the name.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of relation. It is mutually exclusive with “label”. +Examples are GDATA_GCONTACT_RELATION_MANAGER or GDATA_GCONTACT_RELATION_CHILD.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGContactWebsite.html b/docs/reference/html/GDataGContactWebsite.html new file mode 100644 index 0000000..8836d68 --- /dev/null +++ b/docs/reference/html/GDataGContactWebsite.html @@ -0,0 +1,670 @@ + + + + +GDataGContactWebsite: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGContactWebsite

+

GDataGContactWebsite — gContact website element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGContactWebsite * + +gdata_gcontact_website_new () +
const gchar * + +gdata_gcontact_website_get_uri () +
+void + +gdata_gcontact_website_set_uri () +
const gchar * + +gdata_gcontact_website_get_relation_type () +
+void + +gdata_gcontact_website_set_relation_type () +
const gchar * + +gdata_gcontact_website_get_label () +
+void + +gdata_gcontact_website_set_label () +
+gboolean + +gdata_gcontact_website_is_primary () +
+void + +gdata_gcontact_website_set_is_primary () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
gbooleanis-primaryRead / Write
+gchar *labelRead / Write
+gchar *relation-typeRead / Write
+gchar *uriRead / Write
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGContactWebsite
+
+
+
+

Implemented Interfaces

+

+GDataGContactWebsite implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gcontact/gdata-gcontact-website.h>
+
+
+
+

Description

+

GDataGContactWebsite represents a "website" element from the

+gContact specification. + +
+
+

Functions

+
+

gdata_gcontact_website_new ()

+
GDataGContactWebsite *
+gdata_gcontact_website_new (const gchar *uri,
+                            const gchar *relation_type,
+                            const gchar *label,
+                            gboolean is_primary);
+

Creates a new GDataGContactWebsite. More information is available in the gContact specification.

+

Exactly one of relation_type + and label + should be provided; the other must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

uri

the website URI

 

relation_type

the relationship between the website and its owner, or NULL

 

label

a human-readable label for the website, or NULL.

[allow-none]

is_primary

TRUE if this website is its owner's primary website, FALSE otherwise

 
+
+
+

Returns

+

a new GDataGContactWebsite; unref with g_object_unref()

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_website_get_uri ()

+
const gchar *
+gdata_gcontact_website_get_uri (GDataGContactWebsite *self);
+

Gets the “uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactWebsite

 
+
+
+

Returns

+

the URI of the website

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_website_set_uri ()

+
void
+gdata_gcontact_website_set_uri (GDataGContactWebsite *self,
+                                const gchar *uri);
+

Sets the “uri” property to uri +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactWebsite

 

uri

the new website URI

 
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_website_get_relation_type ()

+
const gchar *
+gdata_gcontact_website_get_relation_type
+                               (GDataGContactWebsite *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactWebsite

 
+
+
+

Returns

+

the website's relation type

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_website_set_relation_type ()

+
void
+gdata_gcontact_website_set_relation_type
+                               (GDataGContactWebsite *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type + +such as GDATA_GCONTACT_WEBSITE_HOME_PAGE or GDATA_GCONTACT_WEBSITE_FTP.

+

If relation_type + is NULL, the relation type will be unset. When the GDataGContactWebsite is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactWebsite

 

relation_type

the new relation type for the website

 
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_website_get_label ()

+
const gchar *
+gdata_gcontact_website_get_label (GDataGContactWebsite *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactWebsite

 
+
+
+

Returns

+

the website's label, or NULL

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_website_set_label ()

+
void
+gdata_gcontact_website_set_label (GDataGContactWebsite *self,
+                                  const gchar *label);
+

Sets the “label” property to label +.

+

If label + is NULL, the label will be unset. When the GDataGContactWebsite is used in a query, however, +exactly one of “relation-type” and “label” must be NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactWebsite

 

label

the new label for the website, or NULL.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_website_is_primary ()

+
gboolean
+gdata_gcontact_website_is_primary (GDataGContactWebsite *self);
+

Gets the “is-primary” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGContactWebsite

 
+
+
+

Returns

+

TRUE if this is the primary website, FALSE otherwise

+
+

Since: 0.7.0

+
+
+
+

gdata_gcontact_website_set_is_primary ()

+
void
+gdata_gcontact_website_set_is_primary (GDataGContactWebsite *self,
+                                       gboolean is_primary);
+

Sets the “is-primary” property to is_primary +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGContactWebsite

 

is_primary

TRUE if this is the primary website, FALSE otherwise

 
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDATA_GCONTACT_WEBSITE_HOME_PAGE

+
#define GDATA_GCONTACT_WEBSITE_HOME_PAGE "home-page"
+
+

The relation type URI for a contact's home page.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_WEBSITE_BLOG

+
#define GDATA_GCONTACT_WEBSITE_BLOG "blog"
+
+

The relation type URI for a contact's blog.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_WEBSITE_PROFILE

+
#define GDATA_GCONTACT_WEBSITE_PROFILE "profile"
+
+

The relation type URI for a contact's online profile.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_WEBSITE_HOME

+
#define GDATA_GCONTACT_WEBSITE_HOME "home"
+
+

The relation type URI for a contact's home website.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_WEBSITE_WORK

+
#define GDATA_GCONTACT_WEBSITE_WORK "work"
+
+

The relation type URI for a contact's work website.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_WEBSITE_OTHER

+
#define GDATA_GCONTACT_WEBSITE_OTHER "other"
+
+

The relation type URI for a miscellaneous website of the contact.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDATA_GCONTACT_WEBSITE_FTP

+
#define GDATA_GCONTACT_WEBSITE_FTP "ftp"
+
+

The relation type URI for a contact's FTP site.

+

For more information, see the +gContact specification.

+

Since: 0.7.0

+
+
+
+

GDataGContactWebsite

+
typedef struct _GDataGContactWebsite GDataGContactWebsite;
+

All the fields in the GDataGContactWebsite structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataGContactWebsiteClass

+
typedef struct {
+} GDataGContactWebsiteClass;
+
+

All the fields in the GDataGContactWebsiteClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “is-primary” property

+
  “is-primary”               gboolean
+

Indicates which website out of a group is primary.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.7.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A simple string value used to name this website. It allows UIs to display a label such as "Work", "Travel blog", "Personal blog", etc. +It is mutually exclusive with “relation-type”.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of website. Examples are GDATA_GCONTACT_WEBSITE_HOME_PAGE or GDATA_GCONTACT_WEBSITE_FTP. +It is mutually exclusive with “label”.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “uri” property

+
  “uri”                      gchar *
+

The URI of the website.

+

For more information, see the

+gContact specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDEmailAddress.html b/docs/reference/html/GDataGDEmailAddress.html new file mode 100644 index 0000000..2a8bc17 --- /dev/null +++ b/docs/reference/html/GDataGDEmailAddress.html @@ -0,0 +1,695 @@ + + + + +GDataGDEmailAddress: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDEmailAddress

+

GDataGDEmailAddress — GData e-mail address element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDEmailAddress * + +gdata_gd_email_address_new () +
const gchar * + +gdata_gd_email_address_get_address () +
+void + +gdata_gd_email_address_set_address () +
const gchar * + +gdata_gd_email_address_get_relation_type () +
+void + +gdata_gd_email_address_set_relation_type () +
const gchar * + +gdata_gd_email_address_get_label () +
+void + +gdata_gd_email_address_set_label () +
+gboolean + +gdata_gd_email_address_is_primary () +
+void + +gdata_gd_email_address_set_is_primary () +
const gchar * + +gdata_gd_email_address_get_display_name () +
+void + +gdata_gd_email_address_set_display_name () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *addressRead / Write
+gchar *display-nameRead / Write
gbooleanis-primaryRead / Write
+gchar *labelRead / Write
+gchar *relation-typeRead / Write
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDEmailAddress
+
+
+
+

Implemented Interfaces

+

+GDataGDEmailAddress implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-email-address.h>
+
+
+
+

Description

+

GDataGDEmailAddress represents an "email" element from the

+GData specification. + +
+
+

Functions

+
+

gdata_gd_email_address_new ()

+
GDataGDEmailAddress *
+gdata_gd_email_address_new (const gchar *address,
+                            const gchar *relation_type,
+                            const gchar *label,
+                            gboolean is_primary);
+

Creates a new GDataGDEmailAddress. More information is available in the GData specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

address

the e-mail address

 

relation_type

the relationship between the e-mail address and its owner, or NULL.

[allow-none]

label

a human-readable label for the e-mail address, or NULL.

[allow-none]

is_primary

TRUE if this e-mail address is its owner's primary address, FALSE otherwise

 
+
+
+

Returns

+

a new GDataGDEmailAddress, or NULL; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_gd_email_address_get_address ()

+
const gchar *
+gdata_gd_email_address_get_address (GDataGDEmailAddress *self);
+

Gets the “address” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDEmailAddress

 
+
+
+

Returns

+

the e-mail address itself, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_email_address_set_address ()

+
void
+gdata_gd_email_address_set_address (GDataGDEmailAddress *self,
+                                    const gchar *address);
+

Sets the “address” property to address +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDEmailAddress

 

address

the new e-mail address

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_email_address_get_relation_type ()

+
const gchar *
+gdata_gd_email_address_get_relation_type
+                               (GDataGDEmailAddress *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDEmailAddress

 
+
+
+

Returns

+

the e-mail address' relation type, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_email_address_set_relation_type ()

+
void
+gdata_gd_email_address_set_relation_type
+                               (GDataGDEmailAddress *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +.

+

Set relation_type + to NULL to unset the property in the e-mail address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDEmailAddress

 

relation_type

the new relation type for the email_address, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_email_address_get_label ()

+
const gchar *
+gdata_gd_email_address_get_label (GDataGDEmailAddress *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDEmailAddress

 
+
+
+

Returns

+

the e-mail address' label, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_email_address_set_label ()

+
void
+gdata_gd_email_address_set_label (GDataGDEmailAddress *self,
+                                  const gchar *label);
+

Sets the “label” property to label +.

+

Set label + to NULL to unset the property in the e-mail address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDEmailAddress

 

label

the new label for the e-mail address, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_email_address_is_primary ()

+
gboolean
+gdata_gd_email_address_is_primary (GDataGDEmailAddress *self);
+

Gets the “is-primary” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDEmailAddress

 
+
+
+

Returns

+

TRUE if this is the primary e-mail address, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_email_address_set_is_primary ()

+
void
+gdata_gd_email_address_set_is_primary (GDataGDEmailAddress *self,
+                                       gboolean is_primary);
+

Sets the “is-primary” property to is_primary +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDEmailAddress

 

is_primary

TRUE if this is the primary e-mail address, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_email_address_get_display_name ()

+
const gchar *
+gdata_gd_email_address_get_display_name
+                               (GDataGDEmailAddress *self);
+

Gets the “display-name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDEmailAddress

 
+
+
+

Returns

+

a display name for the e-mail address, or NULL

+
+

Since: 0.6.0

+
+
+
+

gdata_gd_email_address_set_display_name ()

+
void
+gdata_gd_email_address_set_display_name
+                               (GDataGDEmailAddress *self,
+                                const gchar *display_name);
+

Sets the “display-name” property to display_name +.

+

Set display_name + to NULL to unset the property in the e-mail address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDEmailAddress

 

display_name

the new display name, or NULL.

[allow-none]
+
+

Since: 0.6.0

+
+
+
+

Types and Values

+
+

GDATA_GD_EMAIL_ADDRESS_HOME

+
#define GDATA_GD_EMAIL_ADDRESS_HOME "http://schemas.google.com/g/2005#home"
+
+

The relation type URI for a home e-mail address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EMAIL_ADDRESS_OTHER

+
#define GDATA_GD_EMAIL_ADDRESS_OTHER "http://schemas.google.com/g/2005#other"
+
+

The relation type URI for a miscellaneous e-mail address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EMAIL_ADDRESS_WORK

+
#define GDATA_GD_EMAIL_ADDRESS_WORK "http://schemas.google.com/g/2005#work"
+
+

The relation type URI for a work e-mail address.

+

Since: 0.7.0

+
+
+
+

GDataGDEmailAddress

+
typedef struct _GDataGDEmailAddress GDataGDEmailAddress;
+

All the fields in the GDataGDEmailAddress structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataGDEmailAddressClass

+
typedef struct {
+} GDataGDEmailAddressClass;
+
+

All the fields in the GDataGDEmailAddressClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “address” property

+
  “address”                  gchar *
+

The e-mail address itself.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “display-name” property

+
  “display-name”             gchar *
+

A display name of the entity (e.g. a person) the e-mail address belongs to.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.6.0

+
+
+
+

The “is-primary” property

+
  “is-primary”               gboolean
+

Indicates which e-mail address out of a group is primary.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A simple string value used to name this e-mail address. It allows UIs to display a label such as "Work", "Personal", "Preferred", etc.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of e-mail address. For example: GDATA_GD_EMAIL_ADDRESS_HOME or GDATA_GD_EMAIL_ADDRESS_WORK.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDIMAddress.html b/docs/reference/html/GDataGDIMAddress.html new file mode 100644 index 0000000..e1cc84d --- /dev/null +++ b/docs/reference/html/GDataGDIMAddress.html @@ -0,0 +1,803 @@ + + + + +GDataGDIMAddress: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDIMAddress

+

GDataGDIMAddress — GData instant messaging address element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDIMAddress * + +gdata_gd_im_address_new () +
const gchar * + +gdata_gd_im_address_get_address () +
+void + +gdata_gd_im_address_set_address () +
const gchar * + +gdata_gd_im_address_get_protocol () +
+void + +gdata_gd_im_address_set_protocol () +
const gchar * + +gdata_gd_im_address_get_relation_type () +
+void + +gdata_gd_im_address_set_relation_type () +
const gchar * + +gdata_gd_im_address_get_label () +
+void + +gdata_gd_im_address_set_label () +
+gboolean + +gdata_gd_im_address_is_primary () +
+void + +gdata_gd_im_address_set_is_primary () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *addressRead / Write
gbooleanis-primaryRead / Write
+gchar *labelRead / Write
+gchar *protocolRead / Write
+gchar *relation-typeRead / Write
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDIMAddress
+
+
+
+

Implemented Interfaces

+

+GDataGDIMAddress implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-im-address.h>
+
+
+
+

Description

+

GDataGDIMAddress represents an "im" element from the

+GData specification. + +
+
+

Functions

+
+

gdata_gd_im_address_new ()

+
GDataGDIMAddress *
+gdata_gd_im_address_new (const gchar *address,
+                         const gchar *protocol,
+                         const gchar *relation_type,
+                         const gchar *label,
+                         gboolean is_primary);
+

Creates a new GDataGDIMAddress. More information is available in the GData specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

address

the IM address

 

protocol

a URI identifying the IM protocol, or NULL.

[allow-none]

relation_type

the relationship between the IM address and its owner, or NULL.

[allow-none]

label

a human-readable label for the IM address, or NULL.

[allow-none]

is_primary

TRUE if this IM address is its owner's primary address, FALSE otherwise

 
+
+
+

Returns

+

a new GDataGDIMAddress, or NULL; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_gd_im_address_get_address ()

+
const gchar *
+gdata_gd_im_address_get_address (GDataGDIMAddress *self);
+

Gets the “address” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDIMAddress

 
+
+
+

Returns

+

the IM address itself, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_im_address_set_address ()

+
void
+gdata_gd_im_address_set_address (GDataGDIMAddress *self,
+                                 const gchar *address);
+

Sets the “address” property to address +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDIMAddress

 

address

the new IM address

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_im_address_get_protocol ()

+
const gchar *
+gdata_gd_im_address_get_protocol (GDataGDIMAddress *self);
+

Gets the “protocol” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDIMAddress

 
+
+
+

Returns

+

the IM address' protocol, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_im_address_set_protocol ()

+
void
+gdata_gd_im_address_set_protocol (GDataGDIMAddress *self,
+                                  const gchar *protocol);
+

Sets the “protocol” property to protocol +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDIMAddress

 

protocol

the new IM protocol, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_im_address_get_relation_type ()

+
const gchar *
+gdata_gd_im_address_get_relation_type (GDataGDIMAddress *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDIMAddress

 
+
+
+

Returns

+

the IM address' relation type, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_im_address_set_relation_type ()

+
void
+gdata_gd_im_address_set_relation_type (GDataGDIMAddress *self,
+                                       const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +.

+

Set relation_type + to NULL to unset the property in the IM address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDIMAddress

 

relation_type

the new relation type for the im_address, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_im_address_get_label ()

+
const gchar *
+gdata_gd_im_address_get_label (GDataGDIMAddress *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDIMAddress

 
+
+
+

Returns

+

the IM address' label, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_im_address_set_label ()

+
void
+gdata_gd_im_address_set_label (GDataGDIMAddress *self,
+                               const gchar *label);
+

Sets the “label” property to label +.

+

Set label + to NULL to unset the property in the IM address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDIMAddress

 

label

the new label for the IM address, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_im_address_is_primary ()

+
gboolean
+gdata_gd_im_address_is_primary (GDataGDIMAddress *self);
+

Gets the “is-primary” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDIMAddress

 
+
+
+

Returns

+

TRUE if this is the primary IM address, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_im_address_set_is_primary ()

+
void
+gdata_gd_im_address_set_is_primary (GDataGDIMAddress *self,
+                                    gboolean is_primary);
+

Sets the “is-primary” property to is_primary +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDIMAddress

 

is_primary

TRUE if this is the primary IM address, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_GD_IM_ADDRESS_HOME

+
#define GDATA_GD_IM_ADDRESS_HOME "http://schemas.google.com/g/2005#home"
+
+

The relation type URI for a home IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_ADDRESS_NETMEETING

+
#define GDATA_GD_IM_ADDRESS_NETMEETING "http://schemas.google.com/g/2005#netmeeting"
+
+

The relation type URI for a Microsoft NetMeeting IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_ADDRESS_OTHER

+
#define GDATA_GD_IM_ADDRESS_OTHER "http://schemas.google.com/g/2005#other"
+
+

The relation type URI for a miscellaneous IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_ADDRESS_WORK

+
#define GDATA_GD_IM_ADDRESS_WORK "http://schemas.google.com/g/2005#work"
+
+

The relation type URI for a work IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_PROTOCOL_AIM

+
#define GDATA_GD_IM_PROTOCOL_AIM "http://schemas.google.com/g/2005#AIM"
+
+

The protocol type URI for an AIM IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_PROTOCOL_LIVE_MESSENGER

+
#define GDATA_GD_IM_PROTOCOL_LIVE_MESSENGER "http://schemas.google.com/g/2005#MSN"
+
+

The protocol type URI for an Windows Live Messenger IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_PROTOCOL_YAHOO_MESSENGER

+
#define GDATA_GD_IM_PROTOCOL_YAHOO_MESSENGER "http://schemas.google.com/g/2005#YAHOO"
+
+

The protocol type URI for a Yahoo! Messenger IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_PROTOCOL_SKYPE

+
#define GDATA_GD_IM_PROTOCOL_SKYPE "http://schemas.google.com/g/2005#SKYPE"
+
+

The protocol type URI for a Skype IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_PROTOCOL_QQ

+
#define GDATA_GD_IM_PROTOCOL_QQ "http://schemas.google.com/g/2005#QQ"
+
+

The protocol type URI for a QQ IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_PROTOCOL_GOOGLE_TALK

+
#define GDATA_GD_IM_PROTOCOL_GOOGLE_TALK "http://schemas.google.com/g/2005#GOOGLE_TALK"
+
+

The protocol type URI for a Google Talk IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_PROTOCOL_ICQ

+
#define GDATA_GD_IM_PROTOCOL_ICQ "http://schemas.google.com/g/2005#ICQ"
+
+

The protocol type URI for an ICQ IM address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_IM_PROTOCOL_JABBER

+
#define GDATA_GD_IM_PROTOCOL_JABBER "http://schemas.google.com/g/2005#JABBER"
+
+

The protocol type URI for a Jabber IM address.

+

Since: 0.7.0

+
+
+
+

GDataGDIMAddress

+
typedef struct _GDataGDIMAddress GDataGDIMAddress;
+

All the fields in the GDataGDIMAddress structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataGDIMAddressClass

+
typedef struct {
+} GDataGDIMAddressClass;
+
+

All the fields in the GDataGDIMAddressClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “address” property

+
  “address”                  gchar *
+

The IM address itself.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “is-primary” property

+
  “is-primary”               gboolean
+

Indicates which IM address out of a group is primary.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A simple string value used to name this IM address. It allows UIs to display a label such as "Work", "Personal", "Preferred", etc.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “protocol” property

+
  “protocol”                 gchar *
+

Identifies the IM network. For example: GDATA_GD_IM_PROTOCOL_JABBER or GDATA_GD_IM_PROTOCOL_GOOGLE_TALK.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of IM address. For example: GDATA_GD_IM_ADDRESS_HOME or GDATA_GD_IM_ADDRESS_WORK.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDName.html b/docs/reference/html/GDataGDName.html new file mode 100644 index 0000000..8002dd3 --- /dev/null +++ b/docs/reference/html/GDataGDName.html @@ -0,0 +1,758 @@ + + + + +GDataGDName: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDName

+

GDataGDName — GData name element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDName * + +gdata_gd_name_new () +
const gchar * + +gdata_gd_name_get_given_name () +
+void + +gdata_gd_name_set_given_name () +
const gchar * + +gdata_gd_name_get_additional_name () +
+void + +gdata_gd_name_set_additional_name () +
const gchar * + +gdata_gd_name_get_family_name () +
+void + +gdata_gd_name_set_family_name () +
const gchar * + +gdata_gd_name_get_prefix () +
+void + +gdata_gd_name_set_prefix () +
const gchar * + +gdata_gd_name_get_suffix () +
+void + +gdata_gd_name_set_suffix () +
const gchar * + +gdata_gd_name_get_full_name () +
+void + +gdata_gd_name_set_full_name () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *additional-nameRead / Write
+gchar *family-nameRead / Write
+gchar *full-nameRead / Write
+gchar *given-nameRead / Write
+gchar *prefixRead / Write
+gchar *suffixRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataGDName
 GDataGDNameClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDName
+
+
+
+

Implemented Interfaces

+

+GDataGDName implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-name.h>
+
+
+
+

Description

+

GDataGDName represents a "name" element from the

+GData specification. +

Given a name such as Sir Winston Leonard Spencer-Churchill, KG, the properties of the GDataGDName should be +set as follows:

+
++++ + + + + + + + + + + + + + + + + + + + + + + +

“given-name”

Winston

“additional-name”

Leonard

“family-name”

Spencer-Churchill

“prefix”

Sir

“suffix”

KG

+
+
+

Functions

+
+

gdata_gd_name_new ()

+
GDataGDName *
+gdata_gd_name_new (const gchar *given_name,
+                   const gchar *family_name);
+

Creates a new GDataGDName. More information is available in the GData specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

given_name

the person's given name, or NULL.

[allow-none]

family_name

the person's family name, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataGDName, or NULL; unref with g_object_unref()

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_get_given_name ()

+
const gchar *
+gdata_gd_name_get_given_name (GDataGDName *self);
+

Gets the “given-name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDName

 
+
+
+

Returns

+

the person's given name, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_set_given_name ()

+
void
+gdata_gd_name_set_given_name (GDataGDName *self,
+                              const gchar *given_name);
+

Sets the “given-name” property to given_name +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDName

 

given_name

the new given name, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_get_additional_name ()

+
const gchar *
+gdata_gd_name_get_additional_name (GDataGDName *self);
+

Gets the “additional-name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDName

 
+
+
+

Returns

+

the person's additional name, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_set_additional_name ()

+
void
+gdata_gd_name_set_additional_name (GDataGDName *self,
+                                   const gchar *additional_name);
+

Sets the “additional-name” property to additional_name +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDName

 

additional_name

the new additional name, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_get_family_name ()

+
const gchar *
+gdata_gd_name_get_family_name (GDataGDName *self);
+

Gets the “family-name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDName

 
+
+
+

Returns

+

the person's family name, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_set_family_name ()

+
void
+gdata_gd_name_set_family_name (GDataGDName *self,
+                               const gchar *family_name);
+

Sets the “family-name” property to family_name +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDName

 

family_name

the new family name, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_get_prefix ()

+
const gchar *
+gdata_gd_name_get_prefix (GDataGDName *self);
+

Gets the “prefix” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDName

 
+
+
+

Returns

+

the person's name prefix, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_set_prefix ()

+
void
+gdata_gd_name_set_prefix (GDataGDName *self,
+                          const gchar *prefix);
+

Sets the “prefix” property to prefix +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDName

 

prefix

the new prefix, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_get_suffix ()

+
const gchar *
+gdata_gd_name_get_suffix (GDataGDName *self);
+

Gets the “suffix” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDName

 
+
+
+

Returns

+

the person's name suffix, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_set_suffix ()

+
void
+gdata_gd_name_set_suffix (GDataGDName *self,
+                          const gchar *suffix);
+

Sets the “suffix” property to suffix +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDName

 

suffix

the new suffix, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_get_full_name ()

+
const gchar *
+gdata_gd_name_get_full_name (GDataGDName *self);
+

Gets the “full-name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDName

 
+
+
+

Returns

+

the person's full name, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_name_set_full_name ()

+
void
+gdata_gd_name_set_full_name (GDataGDName *self,
+                             const gchar *full_name);
+

Sets the “full-name” property to full_name +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDName

 

full_name

the new full name, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

Types and Values

+
+

GDataGDName

+
typedef struct _GDataGDName GDataGDName;
+

All the fields in the GDataGDName structure are private and should never be accessed directly.

+

Since: 0.5.0

+
+
+
+

GDataGDNameClass

+
typedef struct {
+} GDataGDNameClass;
+
+

All the fields in the GDataGDNameClass structure are private and should never be accessed directly.

+

Since: 0.5.0

+
+
+
+

Property Details

+
+

The “additional-name” property

+
  “additional-name”          gchar *
+

An additional name for the person (e.g. a middle name).

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “family-name” property

+
  “family-name”              gchar *
+

The person's family name.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “full-name” property

+
  “full-name”                gchar *
+

An unstructured representation of the person's full name. It's generally advised to use the other individual properties in preference +to this one, which can fall out of synchronisation with the other properties.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “given-name” property

+
  “given-name”               gchar *
+

The person's given name.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “prefix” property

+
  “prefix”                   gchar *
+

An honorific prefix (e.g. Mr or Mrs).

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “suffix” property

+
  “suffix”                   gchar *
+

An honorific suffix (e.g. san or III).

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDOrganization.html b/docs/reference/html/GDataGDOrganization.html new file mode 100644 index 0000000..5f40003 --- /dev/null +++ b/docs/reference/html/GDataGDOrganization.html @@ -0,0 +1,1065 @@ + + + + +GDataGDOrganization: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDOrganization

+

GDataGDOrganization — GData organization element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDOrganization * + +gdata_gd_organization_new () +
const gchar * + +gdata_gd_organization_get_name () +
+void + +gdata_gd_organization_set_name () +
const gchar * + +gdata_gd_organization_get_title () +
+void + +gdata_gd_organization_set_title () +
const gchar * + +gdata_gd_organization_get_relation_type () +
+void + +gdata_gd_organization_set_relation_type () +
const gchar * + +gdata_gd_organization_get_label () +
+void + +gdata_gd_organization_set_label () +
+gboolean + +gdata_gd_organization_is_primary () +
+void + +gdata_gd_organization_set_is_primary () +
const gchar * + +gdata_gd_organization_get_department () +
+void + +gdata_gd_organization_set_department () +
const gchar * + +gdata_gd_organization_get_job_description () +
+void + +gdata_gd_organization_set_job_description () +
const gchar * + +gdata_gd_organization_get_symbol () +
+void + +gdata_gd_organization_set_symbol () +
+GDataGDWhere * + +gdata_gd_organization_get_location () +
+void + +gdata_gd_organization_set_location () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *departmentRead / Write
gbooleanis-primaryRead / Write
+gchar *job-descriptionRead / Write
+gchar *labelRead / Write
+GDataGDWhere *locationRead / Write
+gchar *nameRead / Write
+gchar *relation-typeRead / Write
+gchar *symbolRead / Write
+gchar *titleRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
#defineGDATA_GD_ORGANIZATION_WORK
#defineGDATA_GD_ORGANIZATION_OTHER
 GDataGDOrganization
 GDataGDOrganizationClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDOrganization
+
+
+
+

Implemented Interfaces

+

+GDataGDOrganization implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-organization.h>
+
+
+
+

Description

+

GDataGDOrganization represents an "organization" element from the

+GData specification. + +
+
+

Functions

+
+

gdata_gd_organization_new ()

+
GDataGDOrganization *
+gdata_gd_organization_new (const gchar *name,
+                           const gchar *title,
+                           const gchar *relation_type,
+                           const gchar *label,
+                           gboolean is_primary);
+

Creates a new GDataGDOrganization. More information is available in the GData specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

name

the name of the organization, or NULL.

[allow-none]

title

the owner's title within the organization, or NULL.

[allow-none]

relation_type

the relationship between the organization and its owner, or NULL.

[allow-none]

label

a human-readable label for the organization, or NULL.

[allow-none]

is_primary

TRUE if this organization is its owner's primary organization, FALSE otherwise

 
+
+
+

Returns

+

a new GDataGDOrganization, or NULL; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_gd_organization_get_name ()

+
const gchar *
+gdata_gd_organization_get_name (GDataGDOrganization *self);
+

Gets the “name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDOrganization

 
+
+
+

Returns

+

the organization's name, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_set_name ()

+
void
+gdata_gd_organization_set_name (GDataGDOrganization *self,
+                                const gchar *name);
+

Sets the “name” property to name +.

+

Set name + to NULL to unset the property in the organization.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDOrganization

 

name

the new name for the organization, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_get_title ()

+
const gchar *
+gdata_gd_organization_get_title (GDataGDOrganization *self);
+

Gets the “title” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDOrganization

 
+
+
+

Returns

+

the organization's title, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_set_title ()

+
void
+gdata_gd_organization_set_title (GDataGDOrganization *self,
+                                 const gchar *title);
+

Sets the “title” property to title +.

+

Set title + to NULL to unset the property in the organization.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDOrganization

 

title

the new title for the organization, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_get_relation_type ()

+
const gchar *
+gdata_gd_organization_get_relation_type
+                               (GDataGDOrganization *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDOrganization

 
+
+
+

Returns

+

the organization's relation type, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_set_relation_type ()

+
void
+gdata_gd_organization_set_relation_type
+                               (GDataGDOrganization *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +.

+

Set relation_type + to NULL to unset the property in the organization.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDOrganization

 

relation_type

the new relation type for the organization, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_get_label ()

+
const gchar *
+gdata_gd_organization_get_label (GDataGDOrganization *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDOrganization

 
+
+
+

Returns

+

the organization's label, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_set_label ()

+
void
+gdata_gd_organization_set_label (GDataGDOrganization *self,
+                                 const gchar *label);
+

Sets the “label” property to label +.

+

Set label + to NULL to unset the property in the organization.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDOrganization

 

label

the new label for the organization, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_is_primary ()

+
gboolean
+gdata_gd_organization_is_primary (GDataGDOrganization *self);
+

Gets the “is-primary” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDOrganization

 
+
+
+

Returns

+

TRUE if this is the primary organization, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_set_is_primary ()

+
void
+gdata_gd_organization_set_is_primary (GDataGDOrganization *self,
+                                      gboolean is_primary);
+

Sets the “is-primary” property to is_primary +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDOrganization

 

is_primary

TRUE if this is the primary organization, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_organization_get_department ()

+
const gchar *
+gdata_gd_organization_get_department (GDataGDOrganization *self);
+

Gets the “department” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDOrganization

 
+
+
+

Returns

+

the department in which the person works in this organization, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_organization_set_department ()

+
void
+gdata_gd_organization_set_department (GDataGDOrganization *self,
+                                      const gchar *department);
+

Sets the “department” property to department +.

+

Set department + to NULL to unset the property in the organization.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDOrganization

 

department

the new department for the person working in the organization, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_organization_get_job_description ()

+
const gchar *
+gdata_gd_organization_get_job_description
+                               (GDataGDOrganization *self);
+

Gets the “job-description” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDOrganization

 
+
+
+

Returns

+

the job description of the person in the organization, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_organization_set_job_description ()

+
void
+gdata_gd_organization_set_job_description
+                               (GDataGDOrganization *self,
+                                const gchar *job_description);
+

Sets the “job-description” property to job_description +.

+

Set job_description + to NULL to unset the property in the organization.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDOrganization

 

job_description

the new job description for the person in the organization, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_organization_get_symbol ()

+
const gchar *
+gdata_gd_organization_get_symbol (GDataGDOrganization *self);
+

Gets the “symbol” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDOrganization

 
+
+
+

Returns

+

the organization's stock symbol, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_organization_set_symbol ()

+
void
+gdata_gd_organization_set_symbol (GDataGDOrganization *self,
+                                  const gchar *symbol);
+

Sets the “symbol” property to symbol +.

+

Set symbol + to NULL to unset the property in the organization.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDOrganization

 

symbol

the new stock symbol for the organization, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_organization_get_location ()

+
GDataGDWhere *
+gdata_gd_organization_get_location (GDataGDOrganization *self);
+

Gets the “location” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDOrganization

 
+
+
+

Returns

+

the organization's location, or NULL.

+

[transfer none]

+
+

Since: 0.6.0

+
+
+
+

gdata_gd_organization_set_location ()

+
void
+gdata_gd_organization_set_location (GDataGDOrganization *self,
+                                    GDataGDWhere *location);
+

Sets the “location” property to location +.

+

Set location + to NULL to unset the property in the organization.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDOrganization

 

location

the new location for the organization, or NULL.

[allow-none]
+
+

Since: 0.6.0

+
+
+
+

Types and Values

+
+

GDATA_GD_ORGANIZATION_WORK

+
#define GDATA_GD_ORGANIZATION_WORK "http://schemas.google.com/g/2005#work"
+
+

The relation type URI for a work organization.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_ORGANIZATION_OTHER

+
#define GDATA_GD_ORGANIZATION_OTHER "http://schemas.google.com/g/2005#other"
+
+

The relation type URI for a miscellaneous organization.

+

Since: 0.7.0

+
+
+
+

GDataGDOrganization

+
typedef struct _GDataGDOrganization GDataGDOrganization;
+

All the fields in the GDataGDOrganization structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataGDOrganizationClass

+
typedef struct {
+} GDataGDOrganizationClass;
+
+

All the fields in the GDataGDOrganizationClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “department” property

+
  “department”               gchar *
+

Specifies a department within the organization.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “is-primary” property

+
  “is-primary”               gboolean
+

Indicates which organization out of a group is primary.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “job-description” property

+
  “job-description”          gchar *
+

Description of a job within the organization.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A simple string value used to name this organization. It allows UIs to display a label such as "Work", "Volunteer", +"Professional Society", etc.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “location” property

+
  “location”                 GDataGDWhere *
+

A place associated with the organization, e.g. office location.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Since: 0.6.0

+
+
+
+

The “name” property

+
  “name”                     gchar *
+

The name of the organization.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of organization. For example: GDATA_GD_ORGANIZATION_WORK or GDATA_GD_ORGANIZATION_OTHER.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “symbol” property

+
  “symbol”                   gchar *
+

Stock symbol of the organization.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “title” property

+
  “title”                    gchar *
+

The title of a person within the organization.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDPhoneNumber.html b/docs/reference/html/GDataGDPhoneNumber.html new file mode 100644 index 0000000..f2291e8 --- /dev/null +++ b/docs/reference/html/GDataGDPhoneNumber.html @@ -0,0 +1,905 @@ + + + + +GDataGDPhoneNumber: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDPhoneNumber

+

GDataGDPhoneNumber — GData phone number element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDPhoneNumber * + +gdata_gd_phone_number_new () +
const gchar * + +gdata_gd_phone_number_get_number () +
+void + +gdata_gd_phone_number_set_number () +
const gchar * + +gdata_gd_phone_number_get_uri () +
+void + +gdata_gd_phone_number_set_uri () +
const gchar * + +gdata_gd_phone_number_get_relation_type () +
+void + +gdata_gd_phone_number_set_relation_type () +
const gchar * + +gdata_gd_phone_number_get_label () +
+void + +gdata_gd_phone_number_set_label () +
+gboolean + +gdata_gd_phone_number_is_primary () +
+void + +gdata_gd_phone_number_set_is_primary () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gbooleanis-primaryRead / Write
+gchar *labelRead / Write
+gchar *numberRead / Write
+gchar *relation-typeRead / Write
+gchar *uriRead / Write
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDPhoneNumber
+
+
+
+

Implemented Interfaces

+

+GDataGDPhoneNumber implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-phone-number.h>
+
+
+
+

Description

+

GDataGDPhoneNumber represents a "phoneNumber" element from the

+GData specification. + +
+
+

Functions

+
+

gdata_gd_phone_number_new ()

+
GDataGDPhoneNumber *
+gdata_gd_phone_number_new (const gchar *number,
+                           const gchar *relation_type,
+                           const gchar *label,
+                           const gchar *uri,
+                           gboolean is_primary);
+

Creates a new GDataGDPhoneNumber. More information is available in the GData specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

number

the phone number, in human-readable format

 

relation_type

the relationship between the phone number and its owner, or NULL.

[allow-none]

label

a human-readable label for the phone number, or NULL.

[allow-none]

uri

+

a "tel URI" to represent the number formally (see

+RFC 3966), or NULL.
[allow-none]

is_primary

TRUE if this phone number is its owner's primary number, FALSE otherwise

 
+
+
+

Returns

+

a new GDataGDPhoneNumber, or NULL; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_gd_phone_number_get_number ()

+
const gchar *
+gdata_gd_phone_number_get_number (GDataGDPhoneNumber *self);
+

Gets the “number” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPhoneNumber

 
+
+
+

Returns

+

the phone number itself

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_phone_number_set_number ()

+
void
+gdata_gd_phone_number_set_number (GDataGDPhoneNumber *self,
+                                  const gchar *number);
+

Sets the “number” property to number +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPhoneNumber

 

number

the new phone number

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_phone_number_get_uri ()

+
const gchar *
+gdata_gd_phone_number_get_uri (GDataGDPhoneNumber *self);
+

Gets the “uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPhoneNumber

 
+
+
+

Returns

+

the phone number's URI, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_phone_number_set_uri ()

+
void
+gdata_gd_phone_number_set_uri (GDataGDPhoneNumber *self,
+                               const gchar *uri);
+

Sets the “uri” property to uri +.

+

Set uri + to NULL to unset the property in the phone number.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPhoneNumber

 

uri

the new URI for the phone number, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_phone_number_get_relation_type ()

+
const gchar *
+gdata_gd_phone_number_get_relation_type
+                               (GDataGDPhoneNumber *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPhoneNumber

 
+
+
+

Returns

+

the phone number's relation type, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_phone_number_set_relation_type ()

+
void
+gdata_gd_phone_number_set_relation_type
+                               (GDataGDPhoneNumber *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +.

+

Set relation_type + to NULL to unset the property in the phone number.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPhoneNumber

 

relation_type

the new relation type for the phone number, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_phone_number_get_label ()

+
const gchar *
+gdata_gd_phone_number_get_label (GDataGDPhoneNumber *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPhoneNumber

 
+
+
+

Returns

+

the phone number's label, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_phone_number_set_label ()

+
void
+gdata_gd_phone_number_set_label (GDataGDPhoneNumber *self,
+                                 const gchar *label);
+

Sets the “label” property to label +.

+

Set label + to NULL to unset the property in the phone number.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPhoneNumber

 

label

the new label for the phone number, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_phone_number_is_primary ()

+
gboolean
+gdata_gd_phone_number_is_primary (GDataGDPhoneNumber *self);
+

Gets the “is-primary” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPhoneNumber

 
+
+
+

Returns

+

TRUE if this is the primary phone number, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_phone_number_set_is_primary ()

+
void
+gdata_gd_phone_number_set_is_primary (GDataGDPhoneNumber *self,
+                                      gboolean is_primary);
+

Sets the “is-primary” property to is_primary +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPhoneNumber

 

is_primary

TRUE if this is the primary phone number, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_GD_PHONE_NUMBER_ASSISTANT

+
#define GDATA_GD_PHONE_NUMBER_ASSISTANT "http://schemas.google.com/g/2005#assistant"
+
+

The relation type URI for the phone number of an assistant.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_CALLBACK

+
#define GDATA_GD_PHONE_NUMBER_CALLBACK "http://schemas.google.com/g/2005#callback"
+
+

The relation type URI for the phone number of a callback service.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_CAR

+
#define GDATA_GD_PHONE_NUMBER_CAR "http://schemas.google.com/g/2005#car"
+
+

The relation type URI for the phone number of a car phone.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_COMPANY_MAIN

+
#define GDATA_GD_PHONE_NUMBER_COMPANY_MAIN "http://schemas.google.com/g/2005#company_main"
+
+

The relation type URI for the main phone number of a company.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_FAX

+
#define GDATA_GD_PHONE_NUMBER_FAX "http://schemas.google.com/g/2005#fax"
+
+

The relation type URI for the phone number of a fax machine.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_HOME

+
#define GDATA_GD_PHONE_NUMBER_HOME "http://schemas.google.com/g/2005#home"
+
+

The relation type URI for a home phone number.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_HOME_FAX

+
#define GDATA_GD_PHONE_NUMBER_HOME_FAX "http://schemas.google.com/g/2005#home_fax"
+
+

The relation type URI for the phone number of a home fax machine.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_ISDN

+
#define GDATA_GD_PHONE_NUMBER_ISDN "http://schemas.google.com/g/2005#isdn"
+
+

The relation type URI for the phone number of an ISDN phone.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_MAIN

+
#define GDATA_GD_PHONE_NUMBER_MAIN "http://schemas.google.com/g/2005#main"
+
+

The relation type URI for the main phone number of a person.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_MOBILE

+
#define GDATA_GD_PHONE_NUMBER_MOBILE "http://schemas.google.com/g/2005#mobile"
+
+

The relation type URI for the phone number of a mobile phone.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_OTHER

+
#define GDATA_GD_PHONE_NUMBER_OTHER "http://schemas.google.com/g/2005#other"
+
+

The relation type URI for a miscellaneous phone number.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_OTHER_FAX

+
#define GDATA_GD_PHONE_NUMBER_OTHER_FAX "http://schemas.google.com/g/2005#other_fax"
+
+

The relation type URI for a miscellaneous fax machine's phone number.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_PAGER

+
#define GDATA_GD_PHONE_NUMBER_PAGER "http://schemas.google.com/g/2005#pager"
+
+

The relation type URI for the phone number of a pager.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_RADIO

+
#define GDATA_GD_PHONE_NUMBER_RADIO "http://schemas.google.com/g/2005#radio"
+
+

The relation type URI for the phone number of a radio phone.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_TELEX

+
#define GDATA_GD_PHONE_NUMBER_TELEX "http://schemas.google.com/g/2005#telex"
+
+

The relation type URI for the phone number of a telex machine.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_TTY_TDD

+
#define GDATA_GD_PHONE_NUMBER_TTY_TDD "http://schemas.google.com/g/2005#tty_tdd"
+
+

The relation type URI for the phone number of a TTY TTD.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_WORK

+
#define GDATA_GD_PHONE_NUMBER_WORK "http://schemas.google.com/g/2005#work"
+
+

The relation type URI for the phone number of a work place.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_WORK_FAX

+
#define GDATA_GD_PHONE_NUMBER_WORK_FAX "http://schemas.google.com/g/2005#work_fax"
+
+

The relation type URI for the phone number of a work fax machine.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_WORK_MOBILE

+
#define GDATA_GD_PHONE_NUMBER_WORK_MOBILE "http://schemas.google.com/g/2005#work_mobile"
+
+

The relation type URI for the phone number of a work mobile phone.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_PHONE_NUMBER_WORK_PAGER

+
#define GDATA_GD_PHONE_NUMBER_WORK_PAGER "http://schemas.google.com/g/2005#work_pager"
+
+

The relation type URI for the phone number of a work pager.

+

Since: 0.7.0

+
+
+
+

GDataGDPhoneNumber

+
typedef struct _GDataGDPhoneNumber GDataGDPhoneNumber;
+

All the fields in the GDataGDPhoneNumber structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataGDPhoneNumberClass

+
typedef struct {
+} GDataGDPhoneNumberClass;
+
+

All the fields in the GDataGDPhoneNumberClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “is-primary” property

+
  “is-primary”               gboolean
+

Indicates which phone number out of a group is primary.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A simple string value used to name this phone number. It allows UIs to display a label such as "Mobile", "Home", "Work", etc.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “number” property

+
  “number”                   gchar *
+

Human-readable phone number; may be in any telephone number format.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of phone number. For example: GDATA_GD_PHONE_NUMBER_WORK or GDATA_GD_PHONE_NUMBER_PAGER.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “uri” property

+
  “uri”                      gchar *
+

An optional "tel URI" used to represent the number in a formal way. Useful for programmatic access, such as a VoIP/PSTN bridge.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDPostalAddress.html b/docs/reference/html/GDataGDPostalAddress.html new file mode 100644 index 0000000..9b221a4 --- /dev/null +++ b/docs/reference/html/GDataGDPostalAddress.html @@ -0,0 +1,1857 @@ + + + + +GDataGDPostalAddress: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDPostalAddress

+

GDataGDPostalAddress — GData postal address element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDPostalAddress * + +gdata_gd_postal_address_new () +
const gchar * + +gdata_gd_postal_address_get_address () +
+void + +gdata_gd_postal_address_set_address () +
const gchar * + +gdata_gd_postal_address_get_relation_type () +
+void + +gdata_gd_postal_address_set_relation_type () +
const gchar * + +gdata_gd_postal_address_get_label () +
+void + +gdata_gd_postal_address_set_label () +
+gboolean + +gdata_gd_postal_address_is_primary () +
+void + +gdata_gd_postal_address_set_is_primary () +
const gchar * + +gdata_gd_postal_address_get_mail_class () +
+void + +gdata_gd_postal_address_set_mail_class () +
const gchar * + +gdata_gd_postal_address_get_usage () +
+void + +gdata_gd_postal_address_set_usage () +
const gchar * + +gdata_gd_postal_address_get_agent () +
+void + +gdata_gd_postal_address_set_agent () +
const gchar * + +gdata_gd_postal_address_get_house_name () +
+void + +gdata_gd_postal_address_set_house_name () +
const gchar * + +gdata_gd_postal_address_get_street () +
+void + +gdata_gd_postal_address_set_street () +
const gchar * + +gdata_gd_postal_address_get_po_box () +
+void + +gdata_gd_postal_address_set_po_box () +
const gchar * + +gdata_gd_postal_address_get_neighborhood () +
+void + +gdata_gd_postal_address_set_neighborhood () +
const gchar * + +gdata_gd_postal_address_get_city () +
+void + +gdata_gd_postal_address_set_city () +
const gchar * + +gdata_gd_postal_address_get_subregion () +
+void + +gdata_gd_postal_address_set_subregion () +
const gchar * + +gdata_gd_postal_address_get_region () +
+void + +gdata_gd_postal_address_set_region () +
const gchar * + +gdata_gd_postal_address_get_postcode () +
+void + +gdata_gd_postal_address_set_postcode () +
const gchar * + +gdata_gd_postal_address_get_country () +
const gchar * + +gdata_gd_postal_address_get_country_code () +
+void + +gdata_gd_postal_address_set_country () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *addressRead / Write
+gchar *agentRead / Write
+gchar *cityRead / Write
+gchar *countryRead
+gchar *country-codeRead
+gchar *house-nameRead / Write
gbooleanis-primaryRead / Write
+gchar *labelRead / Write
+gchar *mail-classRead / Write
+gchar *neighborhoodRead / Write
+gchar *po-boxRead / Write
+gchar *postcodeRead / Write
+gchar *regionRead / Write
+gchar *relation-typeRead / Write
+gchar *streetRead / Write
+gchar *subregionRead / Write
+gchar *usageRead / Write
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDPostalAddress
+
+
+
+

Implemented Interfaces

+

+GDataGDPostalAddress implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-postal-address.h>
+
+
+
+

Description

+

GDataGDPostalAddress represents a "structuredPostalAddress" element from the

+GData specification. +

Note that it does not represent a simple "postalAddress" element, as "structuredPostalAddress" is now used wherever possible in the GData API.

+
+
+

Functions

+
+

gdata_gd_postal_address_new ()

+
GDataGDPostalAddress *
+gdata_gd_postal_address_new (const gchar *relation_type,
+                             const gchar *label,
+                             gboolean is_primary);
+

Creates a new GDataGDPostalAddress. More information is available in the GData specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

relation_type

the relationship between the address and its owner, or NULL.

[allow-none]

label

a human-readable label for the address, or NULL.

[allow-none]

is_primary

TRUE if this phone number is its owner's primary number, FALSE otherwise

 
+
+
+

Returns

+

a new GDataGDPostalAddress, or NULL; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_gd_postal_address_get_address ()

+
const gchar *
+gdata_gd_postal_address_get_address (GDataGDPostalAddress *self);
+

Gets the “address” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address itself, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_postal_address_set_address ()

+
void
+gdata_gd_postal_address_set_address (GDataGDPostalAddress *self,
+                                     const gchar *address);
+

Sets the “address” property to address +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

address

the new postal address, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_postal_address_get_relation_type ()

+
const gchar *
+gdata_gd_postal_address_get_relation_type
+                               (GDataGDPostalAddress *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' relation type, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_postal_address_set_relation_type ()

+
void
+gdata_gd_postal_address_set_relation_type
+                               (GDataGDPostalAddress *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +.

+

Set relation_type + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

relation_type

the new relation type for the postal_address, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_postal_address_get_label ()

+
const gchar *
+gdata_gd_postal_address_get_label (GDataGDPostalAddress *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' label, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_postal_address_set_label ()

+
void
+gdata_gd_postal_address_set_label (GDataGDPostalAddress *self,
+                                   const gchar *label);
+

Sets the “label” property to label +.

+

Set label + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

label

the new label for the postal address, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_postal_address_is_primary ()

+
gboolean
+gdata_gd_postal_address_is_primary (GDataGDPostalAddress *self);
+

Gets the “is-primary” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

TRUE if this is the primary postal address, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_postal_address_set_is_primary ()

+
void
+gdata_gd_postal_address_set_is_primary
+                               (GDataGDPostalAddress *self,
+                                gboolean is_primary);
+

Sets the “is-primary” property to is_primary +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

is_primary

TRUE if this is the primary postal address, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_postal_address_get_mail_class ()

+
const gchar *
+gdata_gd_postal_address_get_mail_class
+                               (GDataGDPostalAddress *self);
+

Gets the “mail-class” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' mail class, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_mail_class ()

+
void
+gdata_gd_postal_address_set_mail_class
+                               (GDataGDPostalAddress *self,
+                                const gchar *mail_class);
+

Sets the “mail-class” property to mail_class +.

+

Set mail_class + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

mail_class

the new mail class for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_usage ()

+
const gchar *
+gdata_gd_postal_address_get_usage (GDataGDPostalAddress *self);
+

Gets the “usage” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' usage, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_usage ()

+
void
+gdata_gd_postal_address_set_usage (GDataGDPostalAddress *self,
+                                   const gchar *usage);
+

Sets the “usage” property to usage +.

+

Set usage + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

usage

the new usage for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_agent ()

+
const gchar *
+gdata_gd_postal_address_get_agent (GDataGDPostalAddress *self);
+

Gets the “agent” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' agent, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_agent ()

+
void
+gdata_gd_postal_address_set_agent (GDataGDPostalAddress *self,
+                                   const gchar *agent);
+

Sets the “agent” property to agent +.

+

Set agent + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

agent

the new agent for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_house_name ()

+
const gchar *
+gdata_gd_postal_address_get_house_name
+                               (GDataGDPostalAddress *self);
+

Gets the “house-name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' house name, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_house_name ()

+
void
+gdata_gd_postal_address_set_house_name
+                               (GDataGDPostalAddress *self,
+                                const gchar *house_name);
+

Sets the “house-name” property to house_name +.

+

Set house_name + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

house_name

the new house name for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_street ()

+
const gchar *
+gdata_gd_postal_address_get_street (GDataGDPostalAddress *self);
+

Gets the “street” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' street, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_street ()

+
void
+gdata_gd_postal_address_set_street (GDataGDPostalAddress *self,
+                                    const gchar *street);
+

Sets the “street” property to street +.

+

Set street + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

street

the new street for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_po_box ()

+
const gchar *
+gdata_gd_postal_address_get_po_box (GDataGDPostalAddress *self);
+

Gets the “po-box” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' P.O. box, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_po_box ()

+
void
+gdata_gd_postal_address_set_po_box (GDataGDPostalAddress *self,
+                                    const gchar *po_box);
+

Sets the “po-box” property to po_box +.

+

Set po_box + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

po_box

the new P.O. box for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_neighborhood ()

+
const gchar *
+gdata_gd_postal_address_get_neighborhood
+                               (GDataGDPostalAddress *self);
+

Gets the “neighborhood” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' neighborhood, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_neighborhood ()

+
void
+gdata_gd_postal_address_set_neighborhood
+                               (GDataGDPostalAddress *self,
+                                const gchar *neighborhood);
+

Sets the “neighborhood” property to neighborhood +.

+

Set neighborhood + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

neighborhood

the new neighborhood for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_city ()

+
const gchar *
+gdata_gd_postal_address_get_city (GDataGDPostalAddress *self);
+

Gets the “city” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' city, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_city ()

+
void
+gdata_gd_postal_address_set_city (GDataGDPostalAddress *self,
+                                  const gchar *city);
+

Sets the “city” property to city +.

+

Set city + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

city

the new city for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_subregion ()

+
const gchar *
+gdata_gd_postal_address_get_subregion (GDataGDPostalAddress *self);
+

Gets the “subregion” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' subregion, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_subregion ()

+
void
+gdata_gd_postal_address_set_subregion (GDataGDPostalAddress *self,
+                                       const gchar *subregion);
+

Sets the “subregion” property to subregion +.

+

Set subregion + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

subregion

the new subregion for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_region ()

+
const gchar *
+gdata_gd_postal_address_get_region (GDataGDPostalAddress *self);
+

Gets the “region” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' region, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_region ()

+
void
+gdata_gd_postal_address_set_region (GDataGDPostalAddress *self,
+                                    const gchar *region);
+

Sets the “region” property to region +.

+

Set region + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

region

the new region for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_postcode ()

+
const gchar *
+gdata_gd_postal_address_get_postcode (GDataGDPostalAddress *self);
+

Gets the “postcode” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' postcode, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_postcode ()

+
void
+gdata_gd_postal_address_set_postcode (GDataGDPostalAddress *self,
+                                      const gchar *postcode);
+

Sets the “postcode” property to postcode +.

+

Set postcode + to NULL to unset the property in the postal address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

postcode

the new postcode for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_country ()

+
const gchar *
+gdata_gd_postal_address_get_country (GDataGDPostalAddress *self);
+

Gets the “country” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' country, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_get_country_code ()

+
const gchar *
+gdata_gd_postal_address_get_country_code
+                               (GDataGDPostalAddress *self);
+

Gets the “country-code” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDPostalAddress

 
+
+
+

Returns

+

the postal address' ISO 3166-1 alpha-2 country code, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_gd_postal_address_set_country ()

+
void
+gdata_gd_postal_address_set_country (GDataGDPostalAddress *self,
+                                     const gchar *country,
+                                     const gchar *country_code);
+

Sets the “country” property to country +, and “country-code” to country_code +.

+

Set country + or country_code + to NULL to unset the relevant property in the postal address. If a country_code + is provided, a country + must +also be provided.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataGDPostalAddress

 

country

the new country for the postal address, or NULL.

[allow-none]

country_code

the new country code for the postal address, or NULL.

[allow-none]
+
+

Since: 0.5.0

+
+
+
+

Types and Values

+
+

GDATA_GD_POSTAL_ADDRESS_WORK

+
#define GDATA_GD_POSTAL_ADDRESS_WORK "http://schemas.google.com/g/2005#work"
+
+

The relation type URI for the postal address of a workplace.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_POSTAL_ADDRESS_HOME

+
#define GDATA_GD_POSTAL_ADDRESS_HOME "http://schemas.google.com/g/2005#home"
+
+

The relation type URI for the postal address of a home.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_POSTAL_ADDRESS_OTHER

+
#define GDATA_GD_POSTAL_ADDRESS_OTHER "http://schemas.google.com/g/2005#other"
+
+

The relation type URI for a miscellaneous postal address.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_ADDRESS_USAGE_GENERAL

+
#define GDATA_GD_ADDRESS_USAGE_GENERAL "http://schemas.google.com/g/2005#general"
+
+

The address is for general usage. Value for “usage”.

+

Since: 0.5.0

+
+
+
+

GDATA_GD_ADDRESS_USAGE_LOCAL

+
#define GDATA_GD_ADDRESS_USAGE_LOCAL "http://schemas.google.com/g/2005#local"
+
+

The address is for local usage. Value for “usage”.

+

Since: 0.5.0

+
+
+
+

GDATA_GD_MAIL_CLASS_BOTH

+
#define GDATA_GD_MAIL_CLASS_BOTH "http://schemas.google.com/g/2005#both"
+
+

Parcels and letters can be sent to the address. Value for “mail-class”.

+

Since: 0.5.0

+
+
+
+

GDATA_GD_MAIL_CLASS_LETTERS

+
#define GDATA_GD_MAIL_CLASS_LETTERS "http://schemas.google.com/g/2005#letters"
+
+

Only letters can be sent to the address. Value for “mail-class”.

+

Since: 0.5.0

+
+
+
+

GDATA_GD_MAIL_CLASS_NEITHER

+
#define GDATA_GD_MAIL_CLASS_NEITHER "http://schemas.google.com/g/2005#neither"
+
+

Address is purely locational and cannot be used for mail. Value for “mail-class”.

+

Since: 0.5.0

+
+
+
+

GDATA_GD_MAIL_CLASS_PARCELS

+
#define GDATA_GD_MAIL_CLASS_PARCELS "http://schemas.google.com/g/2005#parcels"
+
+

Only parcels can be sent to the address. Value for “mail-class”.

+

Since: 0.5.0

+
+
+
+

GDataGDPostalAddress

+
typedef struct _GDataGDPostalAddress GDataGDPostalAddress;
+

All the fields in the GDataGDPostalAddress structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataGDPostalAddressClass

+
typedef struct {
+} GDataGDPostalAddressClass;
+
+

All the fields in the GDataGDPostalAddressClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “address” property

+
  “address”                  gchar *
+

The postal address itself, formatted and unstructured. It is preferred to use the other, structured properties rather than this one.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “agent” property

+
  “agent”                    gchar *
+

The agent who actually receives the mail. Used in work addresses. Also for "in care of" or "c/o".

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “city” property

+
  “city”                     gchar *
+

Can be city, village, town, borough, etc. This is the postal town and not necessarily the place of residence or place of business.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “country” property

+
  “country”                  gchar *
+

The name of the country. Since this is paired with “country-code”, they must both be set with +gdata_gd_postal_address_set_country().

+

For more information, see the

+GData specification. +

Flags: Read

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “country-code” property

+
  “country-code”             gchar *
+

The ISO 3166-1 alpha-2 country code for the country in “country”. Since this is paired with +“country”, they must both be set with gdata_gd_postal_address_set_country().

+

For more information, see the

+GData specification

or ISO 3166-1 alpha-2.

+

Flags: Read

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “house-name” property

+
  “house-name”               gchar *
+

Used in places where houses or buildings have names (and not necessarily numbers).

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “is-primary” property

+
  “is-primary”               gboolean
+

Indicates which postal address out of a group is primary.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A simple string value used to name this postal address. It allows UIs to display a label such as "Work", "Personal", "Preferred", etc.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “mail-class” property

+
  “mail-class”               gchar *
+

Classes of mail accepted at this address. For example: GDATA_GD_MAIL_CLASS_LETTERS or GDATA_GD_MAIL_CLASS_BOTH.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: "http://schemas.google.com/g/2005#both"

+

Since: 0.5.0

+
+
+
+

The “neighborhood” property

+
  “neighborhood”             gchar *
+

This is used to disambiguate a street address when a city contains more than one street with the same name, or to specify a small place +whose mail is routed through a larger postal town. In China it could be a county or a minor city.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “po-box” property

+
  “po-box”                   gchar *
+

Covers actual P.O. boxes, drawers, locked bags, etc. This is usually but not always mutually exclusive with “street”.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “postcode” property

+
  “postcode”                 gchar *
+

Postal code. Usually country-wide, but sometimes specific to the city (e.g. "2" in "Dublin 2, Ireland" addresses).

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “region” property

+
  “region”                   gchar *
+

A state, province, county (in Ireland), Land (in Germany), departement (in France), etc.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

A programmatic value that identifies the type of postal address. For example: GDATA_GD_POSTAL_ADDRESS_WORK or +GDATA_GD_POSTAL_ADDRESS_OTHER.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: "http://schemas.google.com/g/2005#work"

+

Since: 0.4.0

+
+
+
+

The “street” property

+
  “street”                   gchar *
+

Can be street, avenue, road, etc. This element also includes the house number and room/apartment/flat/floor number.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “subregion” property

+
  “subregion”                gchar *
+

Handles administrative districts such as U.S. or U.K. counties that are not used for mail addressing purposes. +Subregion is not intended for delivery addresses.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “usage” property

+
  “usage”                    gchar *
+

The context in which this addess can be used. For example: GDATA_GD_ADDRESS_USAGE_GENERAL or GDATA_GD_ADDRESS_USAGE_LOCAL.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: "http://schemas.google.com/g/2005#general"

+

Since: 0.5.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDReminder.html b/docs/reference/html/GDataGDReminder.html new file mode 100644 index 0000000..f487419 --- /dev/null +++ b/docs/reference/html/GDataGDReminder.html @@ -0,0 +1,557 @@ + + + + +GDataGDReminder: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDReminder

+

GDataGDReminder — GData reminder element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDReminder * + +gdata_gd_reminder_new () +
const gchar * + +gdata_gd_reminder_get_method () +
+void + +gdata_gd_reminder_set_method () +
+gint64 + +gdata_gd_reminder_get_absolute_time () +
+void + +gdata_gd_reminder_set_absolute_time () +
+gboolean + +gdata_gd_reminder_is_absolute_time () +
+gint + +gdata_gd_reminder_get_relative_time () +
+void + +gdata_gd_reminder_set_relative_time () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
gint64absolute-timeRead / Write
gbooleanis-absolute-timeRead
+gchar *methodRead / Write
gintrelative-timeRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
#defineGDATA_GD_REMINDER_ALERT
#defineGDATA_GD_REMINDER_EMAIL
#defineGDATA_GD_REMINDER_SMS
 GDataGDReminder
 GDataGDReminderClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDReminder
+
+
+
+

Implemented Interfaces

+

+GDataGDReminder implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-reminder.h>
+
+
+
+

Description

+

GDataGDReminder represents a "reminder" element from the

+GData specification. + +
+
+

Functions

+
+

gdata_gd_reminder_new ()

+
GDataGDReminder *
+gdata_gd_reminder_new (const gchar *method,
+                       gint64 absolute_time,
+                       gint relative_time);
+

Creates a new GDataGDReminder. More information is available in the GData specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

method

the notification method the reminder should use, or NULL.

[allow-none]

absolute_time

the absolute time for the reminder, or -1

 

relative_time

the relative time for the reminder, in minutes, or -1

 
+
+
+

Returns

+

a new GDataGDReminder, or NULL; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_gd_reminder_get_method ()

+
const gchar *
+gdata_gd_reminder_get_method (GDataGDReminder *self);
+

Gets the “method” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDReminder

 
+
+
+

Returns

+

the method, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_reminder_set_method ()

+
void
+gdata_gd_reminder_set_method (GDataGDReminder *self,
+                              const gchar *method);
+

Sets the “method” property to method +.

+

Set method + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDReminder

 

method

the new method, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_reminder_get_absolute_time ()

+
gint64
+gdata_gd_reminder_get_absolute_time (GDataGDReminder *self);
+

Gets the “absolute-time” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDReminder

 
+
+
+

Returns

+

the UNIX timestamp of the absolute time for the reminder, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_reminder_set_absolute_time ()

+
void
+gdata_gd_reminder_set_absolute_time (GDataGDReminder *self,
+                                     gint64 absolute_time);
+

Sets the “absolute-time” property to absolute_time +.

+

Set absolute_time + to -1 to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDReminder

 

absolute_time

the new absolute time, or -1

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_reminder_is_absolute_time ()

+
gboolean
+gdata_gd_reminder_is_absolute_time (GDataGDReminder *self);
+

Returns whether the reminder is specified as an absolute time, or as a number of minutes after +the corresponding event's start time.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDReminder

 
+
+
+

Returns

+

TRUE if the reminder is absolute, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_reminder_get_relative_time ()

+
gint
+gdata_gd_reminder_get_relative_time (GDataGDReminder *self);
+

Gets the “relative-time” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDReminder

 
+
+
+

Returns

+

the relative time, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_reminder_set_relative_time ()

+
void
+gdata_gd_reminder_set_relative_time (GDataGDReminder *self,
+                                     gint relative_time);
+

Sets the “relative-time” property to relative_time +.

+

Set relative_time + to -1 to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDReminder

 

relative_time

the new relative time, or -1

 
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_GD_REMINDER_ALERT

+
#define GDATA_GD_REMINDER_ALERT "alert"
+
+

The “method” for an alert to appear in the user's browser.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_REMINDER_EMAIL

+
#define GDATA_GD_REMINDER_EMAIL "email"
+
+

The “method” for an alert to be sent to the user by e-mail.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_REMINDER_SMS

+
#define GDATA_GD_REMINDER_SMS "sms"
+
+

The “method” for an alert to be sent to the user by SMS.

+

Since: 0.7.0

+
+
+
+

GDataGDReminder

+
typedef struct _GDataGDReminder GDataGDReminder;
+

All the fields in the GDataGDReminder structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataGDReminderClass

+
typedef struct {
+} GDataGDReminderClass;
+
+

All the fields in the GDataGDReminderClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “absolute-time” property

+
  “absolute-time”            gint64
+

Absolute time at which the reminder should be issued.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “is-absolute-time” property

+
  “is-absolute-time”         gboolean
+

Whether the reminder is specified as an absolute or relative time.

+

For more information, see the

+GData specification. +

Flags: Read

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “method” property

+
  “method”                   gchar *
+

The notification method the reminder should use. For example: GDATA_GD_REMINDER_ALERT or GDATA_GD_REMINDER_EMAIL.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “relative-time” property

+
  “relative-time”            gint
+

Time at which the reminder should be issued, in minutes relative to the start time of the corresponding event.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDWhen.html b/docs/reference/html/GDataGDWhen.html new file mode 100644 index 0000000..a25efac --- /dev/null +++ b/docs/reference/html/GDataGDWhen.html @@ -0,0 +1,747 @@ + + + + +GDataGDWhen: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDWhen

+

GDataGDWhen — GData when element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDWhen * + +gdata_gd_when_new () +
+gint64 + +gdata_gd_when_get_start_time () +
+void + +gdata_gd_when_set_start_time () +
+gint64 + +gdata_gd_when_get_end_time () +
+void + +gdata_gd_when_set_end_time () +
+gboolean + +gdata_gd_when_is_date () +
+void + +gdata_gd_when_set_is_date () +
const gchar * + +gdata_gd_when_get_value_string () +
+void + +gdata_gd_when_set_value_string () +
+GList * + +gdata_gd_when_get_reminders () +
+void + +gdata_gd_when_add_reminder () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
gint64end-timeRead / Write
gbooleanis-dateRead / Write
gint64start-timeRead / Write
+gchar *value-stringRead / Write
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDWhen
+
+
+
+

Implemented Interfaces

+

+GDataGDWhen implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-when.h>
+
+
+
+

Description

+

GDataGDWhen represents a "when" element from the

+GData specification. + +
+
+

Functions

+
+

gdata_gd_when_new ()

+
GDataGDWhen *
+gdata_gd_when_new (gint64 start_time,
+                   gint64 end_time,
+                   gboolean is_date);
+

Creates a new GDataGDWhen. More information is available in the GData specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

start_time

when the event starts or (for zero-duration events) when it occurs

 

end_time

when the event ends, or -1

 

is_date

TRUE if start_time +and end_time +specify dates rather than times, FALSE otherwise

 
+
+
+

Returns

+

a new GDataGDWhen, or NULL; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_gd_when_get_start_time ()

+
gint64
+gdata_gd_when_get_start_time (GDataGDWhen *self);
+

Gets the “start-time” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWhen

 
+
+
+

Returns

+

the UNIX timestamp for the start time of the event

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_when_set_start_time ()

+
void
+gdata_gd_when_set_start_time (GDataGDWhen *self,
+                              gint64 start_time);
+

Sets the “start-time” property to start_time +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWhen

 

start_time

the new start time

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_when_get_end_time ()

+
gint64
+gdata_gd_when_get_end_time (GDataGDWhen *self);
+

Gets the “end-time” property.

+

If the end time is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWhen

 
+
+
+

Returns

+

the UNIX timestamp for the end time of the event, or

+-1 +
+

Since: 0.4.0

+
+
+
+

gdata_gd_when_set_end_time ()

+
void
+gdata_gd_when_set_end_time (GDataGDWhen *self,
+                            gint64 end_time);
+

Sets the “end-time” property to end_time +.

+

Set end_time + to -1 to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWhen

 

end_time

the new end time, or -1

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_when_is_date ()

+
gboolean
+gdata_gd_when_is_date (GDataGDWhen *self);
+

Gets the “is-date” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWhen

 
+
+
+

Returns

+

TRUE if “start-time” and “end-time” are dates rather than times, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_when_set_is_date ()

+
void
+gdata_gd_when_set_is_date (GDataGDWhen *self,
+                           gboolean is_date);
+

Sets the “is-date” property to is_date +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWhen

 

is_date

TRUE if “start-time” and “end-time” should be dates rather than times, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_when_get_value_string ()

+
const gchar *
+gdata_gd_when_get_value_string (GDataGDWhen *self);
+

Gets the “value-string” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWhen

 
+
+
+

Returns

+

the value string, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_when_set_value_string ()

+
void
+gdata_gd_when_set_value_string (GDataGDWhen *self,
+                                const gchar *value_string);
+

Sets the “value-string” property to value_string +.

+

Set value_string + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWhen

 

value_string

the new value string, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_when_get_reminders ()

+
GList *
+gdata_gd_when_get_reminders (GDataGDWhen *self);
+

Returns a list of the GDataGDReminders which are associated with this GDataGDWhen.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWhen

 
+
+
+

Returns

+

a GList of GDataGDReminders, or NULL.

+

[element-type GData.GDReminder][transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_when_add_reminder ()

+
void
+gdata_gd_when_add_reminder (GDataGDWhen *self,
+                            GDataGDReminder *reminder);
+

Adds a reminder to the GDataGDWhen's list of reminders and increments its reference count.

+

Duplicate reminders will not be added to the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWhen

 

reminder

a GDataGDReminder to add

 
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDATA_GD_EVENT_STATUS_CANCELED

+
#define GDATA_GD_EVENT_STATUS_CANCELED "http://schemas.google.com/g/2005#event.canceled"
+
+

The event has been canceled.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EVENT_STATUS_CONFIRMED

+
#define GDATA_GD_EVENT_STATUS_CONFIRMED "http://schemas.google.com/g/2005#event.confirmed"
+
+

The event has been planned and confirmed.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EVENT_STATUS_TENTATIVE

+
#define GDATA_GD_EVENT_STATUS_TENTATIVE "http://schemas.google.com/g/2005#event.tentative"
+
+

The event has been planned, but only tentatively scheduled.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EVENT_VISIBILITY_CONFIDENTIAL

+
#define GDATA_GD_EVENT_VISIBILITY_CONFIDENTIAL "http://schemas.google.com/g/2005#event.confidential"
+
+

The event is visible to only certain people.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EVENT_VISIBILITY_DEFAULT

+
#define GDATA_GD_EVENT_VISIBILITY_DEFAULT "http://schemas.google.com/g/2005#event.default"
+
+

The event's visibility is inherited from the preferences of its owner.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EVENT_VISIBILITY_PRIVATE

+
#define GDATA_GD_EVENT_VISIBILITY_PRIVATE "http://schemas.google.com/g/2005#event.private"
+
+

The event is visible to very few people.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EVENT_VISIBILITY_PUBLIC

+
#define GDATA_GD_EVENT_VISIBILITY_PUBLIC "http://schemas.google.com/g/2005#event.public"
+
+

The event is visible to most people.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EVENT_TRANSPARENCY_OPAQUE

+
#define GDATA_GD_EVENT_TRANSPARENCY_OPAQUE "http://schemas.google.com/g/2005#event.opaque"
+
+

The event consumes time in calendars; its time will be marked as busy in a free/busy search.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_EVENT_TRANSPARENCY_TRANSPARENT

+
#define GDATA_GD_EVENT_TRANSPARENCY_TRANSPARENT "http://schemas.google.com/g/2005#event.transparent"
+
+

The event does not consume time in calendars; its time will be not marked as busy in a free/busy search.

+

Since: 0.7.0

+
+
+
+

GDataGDWhen

+
typedef struct _GDataGDWhen GDataGDWhen;
+

All the fields in the GDataGDWhen structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataGDWhenClass

+
typedef struct {
+} GDataGDWhenClass;
+
+

All the fields in the GDataGDWhenClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “end-time” property

+
  “end-time”                 gint64
+

The title of a person within the when.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “is-date” property

+
  “is-date”                  gboolean
+

A programmatic value that identifies the type of when.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “start-time” property

+
  “start-time”               gint64
+

The name of the when.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Allowed values: >= 0

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “value-string” property

+
  “value-string”             gchar *
+

A simple string value used to name this when. It allows UIs to display a label such as "Work", "Volunteer", +"Professional Society", etc.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDWhere.html b/docs/reference/html/GDataGDWhere.html new file mode 100644 index 0000000..37a32a4 --- /dev/null +++ b/docs/reference/html/GDataGDWhere.html @@ -0,0 +1,505 @@ + + + + +GDataGDWhere: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDWhere

+

GDataGDWhere — GData where element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDWhere * + +gdata_gd_where_new () +
const gchar * + +gdata_gd_where_get_relation_type () +
+void + +gdata_gd_where_set_relation_type () +
const gchar * + +gdata_gd_where_get_value_string () +
+void + +gdata_gd_where_set_value_string () +
const gchar * + +gdata_gd_where_get_label () +
+void + +gdata_gd_where_set_label () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *labelRead / Write
+gchar *relation-typeRead / Write
+gchar *value-stringRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
#defineGDATA_GD_WHERE_EVENT
#defineGDATA_GD_WHERE_EVENT_ALTERNATE
#defineGDATA_GD_WHERE_EVENT_PARKING
 GDataGDWhere
 GDataGDWhereClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDWhere
+
+
+
+

Implemented Interfaces

+

+GDataGDWhere implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-where.h>
+
+
+
+

Description

+

GDataGDWhere represents a "where" element from the

+GData specification. + +
+
+

Functions

+
+

gdata_gd_where_new ()

+
GDataGDWhere *
+gdata_gd_where_new (const gchar *relation_type,
+                    const gchar *value_string,
+                    const gchar *label);
+

Creates a new GDataGDWhere. More information is available in the GData specification.

+

Currently, entryLink functionality is not implemented in GDataGDWhere.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

relation_type

the relationship between the item and this place, or NULL.

[allow-none]

value_string

a string to represent the place, or NULL.

[allow-none]

label

a human-readable label for the place, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataGDWhere; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_gd_where_get_relation_type ()

+
const gchar *
+gdata_gd_where_get_relation_type (GDataGDWhere *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWhere

 
+
+
+

Returns

+

the relation type, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_where_set_relation_type ()

+
void
+gdata_gd_where_set_relation_type (GDataGDWhere *self,
+                                  const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +.

+

Set relation_type + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWhere

 

relation_type

the new relation type, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_where_get_value_string ()

+
const gchar *
+gdata_gd_where_get_value_string (GDataGDWhere *self);
+

Gets the “value-string” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWhere

 
+
+
+

Returns

+

the value string, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_where_set_value_string ()

+
void
+gdata_gd_where_set_value_string (GDataGDWhere *self,
+                                 const gchar *value_string);
+

Sets the “value-string” property to value_string +.

+

Set value_string + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWhere

 

value_string

the new value string, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_where_get_label ()

+
const gchar *
+gdata_gd_where_get_label (GDataGDWhere *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWhere

 
+
+
+

Returns

+

the label, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_where_set_label ()

+
void
+gdata_gd_where_set_label (GDataGDWhere *self,
+                          const gchar *label);
+

Sets the “label” property to label +.

+

Set label + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWhere

 

label

the new label, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_GD_WHERE_EVENT

+
#define GDATA_GD_WHERE_EVENT "http://schemas.google.com/g/2005#event"
+
+

The relation type URI for an event location.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_WHERE_EVENT_ALTERNATE

+
#define GDATA_GD_WHERE_EVENT_ALTERNATE "http://schemas.google.com/g/2005#event.alternate"
+
+

The relation type URI for an alternate event location, such as a video conference site.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_WHERE_EVENT_PARKING

+
#define GDATA_GD_WHERE_EVENT_PARKING "http://schemas.google.com/g/2005#event.parking"
+
+

The relation type URI for an event's parking lot.

+

Since: 0.7.0

+
+
+
+

GDataGDWhere

+
typedef struct _GDataGDWhere GDataGDWhere;
+

All the fields in the GDataGDWhere structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataGDWhereClass

+
typedef struct {
+} GDataGDWhereClass;
+
+

All the fields in the GDataGDWhereClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “label” property

+
  “label”                    gchar *
+

Specifies a user-readable label to distinguish this location from others.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

Specifies the relationship between the containing entity and the contained location. For example: GDATA_GD_WHERE_EVENT or +GDATA_GD_WHERE_EVENT_PARKING.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “value-string” property

+
  “value-string”             gchar *
+

A simple string representation of this location.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGDWho.html b/docs/reference/html/GDataGDWho.html new file mode 100644 index 0000000..9a06ba2 --- /dev/null +++ b/docs/reference/html/GDataGDWho.html @@ -0,0 +1,517 @@ + + + + +GDataGDWho: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGDWho

+

GDataGDWho — GData who element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataGDWho * + +gdata_gd_who_new () +
const gchar * + +gdata_gd_who_get_relation_type () +
+void + +gdata_gd_who_set_relation_type () +
const gchar * + +gdata_gd_who_get_value_string () +
+void + +gdata_gd_who_set_value_string () +
const gchar * + +gdata_gd_who_get_email_address () +
+void + +gdata_gd_who_set_email_address () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *email-addressRead / Write
+gchar *relation-typeRead / Write
+gchar *value-stringRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGDATA_GD_WHO_EVENT_ATTENDEE
#defineGDATA_GD_WHO_EVENT_ORGANIZER
#defineGDATA_GD_WHO_EVENT_PERFORMER
#defineGDATA_GD_WHO_EVENT_SPEAKER
 GDataGDWho
 GDataGDWhoClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGDWho
+
+
+
+

Implemented Interfaces

+

+GDataGDWho implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/gd/gdata-gd-who.h>
+
+
+
+

Description

+

GDataGDWho represents an "who" element from the

+GData specification. + +
+
+

Functions

+
+

gdata_gd_who_new ()

+
GDataGDWho *
+gdata_gd_who_new (const gchar *relation_type,
+                  const gchar *value_string,
+                  const gchar *email_address);
+

Creates a new GDataGDWho. More information is available in the GData specification.

+

Currently, entryLink functionality is not implemented in GDataGDWho.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

relation_type

the relationship between the item and this person, or NULL.

[allow-none]

value_string

a string to represent the person, or NULL.

[allow-none]

email_address

the person's e-mail address, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataGDWho; unref with g_object_unref()

+
+

Since: 0.2.0

+
+
+
+

gdata_gd_who_get_relation_type ()

+
const gchar *
+gdata_gd_who_get_relation_type (GDataGDWho *self);
+

Gets the “relation-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWho

 
+
+
+

Returns

+

the relation type, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_who_set_relation_type ()

+
void
+gdata_gd_who_set_relation_type (GDataGDWho *self,
+                                const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +.

+

Set relation_type + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWho

 

relation_type

the new relation type, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_who_get_value_string ()

+
const gchar *
+gdata_gd_who_get_value_string (GDataGDWho *self);
+

Gets the “value-string” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWho

 
+
+
+

Returns

+

the value string, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_who_set_value_string ()

+
void
+gdata_gd_who_set_value_string (GDataGDWho *self,
+                               const gchar *value_string);
+

Sets the “value-string” property to value_string +.

+

Set value_string + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWho

 

value_string

the new value string, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_gd_who_get_email_address ()

+
const gchar *
+gdata_gd_who_get_email_address (GDataGDWho *self);
+

Gets the “email-address” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGDWho

 
+
+
+

Returns

+

the e-mail address, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_gd_who_set_email_address ()

+
void
+gdata_gd_who_set_email_address (GDataGDWho *self,
+                                const gchar *email_address);
+

Sets the “email-address” property to email_address +.

+

Set email_address + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataGDWho

 

email_address

the new e-mail address, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_GD_WHO_EVENT_ATTENDEE

+
#define GDATA_GD_WHO_EVENT_ATTENDEE "http://schemas.google.com/g/2005#event.attendee"
+
+

The relation type URI for a general meeting or event attendee.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_WHO_EVENT_ORGANIZER

+
#define GDATA_GD_WHO_EVENT_ORGANIZER "http://schemas.google.com/g/2005#event.organizer"
+
+

The relation type URI for an event organizer (not necessarily an attendee).

+

Since: 0.7.0

+
+
+
+

GDATA_GD_WHO_EVENT_PERFORMER

+
#define GDATA_GD_WHO_EVENT_PERFORMER "http://schemas.google.com/g/2005#event.performer"
+
+

The relation type URI for an event performer, which is similar to GDATA_GD_WHO_EVENT_SPEAKER, but with more emphasis on art rather than speaking.

+

Since: 0.7.0

+
+
+
+

GDATA_GD_WHO_EVENT_SPEAKER

+
#define GDATA_GD_WHO_EVENT_SPEAKER "http://schemas.google.com/g/2005#event.speaker"
+
+

The relation type URI for a speaker at an event.

+

Since: 0.7.0

+
+
+
+

GDataGDWho

+
typedef struct _GDataGDWho GDataGDWho;
+

All the fields in the GDataGDWho structure are private and should never be accessed directly.

+

Since: 0.2.0

+
+
+
+

GDataGDWhoClass

+
typedef struct {
+} GDataGDWhoClass;
+
+

All the fields in the GDataGDWhoClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “email-address” property

+
  “email-address”            gchar *
+

The e-mail address of the person represented by the GDataGDWho.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

Specifies the relationship between the containing entity and the contained person. For example: GDATA_GD_WHO_EVENT_PERFORMER or +GDATA_GD_WHO_EVENT_ATTENDEE.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “value-string” property

+
  “value-string”             gchar *
+

A simple string representation of this person.

+

For more information, see the

+GData specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGenerator.html b/docs/reference/html/GDataGenerator.html new file mode 100644 index 0000000..449cad3 --- /dev/null +++ b/docs/reference/html/GDataGenerator.html @@ -0,0 +1,296 @@ + + + + +GDataGenerator: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGenerator

+

GDataGenerator — Atom generator element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
const gchar * + +gdata_generator_get_name () +
const gchar * + +gdata_generator_get_uri () +
const gchar * + +gdata_generator_get_version () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *nameRead
+gchar *uriRead
+gchar *versionRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataGenerator
 GDataGeneratorClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataGenerator
+
+
+
+

Implemented Interfaces

+

+GDataGenerator implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/atom/gdata-generator.h>
+
+
+
+

Description

+

GDataGenerator represents a "generator" element from the

+Atom specification. + +
+
+

Functions

+
+

gdata_generator_get_name ()

+
const gchar *
+gdata_generator_get_name (GDataGenerator *self);
+

Gets the “name” property. The name will be NULL or non-empty.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGenerator

 
+
+
+

Returns

+

the generator's name.

+

[nullable]

+
+

Since: 0.4.0

+
+
+
+

gdata_generator_get_uri ()

+
const gchar *
+gdata_generator_get_uri (GDataGenerator *self);
+

Gets the “uri” property. The URI will be NULL or non-empty.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGenerator

 
+
+
+

Returns

+

the generator's URI, or NULL.

+

[nullable]

+
+

Since: 0.4.0

+
+
+
+

gdata_generator_get_version ()

+
const gchar *
+gdata_generator_get_version (GDataGenerator *self);
+

Gets the “version” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGenerator

 
+
+
+

Returns

+

the generator's version, or NULL

+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDataGenerator

+
typedef struct _GDataGenerator GDataGenerator;
+

All the fields in the GDataGenerator structure are private and should never be accessed directly.

+
+
+
+

GDataGeneratorClass

+
typedef struct {
+} GDataGeneratorClass;
+
+

All the fields in the GDataGeneratorClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “name” property

+
  “name”                     gchar *
+

A human-readable name for the generating agent.

+

For more information, see the

+ +Atom specification. +

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “uri” property

+
  “uri”                      gchar *
+

An IRI reference that is relevant to the agent.

+

For more information, see the

+ +Atom specification. +

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “version” property

+
  “version”                  gchar *
+

Indicates the version of the generating agent.

+

For more information, see the

+ +Atom specification. +

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataGoaAuthorizer.html b/docs/reference/html/GDataGoaAuthorizer.html new file mode 100644 index 0000000..dafd11f --- /dev/null +++ b/docs/reference/html/GDataGoaAuthorizer.html @@ -0,0 +1,274 @@ + + + + +GDataGoaAuthorizer: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataGoaAuthorizer

+

GDataGoaAuthorizer — GData GOA authorization interface

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + +
+GDataGoaAuthorizer * + +gdata_goa_authorizer_new () +
+GoaObject * + +gdata_goa_authorizer_get_goa_object () +
+
+
+

Properties

+
+++++ + + + + + +
+GoaObject *goa-objectRead / Write / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataGoaAuthorizer
 GDataGoaAuthorizerClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataGoaAuthorizer
+
+
+
+

Implemented Interfaces

+

+GDataGoaAuthorizer implements + GDataAuthorizer.

+
+
+

Includes

+
#include <gdata/gdata-goa-authorizer.h>
+
+
+
+

Description

+

GDataGoaAuthorizer provides an implementation of the GDataAuthorizer interface for authentication and authorization using GNOME Online Accounts +(GOA) over D-Bus. This allows a single login session (managed by the GOA daemon) to be used by multiple applications simultaneously, without each +of those applications having to go through the authentication process themselves. Applications making use of GDataGoaAuthorizer don't get access +to the user's password (it's handled solely by the GOA daemon).

+

Internally, GOA authenticates with the Google servers using the

+OAuth 1.0 or +OAuth 2.0 processes. +

GDataGoaAuthorizer natively supports authorization against multiple services (unlike GDataClientLoginAuthorizer), depending entirely on which +services the user has enabled for their Google account in GOA. GDataGoaAuthorizer cannot authenticate for more services than are enabled in GOA.

+
+

Example 7. Authenticating Using GOA

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
GDataSomeService *service;
+GoaObject *goa_object;
+GDataGoaAuthorizer *authorizer;
+
+/* Create an authorizer and pass it an existing #GoaObject. */
+goa_object = get_goa_object ();
+authorizer = gdata_goa_authorizer_new (goa_object);
+
+/* Create a service object and link it with the authorizer */
+service = gdata_some_service_new (GDATA_AUTHORIZER (authorizer));
+
+/* Use the service! */
+
+g_object_unref (service);
+g_object_unref (authorizer);
+g_object_unref (goa_object);
+
+ +
+
+
+
+

Functions

+
+

gdata_goa_authorizer_new ()

+
GDataGoaAuthorizer *
+gdata_goa_authorizer_new (GoaObject *goa_object);
+

Create a new GDataGoaAuthorizer using the authentication token from the given goa_object +.

+
+

Parameters

+
+++++ + + + + + +

goa_object

the GOA account providing authentication.

[transfer none]
+
+
+

Returns

+

a new GDataGoaAuthorizer; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.13.1

+
+
+
+

gdata_goa_authorizer_get_goa_object ()

+
GoaObject *
+gdata_goa_authorizer_get_goa_object (GDataGoaAuthorizer *self);
+

The GOA account providing authentication. This is the same as “goa-object”.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataGoaAuthorizer

 
+
+
+

Returns

+

the GOA account providing authentication.

+

[transfer none]

+
+

Since: 0.13.1

+
+
+
+

Types and Values

+
+

GDataGoaAuthorizer

+
typedef struct _GDataGoaAuthorizer GDataGoaAuthorizer;
+

All the fields in the GDataGoaAuthorizer structure are private and should never be accessed directly.

+

Since: 0.13.1

+
+
+
+

GDataGoaAuthorizerClass

+
typedef struct {
+} GDataGoaAuthorizerClass;
+
+

All the fields in the GDataGoaAuthorizerClass structure are private and should never be accessed directly.

+

Since: 0.13.1

+
+
+
+

Property Details

+
+

The “goa-object” property

+
  “goa-object”               GoaObject *
+

The GOA account providing authentication. This should have all the necessary services enabled on it.

+

Flags: Read / Write / Construct Only

+

Since: 0.13.1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataLink.html b/docs/reference/html/GDataLink.html new file mode 100644 index 0000000..a5c7176 --- /dev/null +++ b/docs/reference/html/GDataLink.html @@ -0,0 +1,882 @@ + + + + +GDataLink: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataLink

+

GDataLink — Atom link element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataLink * + +gdata_link_new () +
const gchar * + +gdata_link_get_uri () +
+void + +gdata_link_set_uri () +
const gchar * + +gdata_link_get_relation_type () +
+void + +gdata_link_set_relation_type () +
const gchar * + +gdata_link_get_content_type () +
+void + +gdata_link_set_content_type () +
const gchar * + +gdata_link_get_language () +
+void + +gdata_link_set_language () +
const gchar * + +gdata_link_get_title () +
+void + +gdata_link_set_title () +
+gint + +gdata_link_get_length () +
+void + +gdata_link_set_length () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *content-typeRead / Write
+gchar *languageRead / Write
gintlengthRead / Write
+gchar *relation-typeRead / Write
+gchar *titleRead / Write
+gchar *uriRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGDATA_LINK_ALTERNATE
#defineGDATA_LINK_BATCH
#defineGDATA_LINK_EDIT
#defineGDATA_LINK_EDIT_MEDIA
#defineGDATA_LINK_ENCLOSURE
#defineGDATA_LINK_RELATED
#defineGDATA_LINK_SELF
#defineGDATA_LINK_VIA
#defineGDATA_LINK_PARENT
 GDataLink
 GDataLinkClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataLink
+
+
+
+

Implemented Interfaces

+

+GDataLink implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/atom/gdata-link.h>
+
+
+
+

Description

+

GDataLink represents a "link" element from the

+Atom specification. + +
+
+

Functions

+
+

gdata_link_new ()

+
GDataLink *
+gdata_link_new (const gchar *uri,
+                const gchar *relation_type);
+

Creates a new GDataLink. More information is available in the Atom specification.

+

uri + must be non-NULL and non-empty. relation_type + must be NULL or non-empty.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

uri

the link's IRI

 

relation_type

the relationship of the link to the current document, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataLink, or NULL; unref with g_object_unref()

+
+
+
+
+

gdata_link_get_uri ()

+
const gchar *
+gdata_link_get_uri (GDataLink *self);
+

Gets the “uri” property. The return value is guaranteed to be a valid IRI, as +specified by the Atom protocol. Common relationship values such as alternate +are returned as http://www.iana.org/assignments/relation/alternate.

+

For more information, see the +Atom specification.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataLink

 
+
+
+

Returns

+

the link's URI

+
+

Since: 0.4.0

+
+
+
+

gdata_link_set_uri ()

+
void
+gdata_link_set_uri (GDataLink *self,
+                    const gchar *uri);
+

Sets the “uri” property to uri +. uri + must be non-NULL and non-empty.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataLink

 

uri

the new URI for the link

 
+
+

Since: 0.4.0

+
+
+
+

gdata_link_get_relation_type ()

+
const gchar *
+gdata_link_get_relation_type (GDataLink *self);
+

Gets the “relation-type” property. If the relation type is non-NULL, it will be non-empty.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataLink

 
+
+
+

Returns

+

the link's relation type.

+

[nullable]

+
+

Since: 0.4.0

+
+
+
+

gdata_link_set_relation_type ()

+
void
+gdata_link_set_relation_type (GDataLink *self,
+                              const gchar *relation_type);
+

Sets the “relation-type” property to relation_type +. If relation_type + is one of the standard Atom relation types, +use one of the defined relation type values, instead of a static string. e.g. GDATA_LINK_EDIT or GDATA_LINK_SELF.

+

Set relation_type + to NULL to unset the property in the link.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataLink

 

relation_type

the new relation type for the link, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_link_get_content_type ()

+
const gchar *
+gdata_link_get_content_type (GDataLink *self);
+

Gets the “content-type” property. If the content type is non-NULL, it will be non-empty.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataLink

 
+
+
+

Returns

+

the link's content type, or NULL.

+

[nullable]

+
+

Since: 0.4.0

+
+
+
+

gdata_link_set_content_type ()

+
void
+gdata_link_set_content_type (GDataLink *self,
+                             const gchar *content_type);
+

Sets the “content-type” property to content_type +. content_type + must be NULL or non-empty.

+

Set content_type + to NULL to unset the property in the link.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataLink

 

content_type

the new content type for the link, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_link_get_language ()

+
const gchar *
+gdata_link_get_language (GDataLink *self);
+

Gets the “language” property. If the language is non-NULL, it will be non-empty.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataLink

 
+
+
+

Returns

+

the link's language, or NULL.

+

[nullable]

+
+

Since: 0.4.0

+
+
+
+

gdata_link_set_language ()

+
void
+gdata_link_set_language (GDataLink *self,
+                         const gchar *language);
+

Sets the “language” property to language +. language + must be NULL or non-empty.

+

Set language + to NULL to unset the property in the link.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataLink

 

language

the new language for the link, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_link_get_title ()

+
const gchar *
+gdata_link_get_title (GDataLink *self);
+

Gets the “title” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataLink

 
+
+
+

Returns

+

the link's title, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_link_set_title ()

+
void
+gdata_link_set_title (GDataLink *self,
+                      const gchar *title);
+

Sets the “title” property to title +.

+

Set title + to NULL to unset the property in the link.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataLink

 

title

the new title for the link, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_link_get_length ()

+
gint
+gdata_link_get_length (GDataLink *self);
+

Gets the “length” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataLink

 
+
+
+

Returns

+

the link's length, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_link_set_length ()

+
void
+gdata_link_set_length (GDataLink *self,
+                       gint length);
+

Sets the “length” property to length +.

+

Set length + to -1 to unset the property in the link.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataLink

 

length

the new length for the link, or -1

 
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_LINK_ALTERNATE

+
#define GDATA_LINK_ALTERNATE "http://www.iana.org/assignments/relation/alternate"
+
+

The relation type URI for alternate resources to the current one.

+

For more information, see the +Atom specification.

+

Since: 0.4.0

+
+
+
+

GDATA_LINK_BATCH

+
#define GDATA_LINK_BATCH "http://schemas.google.com/g/2005#batch"
+
+

The relation type URI for the batch operation URI for a given GDataFeed.

+

For more information, see the GData specification.

+

Since: 0.7.0

+
+
+
+

GDATA_LINK_EDIT

+
#define GDATA_LINK_EDIT "http://www.iana.org/assignments/relation/edit"
+
+

The relation type URI of the edit location for this resource.

+

For more information, see the +Atom Publishing Protocol specification.

+

Since: 0.4.0

+
+
+
+

GDATA_LINK_EDIT_MEDIA

+
#define GDATA_LINK_EDIT_MEDIA "http://www.iana.org/assignments/relation/edit-media"
+
+

The relation type URI of the edit location for media resources attached to this resource.

+

For more information, see the

+ +Atom Publishing Protocol specification. +

Since: 0.4.0

+
+
+
+

GDATA_LINK_ENCLOSURE

+
#define GDATA_LINK_ENCLOSURE "http://www.iana.org/assignments/relation/enclosure"
+
+

The relation type URI for attached objects which may be large in size.

+

For more information, see the +Atom specification.

+

Since: 0.4.0

+
+
+
+

GDATA_LINK_RELATED

+
#define GDATA_LINK_RELATED "http://www.iana.org/assignments/relation/related"
+
+

The relation type URI for resources related to the current one.

+

For more information, see the +Atom specification.

+

Since: 0.4.0

+
+
+
+

GDATA_LINK_SELF

+
#define GDATA_LINK_SELF "http://www.iana.org/assignments/relation/self"
+
+

The relation type URI for the current resource.

+

For more information, see the +Atom specification.

+

Since: 0.4.0

+
+
+
+

GDATA_LINK_VIA

+
#define GDATA_LINK_VIA "http://www.iana.org/assignments/relation/via"
+
+

The relation type URI for the source document of the current resource.

+

For more information, see the +Atom specification.

+

Since: 0.4.0

+
+
+
+

GDATA_LINK_PARENT

+
#define GDATA_LINK_PARENT "http://schemas.google.com/docs/2007#parent"
+
+

The relation type URI of the of the location of the parent resource in a +hierarchy of entries.

+

This is an undocumented GData-specific addition to the Atom specification, +and is not included in the GData documentation except in examples and in the

+ +RelaxNG schema. +

Since: 0.15.1

+
+
+
+

GDataLink

+
typedef struct _GDataLink GDataLink;
+

All the fields in the GDataLink structure are private and should never be accessed directly.

+
+
+
+

GDataLinkClass

+
typedef struct {
+} GDataLinkClass;
+
+

All the fields in the GDataLinkClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “content-type” property

+
  “content-type”             gchar *
+

An advisory media type: it is a hint about the type of the representation that is expected to be returned when the value +of the “uri” property is dereferenced.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “language” property

+
  “language”                 gchar *
+

Describes the language of the resource pointed to by the “uri” property.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “length” property

+
  “length”                   gint
+

Indicates an advisory length of the linked content in octets. -1 means the length is unspecified.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “relation-type” property

+
  “relation-type”            gchar *
+

The link relation type.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Default value: "http://www.iana.org/assignments/relation/alternate"

+

Since: 0.4.0

+
+
+
+

The “title” property

+
  “title”                    gchar *
+

Conveys human-readable information about the link.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “uri” property

+
  “uri”                      gchar *
+

The link's IRI.

+

For more information, see the

+Atom specification. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataMediaCategory.html b/docs/reference/html/GDataMediaCategory.html new file mode 100644 index 0000000..e441a74 --- /dev/null +++ b/docs/reference/html/GDataMediaCategory.html @@ -0,0 +1,453 @@ + + + + +GDataMediaCategory: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataMediaCategory

+

GDataMediaCategory — Media RSS category element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataMediaCategory * + +gdata_media_category_new () +
const gchar * + +gdata_media_category_get_category () +
+void + +gdata_media_category_set_category () +
const gchar * + +gdata_media_category_get_scheme () +
+void + +gdata_media_category_set_scheme () +
const gchar * + +gdata_media_category_get_label () +
+void + +gdata_media_category_set_label () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *categoryRead / Write
+gchar *labelRead / Write
+gchar *schemeRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataMediaCategory
 GDataMediaCategoryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataMediaCategory
+
+
+
+

Includes

+
#include <gdata/media/gdata-media-category.h>
+
+
+
+

Description

+

GDataMediaCategory represents a "category" element from the

+Media RSS specification. + +
+
+

Functions

+
+

gdata_media_category_new ()

+
GDataMediaCategory *
+gdata_media_category_new (const gchar *category,
+                          const gchar *scheme,
+                          const gchar *label);
+

Creates a new GDataMediaCategory. More information is available in the Media RSS specification.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

category

a category describing the content

 

scheme

a URI identifying the categorisation scheme, or NULL.

[allow-none]

label

a human-readable name for the category, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataMediaCategory, or NULL; unref with g_object_unref()

+
+
+
+
+

gdata_media_category_get_category ()

+
const gchar *
+gdata_media_category_get_category (GDataMediaCategory *self);
+

Gets the “category” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaCategory

 
+
+
+

Returns

+

the actual category

+
+

Since: 0.4.0

+
+
+
+

gdata_media_category_set_category ()

+
void
+gdata_media_category_set_category (GDataMediaCategory *self,
+                                   const gchar *category);
+

Sets the “category” property to category +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataMediaCategory

 

category

the new category

 
+
+

Since: 0.4.0

+
+
+
+

gdata_media_category_get_scheme ()

+
const gchar *
+gdata_media_category_get_scheme (GDataMediaCategory *self);
+

Gets the “scheme” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaCategory

 
+
+
+

Returns

+

the category's scheme, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_media_category_set_scheme ()

+
void
+gdata_media_category_set_scheme (GDataMediaCategory *self,
+                                 const gchar *scheme);
+

Sets the “scheme” property to scheme +.

+

Set scheme + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataMediaCategory

 

scheme

the category's new scheme, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_media_category_get_label ()

+
const gchar *
+gdata_media_category_get_label (GDataMediaCategory *self);
+

Gets the “label” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaCategory

 
+
+
+

Returns

+

the category's label, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_media_category_set_label ()

+
void
+gdata_media_category_set_label (GDataMediaCategory *self,
+                                const gchar *label);
+

Sets the “label” property to label +.

+

Set label + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataMediaCategory

 

label

the category's new label, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDataMediaCategory

+
typedef struct _GDataMediaCategory GDataMediaCategory;
+

All the fields in the GDataMediaCategory structure are private and should never be accessed directly.

+
+
+
+

GDataMediaCategoryClass

+
typedef struct {
+} GDataMediaCategoryClass;
+
+

All the fields in the GDataMediaCategoryClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “category” property

+
  “category”                 gchar *
+

The category name.

+

For more information, see the Media RSS specification.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “label” property

+
  “label”                    gchar *
+

A human-readable label that can be displayed in end-user applications.

+

For more information, see the Media RSS specification.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “scheme” property

+
  “scheme”                   gchar *
+

A URI that identifies the categorization scheme.

+

For more information, see the Media RSS specification.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataMediaContent.html b/docs/reference/html/GDataMediaContent.html new file mode 100644 index 0000000..15e9047 --- /dev/null +++ b/docs/reference/html/GDataMediaContent.html @@ -0,0 +1,753 @@ + + + + +GDataMediaContent: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataMediaContent

+

GDataMediaContent — Media RSS content element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *content-typeRead
gint64durationRead
GDataMediaExpressionexpressionRead
gulongfilesizeRead
guintheightRead
gbooleanis-defaultRead
GDataMediaMediummediumRead
+gchar *uriRead
guintwidthRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
 GDataMediaContent
 GDataMediaContentClass
enumGDataMediaMedium
enumGDataMediaExpression
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataMediaContent
+            ╰── GDataYouTubeContent
+
+
+
+

Includes

+
#include <gdata/media/gdata-media-content.h>
+
+
+
+

Description

+

GDataMediaContent represents a "content" element from the

+Media RSS specification. +

The class only implements parsing, not XML output, at the moment.

+
+
+

Functions

+
+

gdata_media_content_get_uri ()

+
const gchar *
+gdata_media_content_get_uri (GDataMediaContent *self);
+

Gets the “uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaContent

 
+
+
+

Returns

+

the content's URI

+
+

Since: 0.4.0

+
+
+
+

gdata_media_content_get_filesize ()

+
gsize
+gdata_media_content_get_filesize (GDataMediaContent *self);
+

Gets the “filesize” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaContent

 
+
+
+

Returns

+

the number of bytes in the content, or 0

+
+

Since: 0.4.0

+
+
+
+

gdata_media_content_get_content_type ()

+
const gchar *
+gdata_media_content_get_content_type (GDataMediaContent *self);
+

Gets the “content-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaContent

 
+
+
+

Returns

+

the content's content (MIME) type, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_media_content_get_medium ()

+
GDataMediaMedium
+gdata_media_content_get_medium (GDataMediaContent *self);
+

Gets the “medium” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaContent

 
+
+
+

Returns

+

the type of the content, or GDATA_MEDIA_UNKNOWN

+
+

Since: 0.4.0

+
+
+
+

gdata_media_content_is_default ()

+
gboolean
+gdata_media_content_is_default (GDataMediaContent *self);
+

Gets the “is-default” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaContent

 
+
+
+

Returns

+

TRUE if the GDataMediaContent is the default content for the media group, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_media_content_get_expression ()

+
GDataMediaExpression
+gdata_media_content_get_expression (GDataMediaContent *self);
+

Gets the “expression” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaContent

 
+
+
+

Returns

+

the content's expression, or GDATA_MEDIA_EXPRESSION_FULL

+
+

Since: 0.4.0

+
+
+
+

gdata_media_content_get_duration ()

+
gint64
+gdata_media_content_get_duration (GDataMediaContent *self);
+

Gets the “duration” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaContent

 
+
+
+

Returns

+

the content's duration in seconds, or 0

+
+

Since: 0.4.0

+
+
+
+

gdata_media_content_get_height ()

+
guint
+gdata_media_content_get_height (GDataMediaContent *self);
+

Gets the “height” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaContent

 
+
+
+

Returns

+

the content's height in pixels, or 0

+
+

Since: 0.4.0

+
+
+
+

gdata_media_content_get_width ()

+
guint
+gdata_media_content_get_width (GDataMediaContent *self);
+

Gets the “width” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaContent

 
+
+
+

Returns

+

the content's width in pixels, or 0

+
+

Since: 0.4.0

+
+
+
+

gdata_media_content_download ()

+
GDataDownloadStream *
+gdata_media_content_download (GDataMediaContent *self,
+                              GDataService *service,
+                              GCancellable *cancellable,
+                              GError **error);
+

Downloads and returns a GDataDownloadStream allowing the content represented by self + to be read.

+

To get the content type of the downloaded data, gdata_download_stream_get_content_type() can be called on the returned GDataDownloadStream. +Calling gdata_download_stream_get_content_length() on the stream will not return a meaningful result, however, as the stream is encoded in chunks, +rather than by content length.

+

In order to cancel the download, a GCancellable passed in to cancellable + must be cancelled using g_cancellable_cancel(). Cancelling the individual +GInputStream operations on the GDataDownloadStream will not cancel the entire download; merely the read or close operation in question. See the +“cancellable” for more details.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataMediaContent

 

service

the GDataService

 

cancellable

a GCancellable for the entire download stream, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataDownloadStream to download the content with, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

Types and Values

+
+

GDataMediaContent

+
typedef struct _GDataMediaContent GDataMediaContent;
+

All the fields in the GDataMediaContent structure are private and should never be accessed directly.

+
+
+
+

GDataMediaContentClass

+
typedef struct {
+} GDataMediaContentClass;
+
+

All the fields in the GDataMediaContentClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

enum GDataMediaMedium

+

An enum representing the possible values of “medium”.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GDATA_MEDIA_UNKNOWN

+

the type of the media is unknown

+
 

GDATA_MEDIA_IMAGE

+

the media is an image

+
 

GDATA_MEDIA_AUDIO

+

the media is an audio stream

+
 

GDATA_MEDIA_VIDEO

+

the media is a video

+
 

GDATA_MEDIA_DOCUMENT

+

the media is another type of document

+
 

GDATA_MEDIA_EXECUTABLE

+

the media is an executable file

+
 
+
+

Since: 0.4.0

+
+
+
+

enum GDataMediaExpression

+

An enum representing the possible values of “expression”.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GDATA_MEDIA_EXPRESSION_SAMPLE

+

the media is a sample of a larger video

+
 

GDATA_MEDIA_EXPRESSION_FULL

+

the media is the full version

+
 

GDATA_MEDIA_EXPRESSION_NONSTOP

+

the media is a continuous stream

+
 
+
+
+
+
+

Property Details

+
+

The “content-type” property

+
  “content-type”             gchar *
+

The standard MIME type of the object.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “duration” property

+
  “duration”                 gint64
+

The number of seconds for which the media object plays.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Allowed values: >= 0

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “expression” property

+
  “expression”               GDataMediaExpression
+

Determines if the object is a sample or the full version of the object, or even if it is a continuous stream.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: GDATA_MEDIA_EXPRESSION_FULL

+

Since: 0.4.0

+
+
+
+

The “filesize” property

+
  “filesize”                 gulong
+

The number of bytes of the media object.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Since: 0.4.0

+
+
+
+

The “height” property

+
  “height”                   guint
+

The height of the media object.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “is-default” property

+
  “is-default”               gboolean
+

Determines if this is the default content for the media group. There should only be one default object per media group.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: FALSE

+

Since: 0.4.0

+
+
+
+

The “medium” property

+
  “medium”                   GDataMediaMedium
+

The type of object, complementing “content-type”. It allows the consuming application to make simpler decisions between +different content objects, based on whether they're a video or audio stream, for example.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: GDATA_MEDIA_UNKNOWN

+

Since: 0.4.0

+
+
+
+

The “uri” property

+
  “uri”                      gchar *
+

The direct URI to the media object.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “width” property

+
  “width”                    guint
+

The width of the media object.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataMediaCredit.html b/docs/reference/html/GDataMediaCredit.html new file mode 100644 index 0000000..82ce5f4 --- /dev/null +++ b/docs/reference/html/GDataMediaCredit.html @@ -0,0 +1,282 @@ + + + + +GDataMediaCredit: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataMediaCredit

+

GDataMediaCredit — Media RSS credit element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
const gchar * + +gdata_media_credit_get_credit () +
const gchar * + +gdata_media_credit_get_scheme () +
const gchar * + +gdata_media_credit_get_role () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *creditRead
+gchar *roleRead
+gchar *schemeRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataMediaCredit
 GDataMediaCreditClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataMediaCredit
+            ╰── GDataYouTubeCredit
+
+
+
+

Includes

+
#include <gdata/media/gdata-media-credit.h>
+
+
+
+

Description

+

GDataMediaCredit represents a "credit" element from the

+Media RSS specification. +

The class only implements parsing, not XML output, at the moment.

+
+
+

Functions

+
+

gdata_media_credit_get_credit ()

+
const gchar *
+gdata_media_credit_get_credit (GDataMediaCredit *self);
+

Gets the “credit” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaCredit

 
+
+
+

Returns

+

the name of the credited entity

+
+

Since: 0.4.0

+
+
+
+

gdata_media_credit_get_scheme ()

+
const gchar *
+gdata_media_credit_get_scheme (GDataMediaCredit *self);
+

Gets the “scheme” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaCredit

 
+
+
+

Returns

+

the credit's role scheme, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_media_credit_get_role ()

+
const gchar *
+gdata_media_credit_get_role (GDataMediaCredit *self);
+

Gets the “role” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaCredit

 
+
+
+

Returns

+

the credited entity's role, or NULL

+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDataMediaCredit

+
typedef struct _GDataMediaCredit GDataMediaCredit;
+

All the fields in the GDataMediaCredit structure are private and should never be accessed directly.

+
+
+
+

GDataMediaCreditClass

+
typedef struct {
+} GDataMediaCreditClass;
+
+

All the fields in the GDataMediaCreditClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “credit” property

+
  “credit”                   gchar *
+

The credited entity's name.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “role” property

+
  “role”                     gchar *
+

The role the credited entity played in the production of the media.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “scheme” property

+
  “scheme”                   gchar *
+

A URI that identifies the role scheme.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataMediaThumbnail.html b/docs/reference/html/GDataMediaThumbnail.html new file mode 100644 index 0000000..b7d2701 --- /dev/null +++ b/docs/reference/html/GDataMediaThumbnail.html @@ -0,0 +1,396 @@ + + + + +GDataMediaThumbnail: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataMediaThumbnail

+

GDataMediaThumbnail — Media RSS thumbnail element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
const gchar * + +gdata_media_thumbnail_get_uri () +
+guint + +gdata_media_thumbnail_get_height () +
+guint + +gdata_media_thumbnail_get_width () +
+gint64 + +gdata_media_thumbnail_get_time () +
+GDataDownloadStream * + +gdata_media_thumbnail_download () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
guintheightRead
gint64timeRead
+gchar *uriRead
guintwidthRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataMediaThumbnail
 GDataMediaThumbnailClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataMediaThumbnail
+
+
+
+

Includes

+
#include <gdata/media/gdata-media-thumbnail.h>
+
+
+
+

Description

+

GDataMediaThumbnail represents a "thumbnail" element from the

+Media RSS specification. +

The class only implements parsing, not XML output, at the moment.

+
+
+

Functions

+
+

gdata_media_thumbnail_get_uri ()

+
const gchar *
+gdata_media_thumbnail_get_uri (GDataMediaThumbnail *self);
+

Gets the “uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaThumbnail

 
+
+
+

Returns

+

the thumbnail's URI

+
+

Since: 0.4.0

+
+
+
+

gdata_media_thumbnail_get_height ()

+
guint
+gdata_media_thumbnail_get_height (GDataMediaThumbnail *self);
+

Gets the “height” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaThumbnail

 
+
+
+

Returns

+

the thumbnail's height in pixels, or 0

+
+

Since: 0.4.0

+
+
+
+

gdata_media_thumbnail_get_width ()

+
guint
+gdata_media_thumbnail_get_width (GDataMediaThumbnail *self);
+

Gets the “width” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaThumbnail

 
+
+
+

Returns

+

the thumbnail's width in pixels, or 0

+
+

Since: 0.4.0

+
+
+
+

gdata_media_thumbnail_get_time ()

+
gint64
+gdata_media_thumbnail_get_time (GDataMediaThumbnail *self);
+

Gets the “time” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataMediaThumbnail

 
+
+
+

Returns

+

the thumbnail's time offset in the media, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_media_thumbnail_download ()

+
GDataDownloadStream *
+gdata_media_thumbnail_download (GDataMediaThumbnail *self,
+                                GDataService *service,
+                                GCancellable *cancellable,
+                                GError **error);
+

Downloads and returns a GDataDownloadStream allowing the thumbnail data represented by self + to be read.

+

To get the content type of the downloaded data, gdata_download_stream_get_content_type() can be called on the returned GDataDownloadStream. +Calling gdata_download_stream_get_content_length() on the stream will not return a meaningful result, however, as the stream is encoded in chunks, +rather than by content length.

+

In order to cancel the download, a GCancellable passed in to cancellable + must be cancelled using g_cancellable_cancel(). Cancelling the individual +GInputStream operations on the GDataDownloadStream will not cancel the entire download; merely the read or close operation in question. See the +“cancellable” for more details.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataMediaThumbnail

 

service

the GDataService

 

cancellable

a GCancellable for the entire download stream, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataDownloadStream to download the thumbnail with, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

Types and Values

+
+

GDataMediaThumbnail

+
typedef struct _GDataMediaThumbnail GDataMediaThumbnail;
+

All the fields in the GDataMediaThumbnail structure are private and should never be accessed directly.

+
+
+
+

GDataMediaThumbnailClass

+
typedef struct {
+} GDataMediaThumbnailClass;
+
+

All the fields in the GDataMediaThumbnailClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “height” property

+
  “height”                   guint
+

The height of the thumbnail, in pixels.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “time” property

+
  “time”                     gint64
+

The time offset of the thumbnail in relation to the media object, in milliseconds.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “uri” property

+
  “uri”                      gchar *
+

The URI of the thumbnail.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “width” property

+
  “width”                    guint
+

The width of the thumbnail, in pixels.

+

For more information, see the Media RSS specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataOAuth1Authorizer.html b/docs/reference/html/GDataOAuth1Authorizer.html new file mode 100644 index 0000000..9f799eb --- /dev/null +++ b/docs/reference/html/GDataOAuth1Authorizer.html @@ -0,0 +1,1323 @@ + + + + +GDataOAuth1Authorizer: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataOAuth1Authorizer

+

GDataOAuth1Authorizer — GData OAuth 1.0 authorization interface

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *application-nameRead / Write / Construct Only
+gchar *localeRead / Write
+GProxyResolver *proxy-resolverRead / Write
+SoupURI *proxy-uriRead / Write
guinttimeoutRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataOAuth1Authorizer
 GDataOAuth1AuthorizerClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataOAuth1Authorizer
+
+
+
+

Implemented Interfaces

+

+GDataOAuth1Authorizer implements + GDataAuthorizer.

+
+
+

Includes

+
#include <gdata/gdata-oauth1-authorizer.h>
+
+
+
+

Description

+

GDataOAuth1Authorizer provides an implementation of the GDataAuthorizer interface for authentication and authorization using the

+OAuth 1.0 process, +

which was preferred by Google until OAuth 2.0 was released — it is now +preferred to use GDataOAuth2Authorizer.

+

OAuth 1.0 replaces the deprecated ClientLogin process. One of the main reasons for this is to allow two-factor authentication to be supported, by +moving the authentication interface to a web page under Google's control.

+

The OAuth 1.0 process as implemented by Google follows the OAuth 1.0 protocol as +specified by IETF in RFC 5849, with a few additions to support scopes (implemented in libgdata by GDataAuthorizationDomains), +locales and custom domains. Briefly, the process is initiated by requesting an authenticated request token from the Google accounts service +(using gdata_oauth1_authorizer_request_authentication_uri()), going to the authentication URI for the request token, authenticating and authorizing +access to the desired scopes, then providing the verifier returned by Google to the Google accounts service again (using +gdata_oauth1_authorizer_request_authorization()) to authorize the token. This results in an access token which is attached to all future requests +to the online service.

+

While Google supports unregistered and registered modes for OAuth 1.0 authorization, it only supports unregistered mode for installed applications. +Consequently, libgdata also only supports unregistered mode. For this purpose, the application name to be presented to the user on the +authentication page at the URI returned by gdata_oauth1_authorizer_request_authentication_uri() can be specified when constructing the +GDataOAuth1Authorizer.

+

As described, each authentication/authorization operation is in two parts: gdata_oauth1_authorizer_request_authentication_uri() and +gdata_oauth1_authorizer_request_authorization(). GDataOAuth1Authorizer stores no state about ongoing authentication operations (i.e. ones which +have successfully called gdata_oauth1_authorizer_request_authentication_uri(), but are yet to successfully call +gdata_oauth1_authorizer_request_authorization()). Consequently, operations can be abandoned before calling +gdata_oauth1_authorizer_request_authorization() without problems. The only state necessary between the calls is the request token and request token +secret, as returned by gdata_oauth1_authorizer_request_authentication_uri() and taken as parameters to +gdata_oauth1_authorizer_request_authorization().

+

GDataOAuth1Authorizer natively supports authorization against multiple services in a single authorization request (unlike +GDataClientLoginAuthorizer).

+

Each access token is long lived, so reauthorization is rarely necessary with GDataOAuth1Authorizer. Consequently, refreshing authorization using +gdata_authorizer_refresh_authorization() is not supported by GDataOAuth1Authorizer, and will immediately return FALSE with no error set.

+
+

Example 8. Authenticating Asynchronously Using OAuth 1.0

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
GDataSomeService *service;
+GDataOAuth1Authorizer *authorizer;
+
+/* Create an authorizer and authenticate and authorize the service we're using, asynchronously. */
+authorizer = gdata_oauth1_authorizer_new (_("My libgdata application"), GDATA_TYPE_SOME_SERVICE);
+gdata_oauth1_authorizer_request_authentication_uri_async (authorizer, cancellable,
+                                                          (GAsyncReadyCallback) request_authentication_uri_cb, user_data);
+
+/* Create a service object and link it with the authorizer */
+service = gdata_some_service_new (GDATA_AUTHORIZER (authorizer));
+
+static void
+request_authentication_uri_cb (GDataOAuth1Authorizer *authorizer, GAsyncResult *async_result, gpointer user_data)
+{
+    gchar *authentication_uri, *token, *token_secret, *verifier;
+    GError *error = NULL;
+
+    authentication_uri = gdata_oauth1_authorizer_request_authentication_uri_finish (authorizer, async_result, &token, &token_secret,
+                                                                                    &error);
+
+    if (error != NULL) {
+        /* Notify the user of all errors except cancellation errors */
+        if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+            g_error ("Requesting a token failed: %s", error->message);
+        }
+
+        g_error_free (error);
+        goto finish;
+    }
+
+    /* (Present the page at the authentication URI to the user, either in an embedded or stand-alone web browser, and
+     * ask them to grant access to the application and return the verifier Google gives them.) */
+    verifier = ask_user_for_verifier (authentication_uri);
+
+    gdata_oauth1_authorizer_request_authorization_async (authorizer, token, token_secret, verifier, cancellable,
+                                                         (GAsyncReadyCallback) request_authorization_cb, user_data);
+
+finish:
+    g_free (verifier);
+    g_free (authentication_uri);
+    g_free (token);
+
+    /* Zero out the secret before freeing. */
+    if (token_secret != NULL) {
+        memset (token_secret, 0, strlen (token_secret));
+    }
+
+    g_free (token_secret);
+}
+
+static void
+request_authorization_cb (GDataOAuth1Authorizer *authorizer, GAsyncResult *async_result, gpointer user_data)
+{
+    GError *error = NULL;
+
+    if (gdata_oauth1_authorizer_request_authorization_finish (authorizer, async_result, &error) == FALSE) {
+        /* Notify the user of all errors except cancellation errors */
+        if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+            g_error ("Authorization failed: %s", error->message);
+        }
+
+        g_error_free (error);
+        return;
+    }
+
+    /* (The client is now authenticated and authorized against the service.
+     * It can now proceed to execute queries on the service object which require the user to be authenticated.) */
+}
+
+g_object_unref (service);
+g_object_unref (authorizer);
+
+ +
+
+
+
+

Functions

+
+

gdata_oauth1_authorizer_new ()

+
GDataOAuth1Authorizer *
+gdata_oauth1_authorizer_new (const gchar *application_name,
+                             GType service_type);
+

Creates a new GDataOAuth1Authorizer.

+

The GDataAuthorizationDomains for the given service_type + (i.e. as returned by gdata_service_get_authorization_domains()) are the ones the +user will be requested to authorize access to on the page at the URI returned by gdata_oauth1_authorizer_request_authentication_uri().

+

The given application_name + will set the value of “application-name” and will be displayed to the user on authentication pages +returned by Google. If NULL is provided, the value of g_get_application_name() will be used as a fallback.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

application_name

a human-readable, translated application name to use on authentication pages, or NULL.

[allow-none]

service_type

the GType of a GDataService subclass which the GDataOAuth1Authorizer will be used with

 
+
+
+

Returns

+

a new GDataOAuth1Authorizer; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_new_for_authorization_domains ()

+
GDataOAuth1Authorizer *
+gdata_oauth1_authorizer_new_for_authorization_domains
+                               (const gchar *application_name,
+                                GList *authorization_domains);
+

Creates a new GDataOAuth1Authorizer. This function is intended to be used only when the default authorization domain list for a single +GDataService, as used by gdata_oauth1_authorizer_new(), isn't suitable. For example, this could be because the GDataOAuth1Authorizer will be used +with multiple GDataService subclasses, or because the client requires a specific set of authorization domains.

+

The specified GDataAuthorizationDomains are the ones the user will be requested to authorize access to on the page at the URI returned by +gdata_oauth1_authorizer_request_authentication_uri().

+

The given application_name + will set the value of “application-name” and will be displayed to the user on authentication pages +returned by Google. If NULL is provided, the value of g_get_application_name() will be used as a fallback.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

application_name

a human-readable, translated application name to use on authentication pages, or NULL.

[allow-none]

authorization_domains

a non-empty list of GDataAuthorizationDomains to be +authorized against by the GDataOAuth1Authorizer.

[element-type GDataAuthorizationDomain][transfer none]
+
+
+

Returns

+

a new GDataOAuth1Authorizer; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_request_authentication_uri ()

+
gchar *
+gdata_oauth1_authorizer_request_authentication_uri
+                               (GDataOAuth1Authorizer *self,
+                                gchar **token,
+                                gchar **token_secret,
+                                GCancellable *cancellable,
+                                GError **error);
+

Requests a fresh unauthenticated token from the Google accounts service and builds and returns the URI of an authentication page for that token. +This should then be presented to the user (e.g. in an embedded or stand alone web browser). The authentication page will ask the user to log in +using their Google account, then ask them to grant access to the GDataAuthorizationDomains passed to the constructor of the +GDataOAuth1Authorizer. If the user grants access, they will be given a verifier, which can then be passed to +gdata_oauth1_authorizer_request_authorization() (along with the token + and token_secret + values returned by this method) to authorize the token.

+

This method can fail if the server returns an error, but this is unlikely. If it does happen, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be +raised, token + and token_secret + will be set to NULL and NULL will be returned.

+

This method implements Section 2.1 and

+Section 2.2 of the +OAuth 1.0 protocol. +

When freeing token_secret +, it's advisable to set it to all zeros first, to reduce the chance of the sensitive token being recoverable from the +free memory pool and (accidentally) leaked by a different part of the process. This can be achieved with the following code:

+
+ + + + + + + +
1
+2
+3
+4
if (token_secret != NULL) {
+    memset (token_secret, 0, strlen (token_secret));
+    g_free (token_secret);
+}
+
+ +

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

token

return location for the temporary credentials token returned by the authentication service; free with g_free().

[out callee-allocates]

token_secret

return location for the temporary credentials token secret returned by the authentication service; free with +g_free().

[out callee-allocates]

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

the URI of an authentication page for the user to use; free with g_free().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_request_authentication_uri_async ()

+
void
+gdata_oauth1_authorizer_request_authentication_uri_async
+                               (GDataOAuth1Authorizer *self,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Requests a fresh unauthenticated token from the Google accounts service and builds and returns the URI of an authentication page for that token. +self + is reffed when this method is called, so can safely be unreffed after this method returns.

+

For more details, see gdata_oauth1_authorizer_request_authentication_uri(), which is the synchronous version of this method.

+

When the operation is finished, callback + will be called. You can then call gdata_oauth1_authorizer_request_authentication_uri_finish() to get the +results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when building the URI is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_request_authentication_uri_finish ()

+
gchar *
+gdata_oauth1_authorizer_request_authentication_uri_finish
+                               (GDataOAuth1Authorizer *self,
+                                GAsyncResult *async_result,
+                                gchar **token,
+                                gchar **token_secret,
+                                GError **error);
+

Finishes an asynchronous authentication URI building operation started with gdata_oauth1_authorizer_request_authentication_uri_async().

+

This method can fail if the server has returned an error, but this is unlikely. If it does happen, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be +raised, token + and token_secret + will be set to NULL and NULL will be returned.

+

When freeing token_secret +, it's advisable to set it to all zeros first, to reduce the chance of the sensitive token being recoverable from the +free memory pool and (accidentally) leaked by a different part of the process. This can be achieved with the following code:

+
+ + + + + + + +
1
+2
+3
+4
if (token_secret != NULL) {
+    memset (token_secret, 0, strlen (token_secret));
+    g_free (token_secret);
+}
+
+ +

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

async_result

a GAsyncResult

 

token

return location for the temporary credentials token returned by the authentication service; free with g_free().

[out callee-allocates]

token_secret

return location for the temporary credentials token secret returned by the authentication service; free with +g_free().

[out callee-allocates]

error

a GError, or NULL

 
+
+
+

Returns

+

the URI of an authentication page for the user to use; free with g_free().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_request_authorization ()

+
gboolean
+gdata_oauth1_authorizer_request_authorization
+                               (GDataOAuth1Authorizer *self,
+                                const gchar *token,
+                                const gchar *token_secret,
+                                const gchar *verifier,
+                                GCancellable *cancellable,
+                                GError **error);
+

Requests authorization of the given request token + from the Google accounts service using the given verifier + as entered by the user from the +authentication page at the URI returned by gdata_oauth1_authorizer_request_authentication_uri(). token + and token_secret + must be the same values +as were returned by gdata_oauth1_authorizer_request_authentication_uri() if it was successful.

+

If the verifier is valid (i.e. the user granted access to the application and the Google accounts service has no reason to distrust the client), +TRUE will be returned and any operations performed from that point onwards on GDataServices using this GDataAuthorizer will be +authorized.

+

If the user denies access to the application or the Google accounts service distrusts it, a bogus verifier could be returned. In this case, FALSE +will be returned and a GDATA_SERVICE_ERROR_FORBIDDEN error will be raised.

+

Note that if the user denies access to the application, it may be the case that they have no verifier to enter. In this case, the client can simply +not call this method. The GDataOAuth1Authorizer stores no state for authentication operations which have succeeded in calling +gdata_oauth1_authorizer_request_authentication_uri() but not yet successfully called gdata_oauth1_authorizer_request_authorization().

+

This method implements Section 2.3 of the

+OAuth 1.0 protocol. +
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

token

the request token returned by gdata_oauth1_authorizer_request_authentication_uri()

 

token_secret

the request token secret returned by gdata_oauth1_authorizer_request_authentication_uri()

 

verifier

the verifier entered by the user from the authentication page

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE if authorization was successful, FALSE otherwise

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_request_authorization_async ()

+
void
+gdata_oauth1_authorizer_request_authorization_async
+                               (GDataOAuth1Authorizer *self,
+                                const gchar *token,
+                                const gchar *token_secret,
+                                const gchar *verifier,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Requests authorization of the given request token + from the Google accounts service using the given verifier + as entered by the user. +self +, token +, token_secret + and verifier + are reffed/copied when this method is called, so can safely be freed after this method returns.

+

For more details, see gdata_oauth1_authorizer_request_authorization(), which is the synchronous version of this method.

+

When the operation is finished, callback + will be called. You can then call gdata_oauth1_authorizer_request_authorization_finish() to get the +results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

token

the request token returned by gdata_oauth1_authorizer_request_authentication_uri()

 

token_secret

the request token secret returned by gdata_oauth1_authorizer_request_authentication_uri()

 

verifier

the verifier entered by the user from the authentication page

 

cancellable

an optional GCancellable, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when authorization is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_request_authorization_finish ()

+
gboolean
+gdata_oauth1_authorizer_request_authorization_finish
+                               (GDataOAuth1Authorizer *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finishes an asynchronous authorization operation started with gdata_oauth1_authorizer_request_authorization_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE if authorization was successful, FALSE otherwise

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_get_application_name ()

+
const gchar *
+gdata_oauth1_authorizer_get_application_name
+                               (GDataOAuth1Authorizer *self);
+

Returns the application name being used on the authentication page at the URI returned by gdata_oauth1_authorizer_request_authentication_uri(); +i.e. the value of “application-name”.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth1Authorizer

 
+
+
+

Returns

+

the application name, or NULL if one isn't set.

+

[allow-none]

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_get_locale ()

+
const gchar *
+gdata_oauth1_authorizer_get_locale (GDataOAuth1Authorizer *self);
+

Returns the locale currently being used for network requests, or NULL if the locale is the default.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth1Authorizer

 
+
+
+

Returns

+

the current locale.

+

[allow-none]

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_set_locale ()

+
void
+gdata_oauth1_authorizer_set_locale (GDataOAuth1Authorizer *self,
+                                    const gchar *locale);
+

Set the locale used for network requests to locale +, given in standard Unix locale format. See “locale” for more details.

+

Note that while it's possible to change the locale after sending network requests (i.e. calling +gdata_oauth1_authorizer_request_authentication_uri() for the first time), it is unsupported, as the server-side software may behave unexpectedly. +The only supported use of this method is after creation of the authorizer, but before any network requests are made.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

locale

the new locale in Unix locale format, or NULL for the default locale.

[allow-none]
+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_get_proxy_uri ()

+
SoupURI *
+gdata_oauth1_authorizer_get_proxy_uri (GDataOAuth1Authorizer *self);
+
+

gdata_oauth1_authorizer_get_proxy_uri has been deprecated since version 0.15.0 and should not be used in newly-written code.

+

Use gdata_oauth1_authorizer_get_proxy_resolver() instead, which gives more flexibility over the proxy used.

+
+

Gets the proxy URI on the GDataOAuth1Authorizer's SoupSession.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth1Authorizer

 
+
+
+

Returns

+

the proxy URI, or NULL; free with soup_uri_free().

+

[transfer full][allow-none]

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_set_proxy_uri ()

+
void
+gdata_oauth1_authorizer_set_proxy_uri (GDataOAuth1Authorizer *self,
+                                       SoupURI *proxy_uri);
+
+

gdata_oauth1_authorizer_set_proxy_uri has been deprecated since version 0.15.0 and should not be used in newly-written code.

+

Use gdata_oauth1_authorizer_set_proxy_resolver() instead, which gives more flexibility over the proxy used.

+
+

Sets the proxy URI on the SoupSession used internally by the GDataOAuth1Authorizer. This forces all requests through the given proxy.

+

If proxy_uri + is NULL, no proxy will be used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

proxy_uri

the proxy URI, or NULL.

[allow-none]
+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_get_proxy_resolver ()

+
GProxyResolver *
+gdata_oauth1_authorizer_get_proxy_resolver
+                               (GDataOAuth1Authorizer *self);
+

gdata_oauth1_authorizer_get_proxy_resolver is deprecated and should not be used in newly-written code.

+

Gets the GProxyResolver on the GDataOAuth1Authorizer's SoupSession.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth1Authorizer

 
+
+
+

Returns

+

a GProxyResolver, or NULL.

+

[transfer none][allow-none]

+
+

Since: 0.15.0

+
+
+
+

gdata_oauth1_authorizer_set_proxy_resolver ()

+
void
+gdata_oauth1_authorizer_set_proxy_resolver
+                               (GDataOAuth1Authorizer *self,
+                                GProxyResolver *proxy_resolver);
+

Sets the GProxyResolver on the SoupSession used internally by the given GDataOAuth1Authorizer.

+

Setting this will clear the “proxy-uri” property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

proxy_resolver

a GProxyResolver, or NULL.

[allow-none]
+
+

Since: 0.15.0

+
+
+
+

gdata_oauth1_authorizer_get_timeout ()

+
guint
+gdata_oauth1_authorizer_get_timeout (GDataOAuth1Authorizer *self);
+

Gets the “timeout” property; the network timeout, in seconds.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth1Authorizer

 
+
+
+

Returns

+

the timeout, or 0

+
+

Since: 0.9.0

+
+
+
+

gdata_oauth1_authorizer_set_timeout ()

+
void
+gdata_oauth1_authorizer_set_timeout (GDataOAuth1Authorizer *self,
+                                     guint timeout);
+

Sets the “timeout” property; the network timeout, in seconds.

+

If timeout + is 0, network operations will never time out.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataOAuth1Authorizer

 

timeout

the timeout, or 0

 
+
+

Since: 0.9.0

+
+
+
+

Types and Values

+
+

GDataOAuth1Authorizer

+
typedef struct _GDataOAuth1Authorizer GDataOAuth1Authorizer;
+

All the fields in the GDataOAuth1Authorizer structure are private and should never be accessed directly.

+

Since: 0.9.0

+
+
+
+

GDataOAuth1AuthorizerClass

+
typedef struct {
+} GDataOAuth1AuthorizerClass;
+
+

All the fields in the GDataOAuth1AuthorizerClass structure are private and should never be accessed directly.

+

Since: 0.9.0

+
+
+
+

Property Details

+
+

The “application-name” property

+
  “application-name”         gchar *
+

The human-readable, translated application name for the client, to be presented to the user on the authentication page at the URI +returned by gdata_oauth1_authorizer_request_authentication_uri().

+

If NULL is provided in the constructor to GDataOAuth1Authorizer, the value returned by g_get_application_name() will be used as a +fallback. Note that this may also be NULL: in this case, the authentication page will use the application name “anonymous”.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.9.0

+
+
+
+

The “locale” property

+
  “locale”                   gchar *
+

The locale to use for network requests, in Unix locale format. (e.g. "en_GB", "cs", "de_DE".) Use NULL for the default "C" locale +(typically "en_US").

+

This locale will be used by the server-side software to localise the authentication and authorization pages at the URI returned by +gdata_oauth1_authorizer_request_authentication_uri().

+

The server-side behaviour is undefined if it doesn't support a given locale.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.9.0

+
+
+
+

The “proxy-resolver” property

+
  “proxy-resolver”           GProxyResolver *
+

The GProxyResolver used to determine a proxy URI. Setting this will clear the “proxy-uri” property.

+

Flags: Read / Write

+

Since: 0.15.0

+
+
+
+

The “proxy-uri” property

+
  “proxy-uri”                SoupURI *
+

The proxy URI used internally for all network requests.

+
+

GDataOAuth1Authorizer:proxy-uri has been deprecated since version 0.15.0 and should not be used in newly-written code.

+

Use “proxy-resolver” instead, which gives more flexibility over the proxy used.

+
+

Flags: Read / Write

+

Since: 0.9.0

+
+
+
+

The “timeout” property

+
  “timeout”                  guint
+

A timeout, in seconds, for network operations. If the timeout is exceeded, the operation will be cancelled and +GDATA_SERVICE_ERROR_NETWORK_ERROR will be returned.

+

If the timeout is 0, operations will never time out.

+

Flags: Read / Write

+

Default value: 0

+

Since: 0.9.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataOAuth2Authorizer.html b/docs/reference/html/GDataOAuth2Authorizer.html new file mode 100644 index 0000000..4c24439 --- /dev/null +++ b/docs/reference/html/GDataOAuth2Authorizer.html @@ -0,0 +1,1282 @@ + + + + +GDataOAuth2Authorizer: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataOAuth2Authorizer

+

GDataOAuth2Authorizer — GData OAuth 2.0 authorization interface

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *client-idRead / Write / Construct Only
+gchar *client-secretRead / Write / Construct Only
+gchar *localeRead / Write
+GProxyResolver *proxy-resolverRead / Write
+gchar *redirect-uriRead / Write / Construct Only
+gchar *refresh-tokenRead / Write
guinttimeoutRead / Write
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataOAuth2Authorizer
+
+
+
+

Implemented Interfaces

+

+GDataOAuth2Authorizer implements + GDataAuthorizer.

+
+
+

Includes

+
#include <gdata/gdata-oauth2-authorizer.h>
+
+
+
+

Description

+

GDataOAuth2Authorizer provides an implementation of the GDataAuthorizer +interface for authentication and authorization using the

+OAuth 2.0

process, which is Google’s currently preferred authentication and +authorization process.

+

OAuth 2.0 replaces the deprecated OAuth 1.0 and ClientLogin processes. One of +the main reasons for this is to allow two-factor authentication to be +supported, by moving the authentication interface to a web page under +Google’s control.

+

The OAuth 2.0 process as implemented by Google follows the

+OAuth 2.0 +protocol as specified by IETF in RFC 6749, with a few additions to +

support scopes (implemented in libgdata by GDataAuthorizationDomains), +locales and custom domains. Briefly, the process is initiated by building an +authentication URI (using gdata_oauth2_authorizer_build_authentication_uri()) +and opening it in the user’s web browser. The user authenticates and +authorizes the requested scopes on Google’s website, then an authorization +code is returned (via “redirect-uri”) to the +application, which then converts the code into an access and refresh token +(using gdata_oauth2_authorizer_request_authorization()). The access token is +then attached to all future requests to the online service, and the refresh +token can be used in future (with gdata_authorizer_refresh_authorization()) +to refresh authorization after the access token expires.

+

The refresh token may also be accessed as +“refresh-token” and saved by the application. It may +later be set on a new instance of GDataOAuth2Authorizer, and +gdata_authorizer_refresh_authorization_async() called to establish a new +access token without requiring the user to re-authenticate unless they have +explicitly revoked the refresh token.

+

For an overview of the standard OAuth 2.0 flow, see

+RFC 6749. +

Before an application can be authorized using OAuth 2.0, it must be +registered with

+Google’s +Developer Console, and a client ID, client secret and redirect URI +

retrieved. These must be built into your application, and knowledge of them +will allow any application to impersonate yours, so it is recommended that +they are kept secret (e.g. as a configure-time option).

+

libgdata supports

+incremental +authorization, where multiple GDataOAuth2Authorizers can be used to +

incrementally build up authorizations against multiple scopes. Typically, +you should use one GDataOAuth2Authorizer per GDataService your application +uses, limit the scope of each authorizer, and enable incremental +authorization when calling +gdata_oauth2_authorizer_build_authentication_uri().

+

Each access token is long lived, so reauthorization is rarely necessary with +GDataOAuth2Authorizer. It is supported using +gdata_authorizer_refresh_authorization().

+
+

Example 9. Authenticating Asynchronously Using OAuth 2.0

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
GDataSomeService *service;
+GDataOAuth2Authorizer *authorizer;
+gchar *authentication_uri, *authorization_code;
+
+/* Create an authorizer and authenticate and authorize the service we're using, asynchronously. */
+authorizer = gdata_oauth2_authorizer_new ("some-client-id", "some-client-secret",
+                                          GDATA_OAUTH2_REDIRECT_URI_OOB, GDATA_TYPE_SOME_SERVICE);
+authentication_uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, NULL, FALSE);
+
+/* (Present the page at the authentication URI to the user, either in an embedded or stand-alone web browser, and
+ * ask them to grant access to the application and return the code Google gives them.) */
+authorization_code = ask_user_for_code (authentication_uri);
+
+gdata_oauth2_authorizer_request_authorization_async (authorizer, authorization_code, cancellable,
+                                                     (GAsyncReadyCallback) request_authorization_cb, user_data);
+
+g_free (authentication_uri);
+
+/* Zero out the code before freeing. */
+if (token_secret != NULL) {
+    memset (authorization_code, 0, strlen (authorization_code));
+}
+
+g_free (authorization_code);
+
+/* Create a service object and link it with the authorizer */
+service = gdata_some_service_new (GDATA_AUTHORIZER (authorizer));
+
+static void
+request_authorization_cb (GDataOAuth2Authorizer *authorizer, GAsyncResult *async_result, gpointer user_data)
+{
+    GError *error = NULL;
+
+    if (gdata_oauth2_authorizer_request_authorization_finish (authorizer, async_result, &error) == FALSE) {
+        /* Notify the user of all errors except cancellation errors */
+        if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+            g_error ("Authorization failed: %s", error->message);
+        }
+
+        g_error_free (error);
+        return;
+    }
+
+    /* (The client is now authenticated and authorized against the service.
+     * It can now proceed to execute queries on the service object which require the user to be authenticated.) */
+}
+
+g_object_unref (service);
+g_object_unref (authorizer);
+
+ +
+
+
+
+

Functions

+
+

gdata_oauth2_authorizer_new ()

+
GDataOAuth2Authorizer *
+gdata_oauth2_authorizer_new (const gchar *client_id,
+                             const gchar *client_secret,
+                             const gchar *redirect_uri,
+                             GType service_type);
+

Creates a new GDataOAuth2Authorizer. The client_id + must be unique for your +application, and as registered with Google, and the client_secret + must be +paired with it.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

client_id

your application’s client ID

 

client_secret

your application’s client secret

 

redirect_uri

authorisation redirect URI

 

service_type

the GType of a GDataService subclass which the +GDataOAuth2Authorizer will be used with

 
+
+
+

Returns

+

a new GDataOAuth2Authorizer; unref with +g_object_unref().

+

[transfer full]

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_new_for_authorization_domains ()

+
GDataOAuth2Authorizer *
+gdata_oauth2_authorizer_new_for_authorization_domains
+                               (const gchar *client_id,
+                                const gchar *client_secret,
+                                const gchar *redirect_uri,
+                                GList *authorization_domains);
+

Creates a new GDataOAuth2Authorizer. The client_id + must be unique for your +application, and as registered with Google, and the client_secret + must be +paired with it.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

client_id

your application’s client ID

 

client_secret

your application’s client secret

 

redirect_uri

authorisation redirect URI

 

authorization_domains

a non-empty list of GDataAuthorizationDomains to be authorized against by +the GDataOAuth2Authorizer.

[element-type GDataAuthorizationDomain][transfer none]
+
+
+

Returns

+

a new GDataOAuth2Authorizer; unref with +g_object_unref().

+

[transfer full]

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_build_authentication_uri ()

+
gchar *
+gdata_oauth2_authorizer_build_authentication_uri
+                               (GDataOAuth2Authorizer *self,
+                                const gchar *login_hint,
+                                gboolean include_granted_scopes);
+

Build an authentication URI to open in the user’s web browser (or an embedded +browser widget). This will display an authentication page from Google, +including an authentication form and confirmation of the authorisation +domains being requested by this GDataAuthorizer. The user will authenticate +in the browser, then an authorisation code will be returned via the +“redirect-uri”, ready to be passed to +gdata_oauth2_authorizer_request_authorization().

+

If login_hint + is non-NULL, it will be passed to the server as a hint of +which user is attempting to authenticate, which can be used to pre-fill the +e-mail address box in the authentication form.

+

If include_granted_scopes + is TRUE, the authentication request will +automatically include all authorisation domains previously granted to this +user/application pair, allowing for incremental authentication — asking for +permissions as needed, rather than all in one large bundle at the first +opportunity. If include_granted_scopes + is FALSE, incremental authentication +will not be enabled, and only the domains passed to the +GDataOAuth2Authorizer constructor will eventually be authenticated. +See the

+reference +documentation for more details. +
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataOAuth2Authorizer

 

login_hint

optional e-mail address or sub identifier for the +user.

[nullable]

include_granted_scopes

TRUE to enable incremental authorisation

 
+
+
+

Returns

+

the authentication URI to open in a web +browser; free with g_free().

+

[transfer full]

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_request_authorization ()

+
gboolean
+gdata_oauth2_authorizer_request_authorization
+                               (GDataOAuth2Authorizer *self,
+                                const gchar *authorization_code,
+                                GCancellable *cancellable,
+                                GError **error);
+

Request an authorisation code from the user’s web browser is converted to +authorisation (access and refresh) tokens. This is the final step in the +authentication process; once complete, the GDataOAuth2Authorizer should be +fully authorised for its domains.

+

On failure, GDATA_SERVICE_ERROR_FORBIDDEN will be returned if the user or +server denied the authorisation request. GDATA_SERVICE_ERROR_PROTOCOL_ERROR +will be returned if the server didn’t follow the expected protocol. +G_IO_ERROR_CANCELLED will be returned if the operation was cancelled using +cancellable +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataOAuth2Authorizer

 

authorization_code

code returned from the authentication page

 

cancellable

a GCancellable, or NULL.

[allow-none]

error

return location for a GError, or NULL

 
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_request_authorization_async ()

+
void
+gdata_oauth2_authorizer_request_authorization_async
+                               (GDataOAuth2Authorizer *self,
+                                const gchar *authorization_code,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Asynchronous version of gdata_oauth2_authorizer_request_authorization().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataOAuth2Authorizer

 

authorization_code

code returned from the authentication page

 

cancellable

an optional GCancellable, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when authorization is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_request_authorization_finish ()

+
gboolean
+gdata_oauth2_authorizer_request_authorization_finish
+                               (GDataOAuth2Authorizer *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finishes an asynchronous authorization operation started with +gdata_oauth2_authorizer_request_authorization_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataOAuth2Authorizer

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE if authorization was successful, FALSE otherwise

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_get_client_id ()

+
const gchar *
+gdata_oauth2_authorizer_get_client_id (GDataOAuth2Authorizer *self);
+

Returns the authorizer's client ID, “client-id”, as +specified on constructing the GDataOAuth2Authorizer.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth2Authorizer

 
+
+
+

Returns

+

the authorizer's client ID

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_get_redirect_uri ()

+
const gchar *
+gdata_oauth2_authorizer_get_redirect_uri
+                               (GDataOAuth2Authorizer *self);
+

Returns the authorizer’s redirect URI, “redirect-uri”, +as specified on constructing the GDataOAuth2Authorizer.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth2Authorizer

 
+
+
+

Returns

+

the authorizer’s redirect URI

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_get_client_secret ()

+
const gchar *
+gdata_oauth2_authorizer_get_client_secret
+                               (GDataOAuth2Authorizer *self);
+

Returns the authorizer's client secret, “client-secret”, +as specified on constructing the GDataOAuth2Authorizer.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth2Authorizer

 
+
+
+

Returns

+

the authorizer's client secret

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_dup_refresh_token ()

+
gchar *
+gdata_oauth2_authorizer_dup_refresh_token
+                               (GDataOAuth2Authorizer *self);
+

Returns the authorizer's refresh token, “refresh-token”, +as set by client code previously on the GDataOAuth2Authorizer, or as +returned by the most recent authentication operation.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth2Authorizer

 
+
+
+

Returns

+

the authorizer's refresh token.

+

[transfer full]

+
+

Since: 0.17.2

+
+
+
+

gdata_oauth2_authorizer_set_refresh_token ()

+
void
+gdata_oauth2_authorizer_set_refresh_token
+                               (GDataOAuth2Authorizer *self,
+                                const gchar *refresh_token);
+

Sets the authorizer's refresh token, “refresh-token”. +This is used to periodically refresh the access token. Set it to NULL to +clear the current authentication from the authorizer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataOAuth2Authorizer

 

refresh_token

the new refresh token, or NULL to clear +authorization.

[nullable]
+
+

Since: 0.17.2

+
+
+
+

gdata_oauth2_authorizer_get_locale ()

+
const gchar *
+gdata_oauth2_authorizer_get_locale (GDataOAuth2Authorizer *self);
+

Returns the locale currently being used for network requests, or NULL if the +locale is the default.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth2Authorizer

 
+
+
+

Returns

+

the current locale.

+

[allow-none]

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_set_locale ()

+
void
+gdata_oauth2_authorizer_set_locale (GDataOAuth2Authorizer *self,
+                                    const gchar *locale);
+

Set the locale used for network requests to locale +, given in standard UNIX +locale format. See “locale” for more details.

+

Note that while it’s possible to change the locale after sending network +requests (i.e. calling gdata_oauth2_authorizer_build_authentication_uri() for +the first time), it is unsupported, as the server-side software may behave +unexpectedly. The only supported use of this method is after creation of the +authorizer, but before any network requests are made.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataOAuth2Authorizer

 

locale

the new locale in UNIX locale format, or NULL for the +default locale.

[allow-none]
+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_get_timeout ()

+
guint
+gdata_oauth2_authorizer_get_timeout (GDataOAuth2Authorizer *self);
+

Gets the “timeout” property; the network timeout, in +seconds.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth2Authorizer

 
+
+
+

Returns

+

the timeout, or 0

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_set_timeout ()

+
void
+gdata_oauth2_authorizer_set_timeout (GDataOAuth2Authorizer *self,
+                                     guint timeout);
+

Sets the “timeout” property; the network timeout, in +seconds.

+

If timeout + is 0, network operations will never +time out.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataOAuth2Authorizer

 

timeout

the timeout, or 0

 
+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_get_proxy_resolver ()

+
GProxyResolver *
+gdata_oauth2_authorizer_get_proxy_resolver
+                               (GDataOAuth2Authorizer *self);
+

Gets the GProxyResolver on the GDataOAuth2Authorizer's SoupSession.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataOAuth2Authorizer

 
+
+
+

Returns

+

a GProxyResolver, or NULL.

+

[transfer none][allow-none]

+
+

Since: 0.17.0

+
+
+
+

gdata_oauth2_authorizer_set_proxy_resolver ()

+
void
+gdata_oauth2_authorizer_set_proxy_resolver
+                               (GDataOAuth2Authorizer *self,
+                                GProxyResolver *proxy_resolver);
+

Sets the GProxyResolver on the SoupSession used internally by the given +GDataOAuth2Authorizer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataOAuth2Authorizer

 

proxy_resolver

a GProxyResolver, or NULL.

[allow-none]
+
+

Since: 0.17.0

+
+
+
+

Types and Values

+
+

GDATA_OAUTH2_REDIRECT_URI_OOB

+
#define GDATA_OAUTH2_REDIRECT_URI_OOB "urn:ietf:wg:oauth:2.0:oob"
+
+

OAuth 2 redirect URI for out-of-band authorisation code transfer, where the +user is shown the authorisation code and asked to copy it.

+

See

+reference +documentation for details. +

Since: 0.17.0

+
+
+
+

GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO

+
#define GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO "urn:ietf:wg:oauth:2.0:oob:auto"
+
+

OAuth 2 redirect URI for out-of-band authorisation code transfer, where the +user is not shown the authorisation code or asked to copy it.

+

See

+reference +documentation for details. +

Since: 0.17.0

+
+
+
+

GDataOAuth2Authorizer

+
typedef struct _GDataOAuth2Authorizer GDataOAuth2Authorizer;
+

All the fields in the GDataOAuth2Authorizer structure are private and should never be accessed directly.

+

Since: 0.17.0

+
+
+
+

GDataOAuth2AuthorizerClass

+
typedef struct {
+} GDataOAuth2AuthorizerClass;
+
+

All the fields in the GDataOAuth2AuthorizerClass structure are private and should never be accessed directly.

+

Since: 0.17.0

+
+
+
+

Property Details

+
+

The “client-id” property

+
  “client-id”                gchar *
+

A client ID for your application (see the

+reference documentation). +

It is recommended that the ID is of the form +company name- +application name- +version ID.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.17.0

+
+
+
+

The “client-secret” property

+
  “client-secret”            gchar *
+

Client secret provided by Google. This is unique for each application +and is accessible from Google’s Developer Console when registering +an application. It must be paired with the +“client-id”.

+

See the

+reference +documentation for details. +

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.17.0

+
+
+
+

The “locale” property

+
  “locale”                   gchar *
+

The locale to use for network requests, in UNIX locale format. +(e.g. "en_GB", "cs", "de_DE".) Use NULL for the default "C" locale +(typically "en_US").

+

This locale will be used by the server-side software to localise the +authentication and authorization pages at the URI returned by +gdata_oauth2_authorizer_build_authentication_uri().

+

The server-side behaviour is undefined if it doesn't support a given +locale.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.17.0

+
+
+
+

The “proxy-resolver” property

+
  “proxy-resolver”           GProxyResolver *
+

The GProxyResolver used to determine a proxy URI.

+

Flags: Read / Write

+

Since: 0.17.0

+
+
+
+

The “redirect-uri” property

+
  “redirect-uri”             gchar *
+

Redirect URI to send the response from the authorisation request to. +This must either be GDATA_OAUTH2_REDIRECT_URI_OOB, +GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO, or a

+http://localhost URI with any port number (optionally) +

specified.

+

This URI is where the authorisation server will redirect the user +after they have completed interacting with the authentication page +(gdata_oauth2_authorizer_build_authentication_uri()). If it is +GDATA_OAUTH2_REDIRECT_URI_OOB, a page will be returned in the user’s +browser with the authorisation code in its title and also embedded in +the page for the user to copy if it is not possible to automatically +extract the code from the page title. If it is +GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO, a similar page will be returned +with the authorisation code in its title, but without displaying the +code to the user — the user will simply be asked to close the page. +If it is a localhost URI, the authentication page will redirect to +that URI with the authorisation code appended as a code +query parameter. If the user denies the authentication request, the +authentication page will redirect to that URI with

+error=access_denied appended as a query parameter. +

Note that the redirect URI used must match that registered in +Google’s Developer Console for your application.

+

See the reference +documentation for details about choosing a redirect URI.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.17.0

+
+
+
+

The “refresh-token” property

+
  “refresh-token”            gchar *
+

The server provided refresh token, which can be stored and passed in +to new GDataOAuth2Authorizer instances before calling +gdata_authorizer_refresh_authorization_async() to create a new +short-lived access token.

+

The refresh token is opaque data and must not be parsed.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.17.2

+
+
+
+

The “timeout” property

+
  “timeout”                  guint
+

A timeout, in seconds, for network operations. If the timeout is +exceeded, the operation will be cancelled and +GDATA_SERVICE_ERROR_NETWORK_ERROR will be returned.

+

If the timeout is 0, operations will +never time out.

+

Flags: Read / Write

+

Default value: 0

+

Since: 0.17.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataParsable.html b/docs/reference/html/GDataParsable.html new file mode 100644 index 0000000..3b6ec9a --- /dev/null +++ b/docs/reference/html/GDataParsable.html @@ -0,0 +1,520 @@ + + + + +GDataParsable: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataParsable

+

GDataParsable — GData parsable object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
const gchar * + +gdata_parsable_get_content_type () +
+GDataParsable * + +gdata_parsable_new_from_xml () +
+gchar * + +gdata_parsable_get_xml () +
+GDataParsable * + +gdata_parsable_new_from_json () +
+gchar * + +gdata_parsable_get_json () +
+
+
+

Properties

+
+++++ + + + + + +
gbooleanconstructed-from-xmlRead / Write / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataParsable
 GDataParsableClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ├── GDataEntry
+        ├── GDataAPPCategories
+        ├── GDataAuthor
+        ├── GDataFeed
+        ├── GDataCategory
+        ├── GDataDocumentsMetadata
+        ├── GDataGContactCalendar
+        ├── GDataGContactEvent
+        ├── GDataGContactExternalID
+        ├── GDataGContactJot
+        ├── GDataGContactLanguage
+        ├── GDataGContactRelation
+        ├── GDataGContactWebsite
+        ├── GDataGDEmailAddress
+        ├── GDataGDIMAddress
+        ├── GDataGDName
+        ├── GDataGDOrganization
+        ├── GDataGDPhoneNumber
+        ├── GDataGDPostalAddress
+        ├── GDataGDReminder
+        ├── GDataGDWhen
+        ├── GDataGDWhere
+        ├── GDataGDWho
+        ├── GDataGenerator
+        ├── GDataLink
+        ├── GDataMediaCategory
+        ├── GDataMediaContent
+        ├── GDataMediaCredit
+        ├── GDataMediaThumbnail
+        ╰── GDataYouTubeState
+
+
+
+

Includes

+
#include <gdata/gdata-parsable.h>
+
+
+
+

Description

+

GDataParsable is an abstract class allowing easy implementation of an extensible parser. It is primarily extended by GDataFeed and GDataEntry, +both of which require XML parsing which can be extended by subclassing.

+

It allows methods to be defined for handling the root XML node, each of its child nodes, and a method to be called after parsing is complete.

+
+
+

Functions

+
+

gdata_parsable_get_content_type ()

+
const gchar *
+gdata_parsable_get_content_type (GDataParsable *self);
+

Returns the content type upon which the GDataParsable is built. For example, application/atom+xml or application/json.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataParsable

 
+
+
+

Returns

+

the parsable's content type

+
+

Since: 0.17.7

+
+
+
+

gdata_parsable_new_from_xml ()

+
GDataParsable *
+gdata_parsable_new_from_xml (GType parsable_type,
+                             const gchar *xml,
+                             gint length,
+                             GError **error);
+

Creates a new GDataParsable subclass (of the given parsable_type +) from the given xml +.

+

An object of the given parsable_type + is created, and its pre_parse_xml, parse_xml and +post_parse_xml class functions called on the XML tree obtained from xml +. pre_parse_xml and +post_parse_xml are called once each on the root node of the tree, while parse_xml is called for +each of the child nodes of the root node.

+

If length + is -1, xml + will be assumed to be null-terminated.

+

If an error occurs during parsing, a suitable error from GDataParserError will be returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

parsable_type

the type of the class represented by the XML

 

xml

the XML for just the parsable object, with full namespace declarations

 

length

the length of xml +, or -1

 

error

a GError, or NULL

 
+
+
+

Returns

+

a new GDataParsable, or NULL; unref with g_object_unref()

+
+

Since: 0.4.0

+
+
+
+

gdata_parsable_get_xml ()

+
gchar *
+gdata_parsable_get_xml (GDataParsable *self);
+

Builds an XML representation of the GDataParsable in its current state, such that it could be inserted on the server. The XML is guaranteed +to have all its namespaces declared properly in a self-contained fashion, and is valid for stand-alone use.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataParsable

 
+
+
+

Returns

+

the object's XML; free with g_free()

+
+

Since: 0.4.0

+
+
+
+

gdata_parsable_new_from_json ()

+
GDataParsable *
+gdata_parsable_new_from_json (GType parsable_type,
+                              const gchar *json,
+                              gint length,
+                              GError **error);
+

Creates a new GDataParsable subclass (of the given parsable_type +) from the given json +.

+

An object of the given parsable_type + is created, and its parse_json and +post_parse_json class functions called on the JSON node obtained from json +. +post_parse_json is called once on the root node, while parse_json is called for +each of the node's members.

+

If length + is -1, json + will be assumed to be nul-terminated.

+

If an error occurs during parsing, a suitable error from GDataParserError will be returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

parsable_type

the type of the class represented by the JSON

 

json

the JSON for just the parsable object

 

length

the length of json +, or -1

 

error

a GError, or NULL

 
+
+
+

Returns

+

a new GDataParsable, or NULL; unref with g_object_unref()

+
+

Since: 0.15.0

+
+
+
+

gdata_parsable_get_json ()

+
gchar *
+gdata_parsable_get_json (GDataParsable *self);
+

Builds a JSON representation of the GDataParsable in its current state, such that it could be inserted on the server. The JSON +is valid for stand-alone use.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataParsable

 
+
+
+

Returns

+

the object's JSON; free with g_free()

+
+

Since: 0.15.0

+
+
+
+

Types and Values

+
+

GDataParsable

+
typedef struct _GDataParsable GDataParsable;
+

All the fields in the GDataParsable structure are private and should never be accessed directly.

+

Since: 0.3.0

+
+
+
+

GDataParsableClass

+
typedef struct {
+	GObjectClass parent;
+
+	gboolean (*pre_parse_xml) (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error);
+	gboolean (*parse_xml) (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error);
+	gboolean (*post_parse_xml) (GDataParsable *parsable, gpointer user_data, GError **error);
+
+	void (*pre_get_xml) (GDataParsable *parsable, GString *xml_string);
+	void (*get_xml) (GDataParsable *parsable, GString *xml_string);
+	void (*get_namespaces) (GDataParsable *parsable, GHashTable *namespaces);
+
+	gboolean (*parse_json) (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error);
+	gboolean (*post_parse_json) (GDataParsable *parsable, gpointer user_data, GError **error);
+	void (*get_json) (GDataParsable *parsable, JsonBuilder *builder);
+
+	const gchar *(*get_content_type) (void);
+
+	const gchar *element_name;
+	const gchar *element_namespace;
+} GDataParsableClass;
+
+

The class structure for the GDataParsable class. Note that JSON and XML functions are mutually exclusive: +a given implementation of GDataParsable is represented as exactly one of JSON and XML.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GObjectClass parent;

the parent class

 

pre_parse_xml ()

a function called before parsing of an XML tree is started, which allows properties from the root node to be extracted +and used in parsable +

 

parse_xml ()

a function to parse an XML representation of the GDataParsable to set the properties of the parsable +

 

post_parse_xml ()

a function called after parsing an XML tree, to allow the parsable +to validate the parsed properties

 

pre_get_xml ()

a function called before building the XML representation of the children of the GDataParsable, which allows attributes of the root +XML node to be added to xml_string +

 

get_xml ()

a function to build an XML representation of the GDataParsable in its current state, appending it to the provided GString

 

get_namespaces ()

a function to return a string containing the namespace declarations used by the parsable +when represented in XML form

 

parse_json ()

a function to parse a JSON representation of the GDataParsable to set the properties of the parsable +

 

post_parse_json ()

a function called after parsing a JSON object, to allow the parsable +to validate the parsed properties

 

get_json ()

a function to build a JSON representation of the GDataParsable in its current state, appending it to the provided JsonBuilder

 

get_content_type ()

a function which returns content type upon which is GDataParsable built

 

const gchar *element_name;

the name of the XML element which represents this parsable

 

const gchar *element_namespace;

the prefix of the XML namespace used for the parsable

 
+
+

Since: 0.3.0

+
+
+
+

Property Details

+
+

The “constructed-from-xml” property

+
  “constructed-from-xml”     gboolean
+

Specifies whether the object was constructed by parsing XML or manually.

+

Flags: Read / Write / Construct Only

+

Default value: FALSE

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataPicasaWebAlbum.html b/docs/reference/html/GDataPicasaWebAlbum.html new file mode 100644 index 0000000..af82cd0 --- /dev/null +++ b/docs/reference/html/GDataPicasaWebAlbum.html @@ -0,0 +1,1394 @@ + + + + +GDataPicasaWebAlbum: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataPicasaWebAlbum

+

GDataPicasaWebAlbum — GData PicasaWeb album object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataPicasaWebAlbum * + +gdata_picasaweb_album_new () +
const gchar * + +gdata_picasaweb_album_get_id () +
const gchar * + +gdata_picasaweb_album_get_user () +
const gchar * + +gdata_picasaweb_album_get_nickname () +
+gint64 + +gdata_picasaweb_album_get_edited () +
const gchar * + +gdata_picasaweb_album_get_location () +
+void + +gdata_picasaweb_album_set_location () +
+GDataPicasaWebVisibility + +gdata_picasaweb_album_get_visibility () +
+void + +gdata_picasaweb_album_set_visibility () +
+gint64 + +gdata_picasaweb_album_get_timestamp () +
+void + +gdata_picasaweb_album_set_timestamp () +
+guint + +gdata_picasaweb_album_get_num_photos () +
+guint + +gdata_picasaweb_album_get_num_photos_remaining () +
+glong + +gdata_picasaweb_album_get_bytes_used () +
+gboolean + +gdata_picasaweb_album_is_commenting_enabled () +
+void + +gdata_picasaweb_album_set_is_commenting_enabled () +
+guint + +gdata_picasaweb_album_get_comment_count () +
const gchar * const * + +gdata_picasaweb_album_get_tags () +
+void + +gdata_picasaweb_album_set_tags () +
+GList * + +gdata_picasaweb_album_get_contents () +
+GList * + +gdata_picasaweb_album_get_thumbnails () +
+void + +gdata_picasaweb_album_get_coordinates () +
+void + +gdata_picasaweb_album_set_coordinates () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *album-idRead / Write / Construct Only
glongbytes-usedRead
guintcomment-countRead
gint64editedRead
gbooleanis-commenting-enabledRead / Write
gdoublelatitudeRead / Write
+gchar *locationRead / Write
gdoublelongitudeRead / Write
+gchar *nicknameRead
guintnum-photosRead
guintnum-photos-remainingRead
GStrvtagsRead / Write
gint64timestampRead / Write
+gchar *userRead
GDataPicasaWebVisibilityvisibilityRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
 GDataPicasaWebAlbum
 GDataPicasaWebAlbumClass
enumGDataPicasaWebVisibility
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataPicasaWebAlbum
+
+
+
+

Includes

+
#include <gdata/services/picasaweb/gdata-picasaweb-album.h>
+
+
+
+

Description

+

GDataPicasaWebAlbum is a subclass of GDataEntry to represent an album from Google PicasaWeb.

+

For more details of Google PicasaWeb's GData API, see the +online documentation.

+
+

Example 40. Getting Basic Album Data

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
GDataFeed *album_feed;
+GList *album_entries;
+
+/* Query for a feed of GDataPicasaWebAlbums owned by user "libgdata.picasaweb" */
+album_feed = gdata_picasaweb_service_query_all_albums (service, NULL, "libgdata.picasaweb", NULL, NULL, NULL, NULL);
+
+/* Get a list of GDataPicasaWebAlbums from the query's feed */
+for (album_entries = gdata_feed_get_entries (album_feed); album_entries != NULL; album_entries = album_entries->next) {
+    GDataPicasaWebAlbum *album;
+    guint num_photos;
+    const gchar *owner_nickname, *title, *summary;
+    gint64 timestamp;
+    GList *thumbnails;
+
+    album = GDATA_PICASAWEB_ALBUM (album_entries->data);
+
+    /* Get various bits of information about the album */
+    num_photos = gdata_picasaweb_album_get_num_photos (album);
+    owner_nickname = gdata_picasaweb_album_get_nickname (album);
+    title = gdata_entry_get_title (GDATA_ENTRY (album));
+    summary = gdata_entry_get_summary (GDATA_ENTRY (album));
+    /* Get the day the album was shot on or, if not set, when it was uploaded. This is in milliseconds since the epoch. */
+    timestamp = gdata_picasaweb_album_get_timestamp (album);
+
+    for (thumbnails = gdata_picasaweb_album_get_thumbnails (album); thumbnails != NULL; thumbnails = thumbnails->next) {
+        GDataMediaThumbnail *thumbnail;
+        GDataDownloadStream *download_stream;
+        GdkPixbuf *pixbuf;
+
+        thumbnail = GDATA_MEDIA_THUMBNAIL (thumbnails->data);
+        /* Do something fun with the thumbnails, like download and display them. We could just as easily download them into
+         * files using g_file_create() and g_output_stream_splice(), rather than create GdkPixbufs directly from them.
+         * Note that this is a blocking operation. */
+        download_stream = gdata_media_thumbnail_download (thumbnail, GDATA_SERVICE (service), NULL, NULL);
+        pixbuf = gdk_pixbuf_new_from_stream (G_INPUT_STREAM (download_stream), NULL, NULL);
+        g_object_unref (download_stream);
+        /* ... */
+        g_object_unref (pixbuf);
+    }
+
+    /* Do something worthwhile with your album data */
+}
+
+g_object_unref (album_feed);
+
+ +
+
+
+
+

Functions

+
+

gdata_picasaweb_album_new ()

+
GDataPicasaWebAlbum *
+gdata_picasaweb_album_new (const gchar *id);
+

Creates a new GDataPicasaWebAlbum with the given ID and default properties. id + is the ID which would be returned by gdata_entry_get_id(), +not gdata_picasaweb_album_get_id().

+

If id + is not NULL and can't be parsed to extract an album ID, NULL will be returned.

+
+

Parameters

+
+++++ + + + + + +

id

the album's entry ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataPicasaWebAlbum, or NULL; unref with g_object_unref()

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_id ()

+
const gchar *
+gdata_picasaweb_album_get_id (GDataPicasaWebAlbum *self);
+

Gets the “album-id” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the album's ID

+
+

Since: 0.7.0

+
+
+
+

gdata_picasaweb_album_get_user ()

+
const gchar *
+gdata_picasaweb_album_get_user (GDataPicasaWebAlbum *self);
+

Gets the “user” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the album owner's username

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_nickname ()

+
const gchar *
+gdata_picasaweb_album_get_nickname (GDataPicasaWebAlbum *self);
+

Gets the “nickname” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the album owner's nickname

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_edited ()

+
gint64
+gdata_picasaweb_album_get_edited (GDataPicasaWebAlbum *self);
+

Gets the “edited” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the UNIX timestamp for the time the album was last edited, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_location ()

+
const gchar *
+gdata_picasaweb_album_get_location (GDataPicasaWebAlbum *self);
+

Gets the “location” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the album's location, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_set_location ()

+
void
+gdata_picasaweb_album_set_location (GDataPicasaWebAlbum *self,
+                                    const gchar *location);
+

Sets the “location” property to location +.

+

Set location + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebAlbum

 

location

the new album location, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_visibility ()

+
GDataPicasaWebVisibility
+gdata_picasaweb_album_get_visibility (GDataPicasaWebAlbum *self);
+

Gets the “visibility” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the album's visibility level

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_set_visibility ()

+
void
+gdata_picasaweb_album_set_visibility (GDataPicasaWebAlbum *self,
+                                      GDataPicasaWebVisibility visibility);
+

Sets the “visibility” property to visibility +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebAlbum

 

visibility

the new album visibility level

 
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_timestamp ()

+
gint64
+gdata_picasaweb_album_get_timestamp (GDataPicasaWebAlbum *self);
+

Gets the “timestamp” property. This value usually holds either the date that best corresponds to the album of photos, or to the +day it was uploaded. It's a UNIX timestamp in milliseconds (not seconds) since the epoch. If the property is unset, -1 +will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the UNIX timestamp for the timestamp property in milliseconds, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_set_timestamp ()

+
void
+gdata_picasaweb_album_set_timestamp (GDataPicasaWebAlbum *self,
+                                     gint64 timestamp);
+

Sets the “timestamp” property from timestamp +. This should be a UNIX timestamp in milliseconds (not seconds) since the epoch.

+

Set timestamp + to -1 to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebAlbum

 

timestamp

a UNIX timestamp, or -1

 
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_num_photos ()

+
guint
+gdata_picasaweb_album_get_num_photos (GDataPicasaWebAlbum *self);
+

Gets the “num-photos” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the number of photos currently in the album

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_num_photos_remaining ()

+
guint
+gdata_picasaweb_album_get_num_photos_remaining
+                               (GDataPicasaWebAlbum *self);
+

Gets the “num-photos-remaining” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the number of photos that can still be uploaded to the album

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_bytes_used ()

+
glong
+gdata_picasaweb_album_get_bytes_used (GDataPicasaWebAlbum *self);
+

Gets the “bytes-used” property. It will return -1 if the current authenticated +user is not the owner of the album.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the number of bytes used by the album and its contents, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_is_commenting_enabled ()

+
gboolean
+gdata_picasaweb_album_is_commenting_enabled
+                               (GDataPicasaWebAlbum *self);
+

Gets the “is-commenting-enabled” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

TRUE if commenting is enabled for the album, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_set_is_commenting_enabled ()

+
void
+gdata_picasaweb_album_set_is_commenting_enabled
+                               (GDataPicasaWebAlbum *self,
+                                gboolean is_commenting_enabled);
+

Sets the “is-commenting-enabled” property to is_commenting_enabled +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebAlbum

 

is_commenting_enabled

TRUE if commenting should be enabled for the album, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_comment_count ()

+
guint
+gdata_picasaweb_album_get_comment_count
+                               (GDataPicasaWebAlbum *self);
+

Gets the “comment-count” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

the number of comments on the album

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_tags ()

+
const gchar * const *
+gdata_picasaweb_album_get_tags (GDataPicasaWebAlbum *self);
+

Gets the “tags” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

a NULL-terminated array of tags associated with all the photos in the album, or NULL.

+

[array zero-terminated=1][transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_set_tags ()

+
void
+gdata_picasaweb_album_set_tags (GDataPicasaWebAlbum *self,
+                                const gchar * const *tags);
+

Sets the “tags” property to tags +.

+

Set tags + to NULL to unset the album's tag list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebAlbum

 

tags

the new NULL-terminated array of tags, or NULL.

[array zero-terminated=1][allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_contents ()

+
GList *
+gdata_picasaweb_album_get_contents (GDataPicasaWebAlbum *self);
+

Returns a list of media content, such as the cover image for the album.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

a GList of GDataMediaContent items.

+

[element-type GData.MediaContent][transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_thumbnails ()

+
GList *
+gdata_picasaweb_album_get_thumbnails (GDataPicasaWebAlbum *self);
+

Returns a list of thumbnails, often at different sizes, for this album.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebAlbum

 
+
+
+

Returns

+

a GList of GDataMediaThumbnails, or NULL.

+

[element-type GData.MediaThumbnail][transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_album_get_coordinates ()

+
void
+gdata_picasaweb_album_get_coordinates (GDataPicasaWebAlbum *self,
+                                       gdouble *latitude,
+                                       gdouble *longitude);
+

Gets the “latitude” and “longitude” properties, +setting the out parameters to them. If either latitude or longitude is NULL, that parameter will not be set. +If the coordinates are unset, latitude + and longitude + will be set to G_MAXDOUBLE.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebAlbum

 

latitude

return location for the latitude, or NULL.

[out caller-allocates][allow-none]

longitude

return location for the longitude, or NULL.

[out caller-allocates][allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_album_set_coordinates ()

+
void
+gdata_picasaweb_album_set_coordinates (GDataPicasaWebAlbum *self,
+                                       gdouble latitude,
+                                       gdouble longitude);
+

Sets the “latitude” and “longitude” properties to +latitude + and longitude + respectively.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebAlbum

 

latitude

the album's new latitude coordinate, or G_MAXDOUBLE

 

longitude

the album's new longitude coordinate, or G_MAXDOUBLE

 
+
+

Since: 0.5.0

+
+
+
+

Types and Values

+
+

GDataPicasaWebAlbum

+
typedef struct _GDataPicasaWebAlbum GDataPicasaWebAlbum;
+

All the fields in the GDataPicasaWebAlbum structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataPicasaWebAlbumClass

+
typedef struct {
+} GDataPicasaWebAlbumClass;
+
+

All the fields in the GDataPicasaWebAlbumClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

enum GDataPicasaWebVisibility

+

Visibility statuses available for albums on PicasaWeb. For more information, see the

+online documentation. +
+

Members

+
+++++ + + + + + + + + + + + + +

GDATA_PICASAWEB_PUBLIC

+

the album is visible to everyone, regardless of whether they're authenticated

+
 

GDATA_PICASAWEB_PRIVATE

+

the album is visible only to authenticated users in a whitelist

+
 
+
+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “album-id” property

+
  “album-id”                 gchar *
+

The ID of the album. This is a substring of the ID returned by gdata_entry_get_id() for GDataPicasaWebAlbums; for example, +if gdata_entry_get_id() returned "http://picasaweb.google.com/data/entry/user/libgdata.picasaweb/albumid/5328889949261497249" for a +particular GDataPicasaWebAlbum, the “album-id” property would be "5328889949261497249".

+

For more information, see the +gphoto specification.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “bytes-used” property

+
  “bytes-used”               glong
+

The number of bytes consumed by this album and its contents. Note that this is only set if the authenticated user is the owner of the +album; it's otherwise -1.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “comment-count” property

+
  “comment-count”            guint
+

The number of comments on the album.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “edited” property

+
  “edited”                   gint64
+

The time this album was last edited. If the album has not been edited yet, the content indicates the time it was created.

+

For more information, see the +Atom Publishing Protocol specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “is-commenting-enabled” property

+
  “is-commenting-enabled”    gboolean
+

Whether commenting is enabled for this album.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “latitude” property

+
  “latitude”                 gdouble
+

The location as a latitude coordinate associated with this album. Valid latitudes range from -90.0 +to 90.0 inclusive.

+

For more information, see the +GeoRSS specification.

+

Flags: Read / Write

+

Allowed values: [-90,90]

+

Default value: 0

+

Since: 0.5.0

+
+
+
+

The “location” property

+
  “location”                 gchar *
+

The user-specified location associated with the album. A place name.

+

For more information, see the +gphoto specification.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “longitude” property

+
  “longitude”                gdouble
+

The location as a longitude coordinate associated with this album. Valid longitudes range from -180.0 +to 180.0 inclusive.

+

For more information, see the +GeoRSS specification.

+

Flags: Read / Write

+

Allowed values: [-180,180]

+

Default value: 0

+

Since: 0.5.0

+
+
+
+

The “nickname” property

+
  “nickname”                 gchar *
+

The user's nickname. This is a user-specified value that should be used when referring to the user by name.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “num-photos” property

+
  “num-photos”               guint
+

The number of photos and videos in the album.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “num-photos-remaining” property

+
  “num-photos-remaining”     guint
+

The number of photos and videos that can still be uploaded to this album. +This doesn't account for quota, just a hardcoded maximum number per album set by Google.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “tags” property

+
  “tags”                     GStrv
+

A NULL-terminated array of tags associated with the album; all the tags associated with the individual photos in the album.

+

For more information, see the +Media RSS specification.

+

Flags: Read / Write

+

Since: 0.4.0

+
+
+
+

The “timestamp” property

+
  “timestamp”                gint64
+

The timestamp of when the album occurred, settable by the user. This a UNIX timestamp in milliseconds (not seconds) since the epoch.

+

For more information, see the +gphoto specification.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “user” property

+
  “user”                     gchar *
+

The username of the album owner.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “visibility” property

+
  “visibility”               GDataPicasaWebVisibility
+

The visibility (or access rights) of the album.

+

For more information, see the +gphoto specification.

+

Flags: Read / Write

+

Default value: GDATA_PICASAWEB_PRIVATE

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataPicasaWebComment.html b/docs/reference/html/GDataPicasaWebComment.html new file mode 100644 index 0000000..d49f141 --- /dev/null +++ b/docs/reference/html/GDataPicasaWebComment.html @@ -0,0 +1,152 @@ + + + + +GDataPicasaWebComment: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataPicasaWebComment

+

GDataPicasaWebComment — GData PicasaWeb comment object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+GDataPicasaWebComment * + +gdata_picasaweb_comment_new () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataPicasaWebComment
 GDataPicasaWebCommentClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataComment
+                ╰── GDataPicasaWebComment
+
+
+
+

Includes

+
#include <gdata/services/picasaweb/gdata-picasaweb-comment.h>
+
+
+
+

Description

+

GDataPicasaWebComment is a subclass of GDataComment to represent a comment on a GDataPicasaWebFile. It is returned by the GDataCommentable +interface implementation on GDataPicasaWebFile.

+

It's possible to query for, add and delete GDataPicasaWebComments from GDataPicasaWebFiles.

+
+
+

Functions

+
+

gdata_picasaweb_comment_new ()

+
GDataPicasaWebComment *
+gdata_picasaweb_comment_new (const gchar *id);
+

Creates a new GDataPicasaWebComment with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the comment's ID, or NULL

 
+
+
+

Returns

+

a new GDataPicasaWebComment; unref with g_object_unref()

+
+

Since: 0.10.0

+
+
+
+

Types and Values

+
+

GDataPicasaWebComment

+
typedef struct _GDataPicasaWebComment GDataPicasaWebComment;
+

All the fields in the GDataPicasaWebComment structure are private and should never be accessed directly.

+

Since: 0.10.0

+
+
+
+

GDataPicasaWebCommentClass

+
typedef struct {
+} GDataPicasaWebCommentClass;
+
+

All the fields in the GDataPicasaWebCommentClass structure are private and should never be accessed directly.

+

Since: 0.10.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataPicasaWebFeed.html b/docs/reference/html/GDataPicasaWebFeed.html new file mode 100644 index 0000000..02138ff --- /dev/null +++ b/docs/reference/html/GDataPicasaWebFeed.html @@ -0,0 +1,108 @@ + + + + +GDataPicasaWebFeed: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataPicasaWebFeed

+

GDataPicasaWebFeed — GData PicasaWeb Feed object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataPicasaWebFeed
 GDataPicasaWebFeedClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataFeed
+            ╰── GDataPicasaWebFeed
+
+
+
+

Includes

+
#include <gdata/services/picasaweb/gdata-picasaweb-feed.h>
+
+
+
+

Description

+

GDataPicasaWebFeed is a subclass of GDataFeed to represent properties for a PicasaWeb feed. It adds a couple of +properties which are specific to the Google PicasaWeb API.

+
+
+

Functions

+

+
+
+

Types and Values

+
+

GDataPicasaWebFeed

+
typedef struct _GDataPicasaWebFeed GDataPicasaWebFeed;
+

All the fields in the GDataPicasaWebFeed structure are private and should never be accessed directly.

+

Since: 0.6.0

+
+
+
+

GDataPicasaWebFeedClass

+
typedef struct {
+} GDataPicasaWebFeedClass;
+
+

All the fields in the GDataPicasaWebFeedClass structure are private and should never be accessed directly.

+

Since: 0.6.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataPicasaWebFile.html b/docs/reference/html/GDataPicasaWebFile.html new file mode 100644 index 0000000..f742085 --- /dev/null +++ b/docs/reference/html/GDataPicasaWebFile.html @@ -0,0 +1,2123 @@ + + + + +GDataPicasaWebFile: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataPicasaWebFile

+

GDataPicasaWebFile — GData PicasaWeb file object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataPicasaWebFile * + +gdata_picasaweb_file_new () +
const gchar * + +gdata_picasaweb_file_get_id () +
+gint64 + +gdata_picasaweb_file_get_edited () +
const gchar * + +gdata_picasaweb_file_get_version () +
const gchar * + +gdata_picasaweb_file_get_album_id () +
+void + +gdata_picasaweb_file_set_album_id () +
+guint + +gdata_picasaweb_file_get_width () +
+guint + +gdata_picasaweb_file_get_height () +
+gsize + +gdata_picasaweb_file_get_size () +
const gchar * + +gdata_picasaweb_file_get_checksum () +
+void + +gdata_picasaweb_file_set_checksum () +
+gint64 + +gdata_picasaweb_file_get_timestamp () +
+void + +gdata_picasaweb_file_set_timestamp () +
+gboolean + +gdata_picasaweb_file_is_commenting_enabled () +
+void + +gdata_picasaweb_file_set_is_commenting_enabled () +
+guint + +gdata_picasaweb_file_get_comment_count () +
+guint + +gdata_picasaweb_file_get_rotation () +
+void + +gdata_picasaweb_file_set_rotation () +
const gchar * + +gdata_picasaweb_file_get_video_status () +
const gchar * const * + +gdata_picasaweb_file_get_tags () +
+void + +gdata_picasaweb_file_set_tags () +
const gchar * + +gdata_picasaweb_file_get_credit () +
const gchar * + +gdata_picasaweb_file_get_caption () +
+void + +gdata_picasaweb_file_set_caption () +
+GList * + +gdata_picasaweb_file_get_contents () +
+GList * + +gdata_picasaweb_file_get_thumbnails () +
+gdouble + +gdata_picasaweb_file_get_distance () +
+gdouble + +gdata_picasaweb_file_get_exposure () +
+gboolean + +gdata_picasaweb_file_get_flash () +
+gdouble + +gdata_picasaweb_file_get_focal_length () +
+gdouble + +gdata_picasaweb_file_get_fstop () +
const gchar * + +gdata_picasaweb_file_get_image_unique_id () +
+gint + +gdata_picasaweb_file_get_iso () +
const gchar * + +gdata_picasaweb_file_get_make () +
const gchar * + +gdata_picasaweb_file_get_model () +
+void + +gdata_picasaweb_file_get_coordinates () +
+void + +gdata_picasaweb_file_set_coordinates () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *album-idRead / Write
+gchar *captionRead / Write
+gchar *checksumRead / Write
guintcomment-countRead
+gchar *creditRead
gdoubledistanceRead
gint64editedRead
gdoubleexposureRead
+gchar *file-idRead / Write / Construct Only
gbooleanflashRead
gdoublefocal-lengthRead
gdoublefstopRead
guintheightRead
+gchar *image-unique-idRead
gbooleanis-commenting-enabledRead / Write
glongisoRead
gdoublelatitudeRead / Write
gdoublelongitudeRead / Write
+gchar *makeRead
+gchar *modelRead
guintrotationRead / Write
gulongsizeRead
GStrvtagsRead / Write
gint64timestampRead / Write
+gchar *versionRead / Write / Construct Only
+gchar *video-statusRead
guintwidthRead
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataPicasaWebFile
+
+
+
+

Implemented Interfaces

+

+GDataPicasaWebFile implements + GDataCommentable.

+
+
+

Includes

+
#include <gdata/services/picasaweb/gdata-picasaweb-file.h>
+
+
+
+

Description

+

GDataPicasaWebFile is a subclass of GDataEntry to represent a file (photo or video) in an album on Google PicasaWeb.

+

GDataPicasaWebFile implements GDataCommentable, allowing comments on files to be queried using gdata_commentable_query_comments(), new +comments to be added to files using gdata_commentable_insert_comment() and existing comments to be deleted from files using +gdata_commentable_delete_comment().

+

For more details of Google PicasaWeb's GData API, see the

+online documentation. +
+

Example 41. Getting Basic Photo Data

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
GDataFeed *photo_feed;
+GList *photo_entries;
+
+/* Query for a feed of GDataPicasaWebFiles belonging to the given GDataPicasaWebAlbum album */
+photo_feed = gdata_picasaweb_service_query_files (service, album, NULL, NULL, NULL, NULL, NULL);
+
+/* Get a list of GDataPicasaWebFiles from the query's feed */
+for (photo_entries = gdata_feed_get_entries (photo_feed); photo_entries != NULL; photo_entries = photo_entries->next) {
+    GDataPicasaWebFile *photo;
+    guint height, width;
+    gsize file_size;
+    gint64 timestamp;
+    const gchar *title, *summary;
+    GList *contents;
+
+    photo = GDATA_PICASAWEB_FILE (photo_entries->data);
+
+    /* Get various bits of information about the photo */
+    height = gdata_picasaweb_file_get_height (photo);
+    width = gdata_picasaweb_file_get_width (photo);
+    file_size = gdata_picasaweb_file_get_size (photo);
+    timestamp = gdata_picasaweb_file_get_timestamp (photo);
+    title = gdata_entry_get_title (GDATA_ENTRY (photo));
+    summary = gdata_entry_get_summary (GDATA_ENTRY (photo));
+
+    /* Obtain the image data at various sizes */
+    for (contents = gdata_picasaweb_file_get_contents (photo); contents != NULL; contents = contents->next) {
+        GDataMediaContent *content;
+        GDataDownloadStream *download_stream;
+        GFileOutputStream *file_stream;
+        GFile *new_file;
+
+        content = GDATA_MEDIA_CONTENT (contents->data);
+        /* Do something fun with the actual images, like download them to a file.
+         * Note that this is a blocking operation. */
+        download_stream = gdata_media_content_download (content, GDATA_SERVICE (service), NULL, NULL);
+        new_file = g_file_new_for_path (file_path);
+        file_stream = g_file_create (new_file, G_FILE_CREATE_NONE, NULL, NULL);
+        g_output_stream_splice (G_OUTPUT_STREAM (file_stream), G_INPUT_STREAM (download_stream),
+                                G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, NULL);
+        g_object_unref (file_stream);
+        g_object_unref (download_stream);
+        /* ... */
+        g_object_unref (new_file);
+    }
+
+    /* Do something worthwhile with your image data */
+}
+
+g_object_unref (photo_feed);
+
+ +
+
+
+
+

Functions

+
+

gdata_picasaweb_file_new ()

+
GDataPicasaWebFile *
+gdata_picasaweb_file_new (const gchar *id);
+

Creates a new GDataPicasaWebFile with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the file's ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataPicasaWebFile; unref with g_object_unref()

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_id ()

+
const gchar *
+gdata_picasaweb_file_get_id (GDataPicasaWebFile *self);
+

Gets the “file-id” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the file's ID

+
+

Since: 0.7.0

+
+
+
+

gdata_picasaweb_file_get_edited ()

+
gint64
+gdata_picasaweb_file_get_edited (GDataPicasaWebFile *self);
+

Gets the “edited” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the UNIX timestamp for the time the file was last edited, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_version ()

+
const gchar *
+gdata_picasaweb_file_get_version (GDataPicasaWebFile *self);
+

Gets the “version” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the file's version number, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_album_id ()

+
const gchar *
+gdata_picasaweb_file_get_album_id (GDataPicasaWebFile *self);
+

Gets the “album-id” property. This is in the same form as returned by gdata_picasaweb_album_get_id().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the ID of the album containing the GDataPicasaWebFile

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_set_album_id ()

+
void
+gdata_picasaweb_file_set_album_id (GDataPicasaWebFile *self,
+                                   const gchar *album_id);
+

Sets the “album-id” property, effectively moving the file to the album.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebFile

 

album_id

the ID of the new album for this file

 
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_width ()

+
guint
+gdata_picasaweb_file_get_width (GDataPicasaWebFile *self);
+

Gets the “width” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the width of the image or video, in pixels

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_height ()

+
guint
+gdata_picasaweb_file_get_height (GDataPicasaWebFile *self);
+

Gets the “height” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the height of the image or video, in pixels

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_size ()

+
gsize
+gdata_picasaweb_file_get_size (GDataPicasaWebFile *self);
+

Gets the “size” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the size of the file, in bytes

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_checksum ()

+
const gchar *
+gdata_picasaweb_file_get_checksum (GDataPicasaWebFile *self);
+

Gets the “checksum” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the checksum assigned to this file, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_set_checksum ()

+
void
+gdata_picasaweb_file_set_checksum (GDataPicasaWebFile *self,
+                                   const gchar *checksum);
+

Sets the “checksum” property to checksum +.

+

Set checksum + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebFile

 

checksum

the new checksum for this file, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_timestamp ()

+
gint64
+gdata_picasaweb_file_get_timestamp (GDataPicasaWebFile *self);
+

Gets the “timestamp” property. It's a UNIX timestamp in milliseconds (not seconds) since the epoch. If the property is unset,

+-1 will be returned. +
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the UNIX timestamp for the timestamp property in milliseconds, or -1

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_set_timestamp ()

+
void
+gdata_picasaweb_file_set_timestamp (GDataPicasaWebFile *self,
+                                    gint64 timestamp);
+

Sets the “timestamp” property from timestamp +. This should be a UNIX timestamp in milliseconds (not seconds) since the epoch. If +timestamp + is -1, the property will be unset.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebFile

 

timestamp

a UNIX timestamp, or -1

 
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_is_commenting_enabled ()

+
gboolean
+gdata_picasaweb_file_is_commenting_enabled
+                               (GDataPicasaWebFile *self);
+

Gets the “is-commenting-enabled” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

TRUE if commenting is enabled, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_set_is_commenting_enabled ()

+
void
+gdata_picasaweb_file_set_is_commenting_enabled
+                               (GDataPicasaWebFile *self,
+                                gboolean is_commenting_enabled);
+

Sets the “is-commenting-enabled” property to is_commenting_enabled +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebFile

 

is_commenting_enabled

TRUE if commenting should be enabled for the file, FALSE otherwise

 
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_comment_count ()

+
guint
+gdata_picasaweb_file_get_comment_count
+                               (GDataPicasaWebFile *self);
+

Gets the “comment-count” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the number of comments on the file

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_rotation ()

+
guint
+gdata_picasaweb_file_get_rotation (GDataPicasaWebFile *self);
+

Gets the “rotation” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the image's rotation, in degrees

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_set_rotation ()

+
void
+gdata_picasaweb_file_set_rotation (GDataPicasaWebFile *self,
+                                   guint rotation);
+

Sets the “rotation” property to rotation +.

+

The rotation is absolute, rather than cumulative, through successive calls to gdata_picasaweb_file_set_rotation(), +so calling it with 90° then 20° will result in a final rotation of 20°.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebFile

 

rotation

the new rotation for the image, in degrees

 
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_video_status ()

+
const gchar *
+gdata_picasaweb_file_get_video_status (GDataPicasaWebFile *self);
+

Gets the “video-status” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the status of this video ("pending", "ready", "final" or "failed"), or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_tags ()

+
const gchar * const *
+gdata_picasaweb_file_get_tags (GDataPicasaWebFile *self);
+

Gets the “tags” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

a NULL-terminated array of tags associated with the file, or NULL.

+

[array zero-terminated=1][transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_set_tags ()

+
void
+gdata_picasaweb_file_set_tags (GDataPicasaWebFile *self,
+                               const gchar * const *tags);
+

Sets the “tags” property to tags +.

+

Set tags + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebFile

 

tags

a new NULL-terminated array of tags, or NULL.

[array zero-terminated=1][allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_credit ()

+
const gchar *
+gdata_picasaweb_file_get_credit (GDataPicasaWebFile *self);
+

Gets the “credit” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the nickname of the user credited with this file

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_caption ()

+
const gchar *
+gdata_picasaweb_file_get_caption (GDataPicasaWebFile *self);
+

Gets the “caption” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the file's descriptive caption, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_set_caption ()

+
void
+gdata_picasaweb_file_set_caption (GDataPicasaWebFile *self,
+                                  const gchar *caption);
+

Sets the “caption” property to caption +.

+

Set caption + to NULL to unset the file's caption.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebFile

 

caption

the file's new caption, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_contents ()

+
GList *
+gdata_picasaweb_file_get_contents (GDataPicasaWebFile *self);
+

Returns a list of media content, e.g. the actual photo or video.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

a GList of GDataMediaContent items.

+

[element-type GData.MediaContent][transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_thumbnails ()

+
GList *
+gdata_picasaweb_file_get_thumbnails (GDataPicasaWebFile *self);
+

Returns a list of thumbnails, often at different sizes, for this +file. Currently, PicasaWeb usually returns three thumbnails, with +widths in pixels of 72, 144, and 288. However, the thumbnail will +not be larger than the actual image, so thumbnails may be smaller +than the widths listed above.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

a GList of GDataMediaThumbnails, or NULL.

+

[element-type GData.MediaThumbnail][transfer none]

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_file_get_distance ()

+
gdouble
+gdata_picasaweb_file_get_distance (GDataPicasaWebFile *self);
+

Gets the “distance” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the distance recorded in the photo's EXIF, or -1 if unknown

+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_get_exposure ()

+
gdouble
+gdata_picasaweb_file_get_exposure (GDataPicasaWebFile *self);
+

Gets the “exposure” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the exposure value, or 0 if unknown

+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_get_flash ()

+
gboolean
+gdata_picasaweb_file_get_flash (GDataPicasaWebFile *self);
+

Gets the “flash” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

TRUE if flash was used, FALSE otherwise

+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_get_focal_length ()

+
gdouble
+gdata_picasaweb_file_get_focal_length (GDataPicasaWebFile *self);
+

Gets the “focal-length” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the focal-length value, or -1 if unknown

+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_get_fstop ()

+
gdouble
+gdata_picasaweb_file_get_fstop (GDataPicasaWebFile *self);
+

Gets the “fstop” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the F-stop value, or 0 if unknown

+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_get_image_unique_id ()

+
const gchar *
+gdata_picasaweb_file_get_image_unique_id
+                               (GDataPicasaWebFile *self);
+

Gets the “image-unique-id” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the photo's unique EXIF identifier, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_get_iso ()

+
gint
+gdata_picasaweb_file_get_iso (GDataPicasaWebFile *self);
+

Gets the “iso” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the ISO speed, or -1 if unknown

+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_get_make ()

+
const gchar *
+gdata_picasaweb_file_get_make (GDataPicasaWebFile *self);
+

Gets the “make” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the name of the manufacturer of the camera, or NULL if unknown

+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_get_model ()

+
const gchar *
+gdata_picasaweb_file_get_model (GDataPicasaWebFile *self);
+

Gets the “model” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebFile

 
+
+
+

Returns

+

the model name of the camera, or NULL if unknown

+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_get_coordinates ()

+
void
+gdata_picasaweb_file_get_coordinates (GDataPicasaWebFile *self,
+                                      gdouble *latitude,
+                                      gdouble *longitude);
+

Gets the “latitude” and “longitude” properties, setting the out parameters to them. +If either latitude or longitude is NULL, that parameter will not be set. If the coordinates are unset, +latitude + and longitude + will be set to G_MAXDOUBLE.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebFile

 

latitude

return location for the latitude, or NULL.

[out caller-allocates][allow-none]

longitude

return location for the longitude, or NULL.

[out caller-allocates][allow-none]
+
+

Since: 0.5.0

+
+
+
+

gdata_picasaweb_file_set_coordinates ()

+
void
+gdata_picasaweb_file_set_coordinates (GDataPicasaWebFile *self,
+                                      gdouble latitude,
+                                      gdouble longitude);
+

Sets the “latitude” and “longitude” properties to +latitude + and longitude + respectively.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebFile

 

latitude

the file's new latitude coordinate, or G_MAXDOUBLE

 

longitude

the file's new longitude coordinate, or G_MAXDOUBLE

 
+
+

Since: 0.5.0

+
+
+
+

Types and Values

+
+

GDATA_PICASAWEB_VIDEO_STATUS_PENDING

+
#define GDATA_PICASAWEB_VIDEO_STATUS_PENDING "pending"
+
+

The video is still being processed.

+

Since: 0.7.0

+
+
+
+

GDATA_PICASAWEB_VIDEO_STATUS_READY

+
#define GDATA_PICASAWEB_VIDEO_STATUS_READY "ready"
+
+

The video has been processed, but still needs thumbnailing.

+

Since: 0.7.0

+
+
+
+

GDATA_PICASAWEB_VIDEO_STATUS_FINAL

+
#define GDATA_PICASAWEB_VIDEO_STATUS_FINAL "final"
+
+

The video has been processed and thumbnailed.

+

Since: 0.7.0

+
+
+
+

GDATA_PICASAWEB_VIDEO_STATUS_FAILED

+
#define GDATA_PICASAWEB_VIDEO_STATUS_FAILED "failed"
+
+

There was an error while processing or thumbnailing the video and it should be deleted.

+

Since: 0.7.0

+
+
+
+

GDataPicasaWebFile

+
typedef struct _GDataPicasaWebFile GDataPicasaWebFile;
+

All the fields in the GDataPicasaWebFile structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataPicasaWebFileClass

+
typedef struct {
+} GDataPicasaWebFileClass;
+
+

All the fields in the GDataPicasaWebFileClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “album-id” property

+
  “album-id”                 gchar *
+

The ID for the file's album. This is in the same form as returned by gdata_picasaweb_album_get_id().

+

For more information, see the +gphoto specification.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “caption” property

+
  “caption”                  gchar *
+

The file's descriptive caption.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “checksum” property

+
  “checksum”                 gchar *
+

A checksum of the file, useful for duplicate detection.

+

For more information, see the +gphoto specification.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “comment-count” property

+
  “comment-count”            guint
+

The number of comments on the file.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “credit” property

+
  “credit”                   gchar *
+

The nickname of the user credited with this file.

+

For more information, see the Media RSS +specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “distance” property

+
  “distance”                 gdouble
+

The distance to the subject reported in the image's EXIF.

+

For more information, see the +EXIF element reference.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.5.0

+
+
+
+

The “edited” property

+
  “edited”                   gint64
+

The time this file was last edited. If the file has not been edited yet, the content indicates the time it was created.

+

For more information, see the +Atom Publishing Protocol specification.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “exposure” property

+
  “exposure”                 gdouble
+

The exposure time.

+

For more information, see the +EXIF element reference.

+

Flags: Read

+

Allowed values: >= 0

+

Default value: 0

+

Since: 0.5.0

+
+
+
+

The “file-id” property

+
  “file-id”                  gchar *
+

The ID of the file. This is a substring of the ID returned by gdata_entry_get_id() for GDataPicasaWebFiles; for example, +if gdata_entry_get_id() returned +"http://picasaweb.google.com/data/entry/user/libgdata.picasaweb/albumid/5328889949261497249/photoid/5328890138794566386" for a +particular GDataPicasaWebFile, the “file-id” property would be "5328890138794566386".

+

For more information, see the +gphoto specification.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “flash” property

+
  “flash”                    gboolean
+

Indicates whether the flash was used.

+

For more information, see the +EXIF element reference.

+

Flags: Read

+

Default value: FALSE

+

Since: 0.5.0

+
+
+
+

The “focal-length” property

+
  “focal-length”             gdouble
+

The focal length for the shot.

+

For more information, see the +EXIF element reference.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.5.0

+
+
+
+

The “fstop” property

+
  “fstop”                    gdouble
+

The F-stop value.

+

For more information, see the +EXIF element reference.

+

Flags: Read

+

Allowed values: >= 0

+

Default value: 0

+

Since: 0.5.0

+
+
+
+

The “height” property

+
  “height”                   guint
+

The height of the photo or video, in pixels.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “image-unique-id” property

+
  “image-unique-id”          gchar *
+

An unique ID for the image found in the EXIF.

+

For more information, see the +EXIF element reference.

+

Flags: Read

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “is-commenting-enabled” property

+
  “is-commenting-enabled”    gboolean
+

Whether commenting is enabled for this file.

+

Flags: Read / Write

+

Default value: TRUE

+

Since: 0.4.0

+
+
+
+

The “iso” property

+
  “iso”                      glong
+

The ISO speed.

+

For more information, see the +EXIF element reference and ISO 5800:1987.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.5.0

+
+
+
+

The “latitude” property

+
  “latitude”                 gdouble
+

The location as a latitude coordinate associated with this file. Valid latitudes range from -90.0 +to 90.0 inclusive.

+

For more information, see the +GeoRSS specification.

+

Flags: Read / Write

+

Allowed values: [-90,90]

+

Default value: 0

+

Since: 0.5.0

+
+
+
+

The “longitude” property

+
  “longitude”                gdouble
+

The location as a longitude coordinate associated with this file. Valid longitudes range from -180.0 +to 180.0 inclusive.

+

For more information, see the +GeoRSS specification.

+

Flags: Read / Write

+

Allowed values: [-180,180]

+

Default value: 0

+

Since: 0.5.0

+
+
+
+

The “make” property

+
  “make”                     gchar *
+

The name of the manufacturer of the camera.

+

For more information, see the +EXIF element reference.

+

Flags: Read

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “model” property

+
  “model”                    gchar *
+

The model of the camera.

+

For more information, see the +EXIF element reference.

+

Flags: Read

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “rotation” property

+
  “rotation”                 guint
+

The rotation of the photo, in degrees. This will only be non-zero for files which are pending rotation, and haven't yet been +permanently modified. For files which have already been rotated, this will be 0.

+

For more information, see the +gphoto specification.

+

Flags: Read / Write

+

Allowed values: <= 359

+

Default value: 0

+

Since: 0.4.0

+
+
+
+

The “size” property

+
  “size”                     gulong
+

The size of the file, in bytes.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Since: 0.4.0

+
+
+
+

The “tags” property

+
  “tags”                     GStrv
+

A NULL-terminated array of tags associated with the file.

+

For more information, see the +Media RSS specification.

+

Flags: Read / Write

+

Since: 0.4.0

+
+
+
+

The “timestamp” property

+
  “timestamp”                gint64
+

The time the file was purportedly taken. This a UNIX timestamp in milliseconds (not seconds) since the epoch.

+

For more information, see the +gphoto specification.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.4.0

+
+
+
+

The “version” property

+
  “version”                  gchar *
+

The version number of the file. Version numbers are based on modification time, so they don't increment linearly.

+

For more information, see the +gphoto specification.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “video-status” property

+
  “video-status”             gchar *
+

The status of the file, if it is a video. For example: GDATA_PICASAWEB_VIDEO_STATUS_PENDING or GDATA_PICASAWEB_VIDEO_STATUS_FAILED.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “width” property

+
  “width”                    guint
+

The width of the photo or video, in pixels.

+

For more information, see the +gphoto specification.

+

Flags: Read

+

Default value: 0

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataPicasaWebQuery.html b/docs/reference/html/GDataPicasaWebQuery.html new file mode 100644 index 0000000..0a8d355 --- /dev/null +++ b/docs/reference/html/GDataPicasaWebQuery.html @@ -0,0 +1,814 @@ + + + + +GDataPicasaWebQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataPicasaWebQuery

+

GDataPicasaWebQuery — GData PicasaWeb query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataPicasaWebQuery * + +gdata_picasaweb_query_new () +
+GDataPicasaWebQuery * + +gdata_picasaweb_query_new_with_limits () +
+GDataPicasaWebVisibility + +gdata_picasaweb_query_get_visibility () +
+void + +gdata_picasaweb_query_set_visibility () +
const gchar * + +gdata_picasaweb_query_get_thumbnail_size () +
+void + +gdata_picasaweb_query_set_thumbnail_size () +
const gchar * + +gdata_picasaweb_query_get_image_size () +
+void + +gdata_picasaweb_query_set_image_size () +
const gchar * + +gdata_picasaweb_query_get_tag () +
+void + +gdata_picasaweb_query_set_tag () +
+void + +gdata_picasaweb_query_get_bounding_box () +
+void + +gdata_picasaweb_query_set_bounding_box () +
const gchar * + +gdata_picasaweb_query_get_location () +
+void + +gdata_picasaweb_query_set_location () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *image-sizeRead / Write
+gchar *locationRead / Write
+gchar *tagRead / Write
+gchar *thumbnail-sizeRead / Write
gintvisibilityRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataPicasaWebQuery
 GDataPicasaWebQueryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ╰── GDataPicasaWebQuery
+
+
+
+

Includes

+
#include <gdata/services/picasaweb/gdata-picasaweb-query.h>
+
+
+
+

Description

+

GDataPicasaWebQuery represents a collection of query parameters specific to the Google PicasaWeb service, which go above and beyond +those catered for by GDataQuery.

+

For more information on the custom GData query parameters supported by GDataPicasaWebQuery, see the online documentation.

+
+
+

Functions

+
+

gdata_picasaweb_query_new ()

+
GDataPicasaWebQuery *
+gdata_picasaweb_query_new (const gchar *q);
+

Creates a new GDataPicasaWebQuery with its “q” property set to q +.

+

Note that when querying for albums with gdata_picasaweb_service_query_all_albums(), the q + parameter cannot be used.

+
+

Parameters

+
+++++ + + + + + +

q

a query string, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataPicasaWebQuery

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_new_with_limits ()

+
GDataPicasaWebQuery *
+gdata_picasaweb_query_new_with_limits (const gchar *q,
+                                       guint start_index,
+                                       guint max_results);
+

Creates a GDataPicasaWebQuery with its “q” property set to q +, returning max_results + starting from the start_index +th result.

+

Note that when querying for albums with gdata_picasaweb_service_query_all_albums(), the q + parameter cannot be used.

+

This is useful for paging through results, but the result set between separate queries may change. So, if you use this to +request the next ten results after a previous query, it may include some of the previously returned results if their order changed, or +omit ones that would have otherwise been found in a earlier but larger query.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

q

a query string, or NULL.

[allow-none]

start_index

the index of the first result to include, or 0

 

max_results

the maximum number of results to include, or 0

 
+
+
+

Returns

+

a new GDataPicasaWebQuery

+
+

Since: 0.6.0

+
+
+
+

gdata_picasaweb_query_get_visibility ()

+
GDataPicasaWebVisibility
+gdata_picasaweb_query_get_visibility (GDataPicasaWebQuery *self);
+

Gets the “visibility” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebQuery

 
+
+
+

Returns

+

the visibility of the objects to retrieve, or 0 to retrieve all objects

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_set_visibility ()

+
void
+gdata_picasaweb_query_set_visibility (GDataPicasaWebQuery *self,
+                                      GDataPicasaWebVisibility visibility);
+

Sets the “visibility” property to visibility +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebQuery

 

visibility

the visibility of the objects to retrieve, or 0 to retrieve all objects

 
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_get_thumbnail_size ()

+
const gchar *
+gdata_picasaweb_query_get_thumbnail_size
+                               (GDataPicasaWebQuery *self);
+

Gets the “thumbnail-size” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebQuery

 
+
+
+

Returns

+

a comma-separated list of thumbnail sizes to retrieve, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_set_thumbnail_size ()

+
void
+gdata_picasaweb_query_set_thumbnail_size
+                               (GDataPicasaWebQuery *self,
+                                const gchar *thumbnail_size);
+

Sets the “thumbnail-size” property to thumbnail_size +.

+

Set thumbnail_size + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebQuery

 

thumbnail_size

a comma-separated list of thumbnail sizes to retrieve, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_get_image_size ()

+
const gchar *
+gdata_picasaweb_query_get_image_size (GDataPicasaWebQuery *self);
+

Gets the “image-size” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebQuery

 
+
+
+

Returns

+

the currently set desired image size for retrieval, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_set_image_size ()

+
void
+gdata_picasaweb_query_set_image_size (GDataPicasaWebQuery *self,
+                                      const gchar *image_size);
+

Sets the “image-size” property to image_size +. +Valid sizes are described in the

+online documentation. +

Set image_size + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebQuery

 

image_size

the desired size of the image to be retrieved, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_get_tag ()

+
const gchar *
+gdata_picasaweb_query_get_tag (GDataPicasaWebQuery *self);
+

Gets the “tag” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebQuery

 
+
+
+

Returns

+

a tag which retrieved objects must have, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_set_tag ()

+
void
+gdata_picasaweb_query_set_tag (GDataPicasaWebQuery *self,
+                               const gchar *tag);
+

Sets the “tag” property to tag +.

+

Set tag + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebQuery

 

tag

a tag which retrieved objects must have, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_get_bounding_box ()

+
void
+gdata_picasaweb_query_get_bounding_box
+                               (GDataPicasaWebQuery *self,
+                                gdouble *north,
+                                gdouble *east,
+                                gdouble *south,
+                                gdouble *west);
+

Gets the latitudes and longitudes of a bounding box, inside which all the results must lie.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebQuery

 

north

return location for the latitude of the top of the box, or NULL.

[out caller-allocates][allow-none]

east

return location for the longitude of the right of the box, or NULL.

[out caller-allocates][allow-none]

south

return location for the latitude of the south of the box, or NULL.

[out caller-allocates][allow-none]

west

return location for the longitude of the left of the box, or NULL.

[out caller-allocates][allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_set_bounding_box ()

+
void
+gdata_picasaweb_query_set_bounding_box
+                               (GDataPicasaWebQuery *self,
+                                gdouble north,
+                                gdouble east,
+                                gdouble south,
+                                gdouble west);
+

Sets a bounding box, inside which all the returned results must lie.

+

Set north +, east +, south + and west + to 0 to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebQuery

 

north

latitude of the top of the box

 

east

longitude of the right of the box

 

south

latitude of the bottom of the box

 

west

longitude of the left of the box

 
+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_get_location ()

+
const gchar *
+gdata_picasaweb_query_get_location (GDataPicasaWebQuery *self);
+

Gets the “location” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebQuery

 
+
+
+

Returns

+

a location which returned objects must be near, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_query_set_location ()

+
void
+gdata_picasaweb_query_set_location (GDataPicasaWebQuery *self,
+                                    const gchar *location);
+

Sets the “location” property to location +.

+

Set location + to NULL to unset the property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataPicasaWebQuery

 

location

a location which returned objects must be near, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDataPicasaWebQuery

+
typedef struct _GDataPicasaWebQuery GDataPicasaWebQuery;
+

All the fields in the GDataPicasaWebQuery structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataPicasaWebQueryClass

+
typedef struct {
+} GDataPicasaWebQueryClass;
+
+

All the fields in the GDataPicasaWebQueryClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “image-size” property

+
  “image-size”               gchar *
+

A comma-separated list of image sizes (width in pixels) to return. Only certain sizes are allowed, and whether the image should be +cropped or scaled can be specified; for more information, see the

+online documentation. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “location” property

+
  “location”                 gchar *
+

A location to search for photos, e.g. "London".

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “tag” property

+
  “tag”                      gchar *
+

A tag which returned results must contain.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “thumbnail-size” property

+
  “thumbnail-size”           gchar *
+

A comma-separated list of thumbnail widths (in pixels) to return. Only certain sizes are allowed, and whether the thumbnail should be +cropped or scaled can be specified; for more information, see the

+online documentation. +

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “visibility” property

+
  “visibility”               gint
+

Specifies which albums should be listed, in terms of their visibility (“visibility”).

+

Set the property to 0 to list all albums, regardless of their visibility. Otherwise, use values +from GDataPicasaWebVisibility.

+

For more information, see the +online documentation.

+

Flags: Read / Write

+

Allowed values: [0,2]

+

Default value: 0

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataPicasaWebService.html b/docs/reference/html/GDataPicasaWebService.html new file mode 100644 index 0000000..754964d --- /dev/null +++ b/docs/reference/html/GDataPicasaWebService.html @@ -0,0 +1,1134 @@ + + + + +GDataPicasaWebService: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataPicasaWebService

+

GDataPicasaWebService — GData PicasaWeb service object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataPicasaWebService
 GDataPicasaWebServiceClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataService
+        ╰── GDataPicasaWebService
+
+
+
+

Includes

+
#include <gdata/services/picasaweb/gdata-picasaweb-service.h>
+
+
+
+

Description

+

GDataPicasaWebService is a subclass of GDataService for communicating with the GData API of Google PicasaWeb. It supports querying for files +and albums, and uploading files.

+

For more details of PicasaWeb's GData API, see the +online documentation.

+
+

Example 38. Authenticating and Creating a New Album

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
GDataClientLoginAuthorizer *authorizer;
+GDataPicasaWebService *service;
+GDataPicasaWebAlbum *album, *inserted_album;
+
+/* Create a service object and authorize against the PicasaWeb service */
+authorizer = gdata_client_login_authorizer_new ("companyName-applicationName-versionID", GDATA_TYPE_PICASAWEB_SERVICE);
+gdata_client_login_authorizer_authenticate (authorizer, username, password, NULL, NULL);
+service = gdata_picasaweb_service_new (GDATA_AUTHORIZER (authorizer));
+
+/* Create a GDataPicasaWebAlbum entry for the new album, setting some information about it */
+album = gdata_picasaweb_album_new (NULL);
+gdata_entry_set_title (GDATA_ENTRY (album), "Photos from the Rhine");
+gdata_entry_set_summary (GDATA_ENTRY (album), "An album of our adventures on the great river.");
+gdata_picasaweb_album_set_location (album, "The Rhine, Germany");
+
+/* Insert the new album on the server. Note that this is a blocking operation. */
+inserted_album = gdata_picasaweb_service_insert_album (service, album, NULL, NULL);
+
+g_object_unref (album);
+g_object_unref (inserted_album);
+g_object_unref (service);
+g_object_unref (authorizer);
+
+ +
+
+

Example 39. Uploading a Photo or Video

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
GDataPicasaWebFile *file_entry, *uploaded_file_entry;
+GDataUploadStream *upload_stream;
+GFile *file_data;
+GFileInfo *file_info;
+GFileInputStream *file_stream;
+
+/* Specify the GFile image on disk to upload */
+file_data = g_file_new_for_path (path);
+
+/* Get the file information for the file being uploaded. If another data source was being used for the upload, it would have to
+ * provide an appropriate slug and content type. Note that this is a blocking operation. */
+file_info = g_file_query_info (file_data, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+                               G_FILE_QUERY_INFO_NONE, NULL, NULL);
+
+/* Create a GDataPicasaWebFile entry for the image, setting a title and caption/summary */
+file_entry = gdata_picasaweb_file_new (NULL);
+gdata_entry_set_title (GDATA_ENTRY (file_entry), "Black Cat");
+gdata_entry_set_summary (GDATA_ENTRY (file_entry), "Photo of the world's most beautiful cat.");
+
+/* Create an upload stream for the file. This is non-blocking. */
+upload_stream = gdata_picasaweb_service_upload_file (service, album, file_entry, g_file_info_get_display_name (file_info),
+                                                     g_file_info_get_content_type (file_info), NULL, NULL);
+g_object_unref (file_info);
+g_object_unref (file_entry);
+
+/* Prepare a file stream for the file to be uploaded. This is a blocking operation. */
+file_stream = g_file_read (file_data, NULL, NULL);
+g_object_unref (file_data);
+
+/* Upload the file to the server. Note that this is a blocking operation. */
+g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), G_INPUT_STREAM (file_stream),
+                        G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, NULL);
+
+/* Parse the resulting updated entry. This is a non-blocking operation. */
+uploaded_file_entry = gdata_picasaweb_service_finish_file_upload (service, upload_stream, NULL);
+g_object_unref (file_stream);
+g_object_unref (upload_stream);
+
+/* ... */
+
+g_object_unref (uploaded_file_entry);
+
+ +
+
+
+
+

Functions

+
+

gdata_picasaweb_service_new ()

+
GDataPicasaWebService *
+gdata_picasaweb_service_new (GDataAuthorizer *authorizer);
+

Creates a new GDataPicasaWebService using the given GDataAuthorizer. If authorizer + is NULL, all requests are made as an unauthenticated user.

+
+

Parameters

+
+++++ + + + + + +

authorizer

a GDataAuthorizer to authorize the service's requests, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataPicasaWebService, or NULL; unref with g_object_unref()

+
+

Since: 0.9.0

+
+
+
+

gdata_picasaweb_service_get_primary_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_picasaweb_service_get_primary_authorization_domain
+                               (void);
+

The primary GDataAuthorizationDomain for interacting with PicasaWeb. This will not normally need to be used, as it's used internally +by the GDataPicasaWebService methods. However, if using the plain GDataService methods to implement custom queries or requests which libgdata +does not support natively, then this domain may be needed to authorize the requests.

+

The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.

+
+

Returns

+

the service's authorization domain.

+

[transfer none]

+
+

Since: 0.9.0

+
+
+
+

gdata_picasaweb_service_get_user ()

+
GDataPicasaWebUser *
+gdata_picasaweb_service_get_user (GDataPicasaWebService *self,
+                                  const gchar *username,
+                                  GCancellable *cancellable,
+                                  GError **error);
+

Queries the service to return the user specified by username +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

username

the username of the user whose information you wish to retrieve, or NULL for the currently authenticated user.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataPicasaWebUser; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.6.0

+
+
+
+

gdata_picasaweb_service_get_user_async ()

+
void
+gdata_picasaweb_service_get_user_async
+                               (GDataPicasaWebService *self,
+                                const gchar *username,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service to return the user specified by username +.

+

For more details, see gdata_picasaweb_service_get_user() which is the synchronous version of this method.

+

When the operation is finished, callback + will be called. You can then call gdata_picasaweb_service_get_user_finish() to get the results of the +operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

username

the username of the user whose information you wish to retrieve, or NULL for the currently authenticated user.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_picasaweb_service_get_user_finish ()

+
GDataPicasaWebUser *
+gdata_picasaweb_service_get_user_finish
+                               (GDataPicasaWebService *self,
+                                GAsyncResult *result,
+                                GError **error);
+

Finishes an asynchronous user retrieval operation started with gdata_picasaweb_service_get_user_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataPicasaWebUser; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.1

+
+
+
+

gdata_picasaweb_service_query_all_albums ()

+
GDataFeed *
+gdata_picasaweb_service_query_all_albums
+                               (GDataPicasaWebService *self,
+                                GDataQuery *query,
+                                const gchar *username,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GError **error);
+

Queries the service to return a list of all albums belonging to the specified username + which match the given +query +. If a user is authenticated with the service, username + can be set as NULL to return a list of albums belonging +to the currently-authenticated user.

+

Note that the “q” query parameter cannot be set on query + for album queries.

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

username

the username of the user whose albums you wish to retrieve, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_service_query_all_albums_async ()

+
void
+gdata_picasaweb_service_query_all_albums_async
+                               (GDataPicasaWebService *self,
+                                GDataQuery *query,
+                                const gchar *username,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service to return a list of all albums belonging to the specified username + which match the given +query +. self +, query + and username + are all reffed/copied when this function is called, so can safely be unreffed/freed after +this function returns.

+

For more details, see gdata_picasaweb_service_query_all_albums(), which is the synchronous version of +this function, and gdata_service_query_async(), which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

username

the username of the user whose albums you wish to retrieve, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_picasaweb_service_query_files ()

+
GDataFeed *
+gdata_picasaweb_service_query_files (GDataPicasaWebService *self,
+                                     GDataPicasaWebAlbum *album,
+                                     GDataQuery *query,
+                                     GCancellable *cancellable,
+                                     GDataQueryProgressCallback progress_callback,
+                                     gpointer progress_user_data,
+                                     GError **error);
+

Queries the specified album + for a list of the files which match the given query +. If album + is NULL and a user is +authenticated with the service, the user's default album will be queried.

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

album

a GDataPicasaWebAlbum from which to retrieve the files, or NULL.

[allow-none]

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.4.0

+
+
+
+

gdata_picasaweb_service_query_files_async ()

+
void
+gdata_picasaweb_service_query_files_async
+                               (GDataPicasaWebService *self,
+                                GDataPicasaWebAlbum *album,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the specified album + for a list of the files which match the given query +. If album + is NULL and a user is authenticated with the service, +the user's default album will be queried. self +, album + and query + are all reffed when this function is called, so can safely be unreffed after +this function returns.

+

For more details, see gdata_picasaweb_service_query_files(), which is the synchronous version of this function, and gdata_service_query_async(), +which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

album

a GDataPicasaWebAlbum from which to retrieve the files, or NULL.

[allow-none]

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_picasaweb_service_upload_file ()

+
GDataUploadStream *
+gdata_picasaweb_service_upload_file (GDataPicasaWebService *self,
+                                     GDataPicasaWebAlbum *album,
+                                     GDataPicasaWebFile *file_entry,
+                                     const gchar *slug,
+                                     const gchar *content_type,
+                                     GCancellable *cancellable,
+                                     GError **error);
+

Uploads a file (photo or video) to the given PicasaWeb album +, using the metadata from file + and the file data written to the resulting +GDataUploadStream. If album + is NULL, the file will be uploaded to the currently-authenticated user's "Drop Box" album. A user must be +authenticated to use this function.

+

If file + has already been inserted, a GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED error will be returned.

+

If no user is authenticated with the service, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED will be returned. It is recommended to retry the +upload after refreshing the authorization tokens held by the associated GDataAuthorizer using gdata_authorizer_refresh_authorization().

+

The stream returned by this function should be written to using the standard GOutputStream methods, asychronously or synchronously. Once the stream +is closed (using g_output_stream_close()), gdata_picasaweb_service_finish_file_upload() should be called on it to parse and return the updated +GDataPicasaWebFile for the uploaded file. This must be done, as file_entry + isn't updated in-place.

+

In order to cancel the upload, a GCancellable passed in to cancellable + must be cancelled using g_cancellable_cancel(). Cancelling the individual +GOutputStream operations on the GDataUploadStream will not cancel the entire upload; merely the write or close operation in question. See the +“cancellable” for more details.

+

Any upload errors will be thrown by the stream methods, and may come from the GDataServiceError domain.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

album

a GDataPicasaWebAlbum into which to insert the file, or NULL.

[allow-none]

file_entry

a GDataPicasaWebFile to insert

 

slug

the filename to give to the uploaded file

 

content_type

the content type of the uploaded data

 

cancellable

a GCancellable for the entire upload stream, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataUploadStream to write the file data to, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_picasaweb_service_finish_file_upload ()

+
GDataPicasaWebFile *
+gdata_picasaweb_service_finish_file_upload
+                               (GDataPicasaWebService *self,
+                                GDataUploadStream *upload_stream,
+                                GError **error);
+

Finish off a file upload operation started by gdata_picasaweb_service_upload_file(), parsing the result and returning the new GDataPicasaWebFile.

+

If an error occurred during the upload operation, it will have been returned during the operation (e.g. by g_output_stream_splice() or one +of the other stream methods). In such a case, NULL will be returned but error + will remain unset. error + is only set in the case that the server +indicates that the operation was successful, but an error is encountered in parsing the result sent by the server.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

upload_stream

the GDataUploadStream from the operation

 

error

a GError, or NULL

 
+
+
+

Returns

+

the new GDataPicasaWebFile, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_picasaweb_service_insert_album ()

+
GDataPicasaWebAlbum *
+gdata_picasaweb_service_insert_album (GDataPicasaWebService *self,
+                                      GDataPicasaWebAlbum *album,
+                                      GCancellable *cancellable,
+                                      GError **error);
+

Inserts a new album described by album +. A user must be +authenticated to use this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

album

a GDataPicasaWebAlbum to create on the server

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

the inserted GDataPicasaWebAlbum; unref with +g_object_unref().

+

[transfer full]

+
+

Since: 0.6.0

+
+
+
+

gdata_picasaweb_service_insert_album_async ()

+
void
+gdata_picasaweb_service_insert_album_async
+                               (GDataPicasaWebService *self,
+                                GDataPicasaWebAlbum *album,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Inserts a new album described by album +. The user must be authenticated to use this function. self + and album + are both reffed when this function +is called, so can safely be unreffed after this function returns.

+

callback + should call gdata_service_insert_entry_finish() to obtain a GDataPicasaWebAlbum representing the inserted album and to check for +possible errors.

+

For more details, see gdata_picasaweb_service_insert_album(), which is the synchronous version of this function, and +gdata_service_insert_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataPicasaWebService

 

album

a GDataPicasaWebAlbum to create on the server

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.8.0

+
+
+
+

Types and Values

+
+

GDataPicasaWebService

+
typedef struct _GDataPicasaWebService GDataPicasaWebService;
+

All the fields in the GDataPicasaWebService structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataPicasaWebServiceClass

+
typedef struct {
+} GDataPicasaWebServiceClass;
+
+

All the fields in the GDataPicasaWebServiceClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataPicasaWebUser.html b/docs/reference/html/GDataPicasaWebUser.html new file mode 100644 index 0000000..a4a8346 --- /dev/null +++ b/docs/reference/html/GDataPicasaWebUser.html @@ -0,0 +1,447 @@ + + + + +GDataPicasaWebUser: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataPicasaWebUser

+

GDataPicasaWebUser — GData PicasaWeb User object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
const gchar * + +gdata_picasaweb_user_get_user () +
const gchar * + +gdata_picasaweb_user_get_nickname () +
+gint64 + +gdata_picasaweb_user_get_quota_limit () +
+gint64 + +gdata_picasaweb_user_get_quota_current () +
+gint + +gdata_picasaweb_user_get_max_photos_per_album () +
const gchar * + +gdata_picasaweb_user_get_thumbnail_uri () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gintmax-photos-per-albumRead
+gchar *nicknameRead
gint64quota-currentRead
gint64quota-limitRead
+gchar *thumbnail-uriRead
+gchar *userRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataPicasaWebUser
 GDataPicasaWebUserClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataPicasaWebUser
+
+
+
+

Includes

+
#include <gdata/services/picasaweb/gdata-picasaweb-user.h>
+
+
+
+

Description

+

GDataPicasaWebUser is a subclass of GDataEntry to represent properties for a PicasaWeb user. It adds a couple of +properties which are specific to the Google PicasaWeb API.

+
+
+

Functions

+
+

gdata_picasaweb_user_get_user ()

+
const gchar *
+gdata_picasaweb_user_get_user (GDataPicasaWebUser *self);
+

Gets the “user” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebUser

 
+
+
+

Returns

+

the feed's user, or NULL

+
+

Since: 0.6.0

+
+
+
+

gdata_picasaweb_user_get_nickname ()

+
const gchar *
+gdata_picasaweb_user_get_nickname (GDataPicasaWebUser *self);
+

Gets the “nickname” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebUser

 
+
+
+

Returns

+

the nickname of the feed's user's nickname, or NULL

+
+

Since: 0.6.0

+
+
+
+

gdata_picasaweb_user_get_quota_limit ()

+
gint64
+gdata_picasaweb_user_get_quota_limit (GDataPicasaWebUser *self);
+

Gets the “quota-limit” property. Note that +this information is not available when accessing feeds which we +haven't authenticated, and 0 is returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebUser

 
+
+
+

Returns

+

the maximum capacity in bytes for this feed's account, or -1

+
+

Since: 0.6.0

+
+
+
+

gdata_picasaweb_user_get_quota_current ()

+
gint64
+gdata_picasaweb_user_get_quota_current
+                               (GDataPicasaWebUser *self);
+

Gets the “quota-current” property. Note that +this information is not available when accessing feeds which we +haven't authenticated, and 0 is returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebUser

 
+
+
+

Returns

+

the current number of bytes in use by this feed's account, or -1

+
+

Since: 0.6.0

+
+
+
+

gdata_picasaweb_user_get_max_photos_per_album ()

+
gint
+gdata_picasaweb_user_get_max_photos_per_album
+                               (GDataPicasaWebUser *self);
+

Gets the “max-photos-per-album” property. Note that +this information is not available when accessing feeds which we +haven't authenticated, and 0 is returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebUser

 
+
+
+

Returns

+

the maximum number of photos an album for this account can hold, or -1

+
+

Since: 0.6.0

+
+
+
+

gdata_picasaweb_user_get_thumbnail_uri ()

+
const gchar *
+gdata_picasaweb_user_get_thumbnail_uri
+                               (GDataPicasaWebUser *self);
+

Gets the “thumbnail-uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataPicasaWebUser

 
+
+
+

Returns

+

the URI for the thumbnail of the account, or NULL

+
+

Since: 0.6.0

+
+
+
+

Types and Values

+
+

GDataPicasaWebUser

+
typedef struct _GDataPicasaWebUser GDataPicasaWebUser;
+

All the fields in the GDataPicasaWebUser structure are private and should never be accessed directly.

+

Since: 0.6.0

+
+
+
+

GDataPicasaWebUserClass

+
typedef struct {
+} GDataPicasaWebUserClass;
+
+

All the fields in the GDataPicasaWebUserClass structure are private and should never be accessed directly.

+

Since: 0.6.0

+
+
+
+

Property Details

+
+

The “max-photos-per-album” property

+
  “max-photos-per-album”     gint
+

The maximum number of photos allowed in an album. +http://code.google.com/apis/picasaweb/docs/2.0/reference.htmlgphoto_maxPhotosPerAlbum

+

If the GDataPicasaWebUser does not represent the currently authenticated user, this will be -1.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.6.0

+
+
+
+

The “nickname” property

+
  “nickname”                 gchar *
+

The user's nickname. This is a user-specified value that should be used when referring to the user by name. +http://code.google.com/apis/picasaweb/docs/2.0/reference.htmlgphoto_nickname

+

Flags: Read

+

Default value: NULL

+

Since: 0.6.0

+
+
+
+

The “quota-current” property

+
  “quota-current”            gint64
+

The current amount of space, in bytes, already used by the user. +http://code.google.com/apis/picasaweb/docs/2.0/reference.htmlgphoto_quotacurrent

+

If the GDataPicasaWebUser does not represent the currently authenticated user, this will be -1.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.6.0

+
+
+
+

The “quota-limit” property

+
  “quota-limit”              gint64
+

The total amount of space, in bytes, available to the user. +http://code.google.com/apis/picasaweb/docs/2.0/reference.htmlgphoto_quotalimit

+

If the GDataPicasaWebUser does not represent the currently authenticated user, this will be -1.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.6.0

+
+
+
+

The “thumbnail-uri” property

+
  “thumbnail-uri”            gchar *
+

The URI of a thumbnail-sized portrait of the user. +http://code.google.com/apis/picasaweb/docs/2.0/reference.htmlgphoto_thumbnail

+

Flags: Read

+

Default value: NULL

+

Since: 0.6.0

+
+
+
+

The “user” property

+
  “user”                     gchar *
+

The username of the user, as seen in feed URLs. +http://code.google.com/apis/picasaweb/docs/2.0/reference.htmlgphoto_user

+

Flags: Read

+

Default value: NULL

+

Since: 0.6.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataQuery.html b/docs/reference/html/GDataQuery.html new file mode 100644 index 0000000..3425655 --- /dev/null +++ b/docs/reference/html/GDataQuery.html @@ -0,0 +1,1353 @@ + + + + +GDataQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataQuery

+

GDataQuery — GData query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataQuery * + +gdata_query_new () +
+GDataQuery * + +gdata_query_new_with_limits () +
+gchar * + +gdata_query_get_query_uri () +
+void + +gdata_query_next_page () +
+gboolean + +gdata_query_previous_page () +
const gchar * + +gdata_query_get_q () +
+void + +gdata_query_set_q () +
const gchar * + +gdata_query_get_etag () +
+void + +gdata_query_set_etag () +
const gchar * + +gdata_query_get_author () +
+void + +gdata_query_set_author () +
const gchar * + +gdata_query_get_categories () +
+void + +gdata_query_set_categories () +
+gint64 + +gdata_query_get_published_min () +
+void + +gdata_query_set_published_min () +
+gint64 + +gdata_query_get_published_max () +
+void + +gdata_query_set_published_max () +
+gint64 + +gdata_query_get_updated_min () +
+void + +gdata_query_set_updated_min () +
+gint64 + +gdata_query_get_updated_max () +
+void + +gdata_query_set_updated_max () +
+guint + +gdata_query_get_start_index () +
+void + +gdata_query_set_start_index () +
+guint + +gdata_query_get_max_results () +
+void + +gdata_query_set_max_results () +
+gboolean + +gdata_query_is_strict () +
+void + +gdata_query_set_is_strict () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *authorRead / Write
+gchar *categoriesRead / Write
+gchar *etagRead / Write
gbooleanis-strictRead / Write
guintmax-resultsRead / Write
gint64published-maxRead / Write
gint64published-minRead / Write
+gchar *qRead / Write
guintstart-indexRead / Write
gint64updated-maxRead / Write
gint64updated-minRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataQuery
 GDataQueryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ├── GDataCalendarQuery
+        ├── GDataContactsQuery
+        ├── GDataDocumentsQuery
+        ├── GDataFreebaseQuery
+        ├── GDataFreebaseSearchQuery
+        ├── GDataFreebaseTopicQuery
+        ├── GDataPicasaWebQuery
+        ├── GDataTasksQuery
+        ╰── GDataYouTubeQuery
+
+
+
+

Includes

+
#include <gdata/gdata-query.h>
+
+
+
+

Description

+

GDataQuery represents a collection of query parameters used in a series of queries on a GDataService. It allows the query parameters to be +set, with the aim of building a query URI using gdata_query_get_query_uri(). Pagination is supported using gdata_query_next_page() and +gdata_query_previous_page().

+

Each query can have an ETag associated with it, which is a unique identifier for the set of query results produced by the query. +Each time a query is made, gdata_service_query() will set the “etag” property of the accompanying query to a value returned by the +server. If the same query is made again (using the same GDataQuery instance), the server can skip returning the resulting GDataFeed if its +contents haven't changed (in this case, gdata_service_query() will return NULL with an empty error).

+

For this reason, code using GDataQuery should be careful when reusing GDataQuery instances: the code should either unset “etag” after +every query or (preferably) gracefully handle the case where gdata_service_query() returns NULL to signify unchanged results.

+

Every time a property of a GDataQuery instance is changed, the instance's ETag will be unset.

+

For more information on the standard GData query parameters supported by GDataQuery, see the online documentation.

+
+
+

Functions

+
+

gdata_query_new ()

+
GDataQuery *
+gdata_query_new (const gchar *q);
+

Creates a new GDataQuery with its “q” property set to q +.

+
+

Parameters

+
+++++ + + + + + +

q

a query string, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataQuery

+
+
+
+
+

gdata_query_new_with_limits ()

+
GDataQuery *
+gdata_query_new_with_limits (const gchar *q,
+                             guint start_index,
+                             guint max_results);
+

Creates a new GDataQuery with its “q” property set to q +, and the limits start_index + and max_results + +applied.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

q

a query string, or NULL.

[allow-none]

start_index

a one-based start index for the results, or 0

 

max_results

the maximum number of results to return, or 0

 
+
+
+

Returns

+

a new GDataQuery

+
+
+
+
+

gdata_query_get_query_uri ()

+
gchar *
+gdata_query_get_query_uri (GDataQuery *self,
+                           const gchar *feed_uri);
+

Builds a query URI from the given base feed URI, using the properties of the GDataQuery. This function will take care +of all necessary URI escaping, so it should not be done beforehand.

+

The query URI is what functions like gdata_service_query() use to query the online service.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

feed_uri

the feed URI on which to build the query URI

 
+
+
+

Returns

+

a query URI; free with g_free()

+
+
+
+
+

gdata_query_next_page ()

+
void
+gdata_query_next_page (GDataQuery *self);
+

Changes the state of the GDataQuery such that when gdata_query_get_query_uri() is next called, it will build the +query URI for the next page in the result set.

+

Ideally, the URI of the next page is retrieved from a feed automatically when gdata_service_query() is called, but +gdata_query_next_page() will fall back to using “start-index” to emulate true pagination if this fails.

+

You should not implement pagination manually using “start-index”.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+
+
+

gdata_query_previous_page ()

+
gboolean
+gdata_query_previous_page (GDataQuery *self);
+

Changes the state of the GDataQuery such that when gdata_query_get_query_uri() is next called, it will build the +query URI for the previous page in the result set.

+

See the documentation for gdata_query_next_page() for an explanation of how query URIs from the feeds are used to this end.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

TRUE if there is a previous page and it has been switched to, FALSE otherwise

+
+
+
+
+

gdata_query_get_q ()

+
const gchar *
+gdata_query_get_q (GDataQuery *self);
+

Gets the “q” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the q property, or NULL if it is unset

+
+
+
+
+

gdata_query_set_q ()

+
void
+gdata_query_set_q (GDataQuery *self,
+                   const gchar *q);
+

Sets the “q” property of the GDataQuery to the new query string, q +.

+

Set q + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

q

a new query string, or NULL.

[allow-none]
+
+
+
+
+

gdata_query_get_etag ()

+
const gchar *
+gdata_query_get_etag (GDataQuery *self);
+

Gets the “etag” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the ETag property, or NULL if it is unset

+
+

Since: 0.2.0

+
+
+
+

gdata_query_set_etag ()

+
void
+gdata_query_set_etag (GDataQuery *self,
+                      const gchar *etag);
+

Sets the “etag” property of the GDataQuery to the new ETag, etag +.

+

Set etag + to NULL to not check against the server-side ETag.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

etag

the new ETag, or NULL.

[allow-none]
+
+

Since: 0.2.0

+
+
+
+

gdata_query_get_author ()

+
const gchar *
+gdata_query_get_author (GDataQuery *self);
+

Gets the “author” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the author property, or NULL if it is unset

+
+
+
+
+

gdata_query_set_author ()

+
void
+gdata_query_set_author (GDataQuery *self,
+                        const gchar *author);
+

Sets the “author” property of the GDataQuery to the new author string, author +.

+

Set author + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

author

the new author string, or NULL.

[allow-none]
+
+
+
+
+

gdata_query_get_categories ()

+
const gchar *
+gdata_query_get_categories (GDataQuery *self);
+

Gets the “categories” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the categories property, or NULL if it is unset

+
+
+
+
+

gdata_query_set_categories ()

+
void
+gdata_query_set_categories (GDataQuery *self,
+                            const gchar *categories);
+

Sets the “categories” property of the GDataQuery to the new category string, categories +.

+

Set categories + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

categories

the new category string, or NULL.

[allow-none]
+
+
+
+
+

gdata_query_get_published_min ()

+
gint64
+gdata_query_get_published_min (GDataQuery *self);
+

Gets the “published-min” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the published-min property, or -1

+
+
+
+
+

gdata_query_set_published_min ()

+
void
+gdata_query_set_published_min (GDataQuery *self,
+                               gint64 published_min);
+

Sets the “published-min” property of the GDataQuery to the new minimum publish time, published_min +.

+

Set published_min + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

published_min

the new minimum publish time, or -1

 
+
+
+
+
+

gdata_query_get_published_max ()

+
gint64
+gdata_query_get_published_max (GDataQuery *self);
+

Gets the “published-max” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the published-max property, or -1

+
+
+
+
+

gdata_query_set_published_max ()

+
void
+gdata_query_set_published_max (GDataQuery *self,
+                               gint64 published_max);
+

Sets the “published-max” property of the GDataQuery to the new maximum publish time, published_max +.

+

Set published_max + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

published_max

the new maximum publish time, or -1

 
+
+
+
+
+

gdata_query_get_updated_min ()

+
gint64
+gdata_query_get_updated_min (GDataQuery *self);
+

Gets the “updated-min” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the updated-min property, or -1

+
+
+
+
+

gdata_query_set_updated_min ()

+
void
+gdata_query_set_updated_min (GDataQuery *self,
+                             gint64 updated_min);
+

Sets the “updated-min” property of the GDataQuery to the new minimum update time, updated_min +.

+

Set updated_min + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

updated_min

the new minimum update time, or -1

 
+
+
+
+
+

gdata_query_get_updated_max ()

+
gint64
+gdata_query_get_updated_max (GDataQuery *self);
+

Gets the “updated-max” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the updated-max property, or -1

+
+
+
+
+

gdata_query_set_updated_max ()

+
void
+gdata_query_set_updated_max (GDataQuery *self,
+                             gint64 updated_max);
+

Sets the “updated-max” property of the GDataQuery to the new maximum update time, updated_max +.

+

Set updated_max + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

updated_max

the new maximum update time, or -1

 
+
+
+
+
+

gdata_query_get_start_index ()

+
guint
+gdata_query_get_start_index (GDataQuery *self);
+

Gets the “start-index” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the start index property, or 0 if it is unset

+
+
+
+
+

gdata_query_set_start_index ()

+
void
+gdata_query_set_start_index (GDataQuery *self,
+                             guint start_index);
+

Sets the “start-index” property of the GDataQuery to the new one-based start index, start_index +.

+

Set start_index + to 0 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

start_index

the new start index, or 0

 
+
+
+
+
+

gdata_query_get_max_results ()

+
guint
+gdata_query_get_max_results (GDataQuery *self);
+

Gets the “max-results” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the maximum results property, or 0 if it is unset

+
+
+
+
+

gdata_query_set_max_results ()

+
void
+gdata_query_set_max_results (GDataQuery *self,
+                             guint max_results);
+

Sets the “max-results” property of the GDataQuery to the new maximum results value, max_results +.

+

Set max_results + to 0 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

max_results

the new maximum results value, or 0

 
+
+
+
+
+

gdata_query_is_strict ()

+
gboolean
+gdata_query_is_strict (GDataQuery *self);
+

Gets the “is-strict” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataQuery

 
+
+
+

Returns

+

the strict property

+
+

Since: 0.2.0

+
+
+
+

gdata_query_set_is_strict ()

+
void
+gdata_query_set_is_strict (GDataQuery *self,
+                           gboolean is_strict);
+

Sets the “is-strict” property of the GDataQuery to the new strict value, is_strict +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataQuery

 

is_strict

the new strict value

 
+
+

Since: 0.2.0

+
+
+
+

Types and Values

+
+

GDataQuery

+
typedef struct _GDataQuery GDataQuery;
+

All the fields in the GDataQuery structure are private and should never be accessed directly.

+
+
+
+

GDataQueryClass

+
typedef struct {
+} GDataQueryClass;
+
+

All the fields in the GDataQueryClass structure are private and should never be accessed directly.

+
+
+
+

Property Details

+
+

The “author” property

+
  “author”                   gchar *
+

An entry author. The service returns entries where the author name and/or e-mail address match your query string.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “categories” property

+
  “categories”               gchar *
+

A category filter.

+

You can query on multiple categories by listing multiple categories separated by slashes. The service returns all entries that match all +of the categories (like using AND between terms). For example: Fritz/Laurie returns +entries that match both categories ("Fritz" and "Laurie").

+

To do an OR between terms, use a pipe character (|). For example: Fritz%7CLaurie returns +entries that match either category.

+

An entry matches a specified category if the entry is in a category that has a matching term or label, as defined in the Atom +specification. (Roughly, the "term" is the internal string used by the software to identify the category, while the "label" is the +human-readable string presented to a user in a user interface.)

+

To exclude entries that match a given category, use the form -categoryname.

+

To query for a category that has a scheme – such as <category scheme="urn:google.com" term="public"/> – you must +place the scheme in curly braces before the category name. For example: {urn:google.com}public. To match a category +that has no scheme, use an empty pair of curly braces. If you don't specify curly braces, then categories in any scheme will match.

+

The above features can be combined. For example: A|-{urn:google.com}B/-C means (A OR (NOT B)) AND (NOT C).

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “etag” property

+
  “etag”                     gchar *
+

The ETag against which to check for updates. If the server-side ETag matches this one, the requested feed hasn't changed, and is not +returned unnecessarily.

+

Setting any of the other query properties will unset the ETag, as ETags match against entire queries. If the ETag should be used in a +query, it must be set again using gdata_query_set_etag() after setting any other properties.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.2.0

+
+
+
+

The “is-strict” property

+
  “is-strict”                gboolean
+

Strict query parameter checking. If this is enabled, an error will be returned by the online service if a parameter is +not recognised.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.2.0

+
+
+
+

The “max-results” property

+
  “max-results”              guint
+

Maximum number of results to be retrieved. Most services have a default “max-results” size imposed by the server; if you wish +to receive the entire feed, specify a large number such as G_MAXUINT for this property.

+

Use 0 to not specify a maximum number of results.

+

Flags: Read / Write

+

Default value: 0

+
+
+
+

The “published-max” property

+
  “published-max”            gint64
+

Upper bound on the entry publish date, exclusive.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “published-min” property

+
  “published-min”            gint64
+

Lower bound on the entry publish date, inclusive.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “q” property

+
  “q”                        gchar *
+

A full-text query string.

+

When creating a query, list search terms separated by spaces, in the form term1 term2 term3. +(As with all of the query parameter values, the spaces must be URL encoded.) The service returns all entries that match all of the +search terms (like using AND between terms). Like Google's web search, a service searches on complete words (and related words with +the same stem), not substrings.

+

To search for an exact phrase, enclose the phrase in quotation marks: "exact phrase".

+

To exclude entries that match a given term, use the form -term.

+

The search is case-insensitive.

+

Example: to search for all entries that contain the exact phrase "Elizabeth Bennet" and the word "Darcy" but don't contain the +word "Austen", use the following query: "Elizabeth Bennet" Darcy -Austen.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “start-index” property

+
  “start-index”              guint
+

The one-based index of the first result to be retrieved. Use gdata_query_next_page() and gdata_query_previous_page() to +implement pagination, rather than manually changing “start-index”.

+

Use 0 to not specify a start index.

+

Flags: Read / Write

+

Default value: 0

+
+
+
+

The “updated-max” property

+
  “updated-max”              gint64
+

Upper bound on the entry update date, exclusive.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “updated-min” property

+
  “updated-min”              gint64
+

Lower bound on the entry update date, inclusive.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataService.html b/docs/reference/html/GDataService.html new file mode 100644 index 0000000..174de3a --- /dev/null +++ b/docs/reference/html/GDataService.html @@ -0,0 +1,2152 @@ + + + + +GDataService: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataService

+

GDataService — GData service object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+void + +(*GDataQueryProgressCallback) () +
+gboolean + +gdata_service_is_authorized () +
+GDataAuthorizer * + +gdata_service_get_authorizer () +
+void + +gdata_service_set_authorizer () +
+GList * + +gdata_service_get_authorization_domains () +
+GDataFeed * + +gdata_service_query () +
+void + +gdata_service_query_async () +
+GDataFeed * + +gdata_service_query_finish () +
+GDataEntry * + +gdata_service_query_single_entry () +
+void + +gdata_service_query_single_entry_async () +
+GDataEntry * + +gdata_service_query_single_entry_finish () +
+GDataEntry * + +gdata_service_insert_entry () +
+void + +gdata_service_insert_entry_async () +
+GDataEntry * + +gdata_service_insert_entry_finish () +
+GDataEntry * + +gdata_service_update_entry () +
+void + +gdata_service_update_entry_async () +
+GDataEntry * + +gdata_service_update_entry_finish () +
+gboolean + +gdata_service_delete_entry () +
+void + +gdata_service_delete_entry_async () +
+gboolean + +gdata_service_delete_entry_finish () +
+SoupURI * + +gdata_service_get_proxy_uri () +
+void + +gdata_service_set_proxy_uri () +
+GProxyResolver * + +gdata_service_get_proxy_resolver () +
+void + +gdata_service_set_proxy_resolver () +
+guint + +gdata_service_get_timeout () +
+void + +gdata_service_set_timeout () +
const gchar * + +gdata_service_get_locale () +
+void + +gdata_service_set_locale () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataAuthorizer *authorizerRead / Write
+gchar *localeRead / Write
+GProxyResolver *proxy-resolverRead / Write
+SoupURI *proxy-uriRead / Write
guinttimeoutRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
 GDataService
 GDataServiceClass
enumGDataServiceError
enumGDataParserError
enumGDataOperationType
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataService
+        ├── GDataCalendarService
+        ├── GDataContactsService
+        ├── GDataDocumentsService
+        ├── GDataFreebaseService
+        ├── GDataPicasaWebService
+        ├── GDataTasksService
+        ╰── GDataYouTubeService
+
+
+
+

Known Derived Interfaces

+

+GDataService is required by + GDataBatchable.

+
+
+

Includes

+
#include <gdata/gdata-service.h>
+
+
+
+

Description

+

GDataService represents a GData API service, typically a website using the GData API, such as YouTube or Google Calendar. One +GDataService instance is required to issue queries to the service, handle insertions, updates and deletions, and generally +communicate with the online service.

+

If operations performed on a GDataService need authorization (such as uploading a video to YouTube or querying the user's personal calendar on +Google Calendar), the service needs a GDataAuthorizer instance set as “authorizer”. Once the user is appropriately authenticated and +authorized by the GDataAuthorizer implementation (see the documentation for GDataAuthorizer for details on how this is achieved for specific +implementations), all operations will be automatically authorized.

+

Note that it's not always necessary to supply a GDataAuthorizer instance to a GDataService. If the only operations to be performed on the +GDataService don't need authorization (e.g. they only query public information), setting up a GDataAuthorizer is just extra overhead. See the +documentation for the operations on individual GDataService subclasses to see which need authorization and which don't.

+
+
+

Functions

+
+

GDataQueryProgressCallback ()

+
void
+(*GDataQueryProgressCallback) (GDataEntry *entry,
+                               guint entry_key,
+                               guint entry_count,
+                               gpointer user_data);
+

Callback function called for each GDataEntry parsed in a GDataFeed when loading the results of a query.

+

It is called in the main thread, so there is no guarantee on the order in which the callbacks are executed, +or whether they will be called in a timely manner. It is, however, guaranteed that they will all be called before +the GAsyncReadyCallback which signals the completion of the query is called.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

entry

a new GDataEntry

 

entry_key

the key of the entry (zero-based index of its position in the feed)

 

entry_count

the total number of entries in the feed

 

user_data

user data passed to the callback

 
+
+
+
+
+

gdata_service_is_authorized ()

+
gboolean
+gdata_service_is_authorized (GDataService *self);
+

Determines whether the service is authorized for all the GDataAuthorizationDomains it belongs to (as returned by +gdata_service_get_authorization_domains()). If the service's “authorizer” is NULL, FALSE is always returned.

+

This is basically a convenience method for checking that the service's GDataAuthorizer is authorized for all the service's +GDataAuthorizationDomains.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataService

 
+
+
+

Returns

+

TRUE if the service is authorized for all its domains, FALSE otherwise

+
+

Since: 0.9.0

+
+
+
+

gdata_service_get_authorizer ()

+
GDataAuthorizer *
+gdata_service_get_authorizer (GDataService *self);
+

Gets the GDataAuthorizer object currently in use by the service. See the documentation for “authorizer” for more details.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataService

 
+
+
+

Returns

+

the authorizer object for this service, or NULL.

+

[transfer none]

+
+

Since: 0.9.0

+
+
+
+

gdata_service_set_authorizer ()

+
void
+gdata_service_set_authorizer (GDataService *self,
+                              GDataAuthorizer *authorizer);
+

Sets “authorizer” to authorizer +. This may be NULL if the service will only make requests in future which don't require authorization. +See the documentation for “authorizer” for more information.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataService

 

authorizer

a new authorizer object for the service, or NULL

 
+
+

Since: 0.9.0

+
+
+
+

gdata_service_get_authorization_domains ()

+
GList *
+gdata_service_get_authorization_domains
+                               (GType service_type);
+

Retrieves the full list of GDataAuthorizationDomains which relate to the specified service_type +. All the +GDataAuthorizationDomains are unique and interned, so can be compared with other domains by simple pointer comparison.

+

Note that in addition to this method, GDataService subclasses may expose some or all of their authorization domains individually by means of +individual accessor functions.

+
+

Parameters

+
+++++ + + + + + +

service_type

the GType of the GDataService subclass to retrieve the authorization domains for

 
+
+
+

Returns

+

an unordered list of GDataAuthorizationDomains; free with +g_list_free().

+

[transfer container][element-type GDataAuthorizationDomain]

+
+

Since: 0.9.0

+
+
+
+

gdata_service_query ()

+
GDataFeed *
+gdata_service_query (GDataService *self,
+                     GDataAuthorizationDomain *domain,
+                     const gchar *feed_uri,
+                     GDataQuery *query,
+                     GType entry_type,
+                     GCancellable *cancellable,
+                     GDataQueryProgressCallback progress_callback,
+                     gpointer progress_user_data,
+                     GError **error);
+

Queries the service's feed_uri + feed to build a GDataFeed.

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled before or during network activity, the error G_IO_ERROR_CANCELLED will be returned. Cancellation has no effect +after network activity has finished, however, and the query will return successfully (or return an error sent by the server) if it is first +cancelled after network activity has finished. See the overview of cancellation for +more details.

+

A GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be returned if the server indicates there is a problem with the query, but subclasses may override +this and return their own errors. See their documentation for more details.

+

For each entry in the response feed, progress_callback + will be called in the main thread. If there was an error parsing the XML response, +a GDataParserError will be returned.

+

If the query is successful and the feed supports pagination, query + will be updated with the pagination URIs, and the next or previous page +can then be loaded by calling gdata_query_next_page() or gdata_query_previous_page() before running the query again.

+

If the GDataQuery's ETag is set and it finds a match on the server, NULL will be returned, but error + will remain unset. Otherwise, +query +'s ETag will be updated with the ETag from the returned feed, if available.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the query falls under, or NULL.

[allow-none]

feed_uri

the feed URI to query, including the host name and protocol

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

entry_type

a GType for the GDataEntrys to build from the XML

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_service_query_async ()

+
void
+gdata_service_query_async (GDataService *self,
+                           GDataAuthorizationDomain *domain,
+                           const gchar *feed_uri,
+                           GDataQuery *query,
+                           GType entry_type,
+                           GCancellable *cancellable,
+                           GDataQueryProgressCallback progress_callback,
+                           gpointer progress_user_data,
+                           GDestroyNotify destroy_progress_user_data,
+                           GAsyncReadyCallback callback,
+                           gpointer user_data);
+

Queries the service's feed_uri + feed to build a GDataFeed. self +, feed_uri + and +query + are all reffed/copied when this function is called, so can safely be freed after this function returns.

+

For more details, see gdata_service_query(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_service_query_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the query falls under, or NULL.

[allow-none]

feed_uri

the feed URI to query, including the host name and protocol

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

entry_type

a GType for the GDataEntrys to build from the XML

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_service_query_finish ()

+
GDataFeed *
+gdata_service_query_finish (GDataService *self,
+                            GAsyncResult *async_result,
+                            GError **error);
+

Finishes an asynchronous query operation started with gdata_service_query_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results, or NULL; unref with g_object_unref().

+

[transfer full]

+
+
+
+
+

gdata_service_query_single_entry ()

+
GDataEntry *
+gdata_service_query_single_entry (GDataService *self,
+                                  GDataAuthorizationDomain *domain,
+                                  const gchar *entry_id,
+                                  GDataQuery *query,
+                                  GType entry_type,
+                                  GCancellable *cancellable,
+                                  GError **error);
+

Retrieves information about the single entry with the given entry_id +. entry_id + should be as returned by +gdata_entry_get_id().

+

Parameters and errors are as for gdata_service_query(). Most of the properties of query + aren't relevant, and +will cause a server-side error if used. The most useful property to use is “etag”, which will cause the +server to not return anything if the entry hasn't been modified since it was given the specified ETag; thus saving +bandwidth. If the server does not return anything for this reason, gdata_service_query_single_entry() will return +NULL, but will not set an error in error +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the query falls under, or NULL.

[allow-none]

entry_id

the entry ID of the desired entry

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

entry_type

a GType for the GDataEntry to build from the XML

 

cancellable

a GCancellable, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_service_query_single_entry_async ()

+
void
+gdata_service_query_single_entry_async
+                               (GDataService *self,
+                                GDataAuthorizationDomain *domain,
+                                const gchar *entry_id,
+                                GDataQuery *query,
+                                GType entry_type,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Retrieves information about the single entry with the given entry_id +. entry_id + should be as returned by +gdata_entry_get_id(). self +, query + and entry_id + are reffed/copied when this +function is called, so can safely be freed after this function returns.

+

For more details, see gdata_service_query_single_entry(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_service_query_single_entry_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the query falls under, or NULL.

[allow-none]

entry_id

the entry ID of the desired entry

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

entry_type

a GType for the GDataEntry to build from the XML

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.0

+
+
+
+

gdata_service_query_single_entry_finish ()

+
GDataEntry *
+gdata_service_query_single_entry_finish
+                               (GDataService *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finishes an asynchronous query operation for a single entry, as started with gdata_service_query_single_entry_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.7.0

+
+
+
+

gdata_service_insert_entry ()

+
GDataEntry *
+gdata_service_insert_entry (GDataService *self,
+                            GDataAuthorizationDomain *domain,
+                            const gchar *upload_uri,
+                            GDataEntry *entry,
+                            GCancellable *cancellable,
+                            GError **error);
+

Inserts entry + by uploading it to the online service at upload_uri +. For more information about the concept of inserting entries, see +the online documentation for the GData +protocol.

+

The service will return an updated version of the entry, which is the return value of this function on success.

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled before or during network activity, the error G_IO_ERROR_CANCELLED will be returned. Cancellation has no effect +after network activity has finished, however, and the insertion will return successfully (or return an error sent by the server) if it is first +cancelled after network activity has finished. See the overview of cancellation for +more details.

+

If the entry is marked as already having been inserted a GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED error will be returned immediately +(there will be no network requests).

+

If there is an error inserting the entry, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. Currently, subclasses +cannot cannot override this or provide more specific errors.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the insertion operation falls under, or NULL.

[allow-none]

upload_uri

the URI to which the upload should be sent

 

entry

the GDataEntry to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_service_insert_entry_async ()

+
void
+gdata_service_insert_entry_async (GDataService *self,
+                                  GDataAuthorizationDomain *domain,
+                                  const gchar *upload_uri,
+                                  GDataEntry *entry,
+                                  GCancellable *cancellable,
+                                  GAsyncReadyCallback callback,
+                                  gpointer user_data);
+

Inserts entry + by uploading it to the online service at upload_uri +. self +, upload_uri + and +entry + are all reffed/copied when this function is called, so can safely be freed after this function returns.

+

For more details, see gdata_service_insert_entry(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_service_insert_entry_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the insertion operation falls under, or NULL.

[allow-none]

upload_uri

the URI to which the upload should be sent

 

entry

the GDataEntry to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.0

+
+
+
+

gdata_service_insert_entry_finish ()

+
GDataEntry *
+gdata_service_insert_entry_finish (GDataService *self,
+                                   GAsyncResult *async_result,
+                                   GError **error);
+

Finishes an asynchronous entry insertion operation started with gdata_service_insert_entry_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.3.0

+
+
+
+

gdata_service_update_entry ()

+
GDataEntry *
+gdata_service_update_entry (GDataService *self,
+                            GDataAuthorizationDomain *domain,
+                            GDataEntry *entry,
+                            GCancellable *cancellable,
+                            GError **error);
+

Updates entry + by PUTting it to its edit link's URI. For more information about the concept of updating entries, see +the online documentation for the GData +protocol.

+

The service will return an updated version of the entry, which is the return value of this function on success.

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled before or during network activity, the error G_IO_ERROR_CANCELLED will be returned. Cancellation has no effect +after network activity has finished, however, and the update will return successfully (or return an error sent by the server) if it is first +cancelled after network activity has finished. See the overview of cancellation for +more details.

+

If there is an error updating the entry, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. Currently, subclasses +cannot cannot override this or provide more specific errors.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the update operation falls under, or NULL.

[allow-none]

entry

the GDataEntry to update

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.9.0

+
+
+
+

gdata_service_update_entry_async ()

+
void
+gdata_service_update_entry_async (GDataService *self,
+                                  GDataAuthorizationDomain *domain,
+                                  GDataEntry *entry,
+                                  GCancellable *cancellable,
+                                  GAsyncReadyCallback callback,
+                                  gpointer user_data);
+

Updates entry + by PUTting it to its edit link's URI. self + and +entry + are both reffed when this function is called, so can safely be unreffed after this function returns.

+

For more details, see gdata_service_update_entry(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_service_update_entry_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the update operation falls under, or NULL.

[allow-none]

entry

the GDataEntry to update

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the update is finished, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.0

+
+
+
+

gdata_service_update_entry_finish ()

+
GDataEntry *
+gdata_service_update_entry_finish (GDataService *self,
+                                   GAsyncResult *async_result,
+                                   GError **error);
+

Finishes an asynchronous entry update operation started with gdata_service_update_entry_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

an updated GDataEntry, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.3.0

+
+
+
+

gdata_service_delete_entry ()

+
gboolean
+gdata_service_delete_entry (GDataService *self,
+                            GDataAuthorizationDomain *domain,
+                            GDataEntry *entry,
+                            GCancellable *cancellable,
+                            GError **error);
+

Deletes entry + from the server. For more information about the concept of deleting entries, see the

+online documentation for the GData +

protocol.

+

If cancellable + is not NULL, then the operation can be cancelled by triggering the cancellable + object from another thread. +If the operation was cancelled before or during network activity, the error G_IO_ERROR_CANCELLED will be returned. Cancellation has no effect +after network activity has finished, however, and the deletion will return successfully (or return an error sent by the server) if it is first +cancelled after network activity has finished. See the overview of cancellation for +more details.

+

If there is an error deleting the entry, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. Currently, subclasses +cannot cannot override this or provide more specific errors.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the deletion falls under, or NULL.

[allow-none]

entry

the GDataEntry to delete

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.9.0

+
+
+
+

gdata_service_delete_entry_async ()

+
void
+gdata_service_delete_entry_async (GDataService *self,
+                                  GDataAuthorizationDomain *domain,
+                                  GDataEntry *entry,
+                                  GCancellable *cancellable,
+                                  GAsyncReadyCallback callback,
+                                  gpointer user_data);
+

Deletes entry + from the server. self + and entry + are both reffed when this function is called, +so can safely be unreffed after this function returns.

+

For more details, see gdata_service_delete_entry(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_service_delete_entry_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

domain

the GDataAuthorizationDomain the deletion falls under, or NULL.

[allow-none]

entry

the GDataEntry to delete

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when deletion is finished, or NULL

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.0

+
+
+
+

gdata_service_delete_entry_finish ()

+
gboolean
+gdata_service_delete_entry_finish (GDataService *self,
+                                   GAsyncResult *async_result,
+                                   GError **error);
+

Finishes an asynchronous entry deletion operation started with gdata_service_delete_entry_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.3.0

+
+
+
+

gdata_service_get_proxy_uri ()

+
SoupURI *
+gdata_service_get_proxy_uri (GDataService *self);
+
+

gdata_service_get_proxy_uri has been deprecated since version 0.15.0 and should not be used in newly-written code.

+

Use gdata_service_get_proxy_resolver() instead, which gives more flexibility over the proxy used.

+
+

Gets the proxy URI on the GDataService's SoupSession.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataService

 
+
+
+

Returns

+

the proxy URI, or NULL.

+

[transfer none]

+
+

Since: 0.2.0

+
+
+
+

gdata_service_set_proxy_uri ()

+
void
+gdata_service_set_proxy_uri (GDataService *self,
+                             SoupURI *proxy_uri);
+
+

gdata_service_set_proxy_uri has been deprecated since version 0.15.0 and should not be used in newly-written code.

+

Use gdata_service_set_proxy_resolver() instead, which gives more flexibility over the proxy used.

+
+

Sets the proxy URI on the SoupSession used internally by the given GDataService. +This forces all requests through the given proxy.

+

If proxy_uri + is NULL, no proxy will be used.

+

Note that if a GDataAuthorizer is being used with this GDataService, the authorizer might also need its proxy URI setting.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataService

 

proxy_uri

the proxy URI, or NULL.

[allow-none]
+
+

Since: 0.2.0

+
+
+
+

gdata_service_get_proxy_resolver ()

+
GProxyResolver *
+gdata_service_get_proxy_resolver (GDataService *self);
+

gdata_service_get_proxy_resolver is deprecated and should not be used in newly-written code.

+

Gets the GProxyResolver on the GDataService's SoupSession.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataService

 
+
+
+

Returns

+

a GProxyResolver, or NULL.

+

[transfer none][allow-none]

+
+

Since: 0.15.0

+
+
+
+

gdata_service_set_proxy_resolver ()

+
void
+gdata_service_set_proxy_resolver (GDataService *self,
+                                  GProxyResolver *proxy_resolver);
+

Sets the GProxyResolver on the SoupSession used internally by the given GDataService.

+

Setting this will clear the “proxy-uri” property.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataService

 

proxy_resolver

a GProxyResolver, or NULL.

[allow-none]
+
+

Since: 0.15.0

+
+
+
+

gdata_service_get_timeout ()

+
guint
+gdata_service_get_timeout (GDataService *self);
+

Gets the “timeout” property; the network timeout, in seconds.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataService

 
+
+
+

Returns

+

the timeout, or 0

+
+

Since: 0.7.0

+
+
+
+

gdata_service_set_timeout ()

+
void
+gdata_service_set_timeout (GDataService *self,
+                           guint timeout);
+

Sets the “timeout” property; the network timeout, in seconds.

+

If timeout + is 0, network operations will never time out.

+

Note that if a GDataAuthorizer is being used with this GDataService, the authorizer might also need its timeout setting.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataService

 

timeout

the timeout, or 0

 
+
+

Since: 0.7.0

+
+
+
+

gdata_service_get_locale ()

+
const gchar *
+gdata_service_get_locale (GDataService *self);
+

Returns the locale currently being used for network requests, or NULL if the locale is the default.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataService

 
+
+
+

Returns

+

the current locale

+
+

Since: 0.7.0

+
+
+
+

gdata_service_set_locale ()

+
void
+gdata_service_set_locale (GDataService *self,
+                          const gchar *locale);
+

Set the locale used for network requests to locale +, given in standard Unix locale format. See “locale” for more details.

+

Note that while it's possible to change the locale after sending network requests, it is unsupported, as the server-side software may behave +unexpectedly. The only supported use of this function is after creation of a service, but before any network requests are made.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataService

 

locale

the new locale in Unix locale format, or NULL for the default locale.

[allow-none]
+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDataService

+
typedef struct _GDataService GDataService;
+

All the fields in the GDataService structure are private and should never be accessed directly.

+
+
+
+

GDataServiceClass

+
typedef struct {
+	GObjectClass parent;
+
+	const gchar *api_version;
+	GType feed_type;
+
+	void (*append_query_headers) (GDataService *self, GDataAuthorizationDomain *domain, SoupMessage *message);
+	void (*parse_error_response) (GDataService *self, GDataOperationType operation_type, guint status, const gchar *reason_phrase,
+	                              const gchar *response_body, gint length, GError **error);
+	GList *(*get_authorization_domains) (void);
+	GDataFeed *(*parse_feed) (GDataService *self,
+	                          GDataAuthorizationDomain *domain,
+	                          GDataQuery *query,
+	                          GType entry_type,
+	                          SoupMessage *message,
+	                          GCancellable *cancellable,
+	                          GDataQueryProgressCallback progress_callback,
+	                          gpointer progress_user_data,
+	                          GError **error);
+} GDataServiceClass;
+
+

The class structure for the GDataService type.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GObjectClass parent;

the parent class

 

const gchar *api_version;

the version of the GData API used by the service (typically 2)

 

GType feed_type;

the GType of the feed class (subclass of GDataFeed) to use for query results from this service

 

append_query_headers ()

a function to allow subclasses to append their own headers to queries before they are submitted to the online service, +using the given authorization domain; new in version 0.9.0

 

parse_error_response ()

a function to parse error responses to queries from the online service. It should set the error +from the status, reason phrase and response body it is passed.

 

get_authorization_domains ()

a function to return a newly-allocated list of all the GDataAuthorizationDomains the service makes use of; +while the list should be newly-allocated, the individual domains should not be; not implementing this function is equivalent to returning an +empty list; new in version 0.9.0

 

parse_feed ()

a function to parse feed responses to queries from the online +service; new in version 0.17.0

 
+
+

Since: 0.9.0

+
+
+
+

enum GDataServiceError

+

Error codes for GDataService operations.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GDATA_SERVICE_ERROR_UNAVAILABLE

+

The service is unavailable due to maintainence or other reasons (e.g. network errors at the server end)

+
 

GDATA_SERVICE_ERROR_PROTOCOL_ERROR

+

The client or server unexpectedly strayed from the protocol (fatal error)

+
 

GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED

+

An entry has already been inserted, and cannot be re-inserted

+
 

GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED

+

The user attempted to do something which required authentication, and they weren't authenticated or +didn't have authorization for the operation

+
 

GDATA_SERVICE_ERROR_NOT_FOUND

+

A requested resource (feed or entry) was not found on the server

+
 

GDATA_SERVICE_ERROR_CONFLICT

+

There was a conflict when updating an entry on the server; the server-side copy was modified inbetween downloading +and uploading the modified entry

+
 

GDATA_SERVICE_ERROR_FORBIDDEN

+

Generic error for a forbidden action (not due to having insufficient permissions)

+
 

GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER

+

A given query parameter was invalid for the query type

+
 

GDATA_SERVICE_ERROR_NETWORK_ERROR

+

The service is unavailable due to local network errors (e.g. no Internet connection)

+
 

GDATA_SERVICE_ERROR_PROXY_ERROR

+

The service is unavailable due to proxy network errors (e.g. proxy unreachable)

+
 

GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION

+

Generic error when running a batch operation and the whole operation fails

+
 

GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED

+

The API request quota for this +developer account has been exceeded for the current time period (e.g. day). +Try again later. (Since: 0.16.0.)

+
 
+
+
+
+
+

enum GDataParserError

+

Error codes for XML or JSON parsing operations.

+
+

Members

+
+++++ + + + + + + + + + + + + +

GDATA_PARSER_ERROR_PARSING_STRING

+

Error parsing the XML or JSON syntax itself

+
 

GDATA_PARSER_ERROR_EMPTY_DOCUMENT

+

Empty document

+
 
+
+
+
+
+

enum GDataOperationType

+

Representations of the different operations performed by the library.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GDATA_OPERATION_QUERY

+

a query

+
 

GDATA_OPERATION_INSERTION

+

an insertion of a GDataEntry

+
 

GDATA_OPERATION_UPDATE

+

an update of a GDataEntry

+
 

GDATA_OPERATION_DELETION

+

a deletion of a GDataEntry

+
 

GDATA_OPERATION_DOWNLOAD

+

a download of a file

+
 

GDATA_OPERATION_UPLOAD

+

an upload of a file

+
 

GDATA_OPERATION_AUTHENTICATION

+

authentication with the service

+
 

GDATA_OPERATION_BATCH

+

a batch operation with GDataBatchOperation

+
 
+
+

Since: 0.6.0

+
+
+
+

Property Details

+
+

The “authorizer” property

+
  “authorizer”               GDataAuthorizer *
+

An object which implements GDataAuthorizer. This should have previously been authenticated authorized against this service type (and +potentially other service types). The service will use the authorizer to add an authorization token to each request it performs.

+

Your application should call methods on the GDataAuthorizer object itself in order to authenticate with the Google accounts service and +authorize against this service type. See the documentation for the particular GDataAuthorizer implementation being used for more details.

+

The authorizer for a service can be changed at runtime for a different GDataAuthorizer object or NULL without affecting ongoing requests +and operations.

+

Note that it's only necessary to set an authorizer on the service if your application is going to make requests of the service which +require authorization. For example, listing the current most popular videos on YouTube does not require authorization, but uploading a +video to YouTube does. It's an unnecessary overhead to require the user to authorize against a service when not strictly required.

+

Flags: Read / Write

+

Since: 0.9.0

+
+
+
+

The “locale” property

+
  “locale”                   gchar *
+

The locale to use for network requests, in Unix locale format. (e.g. "en_GB", "cs", "de_DE".) Use NULL for the default "C" locale +(typically "en_US").

+

Typically, this locale will be used by the server-side software to localise results, such as by translating category names, or by choosing +geographically relevant search results. This will vary from service to service.

+

The server-side behaviour is undefined if it doesn't support a given locale.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “proxy-resolver” property

+
  “proxy-resolver”           GProxyResolver *
+

The GProxyResolver used to determine a proxy URI. Setting this will clear the “proxy-uri” property.

+

Flags: Read / Write

+

Since: 0.15.0

+
+
+
+

The “proxy-uri” property

+
  “proxy-uri”                SoupURI *
+

The proxy URI used internally for all network requests.

+

Note that if a GDataAuthorizer is being used with this GDataService, the authorizer might also need its proxy URI setting.

+
+

GDataService:proxy-uri has been deprecated since version 0.15.0 and should not be used in newly-written code.

+

Use “proxy-resolver” instead, which gives more flexibility over the proxy used.

+
+

Flags: Read / Write

+

Since: 0.2.0

+
+
+
+

The “timeout” property

+
  “timeout”                  guint
+

A timeout, in seconds, for network operations. If the timeout is exceeded, the operation will be cancelled and +GDATA_SERVICE_ERROR_NETWORK_ERROR will be returned.

+

If the timeout is 0, operations will never time out.

+

Note that if a GDataAuthorizer is being used with this GDataService, the authorizer might also need its timeout setting.

+

Flags: Read / Write

+

Default value: 0

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataTasksQuery.html b/docs/reference/html/GDataTasksQuery.html new file mode 100644 index 0000000..cdcf1d0 --- /dev/null +++ b/docs/reference/html/GDataTasksQuery.html @@ -0,0 +1,809 @@ + + + + +GDataTasksQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataTasksQuery

+

GDataTasksQuery — GData Tasks query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataTasksQuery * + +gdata_tasks_query_new () +
+gint64 + +gdata_tasks_query_get_completed_max () +
+void + +gdata_tasks_query_set_completed_max () +
+gint64 + +gdata_tasks_query_get_completed_min () +
+void + +gdata_tasks_query_set_completed_min () +
+gint64 + +gdata_tasks_query_get_due_max () +
+void + +gdata_tasks_query_set_due_max () +
+gint64 + +gdata_tasks_query_get_due_min () +
+void + +gdata_tasks_query_set_due_min () +
+gboolean + +gdata_tasks_query_get_show_completed () +
+void + +gdata_tasks_query_set_show_completed () +
+gboolean + +gdata_tasks_query_get_show_deleted () +
+void + +gdata_tasks_query_set_show_deleted () +
+gboolean + +gdata_tasks_query_get_show_hidden () +
+void + +gdata_tasks_query_set_show_hidden () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gint64completed-maxRead / Write
gint64completed-minRead / Write
gint64due-maxRead / Write
gint64due-minRead / Write
gbooleanshow-completedRead / Write
gbooleanshow-deletedRead / Write
gbooleanshow-hiddenRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataTasksQuery
 GDataTasksQueryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ╰── GDataTasksQuery
+
+
+
+

Includes

+
#include <gdata/services/tasks/gdata-tasks-query.h>
+
+
+
+

Description

+

GDataTasksQuery represents a collection of query parameters specific to the Google Tasks service, which go above and beyond +those catered for by GDataQuery.

+

For more details of Google Tasks API, see the +online documentation.

+
+
+

Functions

+
+

gdata_tasks_query_new ()

+
GDataTasksQuery *
+gdata_tasks_query_new (const gchar *q);
+

Creates a new GDataTasksQuery. q + is unused and must be set to NULL.

+
+

Parameters

+
+++++ + + + + + +

q

a query string, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataTasksQuery

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_get_completed_max ()

+
gint64
+gdata_tasks_query_get_completed_max (GDataTasksQuery *self);
+

Gets the “completed-max” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksQuery

 
+
+
+

Returns

+

the UNIX timestamp for the completed-max property, or -1

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_set_completed_max ()

+
void
+gdata_tasks_query_set_completed_max (GDataTasksQuery *self,
+                                     gint64 completed_max);
+

Sets the “completed-max” property of the GDataTasksQuery +to the new time/date, completed_max +.

+

Set completed_max + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksQuery

 

completed_max

upper bound for a task's completion date by UNIX timestamp, or -1

 
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_get_completed_min ()

+
gint64
+gdata_tasks_query_get_completed_min (GDataTasksQuery *self);
+

Gets the “completed-min” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksQuery

 
+
+
+

Returns

+

the UNIX timestamp for the completed-min property, or -1

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_set_completed_min ()

+
void
+gdata_tasks_query_set_completed_min (GDataTasksQuery *self,
+                                     gint64 completed_min);
+

Sets the “completed-min” property of the GDataTasksQuery +to the new time/date, completed_min +.

+

Set completed_min + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksQuery

 

completed_min

lower bound for a task's completion date by UNIX timestamp, or -1

 
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_get_due_max ()

+
gint64
+gdata_tasks_query_get_due_max (GDataTasksQuery *self);
+

Gets the “due-max” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksQuery

 
+
+
+

Returns

+

the UNIX timestamp for the due-max property, or -1

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_set_due_max ()

+
void
+gdata_tasks_query_set_due_max (GDataTasksQuery *self,
+                               gint64 due_max);
+

Sets the “due-max” property of the GDataTasksQuery +to the new time/date, due_max +.

+

Set due_max + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksQuery

 

due_max

upper bound for a task's due date by UNIX timestamp, or -1

 
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_get_due_min ()

+
gint64
+gdata_tasks_query_get_due_min (GDataTasksQuery *self);
+

Gets the “due-min” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksQuery

 
+
+
+

Returns

+

the UNIX timestamp for the due-min property, or -1

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_set_due_min ()

+
void
+gdata_tasks_query_set_due_min (GDataTasksQuery *self,
+                               gint64 due_min);
+

Sets the “due-min” property of the GDataTasksQuery +to the new time/date, due_min +.

+

Set due_min + to -1 to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksQuery

 

due_min

lower bound for a task's due date by UNIX timestamp, or -1

 
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_get_show_completed ()

+
gboolean
+gdata_tasks_query_get_show_completed (GDataTasksQuery *self);
+

Gets the “show-completed” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksQuery

 
+
+
+

Returns

+

the show-completed property

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_set_show_completed ()

+
void
+gdata_tasks_query_set_show_completed (GDataTasksQuery *self,
+                                      gboolean show_completed);
+

Sets the “show-completed” property of the GDataTasksQuery.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksQuery

 

show_completed

TRUE to show completed tasks, FALSE otherwise

 
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_get_show_deleted ()

+
gboolean
+gdata_tasks_query_get_show_deleted (GDataTasksQuery *self);
+

Gets the “show-deleted” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksQuery

 
+
+
+

Returns

+

the show-deleted property

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_set_show_deleted ()

+
void
+gdata_tasks_query_set_show_deleted (GDataTasksQuery *self,
+                                    gboolean show_deleted);
+

Sets the “show-deleted” property of the GDataTasksQuery.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksQuery

 

show_deleted

TRUE to show deleted tasks, FALSE otherwise

 
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_get_show_hidden ()

+
gboolean
+gdata_tasks_query_get_show_hidden (GDataTasksQuery *self);
+

Gets the “show-hidden” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksQuery

 
+
+
+

Returns

+

the show-hidden property

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_query_set_show_hidden ()

+
void
+gdata_tasks_query_set_show_hidden (GDataTasksQuery *self,
+                                   gboolean show_hidden);
+

Sets the “show-hidden” property of the GDataTasksQuery.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksQuery

 

show_hidden

TRUE to show hidden tasks, FALSE otherwise

 
+
+

Since: 0.15.0

+
+
+
+

Types and Values

+
+

GDataTasksQuery

+
typedef struct _GDataTasksQuery GDataTasksQuery;
+

All the fields in the GDataTasksQuery structure are private and should never be accessed directly.

+

Since: 0.15.0

+
+
+
+

GDataTasksQueryClass

+
typedef struct {
+} GDataTasksQueryClass;
+
+

All the fields in the GDataTasksQueryClass structure are private and should never be accessed directly.

+

Since: 0.15.0

+
+
+
+

Property Details

+
+

The “completed-max” property

+
  “completed-max”            gint64
+

Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. +The default is not to filter by completion date.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.15.0

+
+
+
+

The “completed-min” property

+
  “completed-min”            gint64
+

Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. +The default is not to filter by completion date.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.15.0

+
+
+
+

The “due-max” property

+
  “due-max”                  gint64
+

Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. +The default is not to filter by completion date.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.15.0

+
+
+
+

The “due-min” property

+
  “due-min”                  gint64
+

Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. +The default is not to filter by completion date.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.15.0

+
+
+
+

The “show-completed” property

+
  “show-completed”           gboolean
+

Flag indicating whether completed tasks are returned in the result. Optional. The default is FALSE.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.15.0

+
+
+
+

The “show-deleted” property

+
  “show-deleted”             gboolean
+

Flag indicating whether deleted tasks are returned in the result. Optional. The default is FALSE.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.15.0

+
+
+
+

The “show-hidden” property

+
  “show-hidden”              gboolean
+

Flag indicating whether hidden tasks are returned in the result. Optional. The default is FALSE.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.15.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataTasksService.html b/docs/reference/html/GDataTasksService.html new file mode 100644 index 0000000..3006ae0 --- /dev/null +++ b/docs/reference/html/GDataTasksService.html @@ -0,0 +1,1281 @@ + + + + +GDataTasksService: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataTasksService

+

GDataTasksService — GData Tasks service object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataTasksService
 GDataTasksServiceClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataService
+        ╰── GDataTasksService
+
+
+
+

Includes

+
#include <gdata/services/tasks/gdata-tasks-service.h>
+
+
+
+

Description

+

GDataTasksService is a subclass of GDataService for communicating with the API of Google Tasks. It supports querying +for, inserting, editing and deleting tasks from tasklists, as well as operations on the tasklists themselves.

+

For more details of Google Tasks API, see the +online documentation.

+
+
+

Functions

+
+

gdata_tasks_service_new ()

+
GDataTasksService *
+gdata_tasks_service_new (GDataAuthorizer *authorizer);
+

Creates a new GDataTasksService using the given GDataAuthorizer. If authorizer + is NULL, all requests are made as an unauthenticated user.

+
+

Parameters

+
+++++ + + + + + +

authorizer

a GDataAuthorizer to authorize the service's requests, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataTasksService, or NULL; unref with g_object_unref()

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_get_primary_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_tasks_service_get_primary_authorization_domain
+                               (void);
+

The primary GDataAuthorizationDomain for interacting with Google Tasks. This will not normally need to be used, as it's used internally +by the GDataTasksService methods. However, if using the plain GDataService methods to implement custom queries or requests which libgdata +does not support natively, then this domain may be needed to authorize the requests.

+

The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.

+
+

Returns

+

the service's authorization domain.

+

[transfer none]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_query_all_tasklists ()

+
GDataFeed *
+gdata_tasks_service_query_all_tasklists
+                               (GDataTasksService *self,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GError **error);
+

Queries the service to return a list of all tasklists from the authenticated account which match the given +query +. It will return all tasklists the user has read access to.

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_query_all_tasklists_async ()

+
void
+gdata_tasks_service_query_all_tasklists_async
+                               (GDataTasksService *self,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service to return a list of all tasklists from the authenticated account which match the given +query +. self + and query + are all reffed when this function is called, so can safely be unreffed after +this function returns.

+

For more details, see gdata_tasks_service_query_all_tasklists(), which is the synchronous version of +this function, and gdata_service_query_async(), which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_query_tasks ()

+
GDataFeed *
+gdata_tasks_service_query_tasks (GDataTasksService *self,
+                                 GDataTasksTasklist *tasklist,
+                                 GDataQuery *query,
+                                 GCancellable *cancellable,
+                                 GDataQueryProgressCallback progress_callback,
+                                 gpointer progress_user_data,
+                                 GError **error);
+

Queries the service to return a list of tasks in the given tasklist +, which match query +.

+

For more details, see gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

tasklist

a GDataTasksTasklist

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_query_tasks_async ()

+
void
+gdata_tasks_service_query_tasks_async (GDataTasksService *self,
+                                       GDataTasksTasklist *tasklist,
+                                       GDataQuery *query,
+                                       GCancellable *cancellable,
+                                       GDataQueryProgressCallback progress_callback,
+                                       gpointer progress_user_data,
+                                       GDestroyNotify destroy_progress_user_data,
+                                       GAsyncReadyCallback callback,
+                                       gpointer user_data);
+

Queries the service to return a list of tasks in the given tasklist +, which match query +. self +, tasklist + and query + are all reffed when this +function is called, so can safely be unreffed after this function returns.

+

Get the results of the query using gdata_service_query_finish() in the callback +.

+

For more details, see gdata_tasks_service_query_tasks(), which is the synchronous version of this function, and gdata_service_query_async(), +which is the base asynchronous query function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

tasklist

a GDataTasksTasklist

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when the query is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_insert_task ()

+
GDataTasksTask *
+gdata_tasks_service_insert_task (GDataTasksService *self,
+                                 GDataTasksTask *task,
+                                 GDataTasksTasklist *tasklist,
+                                 GCancellable *cancellable,
+                                 GError **error);
+

Inserts task + by uploading it to the online tasks service into tasklist tasklist +. It is safe to unref tasklist + after function returns.

+

For more details, see gdata_service_insert_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

task

the GDataTasksTask to insert

 

tasklist

GDataTasksTasklist to insert into

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

an updated GDataTasksTask, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_insert_task_async ()

+
void
+gdata_tasks_service_insert_task_async (GDataTasksService *self,
+                                       GDataTasksTask *task,
+                                       GDataTasksTasklist *tasklist,
+                                       GCancellable *cancellable,
+                                       GAsyncReadyCallback callback,
+                                       gpointer user_data);
+

Inserts task + by uploading it to the online tasks service into tasklist tasklist +. self +, task + and tasklist + are all reffed when this function is called, so can safely be +unreffed after this function returns.

+

callback + should call gdata_service_insert_entry_finish() to obtain a GDataTasksTask representing the inserted task and to check for possible +errors.

+

For more details, see gdata_tasks_service_insert_task(), which is the synchronous version of this function, and +gdata_service_insert_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

task

the GDataTasksTask to insert

 

tasklist

GDataTasksTasklist to insert into

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_insert_tasklist ()

+
GDataTasksTasklist *
+gdata_tasks_service_insert_tasklist (GDataTasksService *self,
+                                     GDataTasksTasklist *tasklist,
+                                     GCancellable *cancellable,
+                                     GError **error);
+

Inserts tasklist + by uploading it to the online tasks service.

+

For more details, see gdata_service_insert_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

tasklist

GDataTasksTasklist to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

an updated GDataTasksTasklist, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_insert_tasklist_async ()

+
void
+gdata_tasks_service_insert_tasklist_async
+                               (GDataTasksService *self,
+                                GDataTasksTasklist *tasklist,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Inserts tasklist + by uploading it to the online tasks service. self + and tasklist + are both reffed when this function is called, so can safely be +unreffed after this function returns.

+

callback + should call gdata_service_insert_entry_finish() to obtain a GDataTasksTasklist representing the inserted tasklist and to check for possible +errors.

+

For more details, see gdata_tasks_service_insert_tasklist(), which is the synchronous version of this function, and +gdata_service_insert_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

tasklist

GDataTasksTasklist to insert

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_delete_task ()

+
gboolean
+gdata_tasks_service_delete_task (GDataTasksService *self,
+                                 GDataTasksTask *task,
+                                 GCancellable *cancellable,
+                                 GError **error);
+

Delete task + from online tasks service.

+

For more details, see gdata_service_delete_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

task

the GDataTasksTask to delete

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_delete_task_async ()

+
void
+gdata_tasks_service_delete_task_async (GDataTasksService *self,
+                                       GDataTasksTask *task,
+                                       GCancellable *cancellable,
+                                       GAsyncReadyCallback callback,
+                                       gpointer user_data);
+

Deletes task + from online tasks service. self + and task + are both reffed when this function is called, so can safely be +unreffed after this function returns.

+

callback + should call gdata_service_delete_entry_finish() to finish deleting task and to check for possible +errors.

+

For more details, see gdata_tasks_service_delete_task(), which is the synchronous version of this function, and +gdata_service_delete_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

task

GDataTasksTask to delete

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_delete_tasklist ()

+
gboolean
+gdata_tasks_service_delete_tasklist (GDataTasksService *self,
+                                     GDataTasksTasklist *tasklist,
+                                     GCancellable *cancellable,
+                                     GError **error);
+

Delete tasklist + from online tasks service.

+

For more details, see gdata_service_delete_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

tasklist

the GDataTasksTasklist to delete

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_delete_tasklist_async ()

+
void
+gdata_tasks_service_delete_tasklist_async
+                               (GDataTasksService *self,
+                                GDataTasksTasklist *tasklist,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Deletes tasklist + from online tasks service. self + and tasklist + are both reffed when this function is called, so can safely be +unreffed after this function returns.

+

callback + should call gdata_service_delete_entry_finish() to finish deleting tasklist and to check for possible +errors.

+

For more details, see gdata_tasks_service_delete_tasklist(), which is the synchronous version of this function, and +gdata_service_delete_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

tasklist

GDataTasksTasklist to delete

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_update_task ()

+
GDataTasksTask *
+gdata_tasks_service_update_task (GDataTasksService *self,
+                                 GDataTasksTask *task,
+                                 GCancellable *cancellable,
+                                 GError **error);
+

Update task + in online tasks service.

+

For more details, see gdata_service_update_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

task

the GDataTasksTask to update

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

an updated GDataTasksTask, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_update_task_async ()

+
void
+gdata_tasks_service_update_task_async (GDataTasksService *self,
+                                       GDataTasksTask *task,
+                                       GCancellable *cancellable,
+                                       GAsyncReadyCallback callback,
+                                       gpointer user_data);
+

Updates task + to online tasks service. self + and task + are both reffed when this function is called, so can safely be +unreffed after this function returns.

+

callback + should call gdata_service_update_entry_finish() to obtain a GDataTasksTask representing the updated task and to check for possible +errors.

+

For more details, see gdata_tasks_service_update_task(), which is the synchronous version of this function, and +gdata_service_update_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

task

GDataTasksTask to update

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_update_tasklist ()

+
GDataTasksTasklist *
+gdata_tasks_service_update_tasklist (GDataTasksService *self,
+                                     GDataTasksTasklist *tasklist,
+                                     GCancellable *cancellable,
+                                     GError **error);
+

Update tasklist + in online tasks service.

+

For more details, see gdata_service_update_entry().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

tasklist

the GDataTasksTasklist to update

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

error

a GError, or NULL.

[allow-none]
+
+
+

Returns

+

an updated GDataTasksTasklist, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_service_update_tasklist_async ()

+
void
+gdata_tasks_service_update_tasklist_async
+                               (GDataTasksService *self,
+                                GDataTasksTasklist *tasklist,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Updates tasklist + from online tasks service. self + and tasklist + are both reffed when this function is called, so can safely be +unreffed after this function returns.

+

callback + should call gdata_service_update_entry_finish() to obtain a GDataTasksTasklist representing the updated task and to check for possible +errors.

+

For more details, see gdata_tasks_service_update_tasklist(), which is the synchronous version of this function, and +gdata_service_update_entry_async(), which is the base asynchronous insertion function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataTasksService

 

tasklist

GDataTasksTasklist to update

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when insertion is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.15.0

+
+
+
+

Types and Values

+
+

GDataTasksService

+
typedef struct _GDataTasksService GDataTasksService;
+

All the fields in the GDataTasksService structure are private and should never be accessed directly.

+

Since: 0.15.0

+
+
+
+

GDataTasksServiceClass

+
typedef struct {
+} GDataTasksServiceClass;
+
+

All the fields in the GDataTasksServiceClass structure are private and should never be accessed directly.

+

Since: 0.15.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataTasksTask.html b/docs/reference/html/GDataTasksTask.html new file mode 100644 index 0000000..274a745 --- /dev/null +++ b/docs/reference/html/GDataTasksTask.html @@ -0,0 +1,819 @@ + + + + +GDataTasksTask: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataTasksTask

+

GDataTasksTask — GData Tasks task object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataTasksTask * + +gdata_tasks_task_new () +
const gchar * + +gdata_tasks_task_get_parent () +
const gchar * + +gdata_tasks_task_get_position () +
const gchar * + +gdata_tasks_task_get_notes () +
+void + +gdata_tasks_task_set_notes () +
const gchar * + +gdata_tasks_task_get_status () +
+void + +gdata_tasks_task_set_status () +
+gint64 + +gdata_tasks_task_get_due () +
+void + +gdata_tasks_task_set_due () +
+gint64 + +gdata_tasks_task_get_completed () +
+void + +gdata_tasks_task_set_completed () +
+gboolean + +gdata_tasks_task_is_deleted () +
+void + +gdata_tasks_task_set_is_deleted () +
+gboolean + +gdata_tasks_task_is_hidden () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gint64completedRead / Write
gint64dueRead / Write
gbooleanis-deletedRead / Write
gbooleanis-hiddenRead
+gchar *notesRead / Write
+gchar *parentRead
+gchar *positionRead
+gchar *statusRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
#defineGDATA_TASKS_STATUS_NEEDS_ACTION
#defineGDATA_TASKS_STATUS_COMPLETED
 GDataTasksTask
 GDataTasksTaskClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataTasksTask
+
+
+
+

Includes

+
#include <gdata/services/tasks/gdata-tasks-task.h>
+
+
+
+

Description

+

GDataTasksTask is a subclass of GDataEntry to represent a task in a tasklist from Google Tasks.

+

All functionality of Tasks is currently supported except

+links. +

For more details of Google Tasks API, see the +online documentation.

+
+
+

Functions

+
+

gdata_tasks_task_new ()

+
GDataTasksTask *
+gdata_tasks_task_new (const gchar *id);
+

Creates a new GDataTasksTask with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the task's ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataTasksTask; unref with g_object_unref()

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_get_parent ()

+
const gchar *
+gdata_tasks_task_get_parent (GDataTasksTask *self);
+

Gets the “parent” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksTask

 
+
+
+

Returns

+

the parent of the task, or NULL.

+

[allow-none]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_get_position ()

+
const gchar *
+gdata_tasks_task_get_position (GDataTasksTask *self);
+

Gets the “position” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksTask

 
+
+
+

Returns

+

the position of the task, or NULL.

+

[allow-none]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_get_notes ()

+
const gchar *
+gdata_tasks_task_get_notes (GDataTasksTask *self);
+

Gets the “notes” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksTask

 
+
+
+

Returns

+

notes of the task, or NULL.

+

[allow-none]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_set_notes ()

+
void
+gdata_tasks_task_set_notes (GDataTasksTask *self,
+                            const gchar *notes);
+

Sets the “notes” property to the new notes, notes +.

+

Set notes + to NULL to unset the property in the task.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksTask

 

notes

a new notes of the task, or NULL.

[allow-none]
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_get_status ()

+
const gchar *
+gdata_tasks_task_get_status (GDataTasksTask *self);
+

Gets the “status” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksTask

 
+
+
+

Returns

+

the status of the task, or NULL.

+

[allow-none]

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_set_status ()

+
void
+gdata_tasks_task_set_status (GDataTasksTask *self,
+                             const gchar *status);
+

Sets the “status” property to the new status, status +.

+

Set status + to NULL to unset the property in the task.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksTask

 

status

a new status of the task, or NULL.

[allow-none]
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_get_due ()

+
gint64
+gdata_tasks_task_get_due (GDataTasksTask *self);
+

Gets the “due” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksTask

 
+
+
+

Returns

+

the due property, or -1

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_set_due ()

+
void
+gdata_tasks_task_set_due (GDataTasksTask *self,
+                          gint64 due);
+

Sets the “due” property of the GDataTasksTask to the new due time of the task, due +.

+

Set due + to -1 to unset the property in the due time of the task

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksTask

 

due

due time of the task, or -1

 
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_get_completed ()

+
gint64
+gdata_tasks_task_get_completed (GDataTasksTask *self);
+

Gets the “completed” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksTask

 
+
+
+

Returns

+

the completed property, or -1

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_set_completed ()

+
void
+gdata_tasks_task_set_completed (GDataTasksTask *self,
+                                gint64 completed);
+

Sets the “completed” property of the GDataTasksTask to the new completion time of the task, completed +.

+

Set completed + to -1 to unset the property in the completion time of the task

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksTask

 

completed

completion time of the task, or -1

 
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_is_deleted ()

+
gboolean
+gdata_tasks_task_is_deleted (GDataTasksTask *self);
+

Gets the “is-deleted” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksTask

 
+
+
+

Returns

+

TRUE if task is deleted, FALSE otherwise

+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_set_is_deleted ()

+
void
+gdata_tasks_task_set_is_deleted (GDataTasksTask *self,
+                                 gboolean deleted);
+

Sets the “is-deleted” property to deleted +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataTasksTask

 

deleted

TRUE if task is deleted, FALSE otherwise

 
+
+

Since: 0.15.0

+
+
+
+

gdata_tasks_task_is_hidden ()

+
gboolean
+gdata_tasks_task_is_hidden (GDataTasksTask *self);
+

Gets the “is-hidden” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataTasksTask

 
+
+
+

Returns

+

TRUE if task is hidden, FALSE otherwise

+
+

Since: 0.15.0

+
+
+
+

Types and Values

+
+

GDATA_TASKS_STATUS_NEEDS_ACTION

+
#define GDATA_TASKS_STATUS_NEEDS_ACTION "needsAction"
+
+

A value for “status” indicating the task still needs action +before it is complete.

+

Reference:

+ +Google Tasks documentation. +

Since: 0.16.0

+
+
+
+

GDATA_TASKS_STATUS_COMPLETED

+
#define GDATA_TASKS_STATUS_COMPLETED "completed"
+
+

A value for “status” indicating the task has been completed.

+

Reference:

+ +Google Tasks documentation. +

Since: 0.16.0

+
+
+
+

GDataTasksTask

+
typedef struct _GDataTasksTask GDataTasksTask;
+

All the fields in the GDataTasksTask structure are private and should never be accessed directly.

+

Since: 0.15.0

+
+
+
+

GDataTasksTaskClass

+
typedef struct {
+} GDataTasksTaskClass;
+
+

All the fields in the GDataTasksTaskClass structure are private and should never be accessed directly.

+

Since: 0.15.0

+
+
+
+

Property Details

+
+

The “completed” property

+
  “completed”                gint64
+

Completion date of the task (as a RFC 3339 timestamp; seconds since +the UNIX epoch).

+

This field is -1 if the task has not +been completed.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.15.0

+
+
+
+

The “due” property

+
  “due”                      gint64
+

Due date of the task (as a RFC 3339 timestamp; seconds since the UNIX +epoch).

+

This field is -1 if the task has no due +date assigned.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.15.0

+
+
+
+

The “is-deleted” property

+
  “is-deleted”               gboolean
+

Flag indicating whether the task has been deleted. The default is FALSE.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.15.0

+
+
+
+

The “is-hidden” property

+
  “is-hidden”                gboolean
+

Flag indicating whether the task is hidden. This is the case if the task +had been marked completed when the task list was last cleared. +The default is FALSE. This field is read-only.

+

Flags: Read

+

Default value: FALSE

+

Since: 0.15.0

+
+
+
+

The “notes” property

+
  “notes”                    gchar *
+

This is where the description of what needs to be done in the task is stored.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.15.0

+
+
+
+

The “parent” property

+
  “parent”                   gchar *
+

Parent task identifier. This field is omitted if it is a top-level task. This field is read-only.

+

Flags: Read

+

Default value: NULL

+

Since: 0.15.0

+
+
+
+

The “position” property

+
  “position”                 gchar *
+

String indicating the position of the task among its sibling tasks under the same parent task +or at the top level. If this string is greater than another task's corresponding position string +according to lexicographical ordering, the task is positioned after the other task under the same +parent task (or at the top level). This field is read-only.

+

Flags: Read

+

Default value: NULL

+

Since: 0.15.0

+
+
+
+

The “status” property

+
  “status”                   gchar *
+

Status of the task. This is either GDATA_TASKS_STATUS_NEEDS_ACTION +or GDATA_TASKS_STATUS_COMPLETED.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.15.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataTasksTasklist.html b/docs/reference/html/GDataTasksTasklist.html new file mode 100644 index 0000000..34ffbce --- /dev/null +++ b/docs/reference/html/GDataTasksTasklist.html @@ -0,0 +1,152 @@ + + + + +GDataTasksTasklist: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataTasksTasklist

+

GDataTasksTasklist — GData Tasks tasklist object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+GDataTasksTasklist * + +gdata_tasks_tasklist_new () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataTasksTasklist
 GDataTasksTasklistClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataTasksTasklist
+
+
+
+

Includes

+
#include <gdata/services/tasks/gdata-tasks-tasklist.h>
+
+
+
+

Description

+

GDataTasksTasklist is a subclass of GDataEntry to represent a tasklist from Google Tasks.

+

For more details of Google Tasks API, see the +online documentation.

+
+
+

Functions

+
+

gdata_tasks_tasklist_new ()

+
GDataTasksTasklist *
+gdata_tasks_tasklist_new (const gchar *id);
+

Creates a new GDataTasksTasklist with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the tasklist's ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataTasksTasklist; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.15.0

+
+
+
+

Types and Values

+
+

GDataTasksTasklist

+
typedef struct _GDataTasksTasklist GDataTasksTasklist;
+

All the fields in the GDataTasksTasklist structure are private and should never be accessed directly.

+

Since: 0.15.0

+
+
+
+

GDataTasksTasklistClass

+
typedef struct {
+} GDataTasksTasklistClass;
+
+

All the fields in the GDataTasksTasklistClass structure are private and should never be accessed directly.

+

Since: 0.15.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataUploadStream.html b/docs/reference/html/GDataUploadStream.html new file mode 100644 index 0000000..5fe71ac --- /dev/null +++ b/docs/reference/html/GDataUploadStream.html @@ -0,0 +1,1077 @@ + + + + +GDataUploadStream: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataUploadStream

+

GDataUploadStream — GData upload stream object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GOutputStream * + +gdata_upload_stream_new () +
+GOutputStream * + +gdata_upload_stream_new_resumable () +
const gchar * + +gdata_upload_stream_get_response () +
+GDataService * + +gdata_upload_stream_get_service () +
+GDataAuthorizationDomain * + +gdata_upload_stream_get_authorization_domain () +
+GCancellable * + +gdata_upload_stream_get_cancellable () +
const gchar * + +gdata_upload_stream_get_method () +
const gchar * + +gdata_upload_stream_get_upload_uri () +
+GDataEntry * + +gdata_upload_stream_get_entry () +
const gchar * + +gdata_upload_stream_get_slug () +
const gchar * + +gdata_upload_stream_get_content_type () +
+goffset + +gdata_upload_stream_get_content_length () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataAuthorizationDomain *authorization-domainRead / Write / Construct Only
+GCancellable *cancellableRead / Write / Construct Only
gint64content-lengthRead / Write / Construct Only
+gchar *content-typeRead / Write / Construct Only
+GDataEntry *entryRead / Write / Construct Only
+gchar *methodRead / Write / Construct Only
+GDataService *serviceRead / Write / Construct Only
+gchar *slugRead / Write / Construct Only
+gchar *upload-uriRead / Write / Construct Only
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GOutputStream
+        ╰── GDataUploadStream
+
+
+
+

Includes

+
#include <gdata/gdata-upload-stream.h>
+
+
+
+

Description

+

GDataUploadStream is a GOutputStream subclass to allow uploading of files from GData services with authorization from a GDataService under +the given GDataAuthorizationDomain. If authorization is not required to perform the upload, a GDataAuthorizationDomain doesn't have to be +specified.

+

Once a GDataUploadStream is instantiated with gdata_upload_stream_new(), the standard GOutputStream API can be used on the stream to upload +the file. Network communication may not actually begin until the first call to g_output_stream_write(), so having a GDataUploadStream around is no +guarantee that data is being uploaded.

+

Uploads of a file, or a file with associated metadata (a GDataEntry) should use GDataUploadStream, but if you want to simply upload a single +GDataEntry, use gdata_service_insert_entry() instead. GDataUploadStream is for large streaming uploads.

+

Once an upload is complete, the server's response can be retrieved from the GDataUploadStream using gdata_upload_stream_get_response(). In order +for network communication to be guaranteed to have stopped (and thus the response definitely available), g_output_stream_close() must be called +on the GDataUploadStream first. Otherwise, gdata_upload_stream_get_response() may return saying that the operation is still in progress.

+

If the server returns an error instead of a success response, the error will be returned by g_output_stream_close() as a GDataServiceError.

+

The entire upload operation can be cancelled using the GCancellable instance provided to gdata_upload_stream_new(), or returned by +gdata_upload_stream_get_cancellable(). Cancelling this at any time will cause all future GOutputStream method calls to return +G_IO_ERROR_CANCELLED. If any GOutputStream methods are in the process of being called, they will be cancelled and return G_IO_ERROR_CANCELLED as +soon as possible.

+

Note that cancelling an individual method call (such as a call to g_output_stream_write()) using the GCancellable parameter of the method will not +cancel the upload as a whole — just that particular method call. In the case of g_output_stream_write(), this will cause it to return the number of +bytes it has successfully written up to the point of cancellation (up to the requested number of bytes), or return a G_IO_ERROR_CANCELLED if it +had not managed to write any bytes to the network by that point. This is also the behaviour of g_output_stream_write() when the upload operation as +a whole is cancelled.

+

In the case of g_output_stream_close(), the call will return immediately if network activity hasn't yet started. If it has, the network activity +will be cancelled, regardless of whether the call to g_output_stream_close() is cancelled. Cancelling a pending call to g_output_stream_close() +(either using the method's GCancellable, or by cancelling the upload stream as a whole) will cause it to stop waiting for the network activity to +finish, and return G_IO_ERROR_CANCELLED immediately. Network activity will continue to be shut down in the background.

+

Any outstanding data is guaranteed to be written to the network successfully even if a call to g_output_stream_close() is cancelled. However, if +the upload stream as a whole is cancelled using “cancellable”, no more data will be sent over the network, and the network +connection will be closed immediately. i.e. GDataUploadStream will do its best to instruct the server to cancel the upload and any associated +server-side changes of state.

+

If the server returns an error message (for example, if the user is not correctly authenticated/authorized or doesn't have suitable permissions +to upload from the given URI), it will be returned as a GDataServiceError by g_output_stream_close().

+
+

Example 3. Uploading from a File

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
GDataService *service;
+GDataAuthorizationDomain *domain;
+GCancellable *cancellable;
+GInputStream *input_stream;
+GOutputStream *upload_stream;
+GFile *file;
+GFileInfo *file_info;
+GError *error = NULL;
+
+/* Get the file to upload */
+file = get_file_to_upload ();
+file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+                               G_FILE_ATTRIBUTE_STANDARD_SIZE,
+                               G_FILE_QUERY_INFO_NONE, NULL, &error);
+
+if (file_info == NULL) {
+    g_error ("Error getting file info: %s", error->message);
+    g_error_free (error);
+    g_object_unref (file);
+    return;
+}
+
+input_stream = g_file_read (file, NULL, &error);
+g_object_unref (file);
+
+if (input_stream == NULL) {
+    g_error ("Error getting file input stream: %s", error->message);
+    g_error_free (error);
+    g_object_unref (file_info);
+    return;
+}
+
+/* Create the upload stream */
+service = create_my_service ();
+domain = get_my_authorization_domain_from_service (service);
+cancellable = g_cancellable_new (); /* cancel this to cancel the entire upload operation */
+upload_stream = gdata_upload_stream_new_resumable (service, domain, SOUP_METHOD_POST, upload_uri, NULL,
+                                                   g_file_info_get_display_name (file_info), g_file_info_get_content_type (file_info),
+                                                   g_file_info_get_size (file_info), cancellable);
+g_object_unref (file_info);
+
+/* Perform the upload asynchronously */
+g_output_stream_splice_async (upload_stream, input_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
+                              G_PRIORITY_DEFAULT, NULL, (GAsyncReadyCallback) upload_splice_cb, NULL);
+
+g_object_unref (upload_stream);
+g_object_unref (input_stream);
+g_object_unref (cancellable);
+g_object_unref (domain);
+g_object_unref (service);
+
+static void
+upload_splice_cb (GOutputStream *upload_stream, GAsyncResult *result, gpointer user_data)
+{
+    gssize length;
+    GError *error = NULL;
+
+    g_output_stream_splice_finish (upload_stream, result, &error);
+
+    if (error != NULL && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) == FALSE)) {
+        /* Error upload the file; potentially an I/O error (GIOError), or an error response from the server
+         * (GDataServiceError). */
+        g_error ("Error uploading file: %s", error->message);
+        g_error_free (error);
+    }
+
+    /* If the upload was successful, carry on to parse the result. Note that this will normally be handled by methods like
+     * gdata_youtube_service_finish_video_upload(), gdata_picasaweb_service_finish_file_upload() and
+     * gdata_documents_service_finish_upload() */
+    parse_server_result (gdata_upload_stream_get_response (GDATA_UPLOAD_STREAM (upload_stream), &length), length);
+}
+
+ +
+
+
+
+

Functions

+
+

gdata_upload_stream_new ()

+
GOutputStream *
+gdata_upload_stream_new (GDataService *service,
+                         GDataAuthorizationDomain *domain,
+                         const gchar *method,
+                         const gchar *upload_uri,
+                         GDataEntry *entry,
+                         const gchar *slug,
+                         const gchar *content_type,
+                         GCancellable *cancellable);
+

Creates a new GDataUploadStream, allowing a file to be uploaded from a GData service using standard GOutputStream API.

+

The HTTP method to use should be specified in method +, and will typically be either SOUP_METHOD_POST (for insertions) or SOUP_METHOD_PUT +(for updates), according to the server and the upload_uri +.

+

If entry + is specified, it will be attached to the upload as the entry to which the file being uploaded belongs. Otherwise, just the file +written to the stream will be uploaded, and given a default entry as determined by the server.

+

slug + and content_type + must be specified before the upload begins, as they describe the file being streamed. slug + is the filename given to the +file, which will typically be stored on the server and made available when downloading the file again. content_type + must be the correct +content type for the file, and should be in the service's list of acceptable content types.

+

As well as the standard GIO errors, calls to the GOutputStream API on a GDataUploadStream can also return any relevant specific error from +GDataServiceError, or GDATA_SERVICE_ERROR_PROTOCOL_ERROR in the general case.

+

If a GCancellable is provided in cancellable +, the upload operation may be cancelled at any time from another thread using g_cancellable_cancel(). +In this case, any ongoing network activity will be stopped, and any pending or future calls to GOutputStream API on the GDataUploadStream will +return G_IO_ERROR_CANCELLED. Note that the GCancellable objects which can be passed to individual GOutputStream operations will not cancel the +upload operation proper if cancelled — they will merely cancel that API call. The only way to cancel the upload operation completely is using this +cancellable +.

+

Note that network communication won't begin until the first call to g_output_stream_write() on the GDataUploadStream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

service

a GDataService

 

domain

the GDataAuthorizationDomain to authorize the upload, or NULL.

[allow-none]

method

the HTTP method to use

 

upload_uri

the URI to upload, which must be HTTPS

 

entry

the entry to upload as metadata, or NULL.

[allow-none]

slug

the file's slug (filename)

 

content_type

the content type of the file being uploaded

 

cancellable

a GCancellable for the entire upload stream, or NULL.

[allow-none]
+
+
+

Returns

+

a new GOutputStream, or NULL; unref with g_object_unref()

+
+

Since: 0.9.0

+
+
+
+

gdata_upload_stream_new_resumable ()

+
GOutputStream *
+gdata_upload_stream_new_resumable (GDataService *service,
+                                   GDataAuthorizationDomain *domain,
+                                   const gchar *method,
+                                   const gchar *upload_uri,
+                                   GDataEntry *entry,
+                                   const gchar *slug,
+                                   const gchar *content_type,
+                                   goffset content_length,
+                                   GCancellable *cancellable);
+

Creates a new resumable GDataUploadStream, allowing a file to be uploaded from a GData service using standard GOutputStream API. The upload will +use GData's resumable upload API, so should be more reliable than a normal upload (especially if the file is large). See the

+GData documentation on resumable uploads for more +

information.

+

The HTTP method to use should be specified in method +, and will typically be either SOUP_METHOD_POST (for insertions) or SOUP_METHOD_PUT +(for updates), according to the server and the upload_uri +.

+

If entry + is specified, it will be attached to the upload as the entry to which the file being uploaded belongs. Otherwise, just the file +written to the stream will be uploaded, and given a default entry as determined by the server.

+

slug +, content_type + and content_length + must be specified before the upload begins, as they describe the file being streamed. slug + is the filename +given to the file, which will typically be stored on the server and made available when downloading the file again. content_type + must be the +correct content type for the file, and should be in the service's list of acceptable content types. content_length + must be the size of the file +being uploaded (not including the XML for any associated GDataEntry) in bytes. Zero is accepted if a metadata-only upload is being performed.

+

As well as the standard GIO errors, calls to the GOutputStream API on a GDataUploadStream can also return any relevant specific error from +GDataServiceError, or GDATA_SERVICE_ERROR_PROTOCOL_ERROR in the general case.

+

If a GCancellable is provided in cancellable +, the upload operation may be cancelled at any time from another thread using g_cancellable_cancel(). +In this case, any ongoing network activity will be stopped, and any pending or future calls to GOutputStream API on the GDataUploadStream will +return G_IO_ERROR_CANCELLED. Note that the GCancellable objects which can be passed to individual GOutputStream operations will not cancel the +upload operation proper if cancelled — they will merely cancel that API call. The only way to cancel the upload operation completely is using this +cancellable +.

+

Note that network communication won't begin until the first call to g_output_stream_write() on the GDataUploadStream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

service

a GDataService

 

domain

the GDataAuthorizationDomain to authorize the upload, or NULL.

[allow-none]

method

the HTTP method to use

 

upload_uri

the URI to upload

 

entry

the entry to upload as metadata, or NULL.

[allow-none]

slug

the file's slug (filename)

 

content_type

the content type of the file being uploaded

 

content_length

the size (in bytes) of the file being uploaded

 

cancellable

a GCancellable for the entire upload stream, or NULL.

[allow-none]
+
+
+

Returns

+

a new GOutputStream, or NULL; unref with g_object_unref()

+
+

Since: 0.13.0

+
+
+
+

gdata_upload_stream_get_response ()

+
const gchar *
+gdata_upload_stream_get_response (GDataUploadStream *self,
+                                  gssize *length);
+

Returns the server's response to the upload operation performed by the GDataUploadStream. If the operation +is still underway, or the server's response hasn't been received yet, NULL is returned and length + is set to -1.

+

If there was an error during the upload operation (but it is complete), NULL is returned, and length + is set to 0.

+

While it is safe to call this function from any thread at any time during the network operation, the only way to guarantee that the response has +been set before calling this function is to have closed the GDataUploadStream by calling g_output_stream_close() on it, without cancelling +the close operation. Once the stream has been closed, all network communication is guaranteed to have finished. Note that if a call to +g_output_stream_close() is cancelled, g_output_stream_is_closed() will immediately start to return TRUE, even if the GDataUploadStream is still +attempting to flush the network buffers asynchronously — consequently, gdata_upload_stream_get_response() may still return NULL and a length + of

+-1. The only reliable way to determine if the stream has been fully closed in this situation is to check the results +

of gdata_upload_stream_get_response(), rather than g_output_stream_is_closed().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataUploadStream

 

length

return location for the length of the response, or NULL.

[allow-none][out caller-allocates]
+
+
+

Returns

+

the server's response to the upload, or NULL

+
+

Since: 0.5.0

+
+
+
+

gdata_upload_stream_get_service ()

+
GDataService *
+gdata_upload_stream_get_service (GDataUploadStream *self);
+

Gets the service used to authorize the upload, as passed to gdata_upload_stream_new().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataUploadStream

 
+
+
+

Returns

+

the GDataService used to authorize the upload.

+

[transfer none]

+
+

Since: 0.5.0

+
+
+
+

gdata_upload_stream_get_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_upload_stream_get_authorization_domain
+                               (GDataUploadStream *self);
+

Gets the authorization domain used to authorize the upload, as passed to gdata_upload_stream_new(). It may be NULL if authorization is not +needed for the upload.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataUploadStream

 
+
+
+

Returns

+

the GDataAuthorizationDomain used to authorize the upload, or NULL.

+

[transfer none][allow-none]

+
+

Since: 0.9.0

+
+
+
+

gdata_upload_stream_get_cancellable ()

+
GCancellable *
+gdata_upload_stream_get_cancellable (GDataUploadStream *self);
+

Gets the GCancellable for the entire upload operation, “cancellable”.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataUploadStream

 
+
+
+

Returns

+

the GCancellable for the entire upload operation.

+

[transfer none]

+
+

Since: 0.8.0

+
+
+
+

gdata_upload_stream_get_method ()

+
const gchar *
+gdata_upload_stream_get_method (GDataUploadStream *self);
+

Gets the HTTP request method being used to upload the file, as passed to gdata_upload_stream_new().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataUploadStream

 
+
+
+

Returns

+

the HTTP request method in use

+
+

Since: 0.7.0

+
+
+
+

gdata_upload_stream_get_upload_uri ()

+
const gchar *
+gdata_upload_stream_get_upload_uri (GDataUploadStream *self);
+

Gets the URI the file is being uploaded to, as passed to gdata_upload_stream_new().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataUploadStream

 
+
+
+

Returns

+

the URI which the file is being uploaded to

+
+

Since: 0.5.0

+
+
+
+

gdata_upload_stream_get_entry ()

+
GDataEntry *
+gdata_upload_stream_get_entry (GDataUploadStream *self);
+

Gets the entry being used to upload metadata, if one was passed to gdata_upload_stream_new().

+
+

Parameters

+
+++++ + + + + + +

self

a GDataUploadStream

 
+
+
+

Returns

+

the entry used for metadata, or NULL.

+

[transfer none]

+
+

Since: 0.5.0

+
+
+
+

gdata_upload_stream_get_slug ()

+
const gchar *
+gdata_upload_stream_get_slug (GDataUploadStream *self);
+

Gets the slug (filename) of the file being uploaded.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataUploadStream

 
+
+
+

Returns

+

the slug of the file being uploaded

+
+

Since: 0.5.0

+
+
+
+

gdata_upload_stream_get_content_type ()

+
const gchar *
+gdata_upload_stream_get_content_type (GDataUploadStream *self);
+

Gets the content type of the file being uploaded.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataUploadStream

 
+
+
+

Returns

+

the content type of the file being uploaded

+
+

Since: 0.5.0

+
+
+
+

gdata_upload_stream_get_content_length ()

+
goffset
+gdata_upload_stream_get_content_length
+                               (GDataUploadStream *self);
+

Gets the size (in bytes) of the file being uploaded. This will be -1 for a non-resumable upload, and zero or greater +for a resumable upload.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataUploadStream

 
+
+
+

Returns

+

the size of the file being uploaded

+
+

Since: 0.13.0

+
+
+
+

Types and Values

+
+

GDATA_LINK_RESUMABLE_CREATE_MEDIA

+
#define GDATA_LINK_RESUMABLE_CREATE_MEDIA "http://schemas.google.com/g/2005#resumable-create-media"
+
+

The relation type URI of the resumable upload location for resources attached to this resource.

+

For more information, see the

+GData resumable upload protocol +specification. +

Since: 0.13.0

+
+
+
+

GDATA_LINK_RESUMABLE_EDIT_MEDIA

+
#define GDATA_LINK_RESUMABLE_EDIT_MEDIA "http://schemas.google.com/g/2005#resumable-edit-media"
+
+

The relation type URI of the resumable update location for resources attached to this resource.

+

For more information, see the

+GData resumable upload protocol +specification. +

Since: 0.13.0

+
+
+
+

GDataUploadStream

+
typedef struct _GDataUploadStream GDataUploadStream;
+

All the fields in the GDataUploadStream structure are private and should never be accessed directly.

+

Since: 0.5.0

+
+
+
+

GDataUploadStreamClass

+
typedef struct {
+} GDataUploadStreamClass;
+
+

All the fields in the GDataUploadStreamClass structure are private and should never be accessed directly.

+

Since: 0.5.0

+
+
+
+

Property Details

+
+

The “authorization-domain” property

+
  “authorization-domain”     GDataAuthorizationDomain *
+

The authorization domain for the upload, against which the “authorizer” for the “service” should be +authorized. This may be NULL if authorization is not needed for the upload.

+

Flags: Read / Write / Construct Only

+

Since: 0.9.0

+
+
+
+

The “cancellable” property

+
  “cancellable”              GCancellable *
+

An optional cancellable used to cancel the entire upload operation. If a GCancellable instance isn't provided for this property at +construction time (i.e. to gdata_upload_stream_new()), one will be created internally and can be retrieved using +gdata_upload_stream_get_cancellable() and used to cancel the upload operation with g_cancellable_cancel() just as if it was passed to +gdata_upload_stream_new().

+

If the upload operation is cancelled using this GCancellable, any ongoing network activity will be stopped, and any pending or future calls +to GOutputStream API on the GDataUploadStream will return G_IO_ERROR_CANCELLED. Note that the GCancellable objects which can be passed +to individual GOutputStream operations will not cancel the upload operation proper if cancelled — they will merely cancel that API call. +The only way to cancel the upload operation completely is using “cancellable”.

+

Flags: Read / Write / Construct Only

+

Since: 0.8.0

+
+
+
+

The “content-length” property

+
  “content-length”           gint64
+

The content length (in bytes) of the file being uploaded (i.e. as returned by g_file_info_get_size()). Note that this does not include the +length of the XML serialisation of “entry”, if set.

+

If this is -1 the upload will be non-resumable; if it is non-negative, the upload will be resumable.

+

Flags: Read / Write / Construct Only

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.13.0

+
+
+
+

The “content-type” property

+
  “content-type”             gchar *
+

The content type of the file being uploaded (i.e. as returned by g_file_info_get_content_type()).

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “entry” property

+
  “entry”                    GDataEntry *
+

The entry used for metadata to upload.

+

Flags: Read / Write / Construct Only

+

Since: 0.5.0

+
+
+
+

The “method” property

+
  “method”                   gchar *
+

The HTTP request method to use when uploading the file.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.7.0

+
+
+
+

The “service” property

+
  “service”                  GDataService *
+

The service which is used to authorize the upload, and to which the upload relates.

+

Flags: Read / Write / Construct Only

+

Since: 0.5.0

+
+
+
+

The “slug” property

+
  “slug”                     gchar *
+

The slug of the file being uploaded. This is usually the display name of the file (i.e. as returned by g_file_info_get_display_name()).

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+

The “upload-uri” property

+
  “upload-uri”               gchar *
+

The URI to upload the data and metadata to. This must be HTTPS.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.5.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataYouTubeCategory.html b/docs/reference/html/GDataYouTubeCategory.html new file mode 100644 index 0000000..c28a5a9 --- /dev/null +++ b/docs/reference/html/GDataYouTubeCategory.html @@ -0,0 +1,284 @@ + + + + +GDataYouTubeCategory: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataYouTubeCategory

+

GDataYouTubeCategory — YouTube category element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Properties

+
+++++ + + + + + + + + + + + + +
gbooleanis-assignableRead
gbooleanis-deprecatedRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataYouTubeCategory
 GDataYouTubeCategoryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataCategory
+            ╰── GDataYouTubeCategory
+
+
+
+

Implemented Interfaces

+

+GDataYouTubeCategory implements + GDataComparable.

+
+
+

Includes

+
#include <gdata/services/youtube/gdata-youtube-category.h>
+
+
+
+

Description

+

GDataYouTubeCategory represents the YouTube-specific customizations to GDataCategory. For more information, +see the +online documentation.

+
+
+

Functions

+
+

gdata_youtube_category_is_assignable ()

+
gboolean
+gdata_youtube_category_is_assignable (GDataYouTubeCategory *self);
+

Gets the “is-assignable” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeCategory

 
+
+
+

Returns

+

whether new videos can be assigned to the category

+
+

Since: 0.7.0

+
+
+
+

gdata_youtube_category_is_browsable ()

+
gboolean
+gdata_youtube_category_is_browsable (GDataYouTubeCategory *self,
+                                     const gchar *region);
+

Returns whether the category is browsable in the given region +. The list of supported region IDs is

+available online. +
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeCategory

 

region

a two-letter region ID

 
+
+
+

Returns

+

whether the category is browsable in region +

+
+

Since: 0.7.0

+
+
+
+

gdata_youtube_category_is_deprecated ()

+
gboolean
+gdata_youtube_category_is_deprecated (GDataYouTubeCategory *self);
+

Gets the “is-deprecated” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeCategory

 
+
+
+

Returns

+

whether the category is deprecated

+
+

Since: 0.7.0

+
+
+
+

Types and Values

+
+

GDataYouTubeCategory

+
typedef struct _GDataYouTubeCategory GDataYouTubeCategory;
+

All the fields in the GDataYouTubeCategory structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

GDataYouTubeCategoryClass

+
typedef struct {
+} GDataYouTubeCategoryClass;
+
+

All the fields in the GDataYouTubeCategoryClass structure are private and should never be accessed directly.

+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “is-assignable” property

+
  “is-assignable”            gboolean
+

Whether new videos can be added to the category.

+

Flags: Read

+

Default value: FALSE

+

Since: 0.7.0

+
+
+
+

The “is-deprecated” property

+
  “is-deprecated”            gboolean
+

Whether the category is deprecated.

+

Flags: Read

+

Default value: TRUE

+

Since: 0.7.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataYouTubeComment.html b/docs/reference/html/GDataYouTubeComment.html new file mode 100644 index 0000000..bdb5fc9 --- /dev/null +++ b/docs/reference/html/GDataYouTubeComment.html @@ -0,0 +1,269 @@ + + + + +GDataYouTubeComment: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataYouTubeComment

+

GDataYouTubeComment — GData YouTube comment object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
+GDataYouTubeComment * + +gdata_youtube_comment_new () +
const gchar * + +gdata_youtube_comment_get_parent_comment_uri () +
+void + +gdata_youtube_comment_set_parent_comment_uri () +
+
+
+

Properties

+
+++++ + + + + + +
+gchar *parent-comment-uriRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataYouTubeComment
 GDataYouTubeCommentClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataComment
+                ╰── GDataYouTubeComment
+
+
+
+

Includes

+
#include <gdata/services/youtube/gdata-youtube-comment.h>
+
+
+
+

Description

+

GDataYouTubeComment is a subclass of GDataComment to represent a comment on a GDataYouTubeVideo. It is returned by the GDataCommentable +interface implementation on GDataYouTubeVideo.

+

It's possible to query for and add GDataYouTubeComments, but it is not possible to delete GDataYouTubeComments from any video +using the GData API.

+

Comments on YouTube videos can be arranged in a hierarchy by their “parent-comment-uri”s. If a +GDataYouTubeComment's parent comment URI is non-NULL, it should match the GDATA_LINK_SELF GDataLink of another GDataYouTubeComment on +the same video (as retrieved using gdata_entry_look_up_link() on the comments). Comments with “parent-comment-uri” set to NULL +are top-level comments.

+
+
+

Functions

+
+

gdata_youtube_comment_new ()

+
GDataYouTubeComment *
+gdata_youtube_comment_new (const gchar *id);
+

Creates a new GDataYouTubeComment with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the comment's ID, or NULL

 
+
+
+

Returns

+

a new GDataYouTubeComment; unref with g_object_unref()

+
+

Since: 0.10.0

+
+
+
+

gdata_youtube_comment_get_parent_comment_uri ()

+
const gchar *
+gdata_youtube_comment_get_parent_comment_uri
+                               (GDataYouTubeComment *self);
+

Gets the “parent-comment-uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeComment

 
+
+
+

Returns

+

the parent comment URI, or NULL

+
+

Since: 0.10.0

+
+
+
+

gdata_youtube_comment_set_parent_comment_uri ()

+
void
+gdata_youtube_comment_set_parent_comment_uri
+                               (GDataYouTubeComment *self,
+                                const gchar *parent_comment_uri);
+

Sets the “parent-comment-uri” property to parent_comment_uri +.

+

Set parent_comment_uri + to NULL to unset the “parent-comment-uri” property in the comment (i.e. make the comment a top-level +comment).

+

See the online +documentation for more information.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeComment

 

parent_comment_uri

a new parent comment URI, or NULL

 
+
+

Since: 0.10.0

+
+
+
+

Types and Values

+
+

GDataYouTubeComment

+
typedef struct _GDataYouTubeComment GDataYouTubeComment;
+

All the fields in the GDataYouTubeComment structure are private and should never be accessed directly.

+

Since: 0.10.0

+
+
+
+

GDataYouTubeCommentClass

+
typedef struct {
+} GDataYouTubeCommentClass;
+
+

All the fields in the GDataYouTubeCommentClass structure are private and should never be accessed directly.

+

Since: 0.10.0

+
+
+
+

Property Details

+
+

The “parent-comment-uri” property

+
  “parent-comment-uri”       gchar *
+

The URI of the parent comment to this one, or NULL if this comment is a top-level comment.

+

See the documentation for GDataYouTubeComment for an explanation of the semantics of parent comment URIs.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.10.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataYouTubeContent.html b/docs/reference/html/GDataYouTubeContent.html new file mode 100644 index 0000000..f47c5d2 --- /dev/null +++ b/docs/reference/html/GDataYouTubeContent.html @@ -0,0 +1,201 @@ + + + + +GDataYouTubeContent: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataYouTubeContent

+

GDataYouTubeContent — YouTube content element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+ +
+
+

Properties

+
+++++ + + + + + +
GDataYouTubeFormatformatRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataYouTubeContent
 GDataYouTubeContentClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataMediaContent
+            ╰── GDataYouTubeContent
+
+
+
+

Includes

+
#include <gdata/services/youtube/gdata-youtube-content.h>
+
+
+
+

Description

+

GDataYouTubeContent represents the YouTube-specific customizations to GDataMediaContent. For more information, +see the +online documentation.

+
+
+

Functions

+
+

gdata_youtube_content_get_format ()

+
GDataYouTubeFormat
+gdata_youtube_content_get_format (GDataYouTubeContent *self);
+
+

gdata_youtube_content_get_format has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

Accessing YouTube video content directly is no longer + supported by Google. There is no replacement.

+
+

Gets the “format” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeContent

 
+
+
+

Returns

+

the video format, or GDATA_YOUTUBE_FORMAT_UNKNOWN

+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDataYouTubeContent

+
typedef struct _GDataYouTubeContent GDataYouTubeContent;
+
+

GDataYouTubeContent has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

Accessing YouTube video content directly is no longer + supported by Google. There is no replacement.

+
+

All the fields in the GDataYouTubeContent structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataYouTubeContentClass

+
typedef struct {
+} GDataYouTubeContentClass;
+
+
+

GDataYouTubeContentClass has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

Accessing YouTube video content directly is no longer + supported by Google. There is no replacement.

+
+

All the fields in the GDataYouTubeContentClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “format” property

+
  “format”                   GDataYouTubeFormat
+

The video format of the video object.

+

For more information, see the

+ +YouTube documentation. +
+

GDataYouTubeContent:format has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

Accessing YouTube video content directly is + no longer supported by Google. There is no replacement.

+
+

Flags: Read

+

Default value: GDATA_YOUTUBE_FORMAT_UNKNOWN

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataYouTubeCredit.html b/docs/reference/html/GDataYouTubeCredit.html new file mode 100644 index 0000000..45e795d --- /dev/null +++ b/docs/reference/html/GDataYouTubeCredit.html @@ -0,0 +1,218 @@ + + + + +GDataYouTubeCredit: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataYouTubeCredit

+

GDataYouTubeCredit — YouTube credit element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
const gchar * + +gdata_youtube_credit_get_entity_type () +
+
+
+

Properties

+
+++++ + + + + + +
+gchar *entity-typeRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
#defineGDATA_YOUTUBE_CREDIT_ENTITY_PARTNER
 GDataYouTubeCredit
 GDataYouTubeCreditClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataMediaCredit
+            ╰── GDataYouTubeCredit
+
+
+
+

Includes

+
#include <gdata/services/youtube/gdata-youtube-credit.h>
+
+
+
+

Description

+

GDataYouTubeCredit represents the YouTube-specific customizations to GDataMediaCredit. For more information, +see the +online documentation.

+
+
+

Functions

+
+

gdata_youtube_credit_get_entity_type ()

+
const gchar *
+gdata_youtube_credit_get_entity_type (GDataYouTubeCredit *self);
+
+

gdata_youtube_credit_get_entity_type has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is no longer supported by Google. There is no + replacement.

+
+

Gets the “entity-type” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeCredit

 
+
+
+

Returns

+

the type of the credited user (e.g. GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER), or NULL

+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER

+
#define GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER "partner"
+
+
+

GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is no longer supported by Google. There is no + replacement.

+
+

The credited entity is a YouTube partner.

+

Since: 0.7.0

+
+
+
+

GDataYouTubeCredit

+
typedef struct _GDataYouTubeCredit GDataYouTubeCredit;
+
+

GDataYouTubeCredit has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is no longer supported by Google. There is no + replacement.

+
+

All the fields in the GDataYouTubeCredit structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

GDataYouTubeCreditClass

+
typedef struct {
+} GDataYouTubeCreditClass;
+
+
+

GDataYouTubeCreditClass has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is no longer supported by Google. There is no + replacement.

+
+

All the fields in the GDataYouTubeCreditClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “entity-type” property

+
  “entity-type”              gchar *
+

The type of entity who is credited. Currently this can only be GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER, for a YouTube partner.

+

For more information, see the

+ +YouTube documentation. +
+

GDataYouTubeCredit:entity-type has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is no longer supported by Google. There + is no replacement.

+
+

Flags: Read

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataYouTubeFeed.html b/docs/reference/html/GDataYouTubeFeed.html new file mode 100644 index 0000000..6b6e0a0 --- /dev/null +++ b/docs/reference/html/GDataYouTubeFeed.html @@ -0,0 +1,113 @@ + + + + +GDataYouTubeFeed: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataYouTubeFeed

+

GDataYouTubeFeed — GData YouTube feed object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataYouTubeFeed
 GDataYouTubeFeedClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataFeed
+            ╰── GDataYouTubeFeed
+
+
+
+

Includes

+
#include <gdata/services/youtube/gdata-youtube-feed.h>
+
+
+
+

Description

+

GDataYouTubeFeed is a list of entries (GDataYouTubeVideo subclasses) +returned as the result of a query to a GDataYouTubeService, or given as the +input to another operation on the online service.

+

Each GDataYouTubeVideo represents a single video on YouTube, and the +GDataYouTubeFeed represents a collection of those objects.

+
+
+

Functions

+

+
+
+

Types and Values

+
+

GDataYouTubeFeed

+
typedef struct _GDataYouTubeFeed GDataYouTubeFeed;
+

All the fields in the GDataYouTubeFeed structure are private and should +never be accessed directly.

+

Since: 0.17.0

+
+
+
+

GDataYouTubeFeedClass

+
typedef struct {
+} GDataYouTubeFeedClass;
+
+

All the fields in the GDataYouTubeFeedClass structure are private and should +never be accessed directly.

+

Since: 0.17.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataYouTubeQuery.html b/docs/reference/html/GDataYouTubeQuery.html new file mode 100644 index 0000000..d31425e --- /dev/null +++ b/docs/reference/html/GDataYouTubeQuery.html @@ -0,0 +1,1502 @@ + + + + +GDataYouTubeQuery: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataYouTubeQuery

+

GDataYouTubeQuery — GData YouTube query object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataYouTubeQuery * + +gdata_youtube_query_new () +
+GDataYouTubeAge + +gdata_youtube_query_get_age () +
+void + +gdata_youtube_query_set_age () +
+GDataYouTubeFormat + +gdata_youtube_query_get_format () +
+void + +gdata_youtube_query_set_format () +
const gchar * + +gdata_youtube_query_get_language () +
+void + +gdata_youtube_query_set_language () +
const gchar * + +gdata_youtube_query_get_license () +
+void + +gdata_youtube_query_set_license () +
+void + +gdata_youtube_query_get_location () +
+void + +gdata_youtube_query_set_location () +
const gchar * + +gdata_youtube_query_get_order_by () +
+void + +gdata_youtube_query_set_order_by () +
const gchar * + +gdata_youtube_query_get_restriction () +
+void + +gdata_youtube_query_set_restriction () +
+GDataYouTubeSafeSearch + +gdata_youtube_query_get_safe_search () +
+void + +gdata_youtube_query_set_safe_search () +
+GDataYouTubeSortOrder + +gdata_youtube_query_get_sort_order () +
+void + +gdata_youtube_query_set_sort_order () +
+GDataYouTubeUploader + +gdata_youtube_query_get_uploader () +
+void + +gdata_youtube_query_set_uploader () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GDataYouTubeAgeageRead / Write
GDataYouTubeFormatformatRead / Write
gbooleanhas-locationRead / Write
+gchar *languageRead / Write
gdoublelatitudeRead / Write
+gchar *licenseRead / Write
gdoublelocation-radiusRead / Write
gdoublelongitudeRead / Write
+gchar *order-byRead / Write
+gchar *restrictionRead / Write
GDataYouTubeSafeSearchsafe-searchRead / Write
GDataYouTubeSortOrdersort-orderRead / Write
GDataYouTubeUploaderuploaderRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 GDataYouTubeQuery
 GDataYouTubeQueryClass
enumGDataYouTubeAge
enumGDataYouTubeFormat
enumGDataYouTubeSafeSearch
enumGDataYouTubeSortOrder
enumGDataYouTubeUploader
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataQuery
+        ╰── GDataYouTubeQuery
+
+
+
+

Includes

+
#include <gdata/services/youtube/gdata-youtube-query.h>
+
+
+
+

Description

+

GDataYouTubeQuery represents a collection of query parameters specific to the YouTube service, which go above and beyond +those catered for by GDataQuery.

+

With the transition to version 3 of the YouTube, the “author” and +“start-index” properties are no longer supported, and their values +will be ignored. Use gdata_query_next_page() instead of the +“start-index” API.

+

For more information on the custom GData query parameters supported by GDataYouTubeQuery, see the online documentation.

+
+
+

Functions

+
+

gdata_youtube_query_new ()

+
GDataYouTubeQuery *
+gdata_youtube_query_new (const gchar *q);
+

Creates a new GDataYouTubeQuery with its “q” property set to q +.

+
+

Parameters

+
+++++ + + + + + +

q

a query string, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataYouTubeQuery

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_get_age ()

+
GDataYouTubeAge
+gdata_youtube_query_get_age (GDataYouTubeQuery *self);
+

Gets the “age” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeQuery

 
+
+
+

Returns

+

the age property

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_set_age ()

+
void
+gdata_youtube_query_set_age (GDataYouTubeQuery *self,
+                             GDataYouTubeAge age);
+

Sets the “age” property of the GDataYouTubeQuery to age +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

age

the new age

 
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_get_format ()

+
GDataYouTubeFormat
+gdata_youtube_query_get_format (GDataYouTubeQuery *self);
+
+

gdata_youtube_query_get_format has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Gets the “format” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeQuery

 
+
+
+

Returns

+

the format property

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_set_format ()

+
void
+gdata_youtube_query_set_format (GDataYouTubeQuery *self,
+                                GDataYouTubeFormat format);
+
+

gdata_youtube_query_set_format has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Sets the “format” property of the GDataYouTubeQuery to format +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

format

the requested video format

 
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_get_language ()

+
const gchar *
+gdata_youtube_query_get_language (GDataYouTubeQuery *self);
+
+

gdata_youtube_query_get_language has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Gets the “language” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeQuery

 
+
+
+

Returns

+

the language property, or NULL if it is unset

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_set_language ()

+
void
+gdata_youtube_query_set_language (GDataYouTubeQuery *self,
+                                  const gchar *language);
+
+

gdata_youtube_query_set_language has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Sets the “language” property of the GDataYouTubeQuery to the new language, language +.

+

Set language + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

language

a new language name, or NULL.

[allow-none]
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_get_license ()

+
const gchar *
+gdata_youtube_query_get_license (GDataYouTubeQuery *self);
+

Gets the “license” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeQuery

 
+
+
+

Returns

+

the license property, or NULL if it is unset

+
+

Since: 0.11.0

+
+
+
+

gdata_youtube_query_set_license ()

+
void
+gdata_youtube_query_set_license (GDataYouTubeQuery *self,
+                                 const gchar *license);
+

Sets the “license” property of the GDataYouTubeQuery to the new license value, license +.

+

Set license + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

license

a new license value, or NULL.

[allow-none]
+
+

Since: 0.11.0

+
+
+
+

gdata_youtube_query_get_location ()

+
void
+gdata_youtube_query_get_location (GDataYouTubeQuery *self,
+                                  gdouble *latitude,
+                                  gdouble *longitude,
+                                  gdouble *radius,
+                                  gboolean *has_location);
+

Gets the location-based properties of the GDataYouTubeQuery: “latitude”, “longitude”, +“location-radius” and “has-location”.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

latitude

a location in which to return the latitude, or NULL.

[out caller-allocates][allow-none]

longitude

a location in which to return the longitude, or NULL.

[out caller-allocates][allow-none]

radius

a location in which to return the location radius, or NULL.

[out caller-allocates][allow-none]

has_location

a location in which to return TRUE if the query is searching for videos with a specific +location, FALSE otherwise, or NULL.

[out caller-allocates][allow-none]
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_set_location ()

+
void
+gdata_youtube_query_set_location (GDataYouTubeQuery *self,
+                                  gdouble latitude,
+                                  gdouble longitude,
+                                  gdouble radius,
+                                  gboolean has_location);
+

Sets the location-based properties of the GDataYouTubeQuery: “latitude”, “longitude”, +“location-radius” and “has-location”.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

latitude

the new latitude, or G_MAXDOUBLE

 

longitude

the new longitude, or G_MAXDOUBLE

 

radius

the new location radius, or 0

 

has_location

TRUE if the query is for videos with a specific location, FALSE otherwise

 
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_get_order_by ()

+
const gchar *
+gdata_youtube_query_get_order_by (GDataYouTubeQuery *self);
+

Gets the “order-by” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeQuery

 
+
+
+

Returns

+

the order by property, or NULL if it is unset

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_set_order_by ()

+
void
+gdata_youtube_query_set_order_by (GDataYouTubeQuery *self,
+                                  const gchar *order_by);
+

Sets the “order-by” property of the GDataYouTubeQuery to the new order by string, order_by +.

+

Set order_by + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

order_by

a new order by string, or NULL.

[allow-none]
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_get_restriction ()

+
const gchar *
+gdata_youtube_query_get_restriction (GDataYouTubeQuery *self);
+

Gets the “restriction” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeQuery

 
+
+
+

Returns

+

the restriction property, or NULL if it is unset

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_set_restriction ()

+
void
+gdata_youtube_query_set_restriction (GDataYouTubeQuery *self,
+                                     const gchar *restriction);
+

Sets the “restriction” property of the GDataYouTubeQuery to the new restriction string, restriction +.

+

Set restriction + to NULL to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

restriction

a new restriction string, or NULL.

[allow-none]
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_get_safe_search ()

+
GDataYouTubeSafeSearch
+gdata_youtube_query_get_safe_search (GDataYouTubeQuery *self);
+

Gets the “safe-search” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeQuery

 
+
+
+

Returns

+

the safe search property

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_set_safe_search ()

+
void
+gdata_youtube_query_set_safe_search (GDataYouTubeQuery *self,
+                                     GDataYouTubeSafeSearch safe_search);
+

Sets the “safe-search” property of the GDataYouTubeQuery to safe_search +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

safe_search

a new safe search level

 
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_get_sort_order ()

+
GDataYouTubeSortOrder
+gdata_youtube_query_get_sort_order (GDataYouTubeQuery *self);
+
+

gdata_youtube_query_get_sort_order has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Gets the “sort-order” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeQuery

 
+
+
+

Returns

+

the sort order property

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_set_sort_order ()

+
void
+gdata_youtube_query_set_sort_order (GDataYouTubeQuery *self,
+                                    GDataYouTubeSortOrder sort_order);
+
+

gdata_youtube_query_set_sort_order has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Sets the “sort-order” property of the GDataYouTubeQuery to sort_order +.

+

Set sort_order + to GDATA_YOUTUBE_SORT_NONE to unset the property in the query URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

sort_order

the new sort order

 
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_get_uploader ()

+
GDataYouTubeUploader
+gdata_youtube_query_get_uploader (GDataYouTubeQuery *self);
+
+

gdata_youtube_query_get_uploader has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Gets the “uploader” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeQuery

 
+
+
+

Returns

+

the uploader property

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_query_set_uploader ()

+
void
+gdata_youtube_query_set_uploader (GDataYouTubeQuery *self,
+                                  GDataYouTubeUploader uploader);
+
+

gdata_youtube_query_set_uploader has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Sets the “uploader” property of the GDataYouTubeQuery to uploader +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeQuery

 

uploader

the new uploader

 
+
+

Since: 0.3.0

+
+
+
+

Types and Values

+
+

GDataYouTubeQuery

+
typedef struct _GDataYouTubeQuery GDataYouTubeQuery;
+

All the fields in the GDataYouTubeQuery structure are private and should never be accessed directly.

+

Since: 0.3.0

+
+
+
+

GDataYouTubeQueryClass

+
typedef struct {
+} GDataYouTubeQueryClass;
+
+

All the fields in the GDataYouTubeQueryClass structure are private and should never be accessed directly.

+

Since: 0.3.0

+
+
+
+

enum GDataYouTubeAge

+

GDataYouTubeAge is deprecated and should not be used in newly-written code.

+

Video ages, allowing queries to be limited to videos uploaded in a recent time period.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

GDATA_YOUTUBE_AGE_ALL_TIME

+

retrieve all videos, regardless of the date they were uploaded

+
 

GDATA_YOUTUBE_AGE_TODAY

+

retrieve only videos uploaded in the past day

+
 

GDATA_YOUTUBE_AGE_THIS_WEEK

+

retrieve only videos uploaded in the past week

+
 

GDATA_YOUTUBE_AGE_THIS_MONTH

+

retrieve only videos uploaded in the past month

+
 
+
+

Since: 0.3.0

+
+
+
+

enum GDataYouTubeFormat

+
+

GDataYouTubeFormat has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

Accessing YouTube video content directly is no longer + supported by Google. There is no replacement.

+
+

Video formats available on YouTube. For more information, see the

+online documentation. +
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

GDATA_YOUTUBE_FORMAT_UNKNOWN

+

retrieve videos in all formats when querying the service

+
 

GDATA_YOUTUBE_FORMAT_RTSP_H263_AMR

+

RTSP streaming URI for mobile video playback; H.263 video (up to 176×144) and AMR audio

+
 

GDATA_YOUTUBE_FORMAT_HTTP_SWF

+

HTTP URI to the embeddable player (SWF) for this video

+
 

GDATA_YOUTUBE_FORMAT_RTSP_MPEG4_AAC

+

RTSP streaming URI for mobile video playback; MPEG-4 SP video (up to 176×144) and AAC audio

+
 
+
+

Since: 0.3.0

+
+
+
+

enum GDataYouTubeSafeSearch

+

Safe search levels for removing restricted entries from query results. For more information, see the

+online documentation. +
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GDATA_YOUTUBE_SAFE_SEARCH_NONE

+

YouTube will not perform any filtering on the search result set

+
 

GDATA_YOUTUBE_SAFE_SEARCH_MODERATE

+

YouTube will filter some content from search results and, at the least, +will filter content that is restricted in your locale

+
 

GDATA_YOUTUBE_SAFE_SEARCH_STRICT

+

YouTube will try to exclude all restricted content from the search result set

+
 
+
+

Since: 0.3.0

+
+
+
+

enum GDataYouTubeSortOrder

+
+

GDataYouTubeSortOrder has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. There is no + replacement.

+
+

Sort orders for the search results from queries. They specify the order of the designated order field.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GDATA_YOUTUBE_SORT_NONE

+

do not explicitly sort in any sense

+
 

GDATA_YOUTUBE_SORT_ASCENDING

+

sort results in ascending order of the order field

+
 

GDATA_YOUTUBE_SORT_DESCENDING

+

sort results in descending order of the order field

+
 
+
+

Since: 0.3.0

+
+
+
+

enum GDataYouTubeUploader

+
+

GDataYouTubeUploader has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. There is no + replacement.

+
+

Video uploaders, allowing queries to be limited to returning videos uploaded by YouTube partners.

+
+

Members

+
+++++ + + + + + + + + + + + + +

GDATA_YOUTUBE_UPLOADER_ALL

+

retrieve all videos, regardless of who uploaded them

+
 

GDATA_YOUTUBE_UPLOADER_PARTNER

+

retrieve only videos uploaded by YouTube partners

+
 
+
+

Since: 0.3.0

+
+
+
+

Property Details

+
+

The “age” property

+
  “age”                      GDataYouTubeAge
+

Restricts the search to videos uploaded within the specified time period. To retrieve videos irrespective of their +age, set the property to GDATA_YOUTUBE_AGE_ALL_TIME.

+

Flags: Read / Write

+

Default value: GDATA_YOUTUBE_AGE_ALL_TIME

+

Since: 0.3.0

+
+
+
+

The “format” property

+
  “format”                   GDataYouTubeFormat
+

Specifies that videos must be available in a particular video format. Use GDATA_YOUTUBE_FORMAT_UNKNOWN to +retrieve videos irrespective of their format availability.

+
+

GDataYouTubeQuery:format has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Flags: Read / Write

+

Default value: GDATA_YOUTUBE_FORMAT_UNKNOWN

+

Since: 0.3.0

+
+
+
+

The “has-location” property

+
  “has-location”             gboolean
+

Whether to restrict search results to videos with specific coordinates associated with them. If used with a given +“latitude” and “longitude”, only videos with specific coordinates (not those with merely +a descriptive address) will be returned. If used without a latitude and longitude set, only videos with specific coordinates +(regardless of those coordinates) will be returned.

+

For more information, see the documentation for “latitude”.

+
+

GDataYouTubeQuery:has-location has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries.

+
+

Flags: Read / Write

+

Default value: FALSE

+

Since: 0.3.0

+
+
+
+

The “language” property

+
  “language”                 gchar *
+

Restricts the search to videos that have a title, description or keywords in a specified language. The language code should +be a two-letter ISO 639-1 code; or you can use zh-Hans for simplified Chinese and zh-Hant +for traditional Chinese.

+

For more information, see the online documentation.

+
+

GDataYouTubeQuery:language has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.3.0

+
+
+
+

The “latitude” property

+
  “latitude”                 gdouble
+

The latitude of a particular location of which videos should be found. This should be used in conjunction with +“longitude”; if either property is outside the valid range, neither will be used. Valid latitudes +are between -90 and 900 degrees; any values of this property outside that range +will unset the property in the query URI.

+

If “location-radius” is a non-0 value, this will define a circle from which videos should be +found.

+

As it is deprecated, the value of “has-location” is +ignored.

+

For more information, see the online documentation.

+

Flags: Read / Write

+

Default value: 1.79769e+308

+

Since: 0.3.0

+
+
+
+

The “license” property

+
  “license”                  gchar *
+

The content license which should be used to filter search results. If set to, for example, GDATA_YOUTUBE_LICENSE_CC, only videos which +are Creative Commons licensed will be returned in search results. Set this to NULL to return videos under any license.

+

For more information, see the online documentation.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.11.0

+
+
+
+

The “location-radius” property

+
  “location-radius”          gdouble
+

The radius, in metres, of a circle from within which videos should be returned. The circle is centred on the latitude and +longitude given in “latitude” and “longitude”.

+

Set this property to 0 to search for specific coordinates, rather than within a given radius.

+

For more information, see the documentation for “latitude”.

+

Flags: Read / Write

+

Allowed values: >= 0

+

Default value: 0

+

Since: 0.3.0

+
+
+
+

The “longitude” property

+
  “longitude”                gdouble
+

The longitude of a particular location of which videos should be found. This should be used in conjunction with +“latitude”; if either property is outside the valid range, neither will be used. Valid longitudes +are between -180 and 180 degrees; any values of this property outside that +range will unset the property in the query URI.

+

For more information, see the documentation for “latitude”.

+

Flags: Read / Write

+

Default value: 1.79769e+308

+

Since: 0.3.0

+
+
+
+

The “order-by” property

+
  “order-by”                 gchar *
+

Specifies the order of entries in a feed. Supported values are relevance, +published, viewCount and rating.

+

Additionally, results most relevant to a specific language can be returned by setting the property +to relevance_lang_languageCode, where +languageCode is an ISO 639-1 language code, as used in “language”.

+

For more information, see the online documentation.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.3.0

+
+
+
+

The “restriction” property

+
  “restriction”              gchar *
+

An ISO 3166 two-letter country code that should be used to filter +videos playable only in specific countries.

+

Previously, this property could also accept the client’s IP address +for country lookup. This feature is no longer supported by Google, +and will result in an error from the server if used. Use a country +code instead.

+

For more information, see the online documentation.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.3.0

+
+
+
+

The “safe-search” property

+
  “safe-search”              GDataYouTubeSafeSearch
+

Whether the search results should include restricted content as well as standard content.

+

For more information, see the online documentation.

+

Flags: Read / Write

+

Default value: GDATA_YOUTUBE_SAFE_SEARCH_MODERATE

+

Since: 0.3.0

+
+
+
+

The “sort-order” property

+
  “sort-order”               GDataYouTubeSortOrder
+

Specifies the direction of sorting. To use the default sort order, set the property to GDATA_YOUTUBE_SORT_NONE.

+
+

GDataYouTubeQuery:sort-order has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Flags: Read / Write

+

Default value: GDATA_YOUTUBE_SORT_NONE

+

Since: 0.3.0

+
+
+
+

The “uploader” property

+
  “uploader”                 GDataYouTubeUploader
+

Restricts the search to videos from the specified type of uploader. Currently, this can only be used to restrict +searches to videos from YouTube partners.

+
+

GDataYouTubeQuery:uploader has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. The value of + this property will be unused in queries. There is no replacement.

+
+

Flags: Read / Write

+

Default value: GDATA_YOUTUBE_UPLOADER_ALL

+

Since: 0.3.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataYouTubeService.html b/docs/reference/html/GDataYouTubeService.html new file mode 100644 index 0000000..bbfaca6 --- /dev/null +++ b/docs/reference/html/GDataYouTubeService.html @@ -0,0 +1,1652 @@ + + + + +GDataYouTubeService: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataYouTubeService

+

GDataYouTubeService — GData YouTube service object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+ +
+

Properties

+
+++++ + + + + + +
+gchar *developer-keyRead / Write / Construct Only
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataService
+        ╰── GDataYouTubeService
+
+
+
+

Implemented Interfaces

+

+GDataYouTubeService implements + GDataBatchable.

+
+
+

Includes

+
#include <gdata/services/youtube/gdata-youtube-service.h>
+
+
+
+

Description

+

GDataYouTubeService is a subclass of GDataService for communicating with the GData API of YouTube. It supports querying for and +uploading videos using version 3 of the API.

+

The YouTube API supports returning different sets of properties for +GDataYouTubeVideos depending on the specific query. For search results, only +‘snippet’ properties are returned (including “title”, +“summary” and the set of thumbnails). For querying single videos, +a more complete set of properties are returned — so use +gdata_service_query_single_entry_async() to get further details on a video.

+

For more details of YouTube's GData API, see the +online documentation.

+
+

Example 11. Getting a Localized List of YouTube Categories

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
GDataYouTubeService *service;
+GDataAPPCategories *app_categories;
+GList *categories, *i;
+
+/* Create a service and set its locale to Italian, which localizes the categories to Italian */
+service = create_youtube_service ();
+gdata_service_set_locale (GDATA_SERVICE (service), "it");
+
+/* Query the server for the current list of YouTube categories (in Italian) */
+app_categories = gdata_youtube_service_get_categories (service, NULL, NULL);
+categories = gdata_app_categories_get_categories (app_categories);
+
+/* Iterate through the categories */
+for (i = categories; i != NULL; i = i->next) {
+    GDataYouTubeCategory *category = GDATA_YOUTUBE_CATEGORY (i->data);
+
+    if (gdata_youtube_category_is_deprecated (category) == FALSE && gdata_youtube_category_is_browsable (category, "IT") == TRUE) {
+        /* Do something with the category here, as it's not deprecated, and is browsable in the given region */
+        add_to_ui (gdata_category_get_term (GDATA_CATEGORY (category)), gdata_category_get_label (GDATA_CATEGORY (category)));
+    }
+}
+
+g_object_unref (app_categories);
+g_object_unref (service);
+
+ +
+
+

Example 12. Uploading a Video from Disk

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
GDataYouTubeService *service;
+GDataYouTubeVideo *video, *uploaded_video;
+GDataMediaCategory *category;
+const gchar * const tags[] = { "tag1", "tag2", NULL };
+GFile *video_file;
+GFileInfo *file_info;
+const gchar *slug, *content_type;
+GFileInputStream *file_stream;
+GDataUploadStream *upload_stream;
+GError *error = NULL;
+
+/* Create a service */
+service = create_youtube_service ();
+
+/* Get the video file to upload */
+video_file = g_file_new_for_path ("sample.ogg");
+
+/* Get the file's display name and content type */
+file_info = g_file_query_info (video_file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+                               G_FILE_QUERY_INFO_NONE, NULL, &error);
+
+if (error != NULL) {
+    g_error ("Error getting video file information: %s", error->message);
+    g_error_free (error);
+    g_object_unref (video_file);
+    g_object_unref (service);
+    return;
+}
+
+slug = g_file_info_get_display_name (file_info);
+content_type = g_file_info_get_content_type (file_info);
+
+/* Get an input stream for the file */
+file_stream = g_file_read (video_file, NULL, &error);
+
+g_object_unref (video_file);
+
+if (error != NULL) {
+    g_error ("Error getting video file stream: %s", error->message);
+    g_error_free (error);
+    g_object_unref (file_info);
+    g_object_unref (service);
+    return;
+}
+
+/* Create the video to upload */
+video = gdata_youtube_video_new (NULL);
+
+gdata_entry_set_title (GDATA_ENTRY (video), "Video Title");
+gdata_youtube_video_set_description (video, "Video description.");
+gdata_youtube_video_set_keywords (video, video_tags);
+
+category = gdata_media_category_new ("People", "http://gdata.youtube.com/schemas/2007/categories.cat", NULL);
+gdata_youtube_video_set_category (video, category);
+g_object_unref (category);
+
+/* Get an upload stream for the video */
+upload_stream = gdata_youtube_service_upload_video (service, video, slug, content_type, NULL, &error);
+
+g_object_unref (video);
+g_object_unref (file_info);
+
+if (error != NULL) {
+    g_error ("Error getting upload stream: %s", error->message);
+    g_error_free (error);
+    g_object_unref (file_stream);
+    g_object_unref (service);
+    return;
+}
+
+/* Upload the video. This is a blocking operation, and should normally be done asynchronously. */
+g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), G_INPUT_STREAM (file_stream),
+                        G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error);
+
+g_object_unref (file_stream);
+
+if (error != NULL) {
+    g_error ("Error splicing streams: %s", error->message);
+    g_error_free (error);
+    g_object_unref (upload_stream);
+    g_object_unref (service);
+    return;
+}
+
+/* Finish off the upload by parsing the returned updated video entry */
+uploaded_video = gdata_youtube_service_finish_video_upload (service, upload_stream, &error);
+
+g_object_unref (upload_stream);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error uploading video: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Do something with the uploaded video */
+
+g_object_unref (uploaded_video);
+
+ +
+
+

Example 13. Querying for Videos from a Standard Feed

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
GDataYouTubeService *service;
+GDataFeed *feed;
+GList *i;
+GError *error = NULL;
+
+/* Create a service */
+service = create_youtube_service ();
+
+/* Query for the top page of videos in the most popular feed */
+feed = gdata_youtube_service_query_standard_feed (service, GDATA_YOUTUBE_MOST_POPULAR_FEED, NULL, NULL, NULL, NULL, &error);
+
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error querying for most popular videos: %s", error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Iterate through the videos */
+for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) {
+    GDataYouTubeVideo *video = GDATA_YOUTUBE_VIDEO (i->data);
+
+    /* Do something with the video, like insert it into the UI */
+}
+
+g_object_unref (feed);
+
+ +
+
+

Example 14. Querying for Videos using Search Terms

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
GDataYouTubeService *service;
+GDataYouTubeQuery *query;
+GDataFeed *feed;
+GList *i;
+GError *error = NULL;
+
+/* Create a service */
+service = create_youtube_service ();
+
+/* Build a query with the given search terms, also matching only videos which are CC-licensed */
+query = gdata_youtube_query_new (my_space_separated_search_terms);
+gdata_youtube_query_set_license (query, GDATA_YOUTUBE_LICENSE_CC);
+
+/* Query for the videos matching the query parameters */
+feed = gdata_youtube_service_query_videos (service, query, NULL, NULL, NULL, &error);
+
+g_object_unref (query);
+g_object_unref (service);
+
+if (error != NULL) {
+    g_error ("Error querying for videos matching search terms ‘%s’: %s", my_space_separated_search_terms, error->message);
+    g_error_free (error);
+    return;
+}
+
+/* Iterate through the videos */
+for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) {
+    GDataYouTubeVideo *video = GDATA_YOUTUBE_VIDEO (i->data);
+
+    /* Do something with the video, like insert it into the UI */
+}
+
+g_object_unref (feed);
+
+ +
+
+
+
+

Functions

+
+

gdata_youtube_service_new ()

+
GDataYouTubeService *
+gdata_youtube_service_new (const gchar *developer_key,
+                           GDataAuthorizer *authorizer);
+

Creates a new GDataYouTubeService using the given GDataAuthorizer. If authorizer + is NULL, all requests are made as an unauthenticated user. +The developer_key + must be unique for your application, and as

+registered with Google. +
+

Parameters

+
+++++ + + + + + + + + + + + + +

developer_key

your application's developer API key

 

authorizer

a GDataAuthorizer to authorize the service's requests, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataYouTubeService, or NULL; unref with g_object_unref()

+
+

Since: 0.9.0

+
+
+
+

gdata_youtube_service_get_primary_authorization_domain ()

+
GDataAuthorizationDomain *
+gdata_youtube_service_get_primary_authorization_domain
+                               (void);
+

The primary GDataAuthorizationDomain for interacting with YouTube. This will not normally need to be used, as it's used internally +by the GDataYouTubeService methods. However, if using the plain GDataService methods to implement custom queries or requests which libgdata +does not support natively, then this domain may be needed to authorize the requests.

+

The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.

+
+

Returns

+

the service's authorization domain.

+

[transfer none]

+
+

Since: 0.9.0

+
+
+
+

gdata_youtube_service_query_videos ()

+
GDataFeed *
+gdata_youtube_service_query_videos (GDataYouTubeService *self,
+                                    GDataQuery *query,
+                                    GCancellable *cancellable,
+                                    GDataQueryProgressCallback progress_callback,
+                                    gpointer progress_user_data,
+                                    GError **error);
+

Queries the service for videos matching the parameters set on the GDataQuery. This searches site-wide, and imposes no other restrictions or +parameters on the query.

+

Parameters and errors are as for gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results, or NULL; unref with g_object_unref().

+

[transfer full]

+
+
+
+
+

gdata_youtube_service_query_videos_async ()

+
void
+gdata_youtube_service_query_videos_async
+                               (GDataYouTubeService *self,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service for videos matching the parameters set on the GDataQuery. This searches site-wide, and imposes no other restrictions or +parameters on the query. self + and query + are both reffed when this function is called, so can safely be freed after this function returns.

+

For more details, see gdata_youtube_service_query_videos(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_service_query_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_youtube_service_query_related ()

+
GDataFeed *
+gdata_youtube_service_query_related (GDataYouTubeService *self,
+                                     GDataYouTubeVideo *video,
+                                     GDataQuery *query,
+                                     GCancellable *cancellable,
+                                     GDataQueryProgressCallback progress_callback,
+                                     gpointer progress_user_data,
+                                     GError **error);
+

Queries the service for videos related to video +. The algorithm determining which videos are related is on the server side.

+

Parameters and other errors are as for gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeService

 

video

a GDataYouTubeVideo for which to find related videos

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results; unref with g_object_unref().

+

[transfer full]

+
+
+
+
+

gdata_youtube_service_query_related_async ()

+
void
+gdata_youtube_service_query_related_async
+                               (GDataYouTubeService *self,
+                                GDataYouTubeVideo *video,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service for videos related to video +. The algorithm determining which videos are related is on the server side. +self + and query + are both reffed when this function is called, so can safely be freed after this function returns.

+

For more details, see gdata_youtube_service_query_related(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_service_query_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

video

a GDataYouTubeVideo for which to find related videos

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_youtube_service_query_standard_feed ()

+
GDataFeed *
+gdata_youtube_service_query_standard_feed
+                               (GDataYouTubeService *self,
+                                GDataYouTubeStandardFeedType feed_type,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GError **error);
+

Queries the service's standard feed_type + feed to build a GDataFeed.

+

Note that with the port from v2 to v3 of the YouTube API in libgdata +0.17.0, all feed types except GDATA_YOUTUBE_MOST_POPULAR_FEED have been +deprecated. Other feed types will now transparently return +GDATA_YOUTUBE_MOST_POPULAR_FEED, limited to the past 24 hours.

+

Parameters and errors are as for gdata_service_query().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeService

 

feed_type

the feed type to query, from GDataYouTubeStandardFeedType

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][scope call][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataFeed of query results, or NULL; unref with g_object_unref().

+

[transfer full]

+
+
+
+
+

gdata_youtube_service_query_standard_feed_async ()

+
void
+gdata_youtube_service_query_standard_feed_async
+                               (GDataYouTubeService *self,
+                                GDataYouTubeStandardFeedType feed_type,
+                                GDataQuery *query,
+                                GCancellable *cancellable,
+                                GDataQueryProgressCallback progress_callback,
+                                gpointer progress_user_data,
+                                GDestroyNotify destroy_progress_user_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Queries the service's standard feed_type + feed to build a GDataFeed. self + and +query + are both reffed when this function is called, so can safely be freed after this function returns.

+

For more details, see gdata_youtube_service_query_standard_feed(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_service_query_finish() +to get the results of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataService

 

feed_type

the feed type to query, from GDataYouTubeStandardFeedType

 

query

a GDataQuery with the query parameters, or NULL.

[allow-none]

cancellable

optional GCancellable object, or NULL.

[allow-none]

progress_callback

a GDataQueryProgressCallback to call when an entry is loaded, or NULL.

[allow-none][closure progress_user_data]

progress_user_data

data to pass to the progress_callback +function.

[closure]

destroy_progress_user_data

the function to call when progress_callback +will not be called any more, or NULL. This function will be +called with progress_user_data +as a parameter and can be used to free any memory allocated for it.

[allow-none]

callback

a GAsyncReadyCallback to call when authentication is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.9.1

+
+
+
+

gdata_youtube_service_upload_video ()

+
GDataUploadStream *
+gdata_youtube_service_upload_video (GDataYouTubeService *self,
+                                    GDataYouTubeVideo *video,
+                                    const gchar *slug,
+                                    const gchar *content_type,
+                                    GCancellable *cancellable,
+                                    GError **error);
+

Uploads a video to YouTube, using the properties from video + and the file data written to the resulting GDataUploadStream.

+

If video + has already been inserted, a GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED error will be returned. If no user is authenticated +with the service, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED will be returned.

+

The stream returned by this function should be written to using the standard GOutputStream methods, asychronously or synchronously. Once the stream +is closed (using g_output_stream_close()), gdata_youtube_service_finish_video_upload() should be called on it to parse and return the updated +GDataYouTubeVideo for the uploaded video. This must be done, as video + isn't updated in-place.

+

In order to cancel the upload, a GCancellable passed in to cancellable + must be cancelled using g_cancellable_cancel(). Cancelling the individual +GOutputStream operations on the GDataUploadStream will not cancel the entire upload; merely the write or close operation in question. See the +“cancellable” for more details.

+

Any upload errors will be thrown by the stream methods, and may come from the GDataServiceError domain.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeService

 

video

a GDataYouTubeVideo to insert

 

slug

the filename to give to the uploaded file

 

content_type

the content type of the uploaded data

 

cancellable

a GCancellable for the entire upload stream, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataUploadStream to write the video data to, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_youtube_service_finish_video_upload ()

+
GDataYouTubeVideo *
+gdata_youtube_service_finish_video_upload
+                               (GDataYouTubeService *self,
+                                GDataUploadStream *upload_stream,
+                                GError **error);
+

Finish off a video upload operation started by gdata_youtube_service_upload_video(), parsing the result and returning the new GDataYouTubeVideo.

+

If an error occurred during the upload operation, it will have been returned during the operation (e.g. by g_output_stream_splice() or one +of the other stream methods). In such a case, NULL will be returned but error + will remain unset. error + is only set in the case that the server +indicates that the operation was successful, but an error is encountered in parsing the result sent by the server.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeService

 

upload_stream

the GDataUploadStream from the operation

 

error

a GError, or NULL

 
+
+
+

Returns

+

the new GDataYouTubeVideo, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.8.0

+
+
+
+

gdata_youtube_service_get_categories ()

+
GDataAPPCategories *
+gdata_youtube_service_get_categories (GDataYouTubeService *self,
+                                      GCancellable *cancellable,
+                                      GError **error);
+

Gets a list of the categories currently in use on YouTube. The returned GDataAPPCategories contains a list of GDataYouTubeCategorys which +enumerate the current YouTube categories.

+

The category labels (“label”) are localised based on the value of “locale”.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeService

 

cancellable

a GCancellable, or NULL.

[allow-none]

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataAPPCategories, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.7.0

+
+
+
+

gdata_youtube_service_get_categories_async ()

+
void
+gdata_youtube_service_get_categories_async
+                               (GDataYouTubeService *self,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Gets a list of the categories currently in use on YouTube. self + is reffed when this function is called, so can safely be unreffed after this +function returns.

+

For more details, see gdata_youtube_service_get_categories(), which is the synchronous version of this function.

+

When the operation is finished, callback + will be called. You can then call gdata_youtube_service_get_categories_finish() to get the results of the +operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeService

 

cancellable

optional GCancellable object, or NULL.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is finished

 

user_data

data to pass to the callback +function.

[closure]
+
+

Since: 0.7.0

+
+
+
+

gdata_youtube_service_get_categories_finish ()

+
GDataAPPCategories *
+gdata_youtube_service_get_categories_finish
+                               (GDataYouTubeService *self,
+                                GAsyncResult *async_result,
+                                GError **error);
+

Finishes an asynchronous request for a list of categories on YouTube, as started with gdata_youtube_service_get_categories_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeService

 

async_result

a GAsyncResult

 

error

a GError, or NULL

 
+
+
+

Returns

+

a GDataAPPCategories, or NULL; unref with g_object_unref().

+

[transfer full]

+
+

Since: 0.7.0

+
+
+
+

gdata_youtube_service_get_developer_key ()

+
const gchar *
+gdata_youtube_service_get_developer_key
+                               (GDataYouTubeService *self);
+

Gets the “developer-key” property from the GDataYouTubeService.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeService

 
+
+
+

Returns

+

the developer key property

+
+
+
+
+

Types and Values

+
+

GDataYouTubeService

+
typedef struct _GDataYouTubeService GDataYouTubeService;
+

All the fields in the GDataYouTubeService structure are private and should never be accessed directly.

+
+
+
+

GDataYouTubeServiceClass

+
typedef struct {
+} GDataYouTubeServiceClass;
+
+

All the fields in the GDataYouTubeServiceClass structure are private and should never be accessed directly.

+
+
+
+

enum GDataYouTubeServiceError

+

Error codes for GDataYouTubeService operations.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GDATA_YOUTUBE_SERVICE_ERROR_API_QUOTA_EXCEEDED

+

the API request quota for this developer account has been exceeded

+
 

GDATA_YOUTUBE_SERVICE_ERROR_ENTRY_QUOTA_EXCEEDED

+

the entry (e.g. video) quota for this user account has been exceeded

+
 

GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED

+

the currently authenticated user doesn't have a YouTube channel, but the current action requires one; +if this error is received, inform the user that they need a YouTube channel, and provide a link to

+https://www.youtube.com/create_channel +
 
+
+
+
+
+

enum GDataYouTubeStandardFeedType

+

Standard feed types for standard feed queries with +gdata_youtube_service_query_standard_feed(). For more information, see the

+online +documentation. +
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GDATA_YOUTUBE_TOP_RATED_FEED

+

This feed contains the most highly rated + YouTube videos. Deprecated: 0.17.0: Google no longer supports this feed + type, and it will return results equivalent to + GDATA_YOUTUBE_MOST_POPULAR_FEED.

+
 

GDATA_YOUTUBE_TOP_FAVORITES_FEED

+

This feed contains videos most frequently + flagged as favorite videos. Deprecated: 0.17.0: Google no longer + supports this feed type, and it will return results equivalent to + GDATA_YOUTUBE_MOST_POPULAR_FEED.

+
 

GDATA_YOUTUBE_MOST_VIEWED_FEED

+

This feed contains the most frequently + watched YouTube videos. Deprecated: 0.17.0: Google no longer supports + this feed type, and it will return results equivalent to + GDATA_YOUTUBE_MOST_POPULAR_FEED.

+
 

GDATA_YOUTUBE_MOST_POPULAR_FEED

+

This feed contains the most popular YouTube + videos, selected using an algorithm that combines many different signals to + determine overall popularity. As of version 0.17.0, this is the only + supported feed type.

+
 

GDATA_YOUTUBE_MOST_RECENT_FEED

+

This feed contains the videos most recently + submitted to YouTube. Deprecated: 0.17.0: Google no longer supports + this feed type, and it will return results equivalent to + GDATA_YOUTUBE_MOST_POPULAR_FEED.

+
 

GDATA_YOUTUBE_MOST_DISCUSSED_FEED

+

This feed contains the YouTube videos + that have received the most comments. Deprecated: 0.17.0: Google no + longer supports this feed type, and it will return results equivalent to + GDATA_YOUTUBE_MOST_POPULAR_FEED.

+
 

GDATA_YOUTUBE_MOST_LINKED_FEED

+

This feed contains the YouTube videos that + receive the most links from other websites. Deprecated: 0.17.0: Google + no longer supports this feed type, and it will return results equivalent to + GDATA_YOUTUBE_MOST_POPULAR_FEED.

+
 

GDATA_YOUTUBE_MOST_RESPONDED_FEED

+

This feed contains YouTube videos that + receive the most video responses. Deprecated: 0.17.0: Google no longer + supports this feed type, and it will return results equivalent to + GDATA_YOUTUBE_MOST_POPULAR_FEED.

+
 

GDATA_YOUTUBE_RECENTLY_FEATURED_FEED

+

This feed contains videos recently + featured on the YouTube home page or featured videos tab. Deprecated: + 0.17.0: Google no longer supports this feed type, and it will return + results equivalent to GDATA_YOUTUBE_MOST_POPULAR_FEED.

+
 

GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED

+

This feed contains videos suitable for + playback on mobile devices. Deprecated: 0.17.0: Google no longer + supports this feed type, and it will return results equivalent to + GDATA_YOUTUBE_MOST_POPULAR_FEED.

+
 
+
+
+
+
+

Property Details

+
+

The “developer-key” property

+
  “developer-key”            gchar *
+

The developer key your application has registered with the YouTube API. For more information, see the online documentation.

+

With the port from v2 to v3 of the YouTube API in libgdata +0.17.0, it might be necessary to update your application’s +developer key.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataYouTubeState.html b/docs/reference/html/GDataYouTubeState.html new file mode 100644 index 0000000..8e3bb72 --- /dev/null +++ b/docs/reference/html/GDataYouTubeState.html @@ -0,0 +1,336 @@ + + + + +GDataYouTubeState: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataYouTubeState

+

GDataYouTubeState — YouTube state element

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
const gchar * + +gdata_youtube_state_get_name () +
const gchar * + +gdata_youtube_state_get_reason_code () +
const gchar * + +gdata_youtube_state_get_help_uri () +
const gchar * + +gdata_youtube_state_get_message () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
+gchar *help-uriRead / Write / Construct Only
+gchar *messageRead / Write / Construct Only
+gchar *nameRead / Write / Construct Only
+gchar *reason-codeRead / Write / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 GDataYouTubeState
 GDataYouTubeStateClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataYouTubeState
+
+
+
+

Includes

+
#include <gdata/services/youtube/gdata-youtube-state.h>
+
+
+
+

Description

+

GDataYouTubeState represents a "state" element from the

+YouTube namespace. + +
+
+

Functions

+
+

gdata_youtube_state_get_name ()

+
const gchar *
+gdata_youtube_state_get_name (GDataYouTubeState *self);
+

Gets the “name” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeState

 
+
+
+

Returns

+

the status name

+
+

Since: 0.4.0

+
+
+
+

gdata_youtube_state_get_reason_code ()

+
const gchar *
+gdata_youtube_state_get_reason_code (GDataYouTubeState *self);
+

Gets the “reason-code” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeState

 
+
+
+

Returns

+

the status reason code, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_youtube_state_get_help_uri ()

+
const gchar *
+gdata_youtube_state_get_help_uri (GDataYouTubeState *self);
+

Gets the “help-uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeState

 
+
+
+

Returns

+

the help URI, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_youtube_state_get_message ()

+
const gchar *
+gdata_youtube_state_get_message (GDataYouTubeState *self);
+

Gets the “message” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeState

 
+
+
+

Returns

+

the status message, or NULL

+
+

Since: 0.4.0

+
+
+
+

Types and Values

+
+

GDataYouTubeState

+
typedef struct _GDataYouTubeState GDataYouTubeState;
+

All the fields in the GDataYouTubeState structure are private and should never be accessed directly.

+
+
+
+

GDataYouTubeStateClass

+
typedef struct {
+} GDataYouTubeStateClass;
+
+

All the fields in the GDataYouTubeStateClass structure are private and should never be accessed directly.

+

Since: 0.4.0

+
+
+
+

Property Details

+
+

The “help-uri” property

+
  “help-uri”                 gchar *
+

A URI for a YouTube Help Center page that may help the developer or the video owner to diagnose +the reason that an upload failed or was rejected.

+

For more information, see the

+online documentation. +

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “message” property

+
  “message”                  gchar *
+

A human-readable description of why the video failed to upload.

+

For more information, see the

+online documentation. +

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “name” property

+
  “name”                     gchar *
+

The name of the status of the unpublished video. Valid values are: "processing", "restricted", "deleted", "rejected" and "failed".

+

For more information, see the

+online documentation. +

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “reason-code” property

+
  “reason-code”              gchar *
+

The reason code explaining why the video failed to upload.

+

For more information, see the

+online documentation. +

Flags: Read / Write / Construct Only

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/GDataYouTubeVideo.html b/docs/reference/html/GDataYouTubeVideo.html new file mode 100644 index 0000000..f98e82c --- /dev/null +++ b/docs/reference/html/GDataYouTubeVideo.html @@ -0,0 +1,2155 @@ + + + + +GDataYouTubeVideo: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDataYouTubeVideo

+

GDataYouTubeVideo — GData YouTube video object

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GDataYouTubeVideo * + +gdata_youtube_video_new () +
+GDataYouTubeContent * + +gdata_youtube_video_look_up_content () +
+GList * + +gdata_youtube_video_get_thumbnails () +
+GDataMediaCategory * + +gdata_youtube_video_get_category () +
+void + +gdata_youtube_video_set_category () +
+GDataYouTubeCredit * + +gdata_youtube_video_get_credit () +
const gchar * + +gdata_youtube_video_get_description () +
+void + +gdata_youtube_video_set_description () +
+guint + +gdata_youtube_video_get_duration () +
const gchar * const * + +gdata_youtube_video_get_keywords () +
+void + +gdata_youtube_video_set_keywords () +
const gchar * + +gdata_youtube_video_get_location () +
+void + +gdata_youtube_video_set_location () +
+guint + +gdata_youtube_video_get_view_count () +
+guint + +gdata_youtube_video_get_favorite_count () +
+gboolean + +gdata_youtube_video_is_restricted_in_country () +
const gchar * + +gdata_youtube_video_get_media_rating () +
+GDataYouTubePermission + +gdata_youtube_video_get_access_control () +
+void + +gdata_youtube_video_set_access_control () +
const gchar * + +gdata_youtube_video_get_player_uri () +
+gboolean + +gdata_youtube_video_is_private () +
+void + +gdata_youtube_video_set_is_private () +
+gboolean + +gdata_youtube_video_is_draft () +
+void + +gdata_youtube_video_set_is_draft () +
+GDataYouTubeState * + +gdata_youtube_video_get_state () +
+void + +gdata_youtube_video_get_rating () +
+gint64 + +gdata_youtube_video_get_uploaded () +
+gint64 + +gdata_youtube_video_get_recorded () +
+void + +gdata_youtube_video_set_recorded () +
const gchar * + +gdata_youtube_video_get_video_id () +
+gchar * + +gdata_youtube_video_get_video_id_from_uri () +
const gchar * + +gdata_youtube_video_get_aspect_ratio () +
+void + +gdata_youtube_video_set_aspect_ratio () +
+void + +gdata_youtube_video_get_coordinates () +
+void + +gdata_youtube_video_set_coordinates () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *aspect-ratioRead / Write
gdoubleaverage-ratingRead
+GDataMediaCategory *categoryRead / Write
+GDataYouTubeCredit *creditRead
+gchar *descriptionRead / Write
guintdurationRead
guintfavorite-countRead
gbooleanis-draftRead / Write
gbooleanis-privateRead / Write
GStrvkeywordsRead / Write
gdoublelatitudeRead / Write
+gchar *locationRead / Write
gdoublelongitudeRead / Write
guintmax-ratingRead
guintmin-ratingRead
+gchar *player-uriRead
guintrating-countRead
gint64recordedRead / Write
+GDataYouTubeState *stateRead
gint64uploadedRead
+gchar *video-idRead
guintview-countRead
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GDataParsable
+        ╰── GDataEntry
+            ╰── GDataYouTubeVideo
+
+
+
+

Implemented Interfaces

+

+GDataYouTubeVideo implements + GDataCommentable.

+
+
+

Includes

+
#include <gdata/services/youtube/gdata-youtube-video.h>
+
+
+
+

Description

+

GDataYouTubeVideo is a subclass of GDataEntry to represent a single video on YouTube, either when uploading or querying.

+

GDataYouTubeVideo implements GDataCommentable, allowing comments on videos +to be queried and added.

+

For more details of YouTube’s GData API, see the

+ +online documentation. +
+

Example 15. Getting Basic Video Data

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
GDataYouTubeVideo *video;
+const gchar *video_id, *title, *player_uri, *description, *video_uri = NULL;
+gint64 updated, published;
+GDataMediaContent *content;
+GList *thumbnails;
+
+video = gdata_youtube_service_query_single_video (service, NULL, "R-9gzmQHoe0", NULL, NULL);
+
+video_id = gdata_entry_get_id (GDATA_ENTRY (video)); /* e.g. "R-9gzmQHoe0" */
+title = gdata_entry_get_title (GDATA_ENTRY (video)); /* e.g. "Korpiklaani Vodka (official video 2009)" */
+player_uri = gdata_youtube_video_get_player_uri (video); /* e.g. "http://www.youtube.com/watch?v=ZTUVgYoeN_b" */
+description = gdata_youtube_video_get_description (video); /* e.g. "Vodka is the first single from the album..." */
+published = gdata_entry_get_published (GDATA_ENTRY (video)); /* Date and time the video was originally published */
+updated = gdata_entry_get_updated (GDATA_ENTRY (video)); /* When the video was most recently updated by the author */
+
+/* Get a list of GDataMediaThumbnails for the video */
+for (thumbnails = gdata_youtube_video_get_thumbnails (video); thumbnails != NULL; thumbnails = thumbnails->next)
+    download_and_do_something_with_thumbnail (gdata_media_thumbnail_get_uri (thumbnail));
+
+g_object_unref (video);
+
+ +
+
+
+
+

Functions

+
+

gdata_youtube_video_new ()

+
GDataYouTubeVideo *
+gdata_youtube_video_new (const gchar *id);
+

Creates a new GDataYouTubeVideo with the given ID and default properties.

+
+

Parameters

+
+++++ + + + + + +

id

the video's ID, or NULL.

[allow-none]
+
+
+

Returns

+

a new GDataYouTubeVideo; unref with g_object_unref()

+
+
+
+
+

gdata_youtube_video_look_up_content ()

+
GDataYouTubeContent *
+gdata_youtube_video_look_up_content (GDataYouTubeVideo *self,
+                                     const gchar *type);
+
+

gdata_youtube_video_look_up_content has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is no longer supported by Google, and will + always return NULL. To view a video, open the URI returned by + gdata_youtube_video_get_player_uri() in a web browser.

+
+

Looks up a GDataYouTubeContent from the video with the given MIME type. The video's list of contents is +a list of URIs to various formats of the video itself, such as its SWF URI or RTSP stream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

type

the MIME type of the content desired

 
+
+
+

Returns

+

a GDataYouTubeContent matching type +, or NULL.

+

[transfer none]

+
+
+
+
+

gdata_youtube_video_get_thumbnails ()

+
GList *
+gdata_youtube_video_get_thumbnails (GDataYouTubeVideo *self);
+

Gets a list of the thumbnails available for the video.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

a GList of GDataMediaThumbnails, or NULL.

+

[element-type GData.MediaThumbnail][transfer none]

+
+
+
+
+

gdata_youtube_video_get_category ()

+
GDataMediaCategory *
+gdata_youtube_video_get_category (GDataYouTubeVideo *self);
+

Gets the “category” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

a GDataMediaCategory giving the video's single and mandatory category.

+

[transfer none]

+
+
+
+
+

gdata_youtube_video_set_category ()

+
void
+gdata_youtube_video_set_category (GDataYouTubeVideo *self,
+                                  GDataMediaCategory *category);
+

Sets the “category” property to the new category, category +, and increments its reference count.

+

category + must not be NULL. For more information, see the online documentation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

category

a new GDataMediaCategory

 
+
+
+
+
+

gdata_youtube_video_get_credit ()

+
GDataYouTubeCredit *
+gdata_youtube_video_get_credit (GDataYouTubeVideo *self);
+
+

gdata_youtube_video_get_credit has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is no longer supported by Google, and will + always return NULL. There is no replacement.

+
+

Gets the “credit” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

a GDataMediaCredit giving information on whom to credit for the video, or NULL.

+

[transfer none]

+
+
+
+
+

gdata_youtube_video_get_description ()

+
const gchar *
+gdata_youtube_video_get_description (GDataYouTubeVideo *self);
+

Gets the “description” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

the video's long text description, or NULL

+
+
+
+
+

gdata_youtube_video_set_description ()

+
void
+gdata_youtube_video_set_description (GDataYouTubeVideo *self,
+                                     const gchar *description);
+

Sets the “description” property to the new description, description +.

+

Set description + to NULL to unset the video's description.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

description

the video's new description, or NULL.

[allow-none]
+
+
+
+
+

gdata_youtube_video_get_duration ()

+
guint
+gdata_youtube_video_get_duration (GDataYouTubeVideo *self);
+

Gets the “duration” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

the video duration in seconds, or 0 if unknown

+
+
+
+
+

gdata_youtube_video_get_keywords ()

+
const gchar * const *
+gdata_youtube_video_get_keywords (GDataYouTubeVideo *self);
+

Gets the “keywords” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

a NULL-terminated array of words associated with the video.

+

[array zero-terminated=1][transfer none]

+
+
+
+
+

gdata_youtube_video_set_keywords ()

+
void
+gdata_youtube_video_set_keywords (GDataYouTubeVideo *self,
+                                  const gchar * const *keywords);
+

Sets the “keywords” property to the new keyword list, keywords +.

+

keywords + must not be NULL. For more information, see the online documentation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

keywords

a new NULL-terminated array of keywords.

[array zero-terminated=1]
+
+
+
+
+

gdata_youtube_video_get_location ()

+
const gchar *
+gdata_youtube_video_get_location (GDataYouTubeVideo *self);
+

Gets the “location” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

a string describing the video's location, or NULL

+
+
+
+
+

gdata_youtube_video_set_location ()

+
void
+gdata_youtube_video_set_location (GDataYouTubeVideo *self,
+                                  const gchar *location);
+

Sets the “location” property to the new location string, location +.

+

Set location + to NULL to unset the property in the video.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

location

a new location, or NULL.

[allow-none]
+
+
+
+
+

gdata_youtube_video_get_view_count ()

+
guint
+gdata_youtube_video_get_view_count (GDataYouTubeVideo *self);
+

Gets the “view-count” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

the number of times the video has been viewed

+
+
+
+
+

gdata_youtube_video_get_favorite_count ()

+
guint
+gdata_youtube_video_get_favorite_count
+                               (GDataYouTubeVideo *self);
+

Gets the “favorite-count” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

the number of users who have added the video to their favorites list

+
+
+
+
+

gdata_youtube_video_is_restricted_in_country ()

+
gboolean
+gdata_youtube_video_is_restricted_in_country
+                               (GDataYouTubeVideo *self,
+                                const gchar *country);
+

Checks whether viewing of the video is restricted in country +, either by its content rating, or by the request of the producer. +The return value from this function is purely informational, and no obligation is assumed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

country

an ISO 3166 two-letter country code to check

 
+
+
+

Returns

+

TRUE if the video is restricted in country +, FALSE otherwise

+
+

Since: 0.4.0

+
+
+
+

gdata_youtube_video_get_media_rating ()

+
const gchar *
+gdata_youtube_video_get_media_rating (GDataYouTubeVideo *self,
+                                      const gchar *rating_type);
+

Returns the rating of the given type for the video, if one exists. For example, this could be a film rating awarded by the MPAA; or a simple +rating specifying whether the video contains adult content.

+

The valid values for rating_type + are: GDATA_YOUTUBE_RATING_TYPE_MPAA and GDATA_YOUTUBE_RATING_TYPE_V_CHIP. +Further values may be added in future; if an unknown rating type is passed to the function, NULL will be returned.

+

The possible return values depend on what's passed to rating_type +. Valid values for each rating type are listed in the documentation for the +rating types.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

rating_type

the type of rating to retrieve

 
+
+
+

Returns

+

the rating of the video for the given rating_type +, or NULL if the video isn't rated with that type (or the type is unknown)

+
+

Since: 0.10.0

+
+
+
+

gdata_youtube_video_get_access_control ()

+
GDataYouTubePermission
+gdata_youtube_video_get_access_control
+                               (GDataYouTubeVideo *self,
+                                const gchar *action);
+

Gets the permission associated with the given action + on the GDataYouTubeVideo. If the given action + +doesn't have a permission set on the video, GDATA_YOUTUBE_PERMISSION_DENIED is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

action

the action whose permission should be returned

 
+
+
+

Returns

+

the permission associated with action +, or GDATA_YOUTUBE_PERMISSION_DENIED

+
+

Since: 0.7.0

+
+
+
+

gdata_youtube_video_set_access_control ()

+
void
+gdata_youtube_video_set_access_control
+                               (GDataYouTubeVideo *self,
+                                const gchar *action,
+                                GDataYouTubePermission permission);
+

Sets the permission associated with action + on the GDataYouTubeVideo, allowing restriction or derestriction of various +operations on YouTube videos.

+

Note that only GDATA_YOUTUBE_ACTION_RATE and GDATA_YOUTUBE_ACTION_COMMENT actions can have the GDATA_YOUTUBE_PERMISSION_MODERATED permission.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

action

the action whose permission is being set

 

permission

the permission to give to the action

 
+
+

Since: 0.7.0

+
+
+
+

gdata_youtube_video_get_player_uri ()

+
const gchar *
+gdata_youtube_video_get_player_uri (GDataYouTubeVideo *self);
+

Gets the “player-uri” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

a URI where the video is playable in a web browser, or NULL

+
+
+
+
+

gdata_youtube_video_is_private ()

+
gboolean
+gdata_youtube_video_is_private (GDataYouTubeVideo *self);
+

Gets the “is-private” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

TRUE if the video is private, FALSE otherwise

+
+
+
+
+

gdata_youtube_video_set_is_private ()

+
void
+gdata_youtube_video_set_is_private (GDataYouTubeVideo *self,
+                                    gboolean is_private);
+

Sets the “is-private” property to decide whether the video is publicly viewable.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

is_private

whether the video is private

 
+
+
+
+
+

gdata_youtube_video_is_draft ()

+
gboolean
+gdata_youtube_video_is_draft (GDataYouTubeVideo *self);
+
+

gdata_youtube_video_is_draft has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is now equal to + gdata_youtube_video_is_private().

+
+

Gets the “is-draft” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

TRUE if the video is a draft, FALSE otherwise

+
+
+
+
+

gdata_youtube_video_set_is_draft ()

+
void
+gdata_youtube_video_set_is_draft (GDataYouTubeVideo *self,
+                                  gboolean is_draft);
+
+

gdata_youtube_video_set_is_draft has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is now equivalent to + gdata_youtube_video_set_is_private().

+
+

Sets the “is-draft” property to decide whether the video is a draft.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

is_draft

whether the video is a draft

 
+
+
+
+
+

gdata_youtube_video_get_state ()

+
GDataYouTubeState *
+gdata_youtube_video_get_state (GDataYouTubeVideo *self);
+

Gets the “state” property.

+

For more information, see the online documentation.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

a GDataYouTubeState showing the state of the video, or NULL.

+

[transfer none]

+
+
+
+
+

gdata_youtube_video_get_rating ()

+
void
+gdata_youtube_video_get_rating (GDataYouTubeVideo *self,
+                                guint *min,
+                                guint *max,
+                                guint *count,
+                                gdouble *average);
+

Gets various properties of the ratings on the video.

+

Note that this property may not be retrieved when querying for multiple +videos at once, but is guaranteed to be retrieved when querying with +gdata_service_query_single_entry_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

min

return location for the minimum rating value, or NULL.

[out caller-allocates][allow-none]

max

return location for the maximum rating value, or NULL.

[out caller-allocates][allow-none]

count

return location for the number of ratings, or NULL.

[out caller-allocates][allow-none]

average

return location for the average rating value, or NULL.

[out caller-allocates][allow-none]
+
+
+
+
+

gdata_youtube_video_get_uploaded ()

+
gint64
+gdata_youtube_video_get_uploaded (GDataYouTubeVideo *self);
+

Gets the “uploaded” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

the UNIX timestamp for the time the video was uploaded, or -1

+
+
+
+
+

gdata_youtube_video_get_recorded ()

+
gint64
+gdata_youtube_video_get_recorded (GDataYouTubeVideo *self);
+

Gets the “recorded” property. If the property is unset, -1 will be returned.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

the UNIX timestamp for the time the video was recorded, or -1

+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_video_set_recorded ()

+
void
+gdata_youtube_video_set_recorded (GDataYouTubeVideo *self,
+                                  gint64 recorded);
+

Sets the “recorded” property to the new recorded time, recorded +.

+

Set recorded + to -1 to unset the video's recorded time.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

recorded

the video's new recorded time, or -1

 
+
+

Since: 0.3.0

+
+
+
+

gdata_youtube_video_get_video_id ()

+
const gchar *
+gdata_youtube_video_get_video_id (GDataYouTubeVideo *self);
+
+

gdata_youtube_video_get_video_id has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is now equal to “id”.

+
+

Gets the “video-id” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

the video's unique and permanent ID

+
+
+
+
+

gdata_youtube_video_get_video_id_from_uri ()

+
gchar *
+gdata_youtube_video_get_video_id_from_uri
+                               (const gchar *video_uri);
+

Extracts a video ID from a YouTube video player URI. The video ID is in the same form as returned by +gdata_youtube_video_get_video_id(), and the video_uri + should be in the same form as returned by +gdata_youtube_video_get_player_uri().

+

The function will validate whether the URI actually points to a hostname containing youtube +(e.g. youtube.com), and will return NULL if it doesn't.

+

For example:

+
+ + + + + + + +
1
+2
+3
video_id = gdata_youtube_video_get_video_id_from_uri ("http://www.youtube.com/watch?v=BH_vwsyCrTc&feature=featured");
+g_message ("Video ID: %s", video_id); /* Should print: BH_vwsyCrTc */
+g_free (video_id);
+
+ +
+

Parameters

+
+++++ + + + + + +

video_uri

a YouTube video player URI

 
+
+
+

Returns

+

the video ID, or NULL; free with g_free()

+
+

Since: 0.4.0

+
+
+
+

gdata_youtube_video_get_aspect_ratio ()

+
const gchar *
+gdata_youtube_video_get_aspect_ratio (GDataYouTubeVideo *self);
+

Gets the “aspect-ratio” property.

+
+

Parameters

+
+++++ + + + + + +

self

a GDataYouTubeVideo

 
+
+
+

Returns

+

the aspect ratio property, or NULL

+
+

Since: 0.4.0

+
+
+
+

gdata_youtube_video_set_aspect_ratio ()

+
void
+gdata_youtube_video_set_aspect_ratio (GDataYouTubeVideo *self,
+                                      const gchar *aspect_ratio);
+

Sets the “aspect-ratio” property to specify the video's aspect ratio. +If aspect_ratio + is NULL, the property will be unset.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

aspect_ratio

the aspect ratio property, or NULL.

[allow-none]
+
+

Since: 0.4.0

+
+
+
+

gdata_youtube_video_get_coordinates ()

+
void
+gdata_youtube_video_get_coordinates (GDataYouTubeVideo *self,
+                                     gdouble *latitude,
+                                     gdouble *longitude);
+

Gets the “latitude” and “longitude” properties, setting the out parameters to them. If either latitude or +longitude is NULL, that parameter will not be set. If the coordinates are unset, latitude + and longitude + will be set to G_MAXDOUBLE.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

latitude

return location for the latitude, or NULL.

[out caller-allocates][allow-none]

longitude

return location for the longitude, or NULL.

[out caller-allocates][allow-none]
+
+

Since: 0.8.0

+
+
+
+

gdata_youtube_video_set_coordinates ()

+
void
+gdata_youtube_video_set_coordinates (GDataYouTubeVideo *self,
+                                     gdouble latitude,
+                                     gdouble longitude);
+

Sets the “latitude” and “longitude” properties to latitude + and longitude + respectively.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

a GDataYouTubeVideo

 

latitude

the video's new latitude coordinate, or G_MAXDOUBLE

 

longitude

the video's new longitude coordinate, or G_MAXDOUBLE

 
+
+

Since: 0.8.0

+
+
+
+

Types and Values

+
+

GDATA_YOUTUBE_ASPECT_RATIO_WIDESCREEN

+
#define GDATA_YOUTUBE_ASPECT_RATIO_WIDESCREEN "widescreen"
+
+

The aspect ratio for widescreen (16:9) videos.

+

For more information, see the +online documentation.

+

Since: 0.7.0

+
+
+
+

GDATA_YOUTUBE_ACTION_RATE

+
#define GDATA_YOUTUBE_ACTION_RATE "rate"
+
+

An action to rate a video, for use with gdata_youtube_video_set_access_control().

+

Since: 0.7.0

+
+
+
+

GDATA_YOUTUBE_ACTION_COMMENT

+
#define GDATA_YOUTUBE_ACTION_COMMENT "comment"
+
+

An action to comment on a video, for use with gdata_youtube_video_set_access_control().

+

Since: 0.7.0

+
+
+
+

GDATA_YOUTUBE_ACTION_COMMENT_VOTE

+
#define GDATA_YOUTUBE_ACTION_COMMENT_VOTE "commentVote"
+
+

An action to rate other users' comments on a video, for use with gdata_youtube_video_set_access_control().

+

Since: 0.7.0

+
+
+
+

GDATA_YOUTUBE_ACTION_VIDEO_RESPOND

+
#define GDATA_YOUTUBE_ACTION_VIDEO_RESPOND "videoRespond"
+
+

An action to add a video response to a video, for use with gdata_youtube_video_set_access_control().

+

Since: 0.7.0

+
+
+
+

GDATA_YOUTUBE_ACTION_EMBED

+
#define GDATA_YOUTUBE_ACTION_EMBED "embed"
+
+

An action to embed a video on third-party websites, for use with gdata_youtube_video_set_access_control().

+

Since: 0.7.0

+
+
+
+

GDATA_YOUTUBE_ACTION_SYNDICATE

+
#define GDATA_YOUTUBE_ACTION_SYNDICATE "syndicate"
+
+

An action allowing YouTube to show the video on mobile phones and televisions, for use with gdata_youtube_video_set_access_control().

+

Since: 0.7.0

+
+
+
+

GDATA_YOUTUBE_LICENSE_CC

+
#define GDATA_YOUTUBE_LICENSE_CC "cc"
+
+

GDATA_YOUTUBE_LICENSE_CC is deprecated and should not be used in newly-written code.

+

Value for “license” to restrict search results to only videos which are Creative Commons licensed. Specifically, the license +is the Creative Commons Attribution 3.0 Unported license; see the

+YouTube Help for more information. +

Since: 0.11.0

+
+
+
+

GDATA_YOUTUBE_LICENSE_STANDARD

+
#define GDATA_YOUTUBE_LICENSE_STANDARD "youtube"
+
+

Value for “license” to restrict search results to only videos which are under the standard YouTube license.

+

Since: 0.11.0

+
+
+
+

GDATA_YOUTUBE_RATING_TYPE_SIMPLE

+
#define GDATA_YOUTUBE_RATING_TYPE_SIMPLE "simple"
+
+
+

GDATA_YOUTUBE_RATING_TYPE_SIMPLE has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

No longer supported by Google. Calling + gdata_youtube_video_get_media_rating() with this rating type will always + return NULL.

+
+

A rating type to pass to gdata_youtube_video_get_media_rating() for “simple” ratings. The values which can be returned for such ratings are:

+adult and nonadult. +

Since: 0.10.0

+
+
+
+

GDATA_YOUTUBE_RATING_TYPE_MPAA

+
#define GDATA_YOUTUBE_RATING_TYPE_MPAA "mpaa"
+
+

GDATA_YOUTUBE_RATING_TYPE_MPAA is deprecated and should not be used in newly-written code.

+

A rating type to pass to gdata_youtube_video_get_media_rating() for ratings by the MPAA. The +values which can be returned for such ratings are: g, pg,

+pg-13, r and nc-17. +

Since: 0.10.0

+
+
+
+

GDATA_YOUTUBE_RATING_TYPE_V_CHIP

+
#define GDATA_YOUTUBE_RATING_TYPE_V_CHIP "v-chip"
+
+

A rating type to pass to gdata_youtube_video_get_media_rating() for ratings following the FCC

+V-Chip system. The values which can be returned for such ratings are: +tv-y, tv-y7, tv-y7-fv, tv-g, +tv-pg, tv-14 and tv-ma. +

Since: 0.10.0

+
+
+
+

GDataYouTubeVideo

+
typedef struct _GDataYouTubeVideo GDataYouTubeVideo;
+

All the fields in the GDataYouTubeVideo structure are private and should never be accessed directly.

+
+
+
+

GDataYouTubeVideoClass

+
typedef struct {
+} GDataYouTubeVideoClass;
+
+

All the fields in the GDataYouTubeVideoClass structure are private and should never be accessed directly.

+
+
+
+

enum GDataYouTubePermission

+

Permissions for actions which can be set on a GDataYouTubeVideo using gdata_youtube_video_set_access_control().

+

The only actions which can have the GDATA_YOUTUBE_PERMISSION_MODERATED permission are +GDATA_YOUTUBE_ACTION_RATE and GDATA_YOUTUBE_ACTION_COMMENT.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GDATA_YOUTUBE_PERMISSION_ALLOWED

+

the action is allowed for everyone

+
 

GDATA_YOUTUBE_PERMISSION_DENIED

+

the action is denied for everyone

+
 

GDATA_YOUTUBE_PERMISSION_MODERATED

+

the action is moderated by the video owner

+
 
+
+

Since: 0.7.0

+
+
+
+

Property Details

+
+

The “aspect-ratio” property

+
  “aspect-ratio”             gchar *
+

The aspect ratio of the video. A NULL value means the aspect ratio is unknown (it could still be a widescreen video). A value of +GDATA_YOUTUBE_ASPECT_RATIO_WIDESCREEN means the video is definitely widescreen.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 0.4.0

+
+
+
+

The “average-rating” property

+
  “average-rating”           gdouble
+

The average rating of the video, over all the ratings it's received.

+

For more information, see the online documentation.

+

Flags: Read

+

Allowed values: >= 0

+

Default value: 0

+
+
+
+

The “category” property

+
  “category”                 GDataMediaCategory *
+

Specifies a genre or developer tag that describes the video.

+

For more information, see the online documentation.

+

Flags: Read / Write

+
+
+
+

The “credit” property

+
  “credit”                   GDataYouTubeCredit *
+

Identifies the owner of the video.

+
+

GDataYouTubeVideo:credit has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is no longer supported by Google, and + will always be NULL. There is no replacement.

+
+

Flags: Read

+
+
+
+

The “description” property

+
  “description”              gchar *
+

A summary or description of the video.

+

For more information, see the online documentation.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “duration” property

+
  “duration”                 guint
+

The duration of the video in seconds.

+

For more information, see the online documentation.

+

Flags: Read

+

Allowed values: <= G_MAXINT

+

Default value: 0

+
+
+
+

The “favorite-count” property

+
  “favorite-count”           guint
+

The number of users who have added the video to their favorites.

+

For more information, see the online documentation.

+

Flags: Read

+

Default value: 0

+
+
+
+

The “is-draft” property

+
  “is-draft”                 gboolean
+

Indicates whether the video is in draft, or unpublished, status.

+
+

GDataYouTubeVideo:is-draft has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is now equal to + “is-private”.

+
+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “is-private” property

+
  “is-private”               gboolean
+

Indicates whether the video is private.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “keywords” property

+
  “keywords”                 GStrv
+

A NULL-terminated array of words associated with the video.

+

For more information, see the online documentation.

+

Flags: Read / Write

+
+
+
+

The “latitude” property

+
  “latitude”                 gdouble
+

The location as a latitude coordinate associated with this video. Valid latitudes range from -90.0 +to 90.0 inclusive. Set to a value +outside this range to unset the location.

+

For more information, see the

+ +online documentation. +

Flags: Read / Write

+

Allowed values: >= G_MINDOUBLE

+

Default value: 1.79769e+308

+

Since: 0.8.0

+
+
+
+

The “location” property

+
  “location”                 gchar *
+

Descriptive text about the location where the video was taken.

+

For more information, see the online documentation.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “longitude” property

+
  “longitude”                gdouble
+

The location as a longitude coordinate associated with this video. Valid longitudes range from -180.0 +to 180.0 inclusive. Set to a value +outside this range to unset the location.

+

For more information, see the

+ +online documentation. +

Flags: Read / Write

+

Allowed values: >= G_MINDOUBLE

+

Default value: 1.79769e+308

+

Since: 0.8.0

+
+
+
+

The “max-rating” property

+
  “max-rating”               guint
+

The maximum allowed rating for the video.

+

For more information, see the online documentation.

+

Flags: Read

+

Default value: 5

+
+
+
+

The “min-rating” property

+
  “min-rating”               guint
+

The minimum allowed rating for the video.

+

For more information, see the online documentation.

+

Flags: Read

+

Default value: 1

+
+
+
+

The “player-uri” property

+
  “player-uri”               gchar *
+

A URI for a browser-based media player for the full-length video (i.e. the video's page on YouTube).

+

Flags: Read

+

Default value: NULL

+
+
+
+

The “rating-count” property

+
  “rating-count”             guint
+

The number of times the video has been rated.

+

For more information, see the online documentation.

+

Flags: Read

+

Default value: 0

+
+
+
+

The “recorded” property

+
  “recorded”                 gint64
+

Specifies the time the video was originally recorded.

+

For more information, see the online documentation.

+

Flags: Read / Write

+

Allowed values: >= -1

+

Default value: -1

+

Since: 0.3.0

+
+
+
+

The “state” property

+
  “state”                    GDataYouTubeState *
+

Information describing the state of the video. If this is non-NULL, the video is not playable. +It points to a GDataYouTubeState.

+

For more information, see the online documentation.

+

Flags: Read

+
+
+
+

The “uploaded” property

+
  “uploaded”                 gint64
+

Specifies the time the video was originally uploaded to YouTube.

+

For more information, see the online documentation.

+

Flags: Read

+

Allowed values: >= -1

+

Default value: -1

+
+
+
+

The “video-id” property

+
  “video-id”                 gchar *
+

Specifies a unique ID which YouTube uses to identify the video. For example: qz8EfkS4KK0.

+

For more information, see the online documentation.

+
+

GDataYouTubeVideo:video-id has been deprecated since version 0.17.0 and should not be used in newly-written code.

+

This is now equal to “id”.

+
+

Flags: Read

+

Default value: NULL

+
+
+
+

The “view-count” property

+
  “view-count”               guint
+

The number of times the video has been viewed.

+

For more information, see the online documentation.

+

Flags: Read

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/annotation-glossary.html b/docs/reference/html/annotation-glossary.html new file mode 100644 index 0000000..307ee5f --- /dev/null +++ b/docs/reference/html/annotation-glossary.html @@ -0,0 +1,81 @@ + + + + +Annotation Glossary: GData Reference Manual + + + + + + + + + + + + + + + +
+

+Annotation Glossary

+

A

+
allow-none
+

NULL is OK, both for passing and for returning.

+
array
+

Parameter points to an array of items.

+

C

+
closure
+

This parameter is a 'user_data', for callbacks; many bindings can pass NULL here.

+

E

+
element-type
+

Generics and defining elements of containers and arrays.

+

N

+
nullable
+

NULL may be passed as the value in, out, in-out; or as a return value.

+

O

+
out callee-allocates
+

Out parameter, where caller must allocate storage.

+
out caller-allocates
+

Out parameter, where caller must allocate storage.

+

S

+
scope async
+

The callback is valid until first called.

+
scope call
+

The callback is valid only during the call to the method.

+
scope notified
+

The callback is valid until the GDestroyNotify argument is called.

+
Stable
+

The intention of a Stable interface is to enable arbitrary third parties to +develop applications to these interfaces, release them, and have confidence that +they will run on all minor releases of the product (after the one in which the +interface was introduced, and within the same major release). Even at a major +release, incompatible changes are expected to be rare, and to have strong +justifications. +

+

T

+
transfer container
+

Free data container after the code is done.

+
transfer full
+

Free data after the code is done.

+
transfer none
+

Don't free data after the code is done.

+
+ + + \ No newline at end of file diff --git a/docs/reference/html/cancellation.png b/docs/reference/html/cancellation.png new file mode 100644 index 0000000000000000000000000000000000000000..62b8d44344a4994889f99ea6be0e7276d4e2b04b GIT binary patch literal 7849 zcma)h2UwF`w`Bmuh|(l<5dunYB7%yv&^yw5mEL>rp$iBKktTvbKm-J&HcBhb5IFey6&KH$_elX0y#%U0`6Yqxqghj?&nC1xLfk*0uxDN!W}`hh2i>Se8#A|8Hz+bRQbadD%RRZcFhdCx}f^xl^Qgb-fZLjNf7 zkYiyXA+6gtJRan1FZQ_2wlr2%4Nps-A=bn#z96r9Hct2U_O?7BfP4poS>k4zX>Z)P z!N6ej2Xd#g2;V`#X{n?^n=SR!gA}-Z6H8Rk~rY3d{4grG? z5ctcCjHQi@{>AM}grC#ys9@LDhAWxNYO1SST3aWbeWj$N92~fC%K4hkzdn8&9!~AU z9OLmYYHB$0*VNSF;v&<{o8ZoOx@C_ZJ=&8iXnvTkeBb4lF!H$+%Wu!d%*;$9W-KEE z11lTbQE*#SRL4?(c5`zx*B2s)Af(WrXza%iT3T8G^R}ElT@DU3qp0i0`g#-!)rZ+3 zWfUnfZwlPUMqME{GB$2)X_+WDj-~DH>PpYZprNMzhS>ohfAHV|3vyv`(b&j{n}^5A z(GiQq`mX=X7oeNzH#9V)rlDa)7HXB6@Lz0okk{(P$H!MySEni77BFjR2)j6cEgr=A zcP<13_9sWnd6WpZxweg(I}#Bx6rH1J4N639ZLR;&OtYVhvokc(-qjVH8n|`Hq^zhY zy2~mZg<3>EeE86+itg}@4)=KLd=D&JTXZNmpn0_V5@E*+1T2D!wY&1C=d3D!%i-;dJH9j6q0p@v0x}mw* z>0oQApD~h!kdSaoJCfz4a#5QFr-;J4iV8CLA1pQ@uc@(d{!ZaM0pt~d`WW4(;bD)3 z&Uh5R=}1UvemN);dhF@SMOvk* z?4y4CW^+phyfkuK(0nY`@$_R;lMyeC_LZv;IxI^U;}U**G3;#3TqF0<`0Q*l#kwNd>+0%Qk>Ipk=i1bon%erWMkA1#Ha0~#Zq`)$gZ0T~-wo`_ioLzPqPlu=ax$(b z6#}_V@O**vo^|)LmX?;BoE*Q|fY?5adY*(S`-{uO#7#|2#l^+l-Q7F>E#NzB`ZD$> zbpr#NVq;_T@|aP5q~zpoj*bXuu6R&Jzim)pAo$$x-@nt+ZjAWsy9`WDK7_+9v16r# z5x;jZeMU|;PoH}G_{4Wvxw&nA`t(U+E*1ijVM+{VxDSDR(%j;@1%c3A(|Qbn2+|aS z1GeB*+y-wLJYOJygjcb2WoOzd`GsJ9lk!o`G5Z@weSp_kxNnE}_-6JW+EVda`fk|dU5dyrDJ$DOJe+F_5tF8@6CaI-5S48BMq8hKNLBQDI?ZbhMnT zY>8NWaTVtHIln!}?UNM2J!>UED{P3?@Ew1`lk;2QE(hgjWXRGUJ)Qg2!yX}w= znfH|%BM)W7Q;&1xj>**Xh%Dv*8SnwE8{JIc+A;P+qHF<=e#KK;+hj&jeooGkH*ci; zuJ)^ylwRw-c8M@T>Vx;HR;Ft4RLB0>kEqDV^^J|A;Pca?U5_WKs`bJxuBY-$bWx>= zn=jfNhxj#V=g<;*A+E_flHipJ#a|q&Ir;Ze!McRDej7y2KQ=zT3Tlh+TKOW$I?U&1 zM@Pr*&Q4Z#HZ89~c%n3xKfmVc{YRHEq~#`+jFP#FLt!0_c!^btwY3-C1A7nu8R*Y% zgSh`a&;f2{YIu0~=g(I;IW3+T<-&HdAYENub#--peN=7j{p|j_>go|wgcp^gH%Tv} zQKQ+tbCAk1v1Ifi?$_@-gGrLz{b$PuWD8!&#m&lA3wQX|?V-2^&IQvZqDjj1%C++7 zUn<^a4&EY2>8Yu&pKI`7YYWeBX?ZLt_`GLv^4Bl*EaBCGT(Kq7UA#=|J9%^E2EEaUI{<*y%h9!SKUESW72dfk3(=ss5sn!GA)bs3$s+w!T$9FRH&gE**C>5C;w! zEOidm1|7OeVv$wgij6Ae{(doE7}(Y(u^*M@8cIq5M>|EzMc9pv^ghhW536H^ zlv`@5syTv|2xVnucX#)^*8Pj{7bEo~4*h{t5tYU#a^_Y0=RX#U&0m?VVa20FTpaYz zS8=sTNu-Dsu+RPg*u_IFWd8`0v-JCHM-gzfsC&IXxi|E6r@JYSv$u2fNSBz;Te*qx z?!^CD6Kqc4IHCNo{g&w8-HLuk`b$_Y)v0D^#>vm`aQLl4*bxTBo&K(_?%?<5sD>iS z)X~S`Ar)dDh}4>X6y_h;y>Y-TQ500ViuIe@3?a~k&6L*VZqy<7*HW(%L$!j#a>e{A zii+fJ-vD6W+1Xiw0`=tIn1O|iTjZ;IcF8FzgUy?5Yin!GVHcq-f^2MW%gR)EX@Y`+ zt`HM1IDlG`^ZdD>4^}5a%Kd1^CQ78dxguZ{w_oz)t&osV+xfARm{>C)Bn=G@rbimS zf~eMFXRse>WhbqbBvK0#jV007{{e94=TC!MDYTT7`R5-ibh!OCXOsHc%p2V27rGLK z#ct;^8a<)Q3H-=0QMUAKsl;CQCP z&6J}^_iVuYPNBawXL@f*NlElIS|OIcG94fh^!jtf>dVX3%(MGY0zd^w2IJiYiHKzM z&CF)SHd}T($R$^thQ`K(LE#6AMW)F3t+@Zzr@IMQHNyK3<=A%O&l5#$i_1zsTEd+;0G~F4}GBB{Wvx}uj zNJ`Qz)fr2IcQLvt+65dRna;@Uz?Xx|b1eb)K>Zpp;!bzm$Bxg1p75diawWss40uI+ax9==OO6iP zFJ>ku8y!ZAsW{X>81O!F!YnPt#K!u0d#h#&-Qnc?Iwno#1Fp%*Ns?$*5s`!MnfKV_ zhaQZ&?uarKH@nYAt}0CE9BfS44GjS5P7}6H7!J!D+{EET?6uA?0%3Rk#$>K%_v6;r z3j_S;wS(JXG&BR*qLt<4E`X~i(h3wGee1e$ieF5b3pt$mn#%T9U;#ezs0@(B%hzaN zFxUezv9O(Q9Dsq2Nk_s90d3{uE3c~Z02Jj%g=tMyResIH>L^wl zD-Xv&L)~wUyOgZDY_Oe_~hUsjIM0201x7+Vv{etm0Iii?vi} z&%x$gyYr+FkX)70mX`TIo&52W(spntt*qRvu^ZgG?|*Wz0hk-S{ZPTi27|mxb=(q3 z-{yMX%*{=pJTW6CQsOXLN$eUi!S@nrsbxCEzbJvUtM`u{JSY!$b=y1IC2%Ft-L zEm2Ykq@(u&jR$%6vdapjbLL$DWe}nj6l`vM+y_JrIMu_s;N7GEqA$PiNkAZba{^ov zzyug8c>*Zf_ugJd7Z=_3;8VN@NNbU7KAJ>rZS53h$@5srQ|U9u&`@AV$oTn*N*t!8 zr(=K%Vp~H*NT{r$;=ve=sB#!(|Az;zEiP*7=pa#H7iWh?Ngf=_gLz?_t%u!7jIn>~ zdEB#Se|C=m>B|;%!{KmxqHHr6u0iE55O}WDip+H=5hQ%_G;N{%{CEx1htkNC2wDGG zMNd!fZwXX#-uWJScX<$`X-n{tCvLj&?%lhCuf?^|W59gq>Fj*QaGyl7^?%@jXbQ_i zXF%dk*4X_ckh(fM4GayHZl}=-m`%5bg@Hk_wuNQdAAb}yJDo|Sfj9|(M*8n#sS~>b zPw{u9Da8D6d%L@A&`6fJm>6Owr?rnCg)>#A*F)B>nZNkg@R;SUuIH?Y&iP zq^64tpR3m)&Xkc6SQ9`P81ha49DtG@Gb~~*PUbGQb^t9#Y8o2ShX!JLsewU|Fs?MU z*bSTpuhC;)QVUSwl9|})Z^ad09{{6ehV)y0Cm#JYe7UV>Q>B&a@+`-Do!Q}rs%vpJ-?6x?|}kQQBi>}1?t+Yz|9AHV5H~=!j8^X zRzqVDY-L$lS(jCn0dKdB(wKP@z|&<62A~lz&MYRYZJ_zjpHtjQLFML#0ARx7{jswE zN&e-mJd682JWL7KF*QxfTY!?fxLI3AQ3ReG@R=Eyn^(G4Hame6s7k&i?$}A4!q#?i zezLT*)RV$Ydx7nYrvlE67AFj-BamsPrlu1U6V4)2y}cyxPOB>5b%A|51K>c-qo;Z3 z>gL7_bT81l@v@N=?@CHE(Z40)WedRUH-FWZ0nQB!ATZ3MN56&+KzssQ@O-CFK$lw= zh~UprS3ImoOo`rTu(y`IEi6R#VczL*zh#6J|Mhj+LV|$%;_m*zGCp*+B>;%GtYz0n zVq$>1zj*x`7znrM=)Nv)JG;1WsAYLC4=_zjv8Fz|`A~?RUA{G;O?&nqegML8_Vee6 zj(I#D|2SYr*4(-r<1h2?8qM0yj$^-0aq42t{KC`E&#q|a4F(q89h1km zFyZ0hv$JOXcL2G5m`f~}7J;2unN|JhS4_0LaH5p2dGnFC;_VyrE#lzJr>9LG@o1f; zu8hvixVX9Hp-^_6O`moQofG`r-5&%UykAO_(5L@&JFYnr=5|wYn+U;=Vg~o0sol<% zbyFpX+S~J1Q0M`N%QkWOlRZGA!KZGayV(N+>d2u|ZS@CPU)Bk6a8giPXr!knCnGxLC{A`$tIUW1}p zPQ5?#VWhHyl$SiV<7mBR5by_&f_9+r^3bl=&y^_1Vy)fW!sfqR-WQkc=(NiV@dcz5 zz%iY$fO|Ek(~pWXY*}R+ej$1HE>wrmhauqU)B{)@&3|;7q$0eEMRA6y!?A1Q7r+xF)Ywv{VRw#7HE-{Qj@E_J!hM$i16QQZ!qlK%fkb}I#9QW zmxsC~o8y`)>gwl!pPikaDvEjoqXGkUk zuxl>uV$FJUV8td-^MH`KHp8gLt6*mK8jVIbzO{%1le{Gnj6Xj+A&EwC!q~wDd=CG| zGa27ix9{A!BP}g0l<5qqjDbOcL1pnKu;wY2l`3O(Gwh3g|xJ^tgNgr9UY(=gFZ)fbu|Kkkbg!OA&e^nibpDBCN?!MPtp%(B9Yhb zv!+*$Vqjn>C@A0ul+%8gm60(!GBPsro*ipaknC0?EJXSppGm{k3k`{*?H=Yqpg|nR zxy$u^^o3VqsJ$rTWt+?$AW?vzu20pI=LMtHaqV<_7e7_4zM5KCeB(VxVA#ilg)JPy zPeE5^=WU9Fqk{t+ieOEhZt_WFftoC>fXa?l2W^J*bZUtyb&Af&%h%S|*VSJ?E_D?I zwh?fmxnK#$$H(7ZaB$qYvpT@Dp9U5NvYh#WyA;nD2t4EvP&^*j@zb244xqN==jY?+ zlJzUiKoM}bTw2=*Os0okO9sZqi@L&$D>x=;im;QZxzp2A0Kb4n4#)nI{hg3?-t4uU ze5})~$*HQY?h1;yS9$)+1umfng?NIeM_gvy=?mA8+oQm!@mZSyz5qXJZGPV4&sWNp z$3VLbF7FHRmvpD&!078es=tjS9@TC=Ne z@9*zZQc{AR0U}=z4$m(uOT_ymzkcY|-QSHz@(9*rOZnCa;afqotxwRUn!q*ws9GuiS;kxEwBRhXqovu}T2 zU*E)pF92nuxhPUQnpX=1Oc}u)B!&2MfG!{>Km`@G=c79Rz%1u52f(Y%e;dS7K|_Q8 zA#TRsGB`L`MMcHN#s+jXOigD1HjZuF=efSfGXl~djE(U;iXmm(y8jdkFV*2j^=(JH zdVd+xAEFD-hq@YA)&U~7`Limj55rKG6+i1@3$2b6Ek+^BE!Sn_=}qgVwyfy;yke`bHbHIY^|*Q4T5{r!o(I|hg(-^A%#b~ z(?p3)un$X~(^?^`**e^yha;5v{_R_tdgEX@BP*){SyrIUfnxG+Y)c%xUaoi@bRVtW z!8A-s{5NM?nV6W8l9IlC`vw4377BU^|LV&um?xK)l{JT))VbD!b`I!Kf|C*v`D+1! zQrOWKjesLcfK+-T2m#bq74PFDFE0-~Tm#;Ng9Ebb*LBd=$f2BvUSQ*9Lk>;N&F4U^ zSd6wCd~H)R`TF(i$F~F?JZLB^l&#nJ&$b5_xt-lIh;&deNiGqVD+|Fa0pqW!f=1GP z-vDC& + + + +Object Hierarchy: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Object Hierarchy

+
+    GObject
+    ├── GDataParsable
+    │   ├── GDataEntry
+    │   │   ├── GDataAccessRule
+    │   │   │   ├── GDataCalendarAccessRule
+    │   │   │   ╰── GDataDocumentsAccessRule
+    │   │   ├── GDataCalendarCalendar
+    │   │   ├── GDataCalendarEvent
+    │   │   ├── GDataComment
+    │   │   │   ├── GDataPicasaWebComment
+    │   │   │   ╰── GDataYouTubeComment
+    │   │   ├── GDataContactsContact
+    │   │   ├── GDataContactsGroup
+    │   │   ├── GDataDocumentsEntry
+    │   │   │   ├── GDataDocumentsDocument
+    │   │   │   │   ├── GDataDocumentsDrawing
+    │   │   │   │   ├── GDataDocumentsPdf
+    │   │   │   │   ├── GDataDocumentsPresentation
+    │   │   │   │   ├── GDataDocumentsSpreadsheet
+    │   │   │   │   ╰── GDataDocumentsText
+    │   │   │   ╰── GDataDocumentsFolder
+    │   │   ├── GDataFreebaseResult
+    │   │   │   ├── GDataFreebaseSearchResult
+    │   │   │   ╰── GDataFreebaseTopicResult
+    │   │   ├── GDataPicasaWebAlbum
+    │   │   ├── GDataPicasaWebFile
+    │   │   ├── GDataPicasaWebUser
+    │   │   ├── GDataTasksTask
+    │   │   ├── GDataTasksTasklist
+    │   │   ╰── GDataYouTubeVideo
+    │   ├── GDataAPPCategories
+    │   ├── GDataAuthor
+    │   ├── GDataFeed
+    │   │   ├── GDataCalendarFeed
+    │   │   ├── GDataDocumentsFeed
+    │   │   ├── GDataPicasaWebFeed
+    │   │   ╰── GDataYouTubeFeed
+    │   ├── GDataCategory
+    │   │   ╰── GDataYouTubeCategory
+    │   ├── GDataDocumentsMetadata
+    │   ├── GDataGContactCalendar
+    │   ├── GDataGContactEvent
+    │   ├── GDataGContactExternalID
+    │   ├── GDataGContactJot
+    │   ├── GDataGContactLanguage
+    │   ├── GDataGContactRelation
+    │   ├── GDataGContactWebsite
+    │   ├── GDataGDEmailAddress
+    │   ├── GDataGDIMAddress
+    │   ├── GDataGDName
+    │   ├── GDataGDOrganization
+    │   ├── GDataGDPhoneNumber
+    │   ├── GDataGDPostalAddress
+    │   ├── GDataGDReminder
+    │   ├── GDataGDWhen
+    │   ├── GDataGDWhere
+    │   ├── GDataGDWho
+    │   ├── GDataGenerator
+    │   ├── GDataLink
+    │   ├── GDataMediaCategory
+    │   ├── GDataMediaContent
+    │   │   ╰── GDataYouTubeContent
+    │   ├── GDataMediaCredit
+    │   │   ╰── GDataYouTubeCredit
+    │   ├── GDataMediaThumbnail
+    │   ╰── GDataYouTubeState
+    ├── GDataAuthorizationDomain
+    ├── GDataBatchOperation
+    ├── GDataService
+    │   ├── GDataCalendarService
+    │   ├── GDataContactsService
+    │   ├── GDataDocumentsService
+    │   ├── GDataFreebaseService
+    │   ├── GDataPicasaWebService
+    │   ├── GDataTasksService
+    │   ╰── GDataYouTubeService
+    ├── GDataQuery
+    │   ├── GDataCalendarQuery
+    │   ├── GDataContactsQuery
+    │   ├── GDataDocumentsQuery
+    │   ├── GDataFreebaseQuery
+    │   ├── GDataFreebaseSearchQuery
+    │   ├── GDataFreebaseTopicQuery
+    │   ├── GDataPicasaWebQuery
+    │   ├── GDataTasksQuery
+    │   ╰── GDataYouTubeQuery
+    ├── GDataClientLoginAuthorizer
+    ├── GDataDocumentsUploadQuery
+    ├── GInputStream
+    │   ╰── GDataDownloadStream
+    ├── GDataGoaAuthorizer
+    ├── GDataOAuth1Authorizer
+    ├── GDataOAuth2Authorizer
+    ╰── GOutputStream
+        ╰── GDataUploadStream
+    GInterface
+    ├── GDataAccessHandler
+    ├── GDataComparable
+    ├── GDataAuthorizer
+    ├── GDataBatchable
+    ╰── GDataCommentable
+    GBoxed
+    ├── GDataColor
+    ├── GDataFreebaseSearchResultItem
+    ├── GDataFreebaseTopicObject
+    ╰── GDataFreebaseTopicValue
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch02.html b/docs/reference/html/ch02.html new file mode 100644 index 0000000..bc2e1ef --- /dev/null +++ b/docs/reference/html/ch02.html @@ -0,0 +1,61 @@ + + + + +Core API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Core API

+
+
+Version Information +
+
+GDataService — GData service object +
+
+GDataQuery — GData query object +
+
+GDataFeed — GData feed object +
+
+GDataEntry — GData entry object +
+
+GData Types — miscellaneous data types +
+
+GDataParsable — GData parsable object +
+
+GDataDownloadStream — GData download stream object +
+
+GDataUploadStream — GData upload stream object +
+
+GDataComparable — GData comparable interface +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch03.html b/docs/reference/html/ch03.html new file mode 100644 index 0000000..4c5d8d1 --- /dev/null +++ b/docs/reference/html/ch03.html @@ -0,0 +1,37 @@ + + + + +Access Control List API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Access Control List API

+
+
+GDataAccessHandler — GData access handler interface +
+
+GDataAccessRule — GData access rule object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch04.html b/docs/reference/html/ch04.html new file mode 100644 index 0000000..e80c32d --- /dev/null +++ b/docs/reference/html/ch04.html @@ -0,0 +1,37 @@ + + + + +Batch Operation API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Batch Operation API

+
+
+GDataBatchable — GData batch service interface +
+
+GDataBatchOperation — GData batch operation object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch05.html b/docs/reference/html/ch05.html new file mode 100644 index 0000000..ba02d00 --- /dev/null +++ b/docs/reference/html/ch05.html @@ -0,0 +1,49 @@ + + + + +Authentication/Authorization API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Authentication/Authorization API

+
+
+GDataAuthorizer — GData authorization interface +
+
+GDataAuthorizationDomain — GData authorization domain +
+
+GDataClientLoginAuthorizer — GData ClientLogin authorization interface +
+
+GDataGoaAuthorizer — GData GOA authorization interface +
+
+GDataOAuth1Authorizer — GData OAuth 1.0 authorization interface +
+
+GDataOAuth2Authorizer — GData OAuth 2.0 authorization interface +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch06.html b/docs/reference/html/ch06.html new file mode 100644 index 0000000..0ebcaa7 --- /dev/null +++ b/docs/reference/html/ch06.html @@ -0,0 +1,37 @@ + + + + +Comment API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Comment API

+
+
+GDataCommentable — GData commentable interface +
+
+GDataComment — GData comment object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch07.html b/docs/reference/html/ch07.html new file mode 100644 index 0000000..5320a59 --- /dev/null +++ b/docs/reference/html/ch07.html @@ -0,0 +1,43 @@ + + + + +Atom API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Atom API

+
+
+GDataAuthor — Atom author element +
+
+GDataCategory — Atom category element +
+
+GDataGenerator — Atom generator element +
+
+GDataLink — Atom link element +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch08.html b/docs/reference/html/ch08.html new file mode 100644 index 0000000..e5ec08f --- /dev/null +++ b/docs/reference/html/ch08.html @@ -0,0 +1,32 @@ + + + + +Atom Publishing Protocol API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Atom Publishing Protocol API

+
+GDataAPPCategories — GData APP categories object +
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch09.html b/docs/reference/html/ch09.html new file mode 100644 index 0000000..7d1c6d6 --- /dev/null +++ b/docs/reference/html/ch09.html @@ -0,0 +1,61 @@ + + + + +GData API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+GData API

+
+
+GDataGDEmailAddress — GData e-mail address element +
+
+GDataGDIMAddress — GData instant messaging address element +
+
+GDataGDName — GData name element +
+
+GDataGDOrganization — GData organization element +
+
+GDataGDPhoneNumber — GData phone number element +
+
+GDataGDPostalAddress — GData postal address element +
+
+GDataGDReminder — GData reminder element +
+
+GDataGDWhen — GData when element +
+
+GDataGDWhere — GData where element +
+
+GDataGDWho — GData who element +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch10.html b/docs/reference/html/ch10.html new file mode 100644 index 0000000..8bc92c2 --- /dev/null +++ b/docs/reference/html/ch10.html @@ -0,0 +1,52 @@ + + + + +GContact API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+GContact API

+
+
+GDataGContactCalendar — gContact calendar element +
+
+GDataGContactEvent — gContact event element +
+
+GDataGContactExternalID — gContact externalId element +
+
+GDataGContactJot — gContact jot element +
+
+GDataGContactLanguage — gContact language element +
+
+GDataGContactRelation — gContact relation element +
+
+GDataGContactWebsite — gContact website element +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch11.html b/docs/reference/html/ch11.html new file mode 100644 index 0000000..3015168 --- /dev/null +++ b/docs/reference/html/ch11.html @@ -0,0 +1,43 @@ + + + + +Media RSS API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Media RSS API

+
+
+GDataMediaCategory — Media RSS category element +
+
+GDataMediaContent — Media RSS content element +
+
+GDataMediaCredit — Media RSS credit element +
+
+GDataMediaThumbnail — Media RSS thumbnail element +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch12.html b/docs/reference/html/ch12.html new file mode 100644 index 0000000..2717bfd --- /dev/null +++ b/docs/reference/html/ch12.html @@ -0,0 +1,43 @@ + + + + +YouTube API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+YouTube API

+
+
+GDataYouTubeCategory — YouTube category element +
+
+GDataYouTubeContent — YouTube content element +
+
+GDataYouTubeCredit — YouTube credit element +
+
+GDataYouTubeState — YouTube state element +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch13.html b/docs/reference/html/ch13.html new file mode 100644 index 0000000..12cdd3c --- /dev/null +++ b/docs/reference/html/ch13.html @@ -0,0 +1,46 @@ + + + + +YouTube API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+YouTube API

+
+
+GDataYouTubeService — GData YouTube service object +
+
+GDataYouTubeFeed — GData YouTube feed object +
+
+GDataYouTubeQuery — GData YouTube query object +
+
+GDataYouTubeVideo — GData YouTube video object +
+
+GDataYouTubeComment — GData YouTube comment object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch14.html b/docs/reference/html/ch14.html new file mode 100644 index 0000000..63c97da --- /dev/null +++ b/docs/reference/html/ch14.html @@ -0,0 +1,49 @@ + + + + +Google Calendar API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Google Calendar API

+
+
+GDataCalendarService — GData Calendar service object +
+
+GDataCalendarFeed — GData Calendar feed object +
+
+GDataCalendarQuery — GData Calendar query object +
+
+GDataCalendarCalendar — GData Calendar calendar object +
+
+GDataCalendarEvent — GData Calendar event object +
+
+GDataCalendarAccessRule — GData Calendar access rule object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch15.html b/docs/reference/html/ch15.html new file mode 100644 index 0000000..d6436e4 --- /dev/null +++ b/docs/reference/html/ch15.html @@ -0,0 +1,43 @@ + + + + +Google Contacts API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Google Contacts API

+
+
+GDataContactsService — GData Contacts service object +
+
+GDataContactsQuery — GData Contacts query object +
+
+GDataContactsContact — GData Contacts contact object +
+
+GDataContactsGroup — GData Contacts group object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch16.html b/docs/reference/html/ch16.html new file mode 100644 index 0000000..c3b0758 --- /dev/null +++ b/docs/reference/html/ch16.html @@ -0,0 +1,73 @@ + + + + +Google Documents/Drive API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Google Documents/Drive API

+
+
+GDataDocumentsService — GData Documents service object +
+
+GDataDocumentsFeed — GData documents feed object +
+
+GDataDocumentsQuery — GData Documents query object +
+
+GDataDocumentsUploadQuery — GData Documents upload query object +
+
+GDataDocumentsEntry — GData document object abstract class +
+
+GDataDocumentsDocument — GData documents document object +
+
+GDataDocumentsFolder — GData documents folder object +
+
+GDataDocumentsDrawing — GData Documents drawing object +
+
+GDataDocumentsPdf — GData Documents pdf object +
+
+GDataDocumentsPresentation — GData documents presentation object +
+
+GDataDocumentsSpreadsheet — GData Documents spreadsheet object +
+
+GDataDocumentsText — GData Documents text object +
+
+GDataDocumentsMetadata — GData document service metadata class +
+
+GDataDocumentsAccessRule — GData Documents access rule object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch17.html b/docs/reference/html/ch17.html new file mode 100644 index 0000000..b9d00bb --- /dev/null +++ b/docs/reference/html/ch17.html @@ -0,0 +1,52 @@ + + + + +Google PicasaWeb API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Google PicasaWeb API

+
+
+GDataPicasaWebService — GData PicasaWeb service object +
+
+GDataPicasaWebFeed — GData PicasaWeb Feed object +
+
+GDataPicasaWebQuery — GData PicasaWeb query object +
+
+GDataPicasaWebAlbum — GData PicasaWeb album object +
+
+GDataPicasaWebFile — GData PicasaWeb file object +
+
+GDataPicasaWebUser — GData PicasaWeb User object +
+
+GDataPicasaWebComment — GData PicasaWeb comment object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch18.html b/docs/reference/html/ch18.html new file mode 100644 index 0000000..97567ad --- /dev/null +++ b/docs/reference/html/ch18.html @@ -0,0 +1,43 @@ + + + + +Google Tasks API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Google Tasks API

+
+
+GDataTasksService — GData Tasks service object +
+
+GDataTasksQuery — GData Tasks query object +
+
+GDataTasksTasklist — GData Tasks tasklist object +
+
+GDataTasksTask — GData Tasks task object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/ch19.html b/docs/reference/html/ch19.html new file mode 100644 index 0000000..4854b91 --- /dev/null +++ b/docs/reference/html/ch19.html @@ -0,0 +1,52 @@ + + + + +Google Freebase API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Google Freebase API

+
+
+GDataFreebaseService — GData Freebase service object +
+
+GDataFreebaseQuery — GData Freebase query object +
+
+GDataFreebaseResult — GData Freebase result object +
+
+GDataFreebaseTopicQuery — GData Freebase topic query object +
+
+GDataFreebaseTopicResult — GData Freebase topic result object +
+
+GDataFreebaseSearchQuery — GData Freebase query object +
+
+GDataFreebaseSearchResult — GData Freebase search result object +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/data-flow.png b/docs/reference/html/data-flow.png new file mode 100644 index 0000000000000000000000000000000000000000..d1ff178e41fdda781d5a714e6d87e8b7eaba2f39 GIT binary patch literal 24681 zcmd43^;?u(+Xgy-h>C!Opdg}yq=Yom!U%{GDxC__(hML-7zju`w19+kH_{=9bV+yT z(B157{J!rv_8+i+*mFGZf$z*c>%P}o*ShLF&+$=GkRiH4eFcF)5IvDay+9yv4-p8Q zluNkqj_KOf|KJavo#YecOP4Nwd#~)EWo%&$rI{U$$Os-P zGdpjf7e5c-lsm>4U#+E zMj$R+(IJR05?R)~c~dTxUEFo;D1@r)a1>Q6Eo{H`}B~=-E(-# zX1htrsg+0P+?Ja@Fua;26LTnjh`0$Wsjmn|vu2?GbT(OiOhiHPC_xkQMHVMHZ&#GHZ~>?DlX>3C|SL+G;=z&{M+f0n`|_%sdZ!D3?qiN z=1E6YVxq+g-HtHF*%1x;TjUT3Y7n zR{gY^5PQ>ft=|WMkVCT0U6w@bFbE3^i-?Hu^6tzwhwQIUaBhtR&$-!op6b_=2^e0Bbu*@-ACthu!{n%nRS28BR0NDX{w$$L9g zVAvWi`fe*}cF1{mnIWR}J`-8!M3HF^8#}xB*}+Wu%hZ(A)bn-sbAy;mi1-^fqOXQc z6?TgG1_qLlkkAR)r{!bwKfNP4k!a=6{-Ptzzw49*2SP_Q>D zftXh4?L_tIQcr58YIcTRja$%7vw<913X0$NXhIt&e|-wP^-$l$q||b(yi@G>suThz zKI0KQrIDdwU#^~bv8K+OqoyEw2C~Z`vPueL<>-+TtGJ+`ZkWQK0NPf#Rqgqw9K100 zyLW#WGzK`Xk7ujp##$z*v)$%1qo`L_QmAs?6|$c6c*dwz<0krt1y3UEBV5nQ!jf*c z(6PTZw!Oa}=;v2dSU8j7xZK;^(BNso&zu?`e-Kxq0&@t&n}G z-GV}*w7)`(5JN~aE*@T)p6gDx%-g~by7ueiF(Z-1`VC)U`3nQ^5E7r^K8*DAiEy9p z?rt$LF;Y^}(Zis!90POnkyJ&xew;_*&O3`Xi(Plqm5)|SCOFjdJkYlg2)G@^yLazC zeE2YsqqDuWb+p|nj%MnB#4J8Mr{$aV=CXd3(NHtNQ&zj37d3 z><31|v$eGq)0a6Ac3hS7vrw0z+-pUX?nUC1IK=Y4Pv}Jc2Kto(}~DPYxI2_{@5lx$D*RT<2zH>hIAgr&YTi=V%toW%jwj ztdI9r4QOF`IN^CEG_xJrzHxaG(-!>vDTZDSjgB6{Z11d%Rcw8FH23Yn>pFpn_lbRG zaDnsDj%mLQB0frT;KLPO$F)&C_tU=K-krtn#6hQ*qV2JwF3Y{?F#ku79>M(o-GUx& z!JMgh{MHXf15Pb2nLM+C&hYh(g%lhBF1!9Ec!Tz>6%e?5-d z@T=^-;bL>D99xxkA5_9vg`*>;pPhw;<<6Zu3=E!VBqB|>3oUV;qf^0ezo=BKS!L3l z;C6bHAAq-V^Tv&pv5Jx>A&i}|qJ+f69qsLga3C^B?PVp~qGyYmz-Ao}pji5Ej8f4~G~*?VODKJhJ^dwXIIE8mn^ zbqd}zAMIi^;9@fzxY!65-niqtjlI2y+evADJ{Lw%>2dMfpKQLg~?`X7OOXYV72(|Og-}qIzs#U>{t7AR8fqm7<(D^r@<noKLt2E>v&=qXYTm_;7-4XB-~a|@f_n-=^E>nO62G!4Em_d`6&7xT z*}!?EV%O}ge78M0`O203CPIQhhoHr>JK-^t!uLF|OIV)t^mN^DQv(A7Q^w&0>V z(?UTiYP2qPczAeKY#HD~o`$nUavRFY$~MilM!+#jjcC9{EP5AdvSY5+KAoDH(kZvU zn*bN0VgCc4o^3YLfthAD;(r{E5kj{#H$Mp^yd`9hecYVNaEWh51 z1e^*kDOd$~>a46Rl}uIFqovfW8H9)Rq#&DeK@6H!`P?(j5yAVFX}bh z1-D)nLZA>U5{bTbjZsRf9*$k>n}V6fz!}L!L_F1^kdh`LC7Yn*+V{l78F*S0k`yC& zN1cO%BU-?UF#%2-d?OHC;iTwF{l^y%-Ot`jNO-8Toq;2S{qGbazBB=+Nx*V+FztEb z(+G|!KVgK@?ZF&8tBA0$>ttjJeP(bXd=l`&4CY$GVq;?ma`obPjEOO9h*~S`WdiRH zHnO!!_|5xQAZi_zb0ccCbjoa#<)iuW@$tdF*9P={8rH?XV%)uu_7=pWJcp@i9Enste)@(#UnUmmcLOG^bgIddy3E2X@M z;n=!>Ng?81RS;9m>`%ChL+teQY=B$ArFW3Fwzfx8UUc4zGlAlNxHJ$O3VAvNU%}{Y z&}exDg|oQ`J+ZR`a1;n#a3~fdKdYQJr@wI-^k-`|3Mn+m$;->j$+dKL8q;3z5T&Q5 z*U}oH<}(X@cNuJg!qM{Vr^Sdg3YFJ^yK#<^kr9CSBQAd47RiHygOfG0`10AaHpouu z>gtg6^fS}bMVi^ku48^lPW@$w!9vHJxSd6Q(uWTp9v&RngR3(i$bqPvEN*g9hu|#E z+uIu=1gzwDZ+RrlcgCIfsp-9Qc9wqp_(}4Mew&ue`1n@~9WfKG`(rV} zj#m^TA~n?qY@g5F*TBb16MEK`6+E3_SJ*?SXz$<<3kM7A(BI#GqWpqA?SZ13TXkHV zp1u7}ohP9UDKagp*Q_`<*9zVME2}x#f{@jsklB}`QD`(?`OehT6m>5|OYpcT1JhHW zP?bXYv-pznJA{+Gs##r+OVDNsr})vnq=NJn(#Xh2*WEs~mnqMJWbZMIlEQ=vt*7cZ zYfcIvT0uexxh(7(#rn!nA*3k}xVg*GnDB}UVT_>RCOqO)y;q#5OSt!2+Og=}8%up6 zN^Dc7Mywt!Kl;pWqhiZ!-@dH-q=lM=W9@qEpr&>onB#|f!jQ%}#!=AJYSHBzM-qj8crX0 zN_Gc+ds-(JLBRuv5%ph)MhXlG;V4=KMMW)7O$EiqR>J{<+@c_0n;0xb!0p5-TNN{u zWganQ_a=ohiyUV|>yhqSq|Q^T*dayDRq*g<`!(lPVqo^yNNGi#iy$=!4-bbl3qmTa zL**C*eK=TF=H@h1RL1)HbwUd1){nisg}mA<2RB{8K0nX=+U4<5bxr9r`I;>poLh4i z^_VqHa%+3rWoHoqN}_)>Ak@|lNwc{Rdm#<#x4 zsZ2-3sr$Ak#s3*&h3oOp!a^R5Aj3OIjbM3t{{9_ye~|s8gan+xwUlq}3Us=n@{A!^ z2eqMOs7;?x{!~s*Gw&4+X|_%UhSZfO$Wgr(}1oUJYcl`Ecqws?X0{BA@+)L^|Vr z)H-9Ntn1E3>Cue-t zWx`9&q+pLm8^++r`-z>O*vZH=g11^9%>RTA*S{s=v;p}fC7+o~@!}sLLWyFfR9zl| zk}r^MOqANt3*hUd9tlB0-QY_#XL~qWW(OXNSr{f`(v3t$2|MPz(3s=6vkRV!?0L^x z{qO1Ej@Kjz=ibT%S)^vUJE>gtqMwA{RZj7!=G^*&20tu^=(^CTCTi>FikHMW6bZot_wdE#l&R$U`z)5p>#%|_~nhp)6DAx2hM=1-# zLbbzMjy?ZUZlKcB+*WSn z><5QVd6CsbEUfsIO_&@+c>_#;cA;^ngPonhH&nVZ;~(ir&A|t4i0e#8 z)A>(b;E}B^=9izJpH+xJxPU=Dc5vW#EGYIQq$=pZRm%S!6XQifm-8Y$ zqqocf;c*=dV0t0WUE%3d^NDI#s0P9E)2ty!36{M_!~fRlXom%x`P_ih8n4V+MtH3w zlE(|ypk;Duip!+y4wOA_n#rI$;=u*8c?|+!k$tf$~1&(7%EDLd1UYzh{gz;%*}FoNs0C1w*n)ift#rxCs6(^yjy` z%YA0W&Kr}z92^{A{U7i+tf<@BZ9_H<$r|`b#8r4~RRslN$EkYLo)mbeHW)_a(!W4D zHEHLud|5{(51K!*(53ikp+!eW2Tyn-`oZgu>TD46?WCnI!kv|dy3iMVEB-G0_953G zzJ8*M7c@n#ayit$RDta7j{KQ z=39S`&Qlcl9sUOoUSY3Tgx&)*Ng#c6!B*KCi1-&jFqf1xHHYDy$H?wRI(JxAs8oYw zOZoI+Utod~$&v%4@sO&qgtf%S$3xzLwJ}e>TMu8bhTRslo;=)Mz+N`@Xn^$2n)!YH zWdz0Z3WrrFxaJoYtj5a2ATXqfyy(Y~=;Y9=zIFY&p_LWgty|a|h4FwthMtlENa5P`rmUAT-TB`jhQ7a(GcAEbn{n zX^x`Uvc;T4!K@$QcWhJHmK7Eo>R_=we zO{>TR>KBRUq&18&8qtIMG)yJ@Mw&#Tm7%UP) z@T5l~wn@ECr&V(k@g23;NUJboe5~2(M;-eaZx)3<21iF%Sd8!^sUOY9QPwx3ivIUjI%w^=Zxe zpY8WZVMY5=G*VPJy_R#Zypc@?$y!j`p1AIK)I0TOikC+iZy{xCfh6pcoBh<FWrE(j)^&RsZgxIf%E z2pdRYnb-kt5*t^_m!T|y%64aG2V3f53jk(rWybIq-I=12z9ZvN>+S~C=R|XayBHpt zrr#I2Z7fs1dQoYSyN{8%6G`U)*DsI#n^6vToOo zxi5Ms-fKQS6~tfDy1b_Z+NDs8sxJr$q}C=dMClK@qrL7N?-m63G&vvTBKZ_Fazh@c zpHItu%%Q&p9mjhKccs4M5#uWL4Gj&Um;N${i@Sr%0Vi?N*rhybp}9Kt(jZZiCzP}I z9cOQTL}9v8bC+2Wb=cnHjO94jbONJB$J4Cv-x8s@T}`uOt(sp@JNs5F<^B?k;eU$` z-mmRN&)-F&KS+n|Z^cQg{Oy~*!kKr;fY3+FybwmFfla@mTvlI@NAmQ}^z<}`Zl#Hl zQGccyCz!Roi!uLww$+W3*=*_;4D)Q;XtZ@kxa(uaIu6(wAHe;>Bg{i>}hF6-Se>@yM1ncq{qokmzx?`C6X zZlSv(f+|9{;f<}%(+yUiS8YcZT-Tk%)apUNy z%V0zzT@{X2kDdR1ZIZX>9^aVMLBozfv#biy9VWH0)jC2p5t7D?fS|G}97k_el~1nfxcSDNw~^F> z)^{*>5GSuJEpJm$B&lZR(-2B3HqOin%%;ZW+FO*#nJs?5=$|{sILSPX8lBJnj$7#`q5@FYh#nx6;zm*qc6sni{^5v*6riEHL&X8{y> zn*0}ATtc9J`s>#(l>KZIDfUJQ@t6%Q6B85YvjI5K)|N576phFbTT_Nc6`fkTGB)UW zN(@YuK!E+5Nn(y*#sdJ=%4!{YpHR>Jn+&dwS7VXpYQ90EcN(NA*k@IT91sK#9!yQU)cO%J$bPvO+g2LKCTssH2=p~X z7oc&~U%kDXT3gNgvm%p|8L*q&h>q#%Qi7>VoOhuQmOI7I?7^L{X5ELazZ5Q-rJJz*I7%++@!sBoHuS-PH23 zW~xHWLT8*o6R}4vYzx@{8e6~%UGj*x#wepu7qB;0TogJ{>xU-!2+?ww9U>aV$V|8`){QNv5 z*gif!uxB3QaL-PF61*?TMB^>S$lfy>DqtYhsdNg05xQttFo=x~$ZejX*fon@(O!`7 z(ER!K-PUY#YXs;1>PQ5da`MA(;jfu4FVs`76|BsD+}g=H+4?^&0OtiAFJpZJgOHGr z)zwuUZEbK$*Y2!oUD)@>jlb{{Epm(I+xWwncMJAl+PG@DiJs}6^6$bua_V`Yt-+80 z?L4r6JI_X2(9ksWm!_vQ;1sV6dRqSz<;%_v(UY{==mUMWnNXN9w9!QB(J?9V(FNFV z0Dfa_Yx~vLx58yVr=&yxfPv&P-nW>)dF&X94TppNI-W)74ft!-V2eYnVTglapfdY( zYusYIp$x<>F`MP-S3f_fHxWB{I$ny?Gcyou08yg7bqhO@EGTiw!Js{02``sC_d33F z(c{YBwCD85a)(uF?7q=~CE3pWAwoiL#Q+ws>DH}VD=RD9JUn#bZrCJ$5!%dgqvdE{ zZ)#qXTG;ej8}pkbe{c{Ja7dZ~lz57L%3MhGpvQWL0!%C@BEs?f%r#wEGgns>YhpRj z1w+{%?^$3cK?2TU2K)kRSWA0*dso+gu!$eGH#hIv(;|Mrf%bGYguPCX6uk5Hd!)e&K}qob9u>{mRen?snee&8KE$)75hee8+yMPKtU`=B)djEh$A zaG_M?#8%dEWzc2L`h-v>)E=0sHb5Y9vEKkR#it3|YlLt78XJqz&2~i8nu8tx2fgH= zpx4j=G&hH$S)$kjW_ANUfVu+@X$!?DRO#iDssfgMcnIAPvhEC(O!dZVVoXe_larI& z6Qcb5;oeZ->_%Kd$UzL0M1j}&YgUX5O54JlovSW&J(Haiw?w~84Dd=+3n>^AfMV5n z-)d2Sq_QLN2~$~^&b#nCI>lyvNl!v{u3sAeo&SaYRL(F*7{);&nV6Vdjc`2#czAdU zi;Lx<8dOmDSyGZaE7RHP`dTR0%1KU+LEMtBclh^b#%wmJu_w;-oD>v(yi?op4qejc~|WsY3etFhgW+hV&bCKe0*>3G||Y_0v}zRbx(%&Cj$oI)Y>%|*e zkbzZ5l)>qckd(x&IvT|HkORc}-&bl~dxZoAv6)nrwT{%n%Qj8w_1(sZ^@H z?D{pt0ili;L2yWjPg6&Zwz2;O4@W~Ns^7kaE5DmrM70Jm*;>~Q%}LuvL|8{l%U503 z2?Qb*ygE(}#(IJiC!YIt1+fRTVJukH73M#3}tb|vtyy1>i zX2q7a!(2Q(fbk+?r3TWMbt|17<%(J3#0O*DHUh40MAN=}`4YPa^yK8^$T~hG!ih*H zHKVn?Jz0&e6anca8gT&u@6413U;)rOh(73SUEg$je?q6Bk@XUxx8z=m8Hy(L;-qys zIq^|uL+7scXBsNK>|{jozMh-?y>pM$=b68}j+qeJsy{o~ahoihXZkp>hOV%wV~d^Y zgV3SkV9?XX;J+d4bK$f!#dKXcaVWO#g^Bv87wPwqkkjZr2XJ^;zQeW|DI#jU?4a^J|6NKDSEM!Ld*7cvDCh$k){9DO=ng%5` zGplVdQx4USR2kS7%xf?qfzDbFsly(Slsp>?jA0V8kJhaaAKdsBxIGXMKmH6?{3Tca>0JzY9e zG*@Y*vt_!Rm~=JcWooo`Y>KK^l@r&)yHigd{W`FX%Xf`VG#F58mFa$$>8%&iktM%! z>>r{OgB)ZL4+=%Xv|L+s>j^-gK?6s7$Q~Sr~aUy4d{2oiJHyxB?b*74PbCO*5AMd%0XVl2@o%AOZ-+y1O5mVHCG#<<2 zQgh=VGPjU~^x@DzjMzq@qMH0=%dys9<@2@pQjYCIMtAt`B;b$KtWHm)tDI8$EIq*l zoH(yP@zXXEDr%i{AR4v}lB5h=rs`Ud>}~M6oKJf)thmAx8-2Fhj}QNL+%QjVG+xpH ze3d-t$B(=9R}p=bCChVE!`#2jA5ym`EOeGU6mocvE|ntTDZHI)QJEhudr?#UhBxXZ z8JV<}#?7xNyWrqG;Ln)zj!R2t-nz9+b5s6_Y?D%Eg}C#*>ppHdDw+O1&6sWLr##nu z{H~~cA3QnfBqPtAo!6ARr`MOpRa-YLPk!Ff9<#Bc@l|uIr|p@}O+^xy!-r8_$%Br9XLHTyI;NlHuj|E}j#aL@tmIy-TRiCSMwQg75aLU)1O! z+4CTL%iFFsP}mC)r$!Fl6ch*(cTc;ulSt^euP0VI^2Wm=5`Ad4onmFPdh6I~+SGI`enwz^d#V=Kl1^YN1 zVviN+yk&d4vOicx?x{L-@Wog*NMAqprp}&^rk&uk-W=k$n~9+77`E4M1=}y55PK?r za5nQ;Tv2z|aVHE{1&1`brm1v)){Su8$k1JS=SO_Jhxb*vQMs##>z}oDOZ$`%IV@qw z1ma}j9G<4O6;Ek9CeA?bC>k0)w4KY!TwimqeO;k3s%Z4ruNTONQ!DR##;W{%p5$*= zD#-ILZq7KQq}b@{9xwMshJ{ju#Oba47RlxZ0$Hbpg@LH3R`fU2?Cj#YX2oe2~T92T9@M~{xb#*n8O8@br_km2L6e@eU*_JazXe> zNkqct>9H;s7yLIw-HzdDMIj^AzyDAre{N-G$CIxv$=lw)m+~UL*Gw<&Tz>og$xix6 zl?ym-I9vx>KbpGDQilg+y(|6vKDM_98XHpyZx%?t=Aa}g09xr?N=k)3gOQ&|DMS6k ziGb<`3#<118m@`+FI$hf)+O*F2PGIg+LcM4f4Z&8U4~*KMMGE5G&Dg%qmA$=<(*sf z!3H??(VCIhoSa^Nol9e6QPQ?PAvLCw_FU&a<1!?L_wZC!K0@3skewEzf)w2Pc>m zbctThviwE@YqtG<6Hh3ms}^{^Ag`G>ECsWFw)AI`4O5Nh-UMo$vFsas$cQ)Z;V7So zimqJgUZwsiy1#xHKHg4m8RH@zZ#5K0EXrax@DQ+ESy@>#vkXf)s4kVUuU@D;MWB3Q zcp4s>E&1qrk`nXU1Tdh^PNBlh0&IM=)FzAk@&(6g+h6vy=IOlh+5LZ8N!mj?I!w*b ztzIO24QQ%l)#%J_b-8<}ou`_^DSm!z{?d|3cVC$B77U1qj`Map@|ph>;JS-6$QKl0 zVp2&qb2=Auj1b9o_?&F`QEvC>H$`!|!jIJtK?79ky6QhWNMCLr}e^2*{@6& z(x%U-l5vw$?x-2Oy~~iW9UaWM>Xg%_>f4air}QZ2kA$kd)}QG4CDEE3m*|LNF8Qpa z+~CUhuF2B+Xg4k^5+rx=S+3;4exc6^eY-#t>((pH1s`HV_baSl#3}+@*ag^4t;9|u zXmSl+n{haAKPbv{Jm=!)&M{YG;@|9EH{RnsGx<>!7NePXyJ$noGWq`d0sRG=+_{u) zGfT13xrP4!qS;wQ51;F6<5B75tFw{$T4aZYAv2uYu?D>lbU7oWNs_i2D>*EKPyO2T0ZxPkn$9 zj^qi$+G=Z|7}5qfohB=Yb zic2#?Lq_`fB|+Wn$y;8bp)WZ&Ixb$s*R*I~G+A3>e&31hH};b~$ySqZ&}Bt)^H#1b zYaV>)xKEL*C=wkK@*+(?4W{%ysPwONhuMVh0Ko! zTa3xiH-6@rC#jkmSDbGjxhGmhd3is}N}?oA9)7DTd80R=x_Sa}>Xrg0cVj?3CPxmJ?%6c!fpMNv_=<9mL*;@V+S zq#34qterd@7Wt5!%f`r``U~=TfV2T)kf2;Ls)(Ils>J7)9MZ>yFL+6Qo1(jJP(86P z=gHI70W&_-Kv;_mK7NBDFV~Y7={fWBWZiS4qs++#xN#Az_5UAqfFlef$9YLe(+PPq zDkIK$GlIvLJ*m_`=X?InE*@G-&nI$Le{wZr^tFbwSj40YyUSIK(9VA0vCP?n`NZUz zz;jxmnNOYae!8*Sj+;4j7ugT2rG20H!R*A3P@ww=*c)TIXsXQsnyT9j|@7ZBa! z#JI=t|9a}Kce}u;H+#^1f>&{Z{})889N~i38v^xWTF0KzpEBXQ-H+&h#tw6B50o|L ze(ukld5j{E9((U({(GN}%e}3-2&$$&9D};vhT>;8CN=ix?1-gU|L5=(*P-?8TM-YJ>EXs}Yi;c)&1~T`vta-BCML!2YvZCJ zA=@eMzW(uEx;~Pm~|I$elMRjN&XP$j_}= zv_;qlXzu^gd0Z}McCgiK^*?w(+qO@oyBJ1(`&xHD7m1OJ_RQI89Icw<&pN{QrzK~u z7G&%5{A)U%#5I4r&mDXni13E_t~$9MDTb(02-kR{X2y@z_h*h*k8A{l1l9)2Y-GlE z^cU_XSjty8m=A|}JH(E=&aL&mR}mA48f;8ITlQ)76$y_?9{YZmN4GQ2V*by$K(q>x zInVvI1J3!DyvwIuKcvb>dQufRZ9nV)Qx2e!Z^C-APEMtgKbUQCzW#mtWEk7UBBc-Y ztTr8kT?9%TwAqP>h<10`=hZ8LfCH@ek0ZnPf@J>$($&~6z3`WY#$_RFCeWAd3Ps-^ z0J$u{V(P44(&CPeGqyUmu z0(pK+2WZ0-kcQp9J)YFu`qIo|tQ34bp4TT2HG+P`L-FOBO&Tfpqjd)6%G$bZ>#XG)ks~zLUM4Dhbs8TC z9H|EzYI^EFm)w$3qh`wazC4)bdeh;y%4hCd7hfE>SXVeaRwRD&`t{VpLgScfx-#&q z*tzSq&Ntw!dw%|GeeTWeG`u&1EaADlePaW5OhJ~q24OE5Z4uI~f6nAQRnj0JoP^qyR z1tJ=Lp#0?-G!mC-1H3|@L)zTYahw0`jRBGz?J{oX9h00zphLj!*slx*xri?;EI=#p z2pGP(oOZwn0k%?myS(FB8!&UO-#RsSs}}nt^&?lW zJQ6*Ablm}X(W6V!W}sBKc~c`%ng~e^I+ITqiFm2o0YL&{#aXuu-Sx5v)yx<^^M2@F z&e|SgJNG6)eFX^sLjpiE<7IY@BO}pQ&@n)Coo=~d1w_6wXo>?01yoqz>>#-xJW#K3 zt1|sTo))^b`_WI;En)aNE_sOe)fJ(`UaX3pvD{S8wWV683;Rhb8uyC|D zFr+f0fABtR-J@iOo?WdL3%9bb=2($k*zV|5v(VGc&pqfJNlUf~E^{6X#ku0m@(!)* zmOSg_HoDoWaX=2M7z4z&&fpbLVaUkIeV9Q?w0kZK2?EF#kZb(=ddi?^85or3MQFDQK09xpzL7AE6z(i7r6O%`2D|Betg&(qOvVCtOpUi&7mQ1*QP^j>n%swU~ z=W1$NNq#<1AX!LFd7}UfvePpobWvRlO?iCLp;E=n%&a4m{2L&LQOCJy-le7b(j~h9 zm^D!Z$@0RzU{>F~0S(#%AClLjoEsjSaPw^fqpm>A762ka2^mX z%SYztIXj(I4o=VezZ<&wQW8>`;#~7!Ei)jx!cw110PCJs;R+HEWKDZVM}Lff24e{H z1g}T_*cgn@%9>V`)G5$+d`D3sU;#>pKY#w9Lcf0pKKg5&0Tzc|*2)|J5;e2=IXEoA zmyU)mE-qdsXRPdzEFCcaoAgB3Va22`LuHDHT|+|yyaz4!8}HjZ5p7vr#gSjf?2;nB zTMgge7lLLgjs!GQOLJZx{Rl<<_V=0u$DYu{r40aCFMBrF?C2Judnl$uE&|A|M@@z_ zG&Ey2T6C^EK|cjO12y4Uj3bMS|B?AeCfttM1pjbX*UK+U$DdGF~B7T#;}151r(qMhAp83`!P@M1%sl;wq$>0sNVl)cXL~tHb@-+ zvzCifEg_u-C_tMX)Ai$1NXSbc$Bzl%((H2?NrCe1IO_kmMi=-4lMbigDgZ`w0z?J^ z>Vi>^S@Gz#NTl1*5|ibDuUs0G^!I= z_T=g?sH;G5Y>ky7!bhP~oow<7qScQ9llZ^Jyk(Xl%kIjM9n|^sG6Bz?K222n6pF6l zd+^}k2$O5vdA45a40R3|JDc9w){5_F*F2+q6j0J9%F&rkbh ztKp*brmO4DW(n|(#qt1c4)=4Yj+WMHgPPxfADiv)%~s8f;Lte&#$k6wrLJ7^R&V;t z@=xFFLBpiJ;t^&u^9K&Nn23lrw*191*+%q+z{NqRv|b=n&g}Cv=HcblhB%R9R+CvW z-#eofDxB^(WpIGw;h0B~nKARl%+~nkJ0_^1xwyEnTLCf^e}DO@Del&A_WRoQf*>Y3 zoH##QSXp`d>eb}RiU`2*uwKi=pIN3qk%)PJ{TcoQu<1|*Rt zQ#ew|T(4>oBWlJPs}nWiXL>A!ieiVT{S^yPhN@XV-FC)G0)VVw1*|S0<|n;K2Ss3F zqCt(@sic$?lYEr&N+uoTf58_)(BX( zbL9ab&}crl!BsA3YkP()U|w5(j;IAmlE^Dl(dkg}z$c_CS{A7-%eBi9pl}4|+A=jV@&A^49}YHeTVFd(zs? z3F=R2|AjPVA_RhN2m8AK)a>ecAU*WJ(#O2C)&ZRS2fcX+i@G0{V3Z$OQETI>sIoM^ zx_r^`ULsbMd_iBnR)jxLJ0^pbq=&1Ee);}ll@|h zFM5|F1rdeF$1GuU+LF&uM%9wp5f7BIdS&KZ{k>(&ZRc8m=u2DiKH;SGBbi{oHTbT# zk?U(KE6@HR=W4eRPWLVS?QCr`PQ3W}3s36$_l`qD(KnLSerZO36Xaig@kO|Q*HlB? z4zv35rlKY5PVAK{=E5x(;luN@c%Kn7yQ0@iszb}1@qYig?P>%d_p7(kci-uy>J0P0swrTe)U7BiK6 z_UtMay1fI??U&S4CQ_jCNBl3_0dQh0=;|c^La|GLsTYibMDPFj3^2&Nw2TaF*q!%4 z47z;zGNd)5b3o0;0?Ud2FLK7`bx6cev!Ewl_OL^A0q8rvv9kjjW|G??z^wqDxWr^B z=k-yltB6Tq_z;RsTSrG=W8EmgQ|dlD-Pe;Gz`1tCo>pvgcb6dnf*zI|V?C9 z7#E?ks$ogoP_+XJ^6o;NMu4)BM(4E2E#fT2QMx>!!kX%p7~8M7fUiv)pX1)L(#5Mx$X+p)|d zU?y=ETa17Z22{H&oScDJD$peo5~hTIDGL(&%yFOH+Nggai{DZzA1Zd#1=wpeM7l2p^OtikHrbQ6AfS?IG`d?s^`=mja z=tX)ctZ~{k*h@$^`k~VRLLqr!grOY}(2-Y&iH#tZV9A;5yK7_7-o$Y1ffRC{l$;FN z>kVq^i}?6h0_1gwHv1nxeFD(}kSjywumnaCJ78{x$@S$M$k^H0!IJ)?aO$oO7ek_v zqs(fPK?@0&M^=*%8+Xb!6_qPmnN^`9OOGs+3wVO%l+v zDWxm_G#?-yIKFUA1SBlh4h~qcx`V?Wv@O8jOnv|bDp@!56R=_5I*8!K`blK-m{<+V zVRs+Z=xW|vXYjh3Z%7yjQW_y$TIypGM1;cc8q9&E0bg{q)D7{vf;RkcQlHXMchetR?DyZ0HpEI^6+$o+Qk z0TTQ*^DiL6f#BcF&~SI$WgWY}VK_Q6O3=8lu(Wgoz-e*O1a6d(1{FPdckKr}(2KzW zc(i!r&@*#K`U&T}fm#Q)O!+Zu*w>K{e73W)*!>TNnYTl2=xqXhLihyID%ORA%^3(l zFcRd&_}D#s0#=X$Z7^t2LsL>F;MQxP9JL%m*L$f?4HuEd2wI#)_^Fg1YM;mu5(_}t zf+7ww|5@oxJPAG!4oLuJ%pJJ`O?EIGEMMu$5D4q#l0ihT2#NQXI!Fvnq z4hndEQ`4KIq&C=~2J$1VLL+}rgu+j^fIJ?%Bv|=TYj1C;uul_o_`nCeV!40c98@|e zUemw#;42K-y`D88{58Nn6Mb^x8?*5)RxBI1U`0BHeq1NPR&w9=K& zPPRK?lk$M*TP7b3VrA?lgK$YH^rFeSq3qs1%dI-T>bv}GQ1GnH(X0>0a>+YMpdUV%52_GYohvY=|KV~tz z!BXEgMDm8nCZBubs`1(cldXr{Y0u=|vxoBXMOp}EZ{WQ`C<1E&)KayqPhI^PDp~DIqbV&X$ zUcBg({?LQFzW=p20Bz*tAzNFvmAQAAqk&Z|*#tkHz{|^PQi4G6!61!uwl$}FT3Zuw z$3W18Al%&C47&u)m!vUV1n+AMvnQzesDTAi>BL1(|H*++g6c96k>L#^XdJ<={y)`R z`6HD3+kR}vd?}$Ub*!awNZMo#35ldlvPBCaMz*nKO$sM;$|&n7TO!G%Fr_S|Q;d{t zB$1^!V=M>R@?P^Uf5h7lq8{@+&*yW0?&Z4g>&pM%s|4hdI_9IhA!xyUlAPk=Et@u( zIy&~ed2^K_OdO6axwnO??)0##u%>dMMATonhxos#(5XaV8( zO-=52wXh;OA8izn)X({OGK>^NM+5-6AE9I7;xY(0^tiP(kOy44AkonA`Nc`A>gXo9 zQxRV#ZaR-DOF?GqQ>xOkH^)Cm>R{&6mk*A}J%oz+5SI z7a!e9=1DGZZ9S^0swyFof^RU#TD5&eUEzZV7It=wne1an*n2g9)7cm1*!FQmkgnR9 zwERjTU}eed&({}A|6pdfov^m&bb8h)1^%Kkw#dM!H`bYOKp|_~Tl(zN_@wY^KeTBd^+zm}1bJ z(_2$xrW79+m(#Jl6w&lcYFHj(59CC})P|tv71iFCS(+p5`}L z|7`+blNo7ZYU-wW9(HO#0jr^*VGSsb$xNcWlaDb{RLq_H+m@wBm={cr*iQB?3zh}k z`h;EQ=iO^!0-dW+Y^eV&Xefc-saVfsTJ7I|mC`JqfACK2pf4xol!rSRMn!W_Db3mt zqot)K>M5Jo(07rm=0NHKs|%nxmd@YI-=A)#v}61BiGTmi?U~$sNk0PcLo0RY!Q6jv z6mOXYe?TW3`C>WLbCO{&J5iKk0^7#M#`_E74n_Fo!UZ5BVV_mBv~Iuo_Mthr3vU7Wc@OyXv9U22S_w0N_)bB;Q)b;d zb5d8?S;5o?*9=;oIgm%I^#){m=N4_%*fIq5<}QtMGAk8hf`WsAc9l=l*8g&gd`L&b zR86hq*|TRj!Z>c6_n=5`kz}T6Slr+Q_m7QjT_coj@ZdngXR~U7$U)yTl=h|SRu+o| z>70hWp0X|lrKP>bZ1jkTG+{DDh-OY_lE2rC^x?0yKqwQ<#^fa7C8@nBld*oEUwsARUW>$~s2Z zh=Jk%C8T9$q_@|*Y%}6!$N7_M(xqB&zHqW6bzw_!>RI7Jv%mO_NN6E(;n%h{=(WY( z5F>MVdklkueu7R5bQd}@GyO+`1*F8p$~?Pv7&YEfUy8NLGSL-`-1B#WpZIL?nRAa3 zrk}pBCEKe2HK!dBh<5?zjUo2j+yUgKXojt2%S37x!o7hp1bh{q15l>>Frx&!2-^o; zre|K`>Ch{+)vwTsyApas&v16VyGP?Mp9|!F$hF(pBC^q=I^(ryO$zYtJ$v>W3Wzmx z?pZ`kGW@Tcw(mJ$>Y%aF?Z4O>8P!UmXTCV+m*uLyFxM+G_wyLbgy^yEYIt8Pzpufn z2s%{|AE9n_WR0bs9(^f~1hu2YezPbkK0f}_r%$kPy1KeLv$^?@qvH|+D?}o4GpF>) zy)W2fV_E6x7Noui=j|RNwXg2UR;m=ytBESX*c&NQgAQhimrjP?5k2GOB`YB@-RkGh zs%?)l*rln7T9vDAprmA+L#C0&jr{z|uU~Hh!X6zR4Xup*y2DG`SCpeYg_Z1RZx=TT zveR)ran`a}f6U-qu1Jk~-$ge;UgeDQ8ml&#jLi zKQ(o|Q)hfLv~PeX4o?Ja+_(`vx4W5qdj%DztOu{h_KvXRcJ15=(#0IGU5#D4z6AZ|DI3&{xN{!nw)Z z5fS!QV*bzf{MJuP#f)HICB?-tMmfOvQc~Kwmt(PBscr4;Lj2K1MMYTnEq3&46p@#l zb33|_xMA9yy2VypOl+@ifgiRJaY{o|^P>n4&C1a+lR5mmv@~OO?V|viEL<`W+V&40 zDnq6{a1^kqqDGAd%X7?{U(=;<)zu->MTvIK*( zB!1qqlNrg$U%|}K6(p)wf8M~$3Pb_4XU}u6$GC(tGLOrfZSUb@>(5NU>Y{S^2#%1w zAgiFDKuS{5lmxl27l38hGKW3TV|drx41ybZ$y=QGn)!A6mLORhn~sWd6JjONAyTM9DSM2MkbBpjA={gP;FpK9+ni3JNIjG z4qws1lGY(w#GXN2DGvtL+?*(i9CIi6vldJHWq8S~iWrH%p`qbf8i|mN!T~-3nvs;K zs6vW4FjxSg`*a0QZr!wL2;Km#a!eB{#flLAqPT7MU*>sGAA!hFps%m_fde_2e8tvB zj+{Pwb_&`kPyxc&VM{YlBzaXwz*n#Pg@vG=Acx7z&j+C=og(t+7})-B-0(OfLqoCH z7vHE7J`U#K6fpQu*N2v_sgn4IW*$j9XbZxLAT_e@{f8iE-yQ{g?SU9u9oDe2va6}7 zq@sd~5B%H8U}=q{RgOa(<5%ADH~Ho9nHj`J{fJ+S z$%^|1d=C+kQpeo|4K*PO5D0=RN+ag&?e}Oj!(+$FzYQ1PzaKnl|Lw7@e5Gzg=S2D5 z^FJ56e^y&FmBiy5nyHzY?9tJ8eHRnu4HB{9nLPG_U*xaWahnEj{#-jXT3Qnl6eMF1 zo>AA=IQV}4c@W=xzl)Yo(bb~QS;IEAwmB_^Wuz zCa(hT6V*bTF?SXN*#=DS3I$?^z|abdiZ*T9WOwo;{*9p4wewWQVOPq_tC20jWi_1H zj?;e_P0oq&afKMLYP~TS%YELZM*)Up#2XO5@YG08F=(TjV(u;#Ra*(H6?$2qA(fVL z`Wx_IMC8$z?L5J)9UU;7{;4_mhg#jGI*a-rAzs3ch0hS|pJp+d+t zs=PcGb914jH}@R*33GmXL7j%p*_Xs|2DbfKT^)-5V$0CtPD`&^l>`@qE(t~n?l6Zx zZsjEgqf7WQT^iygxHYu2YkRTnl`B{1ev#`i?p9c+j2wzi-v#&w=?%>v`?eY_X}Ef` zEt1{c-A>O#QYa#aMa9J*U+CBx5HJmiCIC|(vA!-b_}puCec%H}KsOI_;y}j+2M6g1 zv}3oZR7i77MI>>0sx{G_c{ljFp`ok0J1|U|AmAOF^Y7jjmzP&xBLuNWHz*W>d&n|T zh`@Ft4u$=2#!NG!y|zpqLQ^dwo` znbvk~pZhMbC-Wux&HI%>*(Ez8`Yoj2@ls- z#P3y3ZxuyBv5G{ZISO(QzT-9KFyb-lQ-IRCIy&ubZ6CHqCl(bKAGEUaUeZ!iQv*7H zE+5ihD5?Q-$m{-%XhFEDx|NfIA>uyn%**;4hm`@B=Q;ArivJHe*g)T>KL$o-VUbW! zFpN>NAF+_J<=(IaKnfxf=-tqj!O8$(qbCfwc4l0bSd~RzitK^V7IM9Wn&QGjH&0Kf zLVO0g)}TT}raF%j0%-TEsi>^e@ptp_Da*`s49w8oyu-UwJz>nii<8WpjaZ%LyU_Qs zB71uF5xeB$lp|AnU}`DwLDt*SvX6Orc|dCm*kY&+v4gn<1vSq)q1P%~A=2^z(tmJz z|KX2@`CSJphT4ao@MW*D!;zM#MGdF0OH1|rjHRhJC#Nmd7;Q7cLpnks?nNK|9^Ju} zHvMt!xC&QU7jCz*GWhV}7F4_UV|WPql@h*BFq~m7G~WqxgP(g*&1m{MW%{<_>~QTR z*^Jj|7u*ZiexG*G3j6sN(~}i$+5P4b+2GRr+|!AnhrJQI3?>VTTiY*Rc8%riQA`_= z)$M=R_;sH^jA(X`tyRQ@v=<`-*VH#e{PE+rWn~P@U_Qucx(l#2k~b85U|TZoi4!e( z=DNhKb=gcNWPt(opcRZskW4DowEBBfyg6#Ao2Iub_B8g(;;jb=iuY(bijNGrVlsxEHvV z@%rGl^B64zQ&>ip`v<6A)ebavHg@V5-pS8*rBEs`9pvhopP9*>lyZ}LzL#BY`ur5b z=6ZUn!?T(3;CuBKn$3)^<;DH_cS6$rysF*P#H;Tvid=PbFT5^&=2FSskWRzPhnlF> zSk}};xYatuB*4``Tfh-{*WhxNI84IbvZ>S)zP^tW5-dDCM&J=pK}3bCpXw<$jSU`r zl2K9QG4ddL_n$u}XQfm%4&*vn%C^s!J=|S7%@?3y9hbYX=jKxgdQJ1e@o;B>Hg66M z4fXQ!s=S-JC%j3t=n*7AzYNEJmbBT#gM!3 zV!qQaG=$Y9OXQSDGAwxnC{$)vMS#|!`~)|to>-zCSTB_SvOXl(^oUH<>g zUw2g4L?p#CanZ$ZK%K5i3tO?TnjpS9I*&%4L1J-Q+7*Ky^nG6g%q=X`wrp{;Aqa+q i$Yq0jJb25{CBfVqxAs4qzmtQXhyx~vj2{{~NB + + + +GData Types: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GData Types

+

GData Types — miscellaneous data types

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + +
+gboolean + +gdata_color_from_hexadecimal () +
+gchar * + +gdata_color_to_hexadecimal () +
+
+
+

Types and Values

+
++++ + + + + +
 GDataColor
+
+
+

Object Hierarchy

+
    GBoxed
+    ╰── GDataColor
+
+
+
+

Includes

+
#include <gdata/gdata-types.h>
+
+
+
+

Description

+

The structures here are used haphazardly across the library, describing +various small data types.

+
+
+

Functions

+
+

gdata_color_from_hexadecimal ()

+
gboolean
+gdata_color_from_hexadecimal (const gchar *hexadecimal,
+                              GDataColor *color);
+

Parses hexadecimal + and returns a GDataColor describing it in color +.

+

hexadecimal + should be in the form #rrggbb, +where rr is a two-digit hexadecimal red intensity value, gg is green +and bb is blue. The hash is optional.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

hexadecimal

a hexadecimal color string

 

color

a GDataColor.

[out caller-allocates]
+
+
+

Returns

+

TRUE on success, FALSE otherwise

+
+
+
+
+

gdata_color_to_hexadecimal ()

+
gchar *
+gdata_color_to_hexadecimal (const GDataColor *color);
+

Returns a string describing color + in hexadecimal form; in the form #rrgg +bb, where rr is a two-digit hexadecimal red intensity value, +gg is green and bb is blue. The hash is always present.

+
+

Parameters

+
+++++ + + + + + +

color

a GDataColor

 
+
+
+

Returns

+

the color string; free with g_free()

+
+

Since: 0.3.0

+
+
+
+

Types and Values

+
+

GDataColor

+
typedef struct {
+	guint16 red;
+	guint16 green;
+	guint16 blue;
+} GDataColor;
+
+

Describes a color, such as used in the Google Calendar interface to +differentiate calendars.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

guint16 red;

red color intensity, from 0–255

 

guint16 green;

green color intensity, from 0–255

 

guint16 blue;

blue color intensity, from 0–255

 
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/gdata-Version-Information.html b/docs/reference/html/gdata-Version-Information.html new file mode 100644 index 0000000..150d22a --- /dev/null +++ b/docs/reference/html/gdata-Version-Information.html @@ -0,0 +1,48 @@ + + + + +Version Information: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Version Information

+

Version Information

+
+
+

Description

+
+
+

Functions

+

+
+
+

Types and Values

+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/gdata-overview.html b/docs/reference/html/gdata-overview.html new file mode 100644 index 0000000..e409da1 --- /dev/null +++ b/docs/reference/html/gdata-overview.html @@ -0,0 +1,276 @@ + + + + +GData Overview: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GData Overview

+

GData Overview — overview of libgdata's architecture

+
+
+

Introduction

+

libgdata is a library to allow access to web services using the GData protocol from the desktop. The GData protocol is a simple protocol for reading and writing + data on the web, designed by Google.

+
+

Protocols

+

Google's services were originally only accessible using an XML-based protocol called GData. However, later additions + to the set of available services use a REST-style JSON protocol. libgdata supports both protocols, although specific + services use exactly one of the two protocols.

+

The core API in libgdata transparently supports both protocols, so client code need not consider which protocol to use.

+
+
+
+

XML protocol

+

The GData XML protocol is designed by Google to allow interaction with their web services. It is based on the Atom Publishing + protocol, with namespaced XML additions. Communication between the client and server is broadly achieved through HTTP + requests with query parameters, and Atom feeds being returned with result entries. Each service + has its own namespaced additions to the GData protocol; for example, the Google Calendar service's API has + specialisations for addresses and time periods. +

+
+

Figure 1. 

+
+
+An overview of the data flow when making a request of a GData service. +
+
+


+

+

Results are always returned in the form of result feeds, containing multiple + entries. How the entries are interpreted depends on what was queried of the service, but when + using libgdata, this is all taken care of transparently.

+
+
+
+

JSON protocol

+

The more recent JSON protocol is similar in architecture to the XML protocol: entries are arranged into feeds, and the core + operations available are: listing all entries, getting a specific entry, inserting an entry, updating an entry and deleting an entry.

+

The key difference between the two protocols, apart from the serialisation format, is that the JSON protocol is not namespaced. Each + service uses a specific JSON format, and there is no formal sharing of data structures between services. For example, every entry + in the XML protocol is required to have a title, ID and update time (as per the Atom specification). Such commonality between + JSON entries is purely ad-hoc.

+

Differences between the XML and JSON protocols are hidden by the libgdata API. Both protocols are implemented by the standard + GDataService, GDataFeed and + GDataEntry classes.

+
+
+
+

Structure

+

The basic design of libgdata mirrors the protocol's structure quite closely: +

+
+

Figure 2. 

+
+
+An overview of the libgdata class structure. +
+
+


+

+
++++ + + + + + + + + + + + + + + + + + + +

GDataService

+

Subclassed for each different web service implemented, this class represents a single client's + connection to the relevant web service, holding their authentication state, and making the necessary + requests to read and write data to and from the service. All top-level actions, such as creating a new + object on the server, are carried out through a service.

+

There should be one GDataService subclass for + each of the services listed in the GData + documentation.

+

GDataQuery

+

For queries to have multiple individual parameters, a + GDataQuery can be used to specify the parameters.

+

Query objects are optional, and can only be used with queries (not with entry insertions, updates + or deletions). The query object builds the query URI used by the + GDataService when sending the query to the + server.

+

Services can subclass GDataQuery if the service + supports non-standard query parameters.

+

GDataFeed

+

Effectively a list of GDataEntrys, the + GDataFeed class is a direct counterpart of the root + <feed> element in the Atom feeds which form the GData protocol. It contains the + elements in a query response, as well as general information about the response, such as links to + related feeds and the categories under which the query response falls.

+

GDataFeed is usually not subclassed by services, + as there are rarely service-specific elements in a feed itself.

+

GDataEntry

A GDataEntry is a direct counterpart of the + <entry> element in the Atom feeds which form the GData protocol. It represents a + single object of unspecified semantics; an entry could be anything from a calendar event to a video + comment or access control rule. Semantics are given to entries by subclassing + GDataEntry for the various types of entries returned + by queries to a service. Such subclasses implement useful, relevant and query-specific properties + on the entry (such as the duration of a video, or the recurrence rules of a calendar event).

+
+
+
+

Development Philosophy

+

As the GData protocol (and all the service-specific protocols which extend it) is reasonably young, it is subject to fairly + frequent updates and expansions. While backwards compatibility is maintained, these updates necessitate that libgdata + remains fairly flexible in how it treats data. The sections below detail some of the ways in which libgdata achieves this, + and the reasoning behind them, as well as other major design decisions behind libgdata's API.

+
+

Enumerable Properties

+

There are many class properties in libgdata which should, at first glance, be implemented as enumerated types. Function + calls such as gdata_link_get_relation_type() + and gdata_gd_im_address_get_protocol() + would, in a conventional library, return a value from an enum, which would work well, and be more typesafe and + memory-efficient than using arbitrary strings.

+

However, such an implementation would not be forwards-compatible. If a protocol addition was made which added another + link relation type, or added supportf or another IM protocol, there would be no way for libgdata to represent some + of the data it retrieved from the server. It could return an “other” value from the enum, but that could lead to + data loss in the common case of GData entries being queried from the server, processed, then updated again.

+

For this reason – which is made more troublesome by the fact that it is unpredictable when updates to the protocol are + released, or when updated XML/JSON will start coming over the wire – libgdata uses enumerated types sparingly; they are + only used when it is very improbable (or even impossible) for the property in question to be extended or changed in + the future. In any other case, a string value is used instead, with libgdata providing #defined values + for the known values of the property. These values should be used as much as possible by applications which use + libgdata (i.e. they should be treated as if they were enumerated values), but applications are free to use strings + of their own, too. All validation of such pseudo-enums is left to the server.

+

One situation where it is acceptable to use enumerated types is in API which is only ever used to query the server, and + isn't involved in processing or representing the response at all, i.e. subclasses of + GDataQuery.

+
+
+
+

String Constants

+

As the protocols are XML- or JSON-based, they make extensive use of string constants, typically as + enumerated types or namespaced URIs. To stop the authors of applications + which use libgdata from having to continually look up the correct “magic strings” to use, all such strings should + be #defined in libgdata, and referenced in the appropriate function documentation.

+
+
+
+

New Services

+

The API required to implement support for a new service using libgdata is not publicly exposed. This is because doing + so would clutter the API to a large extent; for example, exposing various properties as writeable which are currently + only readable. While the freedom for users of libgdata to write their own services is a good one, it is outweighed by + the muddlement that this would bring to the API.

+

Furthermore, since it is highly unlikely that anyone except Google will use GData as a basis for communicating with + their service, there is little harm in restricting the implementation of services to libgdata. If someone wants to + implement support for a new GData service, it is for the benefit of everyone if this implementation is done in libgdata + itself, rather than their application.

+
+
+
+

Cancellable Support

+

As libgdata is a network library, it has to be able to deal with operations which take a long (and indeterminate) amount + of time due to network latencies. As well as providing asynchronous operation support, every such operation in libgdata + is cancellable, using GCancellable.

+

Using GCancellable, any ongoing libgdata operation can be cancelled + from any other thread by calling g_cancellable_cancel. + If the ongoing operation is doing network activity, the operation will be cancelled as safely as possible (although + the server's state cannot be guaranteed when cancelling a non-idempotent operation, such as an insertion or update, + since the server may have already committed the results of the operation, but might not have returned them to libgdata + yet) and the operation will return to its calling function with a + G_IO_ERROR_CANCELLED error. Similarly, + if the operation is yet to do network activity, it will return with the above error before the network activity is + started, leaving the server unchanged.

+

However, if the operation has finished its network activity, libgdata does not guarantee that it will return with an + error — it may return successfully. There is no way to fix this, as it is an inherent race condition between checking + for cancellation for the last time, and returning the successful result. Rather than reduce the probability of the race + condition occurring, but still have the possibility of it occurring, libgdata will just continue to process an operation + after its network activity is over, and return success.

+

This may be useful in situations where the user is cancelling an operation due to it taking too long; the application + using libgdata may want to make use of the result of the operation, even if it has previously tried to cancel the + operation after network activity finished.

+

The behaviour of cancellation in libgdata can be represented as follows: +

+
+

Figure 3. 

+
+
+The behaviour of cancellation in libgdata. +
+
+


+

+
+
+
+

Privacy

+

Privacy is an important consideration with code such as libgdata's, which handles valuable data such as people's + address books and Google Account login details.

+

Unfortunately, it's infeasible for libgdata to ensure that no private data is ever leaked from a process. To do this + properly would require almost all the data allocated by libgdata (and all the libraries it depends on, all the way down + to the TLS implementation) to use non-pageable memory for all network requests and responses, and to be careful about + zeroing them before freeing them. There isn't enough support for this level of paranoia in the lower levels of the + stack (such as libsoup).

+

However, it is feasible to ensure that the user's password and authentication/authorization tokens aren't leaked. This + is done in several ways in libgdata:

+
    +
  • +

    If libgdata is compiled with libgcr support enabled (using the + --enable-gnome configuration flag), it will use libgcr's support for + non-pageable memory. This will try hard to avoid passwords and auth. tokens being paged out to disk at + any point (although there are circumstances, such as when hibernating, where this is + unavoidable).

    +

    Otherwise, libgdata will ensure that passwords and auth. tokens are zeroed out in memory before being + freed, which lowers the chance of them reaching disk at a later stage.

    +
  • +
  • Unless run with LIBGDATA_DEBUG set to 4, libgdata will attempt to + redact all usernames, passwords and auth. tokens from debug log output. This aims to prevent accidental + disclosure of passwords, etc. in bug reports. Currently, this is implemented using a fixed set of + search patterns, so it's possible that certain bits of private information will not be redacted; any + such occurrence is a bug which should be reported on + GNOME + Bugzilla.

  • +
+

libgdata universally uses HTTPS rather than HTTP for communicating with servers. The port which is used may be changed + for testing purposes, using the LIBGDATA_HTTPS_PORT environment variable; but the protocol used will + always be HTTPS.

+

libgdata provides ways to upload and download files, but does not implement code for loading or saving those files to + or from disk. Since these files will typically be user data (such as their Google Drive documents), it is highly + recommended that they are given restricted permissions, any temporary files are only readable by the current user, + and files are potentially encrypted on disk where appropriate. The aim is to avoid leaking user data to other users + of the system, or to attackers who gain access to the user’s hard drive (which may not be encrypted). libgdata itself + only guarantees that data is encrypted while being sent over the network.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/gdata-running.html b/docs/reference/html/gdata-running.html new file mode 100644 index 0000000..374cfe2 --- /dev/null +++ b/docs/reference/html/gdata-running.html @@ -0,0 +1,132 @@ + + + + +Running GData Applications: GData Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Running GData Applications

+

Running GData Applications — running and debugging GData applications

+
+
+

Running and Debugging GData Applications

+
+

Environment variables

+

libgdata makes use of a few environment variables which affect how it runs, mainly with respect to debugging.

+

LIBGDATA_DEBUG. If this environment variable is set to one of the following values, libgdata will give debug output + (at various levels). If it's unset, no debug output will be produced. +

+
++++ + + + + + + + + + + + + + + + + + + +

0

Output no debug messages or network logs.

1

Output debug messages, but not network logs.

2

Output debug messages and network traffic headers.

3

Output debug messages and full network traffic logs.

+

+ So, to debug a program which uses libgdata, run it from a terminal with the following command:

+
$LIBGDATA_DEBUG=3 ./my-program-name &> libgdata.log
+
+
+
+

Debugging Advice

+

The easiest way to debug problems with libgdata is to use the + LIBGDATA_DEBUG environment variable to observe all the network + traffic being transmitted and received by libgdata. Typically, any problems will occur in the final network + request/response, which is the last one in the log output.

+

If debugging using the environment variables and log output is not possible, it is sometimes possible to diagnose problems + by examining the error responses sent by the Google servers to libgdata. These are exposed as the error messages returned + by libgdata methods; so when handling errors from libgdata method calls, it is a good idea to output the message from + the GError to a debug log, or even as a warning in the user's + .xsession-errors file.

+
+

Example 1. Error Handling when Uploading a Document

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
GDataUploadStream *upload_stream;
+GError *error = NULL; /* make sure to initialise the GError to NULL */
+
+/* Other code goes here. */
+
+upload_stream = gdata_documents_service_upload_document (service, document, slug, content_type, destination_folder, NULL,
+                                                         &error);
+
+/* Handle any errors. */
+if (error != NULL) {
+    /* Note that the error message is outputted to the terminal/logs.
+     * It will contain important debugging information from the Google servers. */
+    g_error ("Error getting upload stream: %s", error->message);
+    g_error_free (error);
+
+    return;
+}
+
+ +
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/gdata.devhelp2 b/docs/reference/html/gdata.devhelp2 new file mode 100644 index 0000000..5d3bd5a --- /dev/null +++ b/docs/reference/html/gdata.devhelp2 @@ -0,0 +1,2118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/reference/html/home.png b/docs/reference/html/home.png new file mode 100644 index 0000000000000000000000000000000000000000..9346b336a784463192c7daab5133a3673dd69845 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRMbARQqaxysz9Q}BI-m)~Y zggoA|1V*z2{cQ=d;!=?fvu4~`n82RKrk1UubNXTJj1GP|o-=>$A29f{JgJ9K`^t{Q z-oWs>M&_hvT&MjX@T4-&sBW+1^4oB5G4r2q!qGktZ!n*!)hjrjd0_4L6;4%u<}orJ u%Vo~x?#i!!ww+1OGuHe}T=cKQUzn^_t)8|WlnDbmjKR~@&t;ucLK6T + + + +GData Reference Manual: GData Reference Manual + + + + + + + +
+
+
+
+

for GData 0.17.9. +

+
+
+
+
+
I. GData Overview
+
+
+GData Overview — overview of libgdata's architecture +
+
+Running GData Applications — running and debugging GData applications +
+
Object Hierarchy
+
+
II. Core API
+
+
Core API
+
+
+Version Information +
+
+GDataService — GData service object +
+
+GDataQuery — GData query object +
+
+GDataFeed — GData feed object +
+
+GDataEntry — GData entry object +
+
+GData Types — miscellaneous data types +
+
+GDataParsable — GData parsable object +
+
+GDataDownloadStream — GData download stream object +
+
+GDataUploadStream — GData upload stream object +
+
+GDataComparable — GData comparable interface +
+
+
Access Control List API
+
+
+GDataAccessHandler — GData access handler interface +
+
+GDataAccessRule — GData access rule object +
+
+
Batch Operation API
+
+
+GDataBatchable — GData batch service interface +
+
+GDataBatchOperation — GData batch operation object +
+
+
Authentication/Authorization API
+
+
+GDataAuthorizer — GData authorization interface +
+
+GDataAuthorizationDomain — GData authorization domain +
+
+GDataClientLoginAuthorizer — GData ClientLogin authorization interface +
+
+GDataGoaAuthorizer — GData GOA authorization interface +
+
+GDataOAuth1Authorizer — GData OAuth 1.0 authorization interface +
+
+GDataOAuth2Authorizer — GData OAuth 2.0 authorization interface +
+
+
Comment API
+
+
+GDataCommentable — GData commentable interface +
+
+GDataComment — GData comment object +
+
+
+
III. Namespace API
+
+
Atom API
+
+
+GDataAuthor — Atom author element +
+
+GDataCategory — Atom category element +
+
+GDataGenerator — Atom generator element +
+
+GDataLink — Atom link element +
+
+
Atom Publishing Protocol API
+
+GDataAPPCategories — GData APP categories object +
+
GData API
+
+
+GDataGDEmailAddress — GData e-mail address element +
+
+GDataGDIMAddress — GData instant messaging address element +
+
+GDataGDName — GData name element +
+
+GDataGDOrganization — GData organization element +
+
+GDataGDPhoneNumber — GData phone number element +
+
+GDataGDPostalAddress — GData postal address element +
+
+GDataGDReminder — GData reminder element +
+
+GDataGDWhen — GData when element +
+
+GDataGDWhere — GData where element +
+
+GDataGDWho — GData who element +
+
+
GContact API
+
+
+GDataGContactCalendar — gContact calendar element +
+
+GDataGContactEvent — gContact event element +
+
+GDataGContactExternalID — gContact externalId element +
+
+GDataGContactJot — gContact jot element +
+
+GDataGContactLanguage — gContact language element +
+
+GDataGContactRelation — gContact relation element +
+
+GDataGContactWebsite — gContact website element +
+
+
Media RSS API
+
+
+GDataMediaCategory — Media RSS category element +
+
+GDataMediaContent — Media RSS content element +
+
+GDataMediaCredit — Media RSS credit element +
+
+GDataMediaThumbnail — Media RSS thumbnail element +
+
+
YouTube API
+
+
+GDataYouTubeCategory — YouTube category element +
+
+GDataYouTubeContent — YouTube content element +
+
+GDataYouTubeCredit — YouTube credit element +
+
+GDataYouTubeState — YouTube state element +
+
+
+
IV. Service APIs
+
+
YouTube API
+
+
+GDataYouTubeService — GData YouTube service object +
+
+GDataYouTubeFeed — GData YouTube feed object +
+
+GDataYouTubeQuery — GData YouTube query object +
+
+GDataYouTubeVideo — GData YouTube video object +
+
+GDataYouTubeComment — GData YouTube comment object +
+
+
Google Calendar API
+
+
+GDataCalendarService — GData Calendar service object +
+
+GDataCalendarFeed — GData Calendar feed object +
+
+GDataCalendarQuery — GData Calendar query object +
+
+GDataCalendarCalendar — GData Calendar calendar object +
+
+GDataCalendarEvent — GData Calendar event object +
+
+GDataCalendarAccessRule — GData Calendar access rule object +
+
+
Google Contacts API
+
+
+GDataContactsService — GData Contacts service object +
+
+GDataContactsQuery — GData Contacts query object +
+
+GDataContactsContact — GData Contacts contact object +
+
+GDataContactsGroup — GData Contacts group object +
+
+
Google Documents/Drive API
+
+
+GDataDocumentsService — GData Documents service object +
+
+GDataDocumentsFeed — GData documents feed object +
+
+GDataDocumentsQuery — GData Documents query object +
+
+GDataDocumentsUploadQuery — GData Documents upload query object +
+
+GDataDocumentsEntry — GData document object abstract class +
+
+GDataDocumentsDocument — GData documents document object +
+
+GDataDocumentsFolder — GData documents folder object +
+
+GDataDocumentsDrawing — GData Documents drawing object +
+
+GDataDocumentsPdf — GData Documents pdf object +
+
+GDataDocumentsPresentation — GData documents presentation object +
+
+GDataDocumentsSpreadsheet — GData Documents spreadsheet object +
+
+GDataDocumentsText — GData Documents text object +
+
+GDataDocumentsMetadata — GData document service metadata class +
+
+GDataDocumentsAccessRule — GData Documents access rule object +
+
+
Google PicasaWeb API
+
+
+GDataPicasaWebService — GData PicasaWeb service object +
+
+GDataPicasaWebFeed — GData PicasaWeb Feed object +
+
+GDataPicasaWebQuery — GData PicasaWeb query object +
+
+GDataPicasaWebAlbum — GData PicasaWeb album object +
+
+GDataPicasaWebFile — GData PicasaWeb file object +
+
+GDataPicasaWebUser — GData PicasaWeb User object +
+
+GDataPicasaWebComment — GData PicasaWeb comment object +
+
+
Google Tasks API
+
+
+GDataTasksService — GData Tasks service object +
+
+GDataTasksQuery — GData Tasks query object +
+
+GDataTasksTasklist — GData Tasks tasklist object +
+
+GDataTasksTask — GData Tasks task object +
+
+
Google Freebase API
+
+
+GDataFreebaseService — GData Freebase service object +
+
+GDataFreebaseQuery — GData Freebase query object +
+
+GDataFreebaseResult — GData Freebase result object +
+
+GDataFreebaseTopicQuery — GData Freebase topic query object +
+
+GDataFreebaseTopicResult — GData Freebase topic result object +
+
+GDataFreebaseSearchQuery — GData Freebase query object +
+
+GDataFreebaseSearchResult — GData Freebase search result object +
+
+
+
V. Appendices
+
Annotation Glossary
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/left-insensitive.png b/docs/reference/html/left-insensitive.png new file mode 100644 index 0000000000000000000000000000000000000000..3269393a7f72af744a772c437bd7b3976c23709d GIT binary patch literal 395 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefH0HbvDJm`3=E7Co-U3d7N^fnTIWJ3j{^~q!iyia4kV=mdU|Jhfgdm;SLIpiYJ7wv^kjFiECCc&8T30!RG0~&BG=X zlu#U4@Z`))V`EG9e^NqDr#{!5k|)wT* zYTNt0`@q%TAD$){%#eQ?;$^ly8}yZCU%T~u0XM^%t?f#e znB*EuLv2rP%K3BMvFO}YmnR}KSgH;`EHL$)^!tH~iBxZ#h^zJi*#P5Xb6B50U@nx2 mU;T=yfcwnSOsS9SKd{M#MlNkCuvG>I8-u5-pUXO@geCx5`k@p6 literal 0 HcmV?d00001 diff --git a/docs/reference/html/left.png b/docs/reference/html/left.png new file mode 100644 index 0000000000000000000000000000000000000000..2abde032b0c98b756b12d380da4318205cd78470 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRMaSLay~*pwMJb7sn8b(^oI8=R24v(*CjE{-BFv z0BhvLm?o9(UC{-Ci?lD?Ve-7-xypA!PTC(0^;>UheG4Altep3@`rO0#Rjs1)RxCLr zE5mee>7m*=%yEk+GVvGkRy0O&*&MTd5SjH(lgq~7r%6oRW$l1p-*S}iC>@fyDsz%y z`UIW8^Ao=maGhj3E8{7Cd_qof`K4oa->23`>&M2+XBtd2J`8jogQu&X%Q~loCIG_? BVG#fT literal 0 HcmV?d00001 diff --git a/docs/reference/html/pt01.html b/docs/reference/html/pt01.html new file mode 100644 index 0000000..afcf898 --- /dev/null +++ b/docs/reference/html/pt01.html @@ -0,0 +1,41 @@ + + + + +Part I. GData Overview: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Part I. GData Overview

+
+

Table of Contents

+
+
+GData Overview — overview of libgdata's architecture +
+
+Running GData Applications — running and debugging GData applications +
+
Object Hierarchy
+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/pt02.html b/docs/reference/html/pt02.html new file mode 100644 index 0000000..d347bbb --- /dev/null +++ b/docs/reference/html/pt02.html @@ -0,0 +1,115 @@ + + + + +Part II. Core API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Part II. Core API

+
+

Table of Contents

+
+
Core API
+
+
+Version Information +
+
+GDataService — GData service object +
+
+GDataQuery — GData query object +
+
+GDataFeed — GData feed object +
+
+GDataEntry — GData entry object +
+
+GData Types — miscellaneous data types +
+
+GDataParsable — GData parsable object +
+
+GDataDownloadStream — GData download stream object +
+
+GDataUploadStream — GData upload stream object +
+
+GDataComparable — GData comparable interface +
+
+
Access Control List API
+
+
+GDataAccessHandler — GData access handler interface +
+
+GDataAccessRule — GData access rule object +
+
+
Batch Operation API
+
+
+GDataBatchable — GData batch service interface +
+
+GDataBatchOperation — GData batch operation object +
+
+
Authentication/Authorization API
+
+
+GDataAuthorizer — GData authorization interface +
+
+GDataAuthorizationDomain — GData authorization domain +
+
+GDataClientLoginAuthorizer — GData ClientLogin authorization interface +
+
+GDataGoaAuthorizer — GData GOA authorization interface +
+
+GDataOAuth1Authorizer — GData OAuth 1.0 authorization interface +
+
+GDataOAuth2Authorizer — GData OAuth 2.0 authorization interface +
+
+
Comment API
+
+
+GDataCommentable — GData commentable interface +
+
+GDataComment — GData comment object +
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/pt03.html b/docs/reference/html/pt03.html new file mode 100644 index 0000000..8fee09d --- /dev/null +++ b/docs/reference/html/pt03.html @@ -0,0 +1,140 @@ + + + + +Part III. Namespace API: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Part III. Namespace API

+
+

Table of Contents

+
+
Atom API
+
+
+GDataAuthor — Atom author element +
+
+GDataCategory — Atom category element +
+
+GDataGenerator — Atom generator element +
+
+GDataLink — Atom link element +
+
+
Atom Publishing Protocol API
+
+GDataAPPCategories — GData APP categories object +
+
GData API
+
+
+GDataGDEmailAddress — GData e-mail address element +
+
+GDataGDIMAddress — GData instant messaging address element +
+
+GDataGDName — GData name element +
+
+GDataGDOrganization — GData organization element +
+
+GDataGDPhoneNumber — GData phone number element +
+
+GDataGDPostalAddress — GData postal address element +
+
+GDataGDReminder — GData reminder element +
+
+GDataGDWhen — GData when element +
+
+GDataGDWhere — GData where element +
+
+GDataGDWho — GData who element +
+
+
GContact API
+
+
+GDataGContactCalendar — gContact calendar element +
+
+GDataGContactEvent — gContact event element +
+
+GDataGContactExternalID — gContact externalId element +
+
+GDataGContactJot — gContact jot element +
+
+GDataGContactLanguage — gContact language element +
+
+GDataGContactRelation — gContact relation element +
+
+GDataGContactWebsite — gContact website element +
+
+
Media RSS API
+
+
+GDataMediaCategory — Media RSS category element +
+
+GDataMediaContent — Media RSS content element +
+
+GDataMediaCredit — Media RSS credit element +
+
+GDataMediaThumbnail — Media RSS thumbnail element +
+
+
YouTube API
+
+
+GDataYouTubeCategory — YouTube category element +
+
+GDataYouTubeContent — YouTube content element +
+
+GDataYouTubeCredit — YouTube credit element +
+
+GDataYouTubeState — YouTube state element +
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/pt04.html b/docs/reference/html/pt04.html new file mode 100644 index 0000000..c81be7e --- /dev/null +++ b/docs/reference/html/pt04.html @@ -0,0 +1,196 @@ + + + + +Part IV. Service APIs: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Part IV. Service APIs

+
+

Table of Contents

+
+
YouTube API
+
+
+GDataYouTubeService — GData YouTube service object +
+
+GDataYouTubeFeed — GData YouTube feed object +
+
+GDataYouTubeQuery — GData YouTube query object +
+
+GDataYouTubeVideo — GData YouTube video object +
+
+GDataYouTubeComment — GData YouTube comment object +
+
+
Google Calendar API
+
+
+GDataCalendarService — GData Calendar service object +
+
+GDataCalendarFeed — GData Calendar feed object +
+
+GDataCalendarQuery — GData Calendar query object +
+
+GDataCalendarCalendar — GData Calendar calendar object +
+
+GDataCalendarEvent — GData Calendar event object +
+
+GDataCalendarAccessRule — GData Calendar access rule object +
+
+
Google Contacts API
+
+
+GDataContactsService — GData Contacts service object +
+
+GDataContactsQuery — GData Contacts query object +
+
+GDataContactsContact — GData Contacts contact object +
+
+GDataContactsGroup — GData Contacts group object +
+
+
Google Documents/Drive API
+
+
+GDataDocumentsService — GData Documents service object +
+
+GDataDocumentsFeed — GData documents feed object +
+
+GDataDocumentsQuery — GData Documents query object +
+
+GDataDocumentsUploadQuery — GData Documents upload query object +
+
+GDataDocumentsEntry — GData document object abstract class +
+
+GDataDocumentsDocument — GData documents document object +
+
+GDataDocumentsFolder — GData documents folder object +
+
+GDataDocumentsDrawing — GData Documents drawing object +
+
+GDataDocumentsPdf — GData Documents pdf object +
+
+GDataDocumentsPresentation — GData documents presentation object +
+
+GDataDocumentsSpreadsheet — GData Documents spreadsheet object +
+
+GDataDocumentsText — GData Documents text object +
+
+GDataDocumentsMetadata — GData document service metadata class +
+
+GDataDocumentsAccessRule — GData Documents access rule object +
+
+
Google PicasaWeb API
+
+
+GDataPicasaWebService — GData PicasaWeb service object +
+
+GDataPicasaWebFeed — GData PicasaWeb Feed object +
+
+GDataPicasaWebQuery — GData PicasaWeb query object +
+
+GDataPicasaWebAlbum — GData PicasaWeb album object +
+
+GDataPicasaWebFile — GData PicasaWeb file object +
+
+GDataPicasaWebUser — GData PicasaWeb User object +
+
+GDataPicasaWebComment — GData PicasaWeb comment object +
+
+
Google Tasks API
+
+
+GDataTasksService — GData Tasks service object +
+
+GDataTasksQuery — GData Tasks query object +
+
+GDataTasksTasklist — GData Tasks tasklist object +
+
+GDataTasksTask — GData Tasks task object +
+
+
Google Freebase API
+
+
+GDataFreebaseService — GData Freebase service object +
+
+GDataFreebaseQuery — GData Freebase query object +
+
+GDataFreebaseResult — GData Freebase result object +
+
+GDataFreebaseTopicQuery — GData Freebase topic query object +
+
+GDataFreebaseTopicResult — GData Freebase topic result object +
+
+GDataFreebaseSearchQuery — GData Freebase query object +
+
+GDataFreebaseSearchResult — GData Freebase search result object +
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/pt05.html b/docs/reference/html/pt05.html new file mode 100644 index 0000000..e3bf952 --- /dev/null +++ b/docs/reference/html/pt05.html @@ -0,0 +1,33 @@ + + + + +Part V. Appendices: GData Reference Manual + + + + + + + + + + + + + + + + +
+

+Part V. Appendices

+
+

Table of Contents

+
Annotation Glossary
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/right-insensitive.png b/docs/reference/html/right-insensitive.png new file mode 100644 index 0000000000000000000000000000000000000000..4c95785b907b978f36674cd98bf5302669c15c1b GIT binary patch literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefG`u!(zUX23=E7+o-U3d7N^fn+URvSL8NuRG*{E) z?#-+97X-^pidQ*u@StO1(S@7g8g>nnA24$?ty?)cmuaa|Y>ez2*_Ia?6HP4j{3LIs zTr!s1ao_Sz^~3e4zRJGAjKZGn=XP#)Wmuo-QN>teTzzI!&R*jMI^Oa#7_ukLYdicf zOx;1mb-rt04s-c|uIH8fnX}$)XJa^0_-F3(pA%=sGI<|(n_*&=yYt96+n5InXn_GN+EraJI9q(O+n{6MQKErp&KxRvpfn0xh z`sSMqH(2Z%?kaFBTf06W^y=UDA9gR9YrwNS*1pjB((0K%&+SbAx3`XA&dKZ}j*nX7 QfdRze>FVdQ&MBb@09|aA9{>OV literal 0 HcmV?d00001 diff --git a/docs/reference/html/right.png b/docs/reference/html/right.png new file mode 100644 index 0000000000000000000000000000000000000000..76260ec8865f4e13cd269ec62eccd78a33adba3c GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRMbR+#PqI2*V^#7sn8b(^oI8=W9$9IsUQVezxzH zy`G{eu0`y#boSlU-NAlQG~=D)BPJG4k(^0qdDa(AdQvI0d|vJT=i7_<_D6`Cy?Dm; zP0@1EeB~D|O$oQe*sxL-P;q{2UCr}fN-o#M~tpZzsGyfNz46SZlIJCbKH zZQscEqpOfBCPDgxat=WqaOD zAMcC|b$^}n6Nc2ZR}cQ<*3ZGo-@Nv;tPNahcPF)MQzvRBRf}LQ6C*}jR`Xtyny8Fe zD$nsBnoA_SG`qQdqsZ{$5p~9&Bj1yg%~dai&mO#=B+dJ1Fkr-r`=5Q+mDN=WLD%h# zk*sIWo)r`neE9G|kzB)a*KA9G4GbqsLe%$YkPkc>V%D=>ZEZGN5Yn-zxngB(W!_iI{bx%+`hFY@ z+@yU2>e;LGQJgDo%SXzKk%qxBgiJgTGiz%>%b}EKcyz?1q*}R5F>n=AyTxW<@ALiq ze0u6b*XOL1YqMI;BBC^s6NQsGybz#uaY*_;P zFPuaRF}fv`e0IpS!DN!a+~be$c-sbp5hE@@1|IwjLR;Nbt`%PRcnz15z@t-m*WxRD zw2A#)b*+tTWU?;Mdnm&rT;gWXITZ&q-+)KgR$ciL=oD*c>;E+w$6V+cFHq;RUts24 zqBQy)L`no2LEo;6^+vLhqGQ6zcx@8+oz{xl*ptvFYW?nReQz$GVZ4cN!8&#$_$xpG zTIWmKi4NIc>3r4C;P*cNc(yy=|KvS4Q6U2@tvRyJ0dfrHneXrr3^ndC?{hYa-P{qY zt}v45v@}EB2j;9AV=KMUV`F0t|H#of!=_wVL6<62KI3CA#}}DtX;;B6vNjM#6aEy~ zU2NIg+e55#I*6jq$YMCBVu7aP>avNBh=VCjQaVP)zPY)E6~?eNaTo8aom$dx3vX?~ z@jB4zr^I){z^rzg8NKs(-GCAO{7N8FK<3!9zZp`k*k~3Q&7pv1?(%8bgcl0+t$z-q zqN0jRN?<$0g8__lwf5<11>19@xIFix+ek?cS49x6p#?1c`iw$5r@AH{n=0ay6kPvj z-TQu?b{h)=Uku~ub-}JfW8_xhPV2$+)z5q}?vLu`SGViI;EjPqE+|ZQE|`<3aIMuJ zm7kwK?evi}`oKHT=9?5~)CG2;r!exZx`bMtkkSSXTFPV^b(8)_Om9^Pu+RXkNFw6Nwe*r9L* zx+>1q+u!NmlkT(lVZ-_t$4h**`AX{bGDE6Z}%!9)5sbf?9+b29O_P~dCpt;C>5Q=*rz%< zuWmE86fyuF)^EmXi{7W7pHy94eM}xuP%dC!)qHMrJ!FdL5J&m^l2ynjOQn#;MD2<> z*5DnX%7m@5l$l?PpKy9V5y`VfDZ8I~{Ey+wTFR7!qg_9YU>_VGJ8HhSVU{rKZD$Ik z>{Bi167jNdLo~|&%r2aBHFDqcu*nz>>n_-R&pxh$mU!8BT21Q_*e_kD>7s}Cl1*4T zGA*stw$&PSyapjvLpqliQd;$il<@XNPIvXZ{iwuG%U^jC7LytxDsGJp&X9`Ay4mDV z{uE+m1nB_kW^ijrNZ#SmVs;R=--+XXyO*iY(G-F~I_}kkhW$Aj>HU^&yo`b0zyAzU zS-TgMPn6<`==UFZJ~h7=yZ=ucKw$%#jIk}Zm)0%5Hz}#9m>3vgVPQxl@(DKO_0?Vr zQ*7VtzzPhDN@SqX`SSRKLEioOc%a!{1QVVI@;vXh=(GR(ZEx54zb|30(-ffV^3r_^ zVP^LY#abrR61{*faNU_*U0Z|doqIP|R8(j%Y8FjEUd8uYzs9?7mX8fJ9sQzKKrY~% zU(w8;a+U`+;e#C^c-p1<1zJT%hli)zGe@ncROOM_ltROkmo(Dfi(La(Deo=M zgBUe3^WB}fT3COR=Skt4^R93*)2=XM`^I0ZjuPVH+@yoCOxoj67gg1fU>q86Z|@|q zn9w5dA(WfcHPN8X=js$(nAV+XZ8aYL`Ia#jx;~UTGcyCsKDgB6b;g>GDBG+E?p*r) z`@OxreF!8|g&s^Mf>O9pt0-N_gVTPYF`SH#*J}7Dn67jLC2i(lGM{z7zHN!Uo!vr% z+aA>N-Kk8*p=-MD{!w#q!dGUI__^_J3;nxa>XP82(B&T z%9m@G$(pO^o0}W;_4uEn?$PWI7A950pRoLA&(_)N5T*uaUP?m|IyxMV{1L`U=>Omi z4hn{LLdLmScV!(oB+R;2FUd%J=p&EWOE-*~yc7ob`S{k+?r*;=2#O$AfzlDazv*?`ytq?yemo)+`m*wF~FLmU`EX*2G?S5cV z^QF3`=6i5(d3E)xOb*kof1W&nawi30Q|*El;4EqiJm=%9t*++&ET&TFaC!WGYks}IXFC|&J?{p_YbE68sYQjw=gbduWS|BtyARXU&Ne| z-*|@Nr)b?0IAyH&u^O}98tzD0sF$17T1u*(^QF{vHI!e=PBxw=PW>5%+ zHkH0*zdm)+)k2;k^5)3wqLy;ru;H%zOuVZ8v5QCa{7!@S{`ASR`jz5=>!DnqdyVVj zWpQJ1NK=<)8DEZE@ABlrpwni_9v9b?rMZu#^_tNpyy~XEhI7rLYmaYzx&NF$=vl^YKYpTMYH( zUAA~sbJSA#odON)CJG7kmT^_@Zf{T?J))+j4&DHo!klk=EDup>-aowxG-;tmVf1U| zN^H=e)Uc^A92j8*Wo65&0%)SOm6ba<-Z1Ma!)9-O4vvcQ@^Z7CsL063)Kr#8nR=k_ zf4=qaj-bLDiDS`=V>6;8BlB7xqTmfntx(y)kf-<%dsv1*Gy6s$Sax%09&xIeIui#D zv2D0KgdD4V*|GRlo15Sj=^;G*=HsnDrLPdHUh0ApzCxx*^bX;nst$-ceb@5 z2}!%*Qy>}N-iUp}6q279Ve4J#JUGD4+q}3f8su_9asC}K%A);+Y%Vz%V<{@z$@h)h zk@2^ThxX!kzX~LhTMG5^3p1B84c5Z&tst z5th_sw25@biAhwFA1QT>0s$L-Z`-k3Mwb(*yZ=ncd-|AX>7W}wy<120xVx0AKj@#Fronz{1ZRVWM;v0U= zdVUJ&Eg~)JH;YaeMW_^bl8_Za_g+m1c0S%zFG}|-A8D`J39YX(&M&CxqNNU$Ag83M z0Xo&Dm*@9(`W?4>9YIhxxo!fn1A7s@k@=JgyL&(~ENFzvDXq^jX6s7YsgBz$R?q+a zawUgNx{ySd*m0S%Z?l#2RcgfcZu*b4TztMA`w{aRiJ1lPX+t|??y5VdOG_x;V(GYB zQbMb~BH5l8f8H@c^S#lLF25x#k5`0ZOsQ+aiW^vF0tj$J2=VdD`Aq z{ zPpV@leVTRn!)D(YWSsN)*M|rY8 z^K#_K-7GYsyuAHB;?=!4%TZ|RwEnFjfHA~}vfKF0Ehecp-J6~~kGHDEYL{Ff?mfIT z?kh}9w>`1{UAz1133bx&mPAFQ``?WKvfP{Dp3Yii0#Sq0+1Tj^OS>(z9d}WYLZomZ z&t^`GFU9ZO7So})i}p1eks20$rT~LjI>oEY_MG&lD_OxiUcStB0=dUH=4%$hvfr@} zKio>aetf&5rHT_IBUqzbL22UfU5>y&Ujg#=(c8KPugqFE)JQ8wM^2oQnkuek$B2gd zg_C_NAd_V3ao?x9y z!+N0fu-#Z_Rs$+7v&?EC2`?O%mV~T~>I+?!b%ka<5}r%gPCNM;{Dj#JC*hFp=I_nS z;w|Qv@c!@uF|ADRLy`2qd87tcEHpe)S~YyUYgrPQ(zYiU+m<*kYK1XHA@r}|=Q?J_ zSwo(0*h+!j%~ec>#$!{7==YWsI)`%T>CF|cLNqpcpT=_dTspgo2UJuXY)%v*(nb9a zmO2lXyRA{G1NHzw5*`*7Ob?=B@at>{e72x|VyK){8VwQ?tM`h7W7JUH&d0a5^2AFunk7zsqVR^b%~>}1|{-VOG2Cr#dU@fWM+s>Gg>oZQ8XD(q?wdF zPVYXn9WGx~F74;9v{84)v<}vhclFOSdRd=EYa2CMgzv5*)+T?o4)jj0T$lVqE#Q2h z+P%hV^7*r?^b}1rf!xXQneM&^`RA92#rC9N#tp*4S7q#r@8~TyIyDa$w5c%Oy>b54 zmH||qxj*Jb;1h5E>r8KIv;#~+Vzf6HmSS_w6^NynLPy`R3LAxj`3i-vbRGd7tGPs} z#5CIYC${s+?H|cY$n|(_a43DE4JKfcmNisN>hhM>dC3uWcq6MlOoL6yq=#F3DUG!+ z3FqpSR+L_U)W=YlnfDKaXnudpW+cEl;o;y|`&b9zVqvlGH|ty-H1X6N z$hSlwO-;Z*i|lM9Ju~yLRj%&4k0Fhim|mo0R0srH?SZaw21n3QX#oQcCLfm*2RnU( zbUsdiTF&rx`rlVa-gZ7qX7C^VS>?XVZ-59UvAhok3%!UfB%_;n7vvPKn;$f>ggNgHT%kwT-ee2Yf^fD-v$e3 zo*b;Qoj4hu6g2p#kmVlSJj zdwOJCTgS)8vj<*zVyzn?6nlMvf3Ho`QWlq(c(E};+g!0rC_RM*Jh@_llrXVF#~_>fv2TxOvM<37D|{pV~+Pnlr3cEX3ntQkH5}% zILAvn(3xCg(CJ~>`=Mp?0u55ngB0PT(;IEe$?y@PBr?*kM{eiS^;6{47@jFJ zxEgb>xL;nUdm_9#Z7TL|yW$B{7R> zg&@b}yDeze0ELkIeiW@drHHo-q_?-%cD7ol$O4wVUr- zbzJmVPn8J5!WmiZk4K~llaZ3jL4aRBxloz`g4(iqn)v>m@q#e`V1-zLSlnrCz`@CB ztaNZ_XracGN zo<>Hg{&v;Th7xIr0`#4{Hj&_%Jed&}O(U>!JS~gvNhwaEtir`PdcB&HYnj>AqY^$^ zxW?x70aJ(NZrax4XX%hjc$4o!TlmJu$jIT5zCW^Z*J&-c`Xa6&;T^g;T9`VV*Q=6; z${*nz+q=76^VUnZOSZC(T5{sLCZ?i{SLGa8h&PCC>AP)lb0(p2i)$k1H>8*@HJkX_&juhegY$*O-l9G!SW+{$NPOC=* zq~Sa5L2Rs1xUFU1UQ(m8PTiVELI;=O#Kij6!#`KPvl0--**2=E{K&XmAIppCSE))# z3g(6?B4hO*O6KQH28yj*8ikVf#WZrO6p3O03QA{+nzJUQ| zzGjc3wQX+w5;ZPDsE|bdCz)UAJdLZsM5WfBLg=*nR{Hwg(p5v^AHa08Gzz$~D-H4} z2QK~~i~q1(2q}G5FlOfdSk6nAX%rz{Xk?g!Yues1PPA$P=Wvi6J@K-q%~@rL+3e{i zL1pW@^mvELQ>k4vA$sGXm!VO>lOz~1nnt%Cqd3vq)iE~X-L=V;s#}K^e#`R!Z@lL_ zVzu}}SieB6f2FUX;sZpZ*X|E23?nSinfUys`Q#5r?Ft%P|7Ap2L?-SYz(-(mC4CG% z!hY*z;nFo2yX-&u{}2)oJ;Qt)mrDq7zMRzAkxzX0LJ8r)foMh&)1YL%-9arDtb55R zB3Gc+l_z3Q;icLA2@5Ok6oX@EQt51&CS+rzYP!2uIk=~LMz2Jbs@_whKn;Z3bt~Nk zGat+&#BE+dw>KL=JgU{)s;_jxxBCf-=kO+7S69jV_8Q_VBKXd$;O8ef{9-6|j#PB1 z#%)|Q7ZdHOy1cwdJAVE|mwqWtgfv7jTW#k>^4ESvjm8ANlfneGFOMI=q^d-iir!_Z z;z{BYbTZ+u^48#^smJzxObiPy?KO*(TpeioOltgM>8oPZB9HKGYa+R8`RT!gP^KR% zdU(>foT6{;;o8E0&rw>SV(t22!jd>FGQrxyUJNqj*FW6o-4|fdxSdT@`@>5U1E(N{ zG)I5%HczYhP)UT=i%I@{p9?m}49`u7ANI5OymUUp{2W0R?hm6YZ2{;&Ntt&$hve7Q z)tQl4o*y#hw6?YaNQ_+6w-I1~jIox8G!~L7AXmSBi4}e&WYN7o>}NCW{>}oj27`n1 zKwA}jf?hZ7kLJkFsA=Y?RnWjpD%=5_<#oEvz~>79k6EKH>^wXZgj@D(68XPY-YT*T z{$pg{BH($TDiX20XWXsOXnxNrp`g9qC~OF8fZ9;0|-= z&ZATeL*Eo`kM~s^^4}R_3t5i5spnumpOV}<8H@?lAMh;pg%@S3& z50t#Qb26?I33fDoLgz;d=vOJlsg0?P!NL81hNy05y0Y}#Qs>&)!;(w3&eKf$g}=Gp z+P2I$9co(t!St~)Htt;ZiA}rxtUqL$KqnSV0B@sBY_IuyKv63Nvt79E?dHw4`?kS#4XWVr(Q`(OEtL1%??ygK6QMh$p zy&cI#uyIdMg7xCNH~ZGwExWkXjvwgkp4&7orOK!aHcMOME%YaUfl=8vn2M*!Wsn?H zHFz;aJDLV>#E(?WuKqUGx`~I!q`wPU=%cW)n?-nEo!31qo7Tr>hh5;Ipaqyrl^Ot< zg1c;K$;qJwwO7Dkwv)v(05o}mMgHzE?|Eis=47#s6M$^9vtLm=Iy$0ZVy5!iCPhR< z@UDTla+WIjjmxG+o>FSxE(a^C-OelwWGO=;BI0|^K)^~#NeM(BK)IXK6{e4m^o=Gi zcIO)afCn&STEb9}%WC=frwt&$R;UR8dtKVxEZoV?&+ln%{amtU#PhJ0lSFGx#(GfO z$cM*m7l}aSXY)kB3g?EVanEitEahLrsOIu6YqJCD8Lr>TMSN(G@K#`DM$g}@39>Ug zy<+6-$?F7}kmhjYE#9r$>Dm591tnc4f}K!Z+N(OcK4KB~MDmXjM^0}r>q!6xPo zt-HK|*M&a52}aqRUT2jYLD4EFR3%^Q?LV3<6d)#@4f*mtUyuBI3UP8~8HuHU~#X$y}C7@Kk(! zd@H{mxAA;c5NL5qqdmC$uosBML73D*D+=`1Dc$$QHxn7M4FYP*kHid4&rYi?P*^sV z!u6InClL}G;S)vLM1+L*8_*Ol4zK}#e}9)${0HL(7#vMsbWefxqR#aA^o$_*U<`1nucxbou1k2)15a*-?Pn9Q)cq0WKqKYb71+}qa zrQBG5L!{0@ApkEK3Q;;x??RB;g5*oYk!wIHSS)2ZaExE_};53hG# zh>ltP_J(#H`*E};3XPw(Di1F{@y9Psip(r5FqZq&umh{?_W4Lf@`Q)# z6`O!Jjk;Fx?o6AwN{QR!JAT8{F9CaSEz@=j%C0$)T!O0-s6dv$rl-Qf*l}i@A>EKx zVEs@|oK3o2&$1SLfM?0ccX8b8_-w?UhBhC44dWwpiLSIOP(G*uXJk1hGifNFl`*F1 z`&Y}5u)6u=#4Uk%-BG5Vr6$+OiD`BQbzdF>*TR_0jG_|!=g#6|IwrMMpnT4sh zJ&9UsT1IQ$H>JE^&Br(F!s=qcg}uCJ!87hc2s2wr+Q?fEr8_GxTi9}MqGta+o{o-E z__f4&%Rle0q;y-EUgF__{U6w9b|=Kl^hh~TmF-F5&nFe;cDgS8_hR>{_A`spw0J-O z$ccCL_lE{k;iZ7@cwV;%*2sts9|NP0Yh5X0xc9xfESX36m+TGIc6YolO zgwe@H*@s6*Tzq$yxLhECTv=YuPA%ZHu4w<_UXoR4l%&n@RDtr8N7WMz=Tsaj_ukg4S_fFuU=0-u_i8dPjbe6#>P<-9PX2)TcGApUYCBn`Y4 z-4_}a@4PpLUotTjIku|+V#$Yz!U-_34wHk)F@`3>#r`4fO#vFv{jg=C$G2Vdy`4Ad zP#YWXrH&BbYBe(AnzJ?*fYbm5zvEZLdU{>z&Y8ox15)AsDGT4*`8aPx>OIy<$J^SL zE>E^zzI;jWPu4&H=`h#<;L!~a565gT8OraT89LsnX?!n@zTd5zgQ=So%Fx}D8%9o+ zygCq%y6r8T92^w5;~91qJ!AyY?cd|SV*nE|YWBVuN!F3Jw*aIejJ@~sfCtoGdW!HExM=q+auBY)vz6D#%(BAEtsu|8RK$xiaIHH@IuC+HJBTEho!`SiIKRdJRM}h@o z)2j)y#ee$GzqWWY4r~O~n~y&~jOF@V9*?-Nssw?ozh;q^?5im7+24CTUZ~0BYJ7cu zFgv18Mn*Aw_{ae~jEKO1=;1OOu{umW}; zOqP?2t0;)5>z<)d*a>J5+a6Cb?_VsnsNRn;?^o;psFTn!=JM$09jkubkF>P3xVX5a zB*y1Yaq;k6QdL^agd~ex`9KNL^^=+DMziq7x2hHlnC_JtJklk=XQV3 zAL|^mP|!UA3*nNO$&$!Y zr_Tbf_)qP|W7|(D6-fh+fzee7!Y5eKzco!2vmqSyiz;<0pw(w(V`GA`^D(gr^1R$k zs(d$8GdDf$eSOf4_gX1N=2h%A8X(YhfoWYFt+N?5>*uK9M5Z>h*vnwYOSM|?4%I6u z@|9A|GP4aF+0Ltj(cLeg2c_5R)dQdPz_*xsE`XS)610CFsH%;XJO}6b`$lF8E=CcR zoalWK;qpW()6>h?EU!Z}yq?hI;$z?P6;Q`FOQCFQL#Yk#TOS1)8#b^2Ye)jpY9RCw z@;YU1XSY+Fed0p3`kNqsD;q55?-oUqEyfBL%%>Dl$L!aaBP9oCrOdk38z2z^6fdl{ zw#;1*m?{*o`@;Z83J`zE3ELL3_?&EHZD9Ei=)tpdBoCgYeAJCYq-1B{4p=gNes|zl zUYwt6ls~hhe`3E0paQT{D)jiJzAvemZ?b$R>qx`vG5Q!8tY3 zj=dvgrh@tQ)_NB^HWJ^<ixF6%{~j5w{G+o*m@-~{Ot3z!VBIx5x@OEC+Tr|+ahqc3%}6C z#ahR2$$rVR%4NIn-=wgb5?%%#4H9c*YUn-j{23sGRX z7R0D?Ih-1si_;fuEHFn@Y~#n9=(GkH6z!(WW&P+6mhoy8^J!%-xeQxuvDggHYJsH8 z5bO^bV2qfRg&A)?;*G_2cMD%n&{3V%S&(`s4H!U>(b)kkdBXU3`F%)*c6q6>v@6O1rjnbc>Y&w;wQyME%%7g zBhxCJ(6es}EY7J)sn5N(kgYJTYHSiL?JO;vcB?$)$0y`t7GgdZBxJ*kJ-x_lS!Htv zoU0%G%SAD0SV2WiLDi`ZcMV51e_7uSAxydb)OziJND1nXnsQPvYhzC$%dQe;8+Zd7svA1tqiHyA8 zLX2rz#KMa@u{NMo(CPT>cplb3$1N6DG3~1#EGBZdooy<1!kzbvHzi`i781p!_h^CS z3u&z{bYTajIpg;#4d%@i0g42iHiUL^FYG)e7#wz{=w7)JNg#<8z$Oh0D4>>!MdVTd z&%vOLz163y32H8u=N8_P3roZrrvQt-L_!?f&^I){2y-aX9RftjCyKMPb(e7s-|XqF z7F-}K>nJW?hdUa-Q2Ene>^=?d5zMc$_3r{)a-b4eV1Vkaktm+=4(>>c^Vo$7sIAQu zHI#Z?;=Yn~In0f?uNg?sokf&-T4Va!w5zjEyQ1tddZj-pvqCl+_L|ihWB-G_OCjnj z^zvmZa){t=wC~{CLj#OeaX3mnabJKVsxwCndKu|(r-~gMi87b0BPi^9eGdG}|K$A& zxO@vHt=Uwy-<#I1sJy@Dv1jKeu#y?b`)(e^^8F0WKx!Kke^>sf?WvP#1)@$y)3TSA zi*fZz*`63KK|=1mi&H#opnOZ0X`_#be3v zb#=>UVYE8E2SHPQg-AlG=8A%@8r690PIA4A^Tg_|s>1%tsPqki09_M1lk5>I z-LrK42~2Rx?Cf;#qls^LD+{Yk>{7;E&|uv{Mx;X4KAM&S3(k2+^>B%NE6AETm^@_JKu zhWXcEIpp(D$*t4Q1nQJtp{7PBCr~F+X+I9b-$-aTH02=0f`)E?T(5ZgzE4&tDzs02 z?xGl%wS5cE3aBz3w0t5!;3DS1h#D$)TMa*%c5lzXFks0?9KddCOK@(9!2@oad zyL0~-zU@}zbR)s8T3$r+V(qRX@A@He%WgtZVUXQ+pSzDrfRJADoAYPZuSoI*E2CC; zrpcPW+ z0DlAWdCKXNS2y>;qgeRwin}=w!U7^iEMVnGdfvY-0SmRpZhp2$^c_e4f+?(q*M_ZJ^bbkk(|qhb>h5>`e`mFV%gZofl8`Hv&ywK-k@ zVo6SntfFf`@r{d*?`B2+=aE6qJ+$`Vj)k21TSSB<)zg4B*=Ra2>gPD^?7*vyrc zr+bS=IYLDc#@L}0el9Sv&Q3{s{6lx45C|?lel>933N-q<2GWF+h5rGnWG5LluB?o$ zp%7rFntkP8qIH^3?&mY?Mb5|}2at|BKu1u^vD5)PZGgi7Ep6cJ>tXqVPQg^$N9P?_Z~*0#}Tg`avCHL z?)mS+o-x6^fP4m+-c}Lc4cPhkfE{rAkI5z7`3>!kVf!u+;Y9!FTz5>qoDSQfA|_k` zzK^tBsPd38F((1pg~z+_zdMU89Zg?+y`S88Zw6&3@zN3O*-aIof&}T6s!7do@S@1@ zhuw|mAlvRpLxw%?Y_%%J=T)^yNrIW`_5R(IRMV`d2HpAplyKeRTcz!Ow6Ya*kE~0Wt0e$dEr>)vO_se+mk2x_$KUnt=+!M$K2N9 zq<;R!Wn(W3!I?%zN_@$;Pj)-hz>B-(NYhJT zrcBZ7$*h=ULC1@Zxxt?ADfFjj|p77vK^oYr?a${QCntDa%fcr=73L|DH}Pz_e(UWZ{IHmVNvucp%)kink(m0>ea4KD*G+mUS?t0K1vyf4xZ$% zWW}4zaK;Dw8Xy}axYoCknPYrQqJ|F8p`L4wrsT%n-O0VCljQ|Hrrf|9kOyT}qpUyQ zSb?2mUp1?y+bd;g5cJ?@5mM-IRv6rUU+9!O3DA2M>m3Bjf6j&MW=`Q*63hw#JgEhC zN#e*e5!ie5${QEPrhG;o71w+D)*yxNS-q``7o_GR7aP^R`oCs+HyPLRB&^TvPX)$=CaYbs zxH#C`7OSdzyWifJ&e$}GL$dr1j-i%n^qL|<$yL@}(WO-s;!<&UY1x$xR}8Cdhys+j zhPql#*0_Q_ir()6(PI|lWG5GE8fcjDi19&W_20h&p?S2e<&Kr~w6mW$!Ae85jyyHUX4}5WUkc(E{}?@xdUq0JdvJ^WnpXHU)hE2m<`= z*O~Wd0OJrK;8)qqaJs?)G6CTRRVTnzXTV2uU1%#eZf6uVeOsbs?X-V*s9R|kQu7Zm zciW3Cey}5N772-V0F4$KG@Kr;_Jc@1ARvIY2rv@Ewzq9UAftd2{sfa$$oD!SxW;Ct z();3YdU_h%P;R^(7I0s|VYXTHDAA;I$hyUQCd)_NvWAwqM-y<-ae~_S>&Tfx_UDJ1 z1HE@GMN{s622n-yC${`)yFKFY2Sov!s;&d{TBIHp<;sqzS*x4R>d5dLk zIz4ZjHq~V6L`02?j?r~&*Cx_r?k~SalAgk4JvgI>tv(PIz6MayvMeGTkJCl=o%x?x z@ylwQN2txqM>9QIHv8fED+P zj)CcpcZsS*G28gXZtLg&F79~4-K?P3{_%q|I>;;b=g#PxnJ+PMVli10E#+J{0pXlV zIFtarW6#aAR&jX}a(sI@f--l~aQa(H%TP=3u4XR)%h*2)&(!zLzNy_?yZ*qp(818q zY~<~tkx0G$*1{B}VSMmlF7~-Q!pP5Cz|4Y1+lbl`=8(wae%UQLuz@!^CS}6qeo(%+ zzWe*=98&%M3U}w%X%X(2>(=VVi4fOCRx{oV_u5@$xl@&r?Tu~=EUy~+4ShUMOZ4u2 zR*>Z!kzY1hU=lQxfZF6u#~%(8dEcYfIDM3%+Y4p?AUy~7fsB9<9Mr0BhnlXKkNvgl zbi9afIMxf8rQywf+(GgZT5z7HysTvHyLKH~n3a%sg zmGP(#0mWq3i5%rJ0dIsT+^*#)a{dNy6dALWd&5#c;Oj6b)RfrbW#R3c+g6qg$?_bL zfZzCyY`6x6)SN}ghnKjw`+h8IMH`e!qDfAkF=yUvJ2VK-n!GE^b?UyLO2#&--5w z0BVVOx!bTe4&}KAC82(dOQ0~eN$x!p7qus-z$@@6&#{yRekL&Kmhm%h^>@MoqKf)r zLFGkyI)WAO_3DugVj66SDS`iihE4^EqP3}tami6;6f0wmKl9lcZb)!E1U+up%_oKsHNc0^b9;}1qquRBF)h>ReB6dP=4-XG zq-UqFee@7MuL4?Cr;As0!= zL|v$kYANH1Dh>{un+S1Rbg+~!hTx@ZuoQlo`LN&MpWH@SKTp5YTG1w z=5DOrwu>M$?^$4SRpu)+Wv+CgyQtr1c0C>%s8>CBK=9}Odja0R74M3scGdjvIPFr9 zK9j*y2Zs#xZNdd~=MQw>udX`70}Utqv@);%gX>;=fb7fFo7 zN1%Z0p6tadrg#3GQg{}mI)bO!x<0&KgXV2&3AQ^b=Nk6)u|y>he@Hj36%n0vzF5fZ zKYPq6IrIMWOXc@H@oT*y`EG*BrWp_8+ZD)Wsi_4tGc;nu*~rwPZUm^-+5ytEM1%~v z7Y^Lh>Gjh9O~EBJy zA1|65Q8D~`xbHJ#>}3`~p3v1DxADb+w~oW(hDp1*{~4v8cg@qRQoJDT)(~AJf`)zN z!t0&3H^fE7(73rmWq>dVa{T|AP|s*Sb6&}j3$q)kK_D-QVQ}&;&YIH_tO6=N#BIZSXx=o%Yy(ZeA`>bEhe?y7?TyMkv z|3Han{`r58vaRIHlDG>{y5y{;%M4aXNn96!AOiv+WKwWghyMBl)k72#oX((ivTyLg zC%Vs7Ltn<>zV`oig-v2SxTd}gk5w!ygvTnBDYcrbZ+cv~j4nS`q@KRZRFY?z4;!Gs zG-X}E9ciMOS=dp;>_h^g%-av97Z8|jYx|N)R%mW#M@dRbN^)Vs{F#ORKl${&037(Y z!g)YsI;1M+czb3H0Gy1meXEBqTa%i%l;}V?Q%43L;J?RyV%T$7T*7^6)Db3jt+6p;VmYTKMq2pR!TsQ-);hR5E&et{rVv4p1T=JZy_|P<@yPt=#nV$s85){K22}txG+ht_jnWk-tx!)Cly~0Q1OHFW$ljyQL9J; zlcdP|pu(f|g%{%tLev6)Ob7Jcg4bTtONqd0o0+I4vaOS?DHs(j6hbX1C`i5J2nXq7 z0r&kEI6I(j9KbPlc6PJPl~q->HZ!BZ-~ajZ=hW`>@bE{#QWL$q=E7kCc~A;eP&RKf zbI7yEum(C1bXx#0T@qbDAOgz1F zqY4R$M+iX!*9*;OE#HE&vfcC|f)mEe<4R*^T+&a|tbJP!xcS$8^*!Io*G3f;4@$~@ z$O*bEbcP758}F4)=I@Dy96Nd4GzO53{Gq1F$ck-`jyV_hyMcReu zbq6T*Xg-gFwxh6a%Pq=APqZ2hUMVbZKxbjpfCLX z4lC}8ct@C%K!{9M#!CL7pjimZ#oAC{)sPkx8a^Fm^y37vm~_p&S`@{wt}#A=+$04O z7ChjQ>-vONFX=cc<>n16N4J;i6(X50!XQpA2Ly$n!e6KSeQOvAmw?OW{TJO>PZsyxoqus% z_;OnFY&P!OV7h2}lg>jNKuYSFpKnr57Xgfp>Z+=_>JRGS>%El#2y=Eei|4bQ<%W*u zD~sN6)6;|RE2%=BgP^o(>?2HW@Lm1^#z`39?w{P9?g|(FU%j09Kh)bF$K@t&AxoC5 z5fZ~tLe?6hjO^P8L&`2O)(A0(WQnqKZP%K8$uh_lWuLK(%P?h&Fm@Be_#VFBzv27& z`Fzf2IiJTl=ktEOUe9P{>>s~9-hB&aVR(&Z5Vq)`ryVnrcwgpJU(`cSXWg}8FI6!< zJ7-omIlDHiT4>tX`SCZ+N3(HD%L{#omWKP1^_GuX)L4*ohBjvm1@gY$MC&?`1hL75 znh#!Q5H^nZjyvYblmP|Q_l*IWn+Q2-yV2J6kZI{?tj<7Y(~Asm$`3n49Jc1|MH9q6 zp4~Ucs@Up~cQQNEBh8rp;WU*KI4Xe*o6qz-3~auAz{Fc8z1vmC;t~BDsYn09uAk*hPUBo3 ztyW*@X#ZHvIeTQ{m*|MufTVmsfd|k}h~n|$F&>}9npE#V^M5?cKa9yYHfA<&%~1)l zso$_c0`0YB#=Cm_?S{@;fnSDT_GRJaOfPeZ?0mPv$wx&%&G?0>9ouqoM#Td;aMm{t}Xfj;KSeqF>ayF4EnNaJP3c)At za2;vvx7s`-*xiK%&h%}P5U%g>`f@9A&8C^|qUfb~Clti)a>beeO7`bWqPjVzbv#So z*qXoGqSw!hiw!m?_$2&l6|=V4yyZGUoC))UWELYxv*IRaq=~5T~-189Q;^^_EVFS_E&<)XrZ| z6}1L_QL7oX89W6f-ch1aGiGtwvm(hGu>&LajTW2_8J2^kAw8Z47k6+cg0+`d4YeH@ z)Ij;zs=*E6=;#QC!?m=u;yEb6ZEhA86DJO1Ny%MyiUq3YEpH0&4FEBXlHYDrG8&RF zHS)EjF<{%l+H}mNzWHjsQHeJ|TurN=%WDBno@MnvVPZ+38m_vAmUkE<{5+@p?@Rxs z)tni1vA+WDwr#~eyt!-bZZ~TfBOJGvMN^xYAuew34>4YD6LQF+9%2WOLHAj8gg-Ev`&at=1S~CWq7%TE zc!W8^7ho1Y!@|04#EuCxUEa@s<=#i?Kw-b z^PMPTOPrqZ*uzg(I^N!U{}XAWq-sVU#VuC{#*zANzw9z5-NvEN)t|-a9_kKKmt?D@ z#8vc!_#ukfUX)rR4*fe!OjXFk>Ua{@O(Bu14as@0Ctj@!T#2R*Kk~a~SZTX_Gne_g z@tY?aXWQ)JcJh_QBieI+Ln^GwesHdDZw6qo!`y+6O6&imN7m@&q7@#$b30HL7}U6j zVIKd19mNeDw&|3sQL+3n!X$eUR0FlIuwoi3JR?Xxm~YL$q`Z|C71OFw5dS9uWp3dq z?;7rrL1Lzs=pOql!OW*4v)^*>>;^VcKjC}ODyqJ4WL&zsYBHJrd3iJqPwP-Sv+b6Htg0Ym4< zrav)g`=O>L`q^^;@2PVhc`QwHRpn_c!pa=oLjUn0X>C?i-#>U{p z!9l%?7cWlVMQB|6z9(uY=(pJ31CSFlFUixJtbLt}(4dFBw*&_bLzK3s3-QEoikia(xUJ?<<{@LR;}%GEI4K^|^A{rt953ZB#j+f33{ ze-Pk)&ud&eaMo}4#r`z=0I~Jcn`O(|W4;_twE%Ag9-p3yPcqfXIVLKkZ}~rtGh*>N za6S1UM9Lz+;^&Dbq=-~$8N@PaWu4XOY9kFjMvy$V5NyDH-!c-5^96ZH4fqYXMgHp`j5=n0%m4^dH6nwveuz!Lv>m zR^dc(Aecg-9-U|N^;J&P*HCH)mQVx>(K+Q>S)7ggFYt;9HgIYRN&}%K21i!ZBQqK`o6yvIi=LxFTerw2*KF3+#yjfd7p!oKN2_?|;; z5v^+#RP7@gD&za%j#J8Wu??slev*e`n*7;CYT_uiOuP#XmM|TP#LMoiS>{@8T2~pn zY8C%ZFLtp~<*7Bk%muF|D(lJBv$C>E>q}}eU(ijoiCwq1<~T;i9Q5hNLwkzuvC*@O zZ8_)qF1kwE#K;GVRI!N~U4vZ?8GW1A{4A*X@z3z01cvf31CfOht@dLf^y{^!hLYQg zX0ChpZJC^MEw0quw0rFM=uK(;0|@7FL-M}S=g_|blSZ*##JXkLM9nMjQg5+N(5gw* zp;#=H=qv9#CsAVcF!*qX;`xX$7Mxe*IPUJrum_J2 z{G(JPB$SGqY%>8LukT6C-_4~Bf4_h`o+!~*&1?4RN+sMlO;VxcJ5X_-~xVW@= z$wfL<_{tSqU@NxN+P3aKW{Ioy<^#QPzgCPp+Dm#^{sHJOmw|L0?+7ld3H(qM6&1a% z?N(}O?#mF+P=>|2SKZ1w$R^idmC&?J9s+M6`qKF?fIh|`R8-qQ#Q2QhJV8TSTjyel z{o9UQ_YCQo`JVgu939bs=e0I583pQJnzYaO2hm#!=cV}RLF02VkMPhZ?ubsOQGiSX zx!xro#xFm*be8BpJWYWjgMramO)3-PiAM4TwYCU(Ffqx> z8s=j^`Ty2UZ}j!IO)b;_LmkTW<5NtTdd}d%Qt(G3@k>CLe+g^=@j0*3FF2rel__yi_slQ0mrK6I%1v7{n~g^im#_0-_G(-i;)NDm;) zK-wJ?%F8M%uc0@be+(ynwz2PSVdfR`@l8@>u1QitoW>n2WaEtM75wCguI?_M0#_V- zu>Yp>a@EI1vH-*x8ynl~?5w7+A<_&?Y}@wSVu0re48kCM@@tc6k)+Vjuv%IecJd(a zd1u-Ei&k~W+Tt dt +{ + padding-top: 0.25em; + padding-bottom: 0.25em; + font-weight: bold; +} + +dl.toc > dl +{ + padding-bottom: 0.5em; +} + +.parameter +{ + font-style: normal; +} + +.footer +{ + padding-top: 3.5em; + /* tango:aluminium 3 */ + color: #babdb6; + text-align: center; + font-size: 80%; +} + +.informalfigure, +.figure +{ + margin: 1em; +} + +.informalexample, +.example +{ + margin-top: 1em; + margin-bottom: 1em; +} + +.warning +{ + /* tango:orange 0/1 */ + background: #ffeed9; + background: rgba(252, 175, 62, 0.1); + border-color: #ffb04f; + border-color: rgba(252, 175, 62, 0.2); +} +.note +{ + /* tango:chameleon 0/0.5 */ + background: #d8ffb2; + background: rgba(138, 226, 52, 0.1); + border-color: #abf562; + border-color: rgba(138, 226, 52, 0.2); +} +div.blockquote +{ + border-color: #eeeeec; +} +.note, .warning, div.blockquote +{ + padding: 0.5em; + border-width: 1px; + border-style: solid; + margin: 2em; +} +.note p, .warning p +{ + margin: 0; +} + +div.warning h3.title, +div.note h3.title +{ + display: none; +} + +p + div.section +{ + margin-top: 1em; +} + +div.refnamediv, +div.refsynopsisdiv, +div.refsect1, +div.refsect2, +div.toc, +div.section +{ + margin-bottom: 1em; +} + +/* blob links */ +h2 .extralinks, h3 .extralinks +{ + float: right; + /* tango:aluminium 3 */ + color: #babdb6; + font-size: 80%; + font-weight: normal; +} + +.lineart +{ + color: #d3d7cf; + font-weight: normal; +} + +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-weight: normal; +} + +.structfield +{ + font-style: normal; + font-weight: normal; +} + +acronym,abbr +{ + border-bottom: 1px dotted gray; +} + +/* code listings */ + +.listing_code .programlisting .normal, +.listing_code .programlisting .normal a, +.listing_code .programlisting .number, +.listing_code .programlisting .cbracket, +.listing_code .programlisting .symbol { color: #555753; } +.listing_code .programlisting .comment, +.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ +.listing_code .programlisting .function, +.listing_code .programlisting .function a, +.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ +.listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ +.listing_code .programlisting .keyword, +.listing_code .programlisting .usertype, +.listing_code .programlisting .type, +.listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ + +.listing_frame { + /* tango:sky blue 1 */ + border: solid 1px #729fcf; + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0px; +} + +.listing_lines, .listing_code { + margin-top: 0px; + margin-bottom: 0px; + padding: 0.5em; +} +.listing_lines { + /* tango:sky blue 0.5 */ + background: #a6c5e3; + background: rgba(114, 159, 207, 0.2); + /* tango:aluminium 6 */ + color: #2e3436; +} +.listing_code { + /* tango:sky blue 0 */ + background: #e6f3ff; + background: rgba(114, 159, 207, 0.1); +} +.listing_code .programlisting { + /* override from previous */ + border: none 0px; + padding: 0px; + background: none; +} +.listing_lines pre, .listing_code pre { + margin: 0px; +} + +@media screen { + /* these have a as a first child, but since there are no parent selectors + * we can't use that. */ + a.footnote + { + position: relative; + top: 0em ! important; + } + /* this is needed so that the local anchors are displayed below the naviagtion */ + div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] + { + display: inline-block; + position: relative; + top:-5em; + } + /* this seems to be a bug in the xsl style sheets when generating indexes */ + div.index div.index + { + top: 0em; + } + /* make space for the fixed navigation bar and add space at the bottom so that + * link targets appear somewhat close to top + */ + body + { + padding-top: 2.5em; + padding-bottom: 500px; + max-width: 60em; + } + p + { + max-width: 60em; + } + /* style and size the navigation bar */ + table.navigation#top + { + position: fixed; + background: #e2e2e2; + border-bottom: solid 1px #babdb6; + border-spacing: 5px; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + z-index: 10; + } + table.navigation#top td + { + padding-left: 6px; + padding-right: 6px; + } + .navigation a, .navigation a:visited + { + /* tango:sky blue 3 */ + color: #204a87; + } + .navigation a:hover + { + /* tango:sky blue 2 */ + color: #3465a4; + } + td.shortcuts + { + /* tango:sky blue 2 */ + color: #3465a4; + font-size: 80%; + white-space: nowrap; + } + td.shortcuts .dim + { + color: #babdb6; + } + .navigation .title + { + font-size: 80%; + max-width: none; + margin: 0px; + font-weight: normal; + } +} +@media screen and (min-width: 60em) { + /* screen larger than 60em */ + body { margin: auto; } +} +@media screen and (max-width: 60em) { + /* screen less than 60em */ + #nav_hierarchy { display: none; } + #nav_interfaces { display: none; } + #nav_prerequisites { display: none; } + #nav_derived_interfaces { display: none; } + #nav_implementations { display: none; } + #nav_child_properties { display: none; } + #nav_style_properties { display: none; } + #nav_index { display: none; } + #nav_glossary { display: none; } + .gallery_image { display: none; } + .property_flags { display: none; } + .signal_flags { display: none; } + .parameter_annotations { display: none; } + .enum_member_annotations { display: none; } + .struct_member_annotations { display: none; } + .union_member_annotations { display: none; } + /* now that a column is hidden, optimize space */ + col.parameters_name { width: auto; } + col.parameters_description { width: auto; } + col.struct_members_name { width: auto; } + col.struct_members_description { width: auto; } + col.enum_members_name { width: auto; } + col.enum_members_description { width: auto; } + col.union_members_name { width: auto; } + col.union_members_description { width: auto; } + .listing_lines { display: none; } +} +@media print { + table.navigation { + visibility: collapse; + display: none; + } + div.titlepage table.navigation { + visibility: visible; + display: table; + background: #e2e2e2; + border: solid 1px #babdb6; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + } +} + diff --git a/docs/reference/html/up-insensitive.png b/docs/reference/html/up-insensitive.png new file mode 100644 index 0000000000000000000000000000000000000000..f40498606db349a7321cf6b470523e836ee7ac2e GIT binary patch literal 374 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefG~@Ex#w@70gTL^E{-7zACwHGSRJaopUzr*FR_KPpkxheNzTDP+%{a~ox zRb6~e-_l%s#;V|Jw-)bO$G_X=4F`Y7SBoCzyjAZQ8BPW>ywAP8?pbBsZ|wt?+h6S6&uqY)kkMnwQQEd@7k`4t@sCCO z@7MoiEI4Q_#IB70vhu7Ab+>SXLxu@LWH Qzz|~aboFyt=akR{08E^fv;Y7A literal 0 HcmV?d00001 diff --git a/docs/reference/html/up.png b/docs/reference/html/up.png new file mode 100644 index 0000000000000000000000000000000000000000..80b4b37e997d69b2e128bc3090bc447ccb74bbe9 GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRFevZLys@4W>+6GUE!tU04Ii{0w_tkMIDB?rA5 zttYTN0Ep5-NVh?+_d-Xk&Wzd z#oz&)#4q=^p8z|KZLkwSxa8!Sx;2q^wPL^3r`;|2@bPgTSobnc{3yH`Kwu9n8BQY4 z4`(-nzrTOIVuO#j7au%dyjOo_v6x%x8)1@tx*6Q1>Eiux`0(%mf>k2YC_6zsgRSsKO3_i zm8e1C?DpL+YU6RRm%sED($akRokAI;EHL471jzX$;aGz6R-l%rGyhq?d(v?Tq>_HYZq(Z z(l%iB?u#^2y6c72p6DXlOwoSWsZ43wb~8mH@Mqy%mfuYoF6Sl3 z_+tn8va{&xuyLPHX&)Wisi2oZZW5{ZJxNuZNe+Ov`H6L>BGcMA(w;4lYgYBI(_0fv}mpL#<% zK8rwR_rXw)?x;uRl!klslY5Y}a1Wiw^R{^h6B1!!ct;c7 z;Wh>v*PQ1dF2FXTMV^D&z~L_KQ=a2Xn8qtZHFQ&r!VeA8=qJ-~&cZZU)8L04y;%-S zw^~Z0Fv+kD!#0lMjkmz;wc@Ry_66PwZm%704NNk4Gk81B?qTCTH)88fD`E!_ zs`!18RwPOpacM8pikrU;+1F0?ZIf5*G23UF*?v_tge@dHG)F_C82_fkLJ_dtUPi(% z_sZ2x80;YDVZva4!yrFP(gQZ`BSo&(`U-NM>MNLbQD3QV&)YtM3D2DhW=>#@I7j0~ zQVca0SP%!07v&X<0E2xhuKcx>rnsV?XcRtZct$^Y20Tv>DI_fr4Xx?kf@u`#-hygq zPxm%3$&d|0HcpTY+5*|ooZvt%V6MAK_hJGdLj6ql8t%~*_b^G09+QvrG?7B5h29RT zy|sgEJ3E;E#txI^DEr?lQ^XNB#G?`Ma9gM|>&I{M2sbhnZI;fJz}Y_Jvz%S>lgnPp_d&B+GO^Bi_n2K7z%^H0>iMq!@kqtoo z0tG_<2T;`6mSA}+3G8TFLa+zh(guNcR|q_{EoB1?0^b+{*_jZCS}6JGJbK^^cKOKz z!;S#BYf*Vc!Qk(W;IFF5!8!1NBjDXHQgnviHXbvm6TJv-(2Gz<=-sub{FyQay>AS? zO~9)gyA?GL)chHFRCCRP1Bfpva4@m)b=KO1I8$iG4(&tP<8u^CEB`$JXRLd$!@|ea zrzr6BS3e-YeD|fh_>udg12H3StNMZZQ~hWuG|?79ljc4!7f_rN3dd#aI@3o0MiBq} tacTYZKogp}4Nb})9mJRkO+QI!Dn92RxV_lat=WqaOD zAMcC|b$^}n6Nc2ZR}cQ<*3ZGo-@Nv;tPNahcPF)MQzvRBRf}LQ6C*}jR`Xtyny8Fe zD$nsBnoA_SG`qQdqsZ{$5p~9&Bj1yg%~dai&mO#=B+dJ1Fkr-r`=5Q+mDN=WLD%h# zk*sIWo)r`neE9G|kzB)a*KA9G4GbqsLe%$YkPkc>V%D=>ZEZGN5Yn-zxngB(W!_iI{bx%+`hFY@ z+@yU2>e;LGQJgDo%SXzKk%qxBgiJgTGiz%>%b}EKcyz?1q*}R5F>n=AyTxW<@ALiq ze0u6b*XOL1YqMI;BBC^s6NQsGybz#uaY*_;P zFPuaRF}fv`e0IpS!DN!a+~be$c-sbp5hE@@1|IwjLR;Nbt`%PRcnz15z@t-m*WxRD zw2A#)b*+tTWU?;Mdnm&rT;gWXITZ&q-+)KgR$ciL=oD*c>;E+w$6V+cFHq;RUts24 zqBQy)L`no2LEo;6^+vLhqGQ6zcx@8+oz{xl*ptvFYW?nReQz$GVZ4cN!8&#$_$xpG zTIWmKi4NIc>3r4C;P*cNc(yy=|KvS4Q6U2@tvRyJ0dfrHneXrr3^ndC?{hYa-P{qY zt}v45v@}EB2j;9AV=KMUV`F0t|H#of!=_wVL6<62KI3CA#}}DtX;;B6vNjM#6aEy~ zU2NIg+e55#I*6jq$YMCBVu7aP>avNBh=VCjQaVP)zPY)E6~?eNaTo8aom$dx3vX?~ z@jB4zr^I){z^rzg8NKs(-GCAO{7N8FK<3!9zZp`k*k~3Q&7pv1?(%8bgcl0+t$z-q zqN0jRN?<$0g8__lwf5<11>19@xIFix+ek?cS49x6p#?1c`iw$5r@AH{n=0ay6kPvj z-TQu?b{h)=Uku~ub-}JfW8_xhPV2$+)z5q}?vLu`SGViI;EjPqE+|ZQE|`<3aIMuJ zm7kwK?evi}`oKHT=9?5~)CG2;r!exZx`bMtkkSSXTFPV^b(8)_Om9^Pu+RXkNFw6Nwe*r9L* zx+>1q+u!NmlkT(lVZ-_t$4h**`AX{bGDE6Z}%!9)5sbf?9+b29O_P~dCpt;C>5Q=*rz%< zuWmE86fyuF)^EmXi{7W7pHy94eM}xuP%dC!)qHMrJ!FdL5J&m^l2ynjOQn#;MD2<> z*5DnX%7m@5l$l?PpKy9V5y`VfDZ8I~{Ey+wTFR7!qg_9YU>_VGJ8HhSVU{rKZD$Ik z>{Bi167jNdLo~|&%r2aBHFDqcu*nz>>n_-R&pxh$mU!8BT21Q_*e_kD>7s}Cl1*4T zGA*stw$&PSyapjvLpqliQd;$il<@XNPIvXZ{iwuG%U^jC7LytxDsGJp&X9`Ay4mDV z{uE+m1nB_kW^ijrNZ#SmVs;R=--+XXyO*iY(G-F~I_}kkhW$Aj>HU^&yo`b0zyAzU zS-TgMPn6<`==UFZJ~h7=yZ=ucKw$%#jIk}Zm)0%5Hz}#9m>3vgVPQxl@(DKO_0?Vr zQ*7VtzzPhDN@SqX`SSRKLEioOc%a!{1QVVI@;vXh=(GR(ZEx54zb|30(-ffV^3r_^ zVP^LY#abrR61{*faNU_*U0Z|doqIP|R8(j%Y8FjEUd8uYzs9?7mX8fJ9sQzKKrY~% zU(w8;a+U`+;e#C^c-p1<1zJT%hli)zGe@ncROOM_ltROkmo(Dfi(La(Deo=M zgBUe3^WB}fT3COR=Skt4^R93*)2=XM`^I0ZjuPVH+@yoCOxoj67gg1fU>q86Z|@|q zn9w5dA(WfcHPN8X=js$(nAV+XZ8aYL`Ia#jx;~UTGcyCsKDgB6b;g>GDBG+E?p*r) z`@OxreF!8|g&s^Mf>O9pt0-N_gVTPYF`SH#*J}7Dn67jLC2i(lGM{z7zHN!Uo!vr% z+aA>N-Kk8*p=-MD{!w#q!dGUI__^_J3;nxa>XP82(B&T z%9m@G$(pO^o0}W;_4uEn?$PWI7A950pRoLA&(_)N5T*uaUP?m|IyxMV{1L`U=>Omi z4hn{LLdLmScV!(oB+R;2FUd%J=p&EWOE-*~yc7ob`S{k+?r*;=2#O$AfzlDazv*?`ytq?yemo)+`m*wF~FLmU`EX*2G?S5cV z^QF3`=6i5(d3E)xOb*kof1W&nawi30Q|*El;4EqiJm=%9t*++&ET&TFaC!WGYks}IXFC|&J?{p_YbE68sYQjw=gbduWS|BtyARXU&Ne| z-*|@Nr)b?0IAyH&u^O}98tzD0sF$17T1u*(^QF{vHI!e=PBxw=PW>5%+ zHkH0*zdm)+)k2;k^5)3wqLy;ru;H%zOuVZ8v5QCa{7!@S{`ASR`jz5=>!DnqdyVVj zWpQJ1NK=<)8DEZE@ABlrpwni_9v9b?rMZu#^_tNpyy~XEhI7rLYmaYzx&NF$=vl^YKYpTMYH( zUAA~sbJSA#odON)CJG7kmT^_@Zf{T?J))+j4&DHo!klk=EDup>-aowxG-;tmVf1U| zN^H=e)Uc^A92j8*Wo65&0%)SOm6ba<-Z1Ma!)9-O4vvcQ@^Z7CsL063)Kr#8nR=k_ zf4=qaj-bLDiDS`=V>6;8BlB7xqTmfntx(y)kf-<%dsv1*Gy6s$Sax%09&xIeIui#D zv2D0KgdD4V*|GRlo15Sj=^;G*=HsnDrLPdHUh0ApzCxx*^bX;nst$-ceb@5 z2}!%*Qy>}N-iUp}6q279Ve4J#JUGD4+q}3f8su_9asC}K%A);+Y%Vz%V<{@z$@h)h zk@2^ThxX!kzX~LhTMG5^3p1B84c5Z&tst z5th_sw25@biAhwFA1QT>0s$L-Z`-k3Mwb(*yZ=ncd-|AX>7W}wy<120xVx0AKj@#Fronz{1ZRVWM;v0U= zdVUJ&Eg~)JH;YaeMW_^bl8_Za_g+m1c0S%zFG}|-A8D`J39YX(&M&CxqNNU$Ag83M z0Xo&Dm*@9(`W?4>9YIhxxo!fn1A7s@k@=JgyL&(~ENFzvDXq^jX6s7YsgBz$R?q+a zawUgNx{ySd*m0S%Z?l#2RcgfcZu*b4TztMA`w{aRiJ1lPX+t|??y5VdOG_x;V(GYB zQbMb~BH5l8f8H@c^S#lLF25x#k5`0ZOsQ+aiW^vF0tj$J2=VdD`Aq z{ zPpV@leVTRn!)D(YWSsN)*M|rY8 z^K#_K-7GYsyuAHB;?=!4%TZ|RwEnFjfHA~}vfKF0Ehecp-J6~~kGHDEYL{Ff?mfIT z?kh}9w>`1{UAz1133bx&mPAFQ``?WKvfP{Dp3Yii0#Sq0+1Tj^OS>(z9d}WYLZomZ z&t^`GFU9ZO7So})i}p1eks20$rT~LjI>oEY_MG&lD_OxiUcStB0=dUH=4%$hvfr@} zKio>aetf&5rHT_IBUqzbL22UfU5>y&Ujg#=(c8KPugqFE)JQ8wM^2oQnkuek$B2gd zg_C_NAd_V3ao?x9y z!+N0fu-#Z_Rs$+7v&?EC2`?O%mV~T~>I+?!b%ka<5}r%gPCNM;{Dj#JC*hFp=I_nS z;w|Qv@c!@uF|ADRLy`2qd87tcEHpe)S~YyUYgrPQ(zYiU+m<*kYK1XHA@r}|=Q?J_ zSwo(0*h+!j%~ec>#$!{7==YWsI)`%T>CF|cLNqpcpT=_dTspgo2UJuXY)%v*(nb9a zmO2lXyRA{G1NHzw5*`*7Ob?=B@at>{e72x|VyK){8VwQ?tM`h7W7JUH&d0a5^2AFunk7zsqVR^b%~>}1|{-VOG2Cr#dU@fWM+s>Gg>oZQ8XD(q?wdF zPVYXn9WGx~F74;9v{84)v<}vhclFOSdRd=EYa2CMgzv5*)+T?o4)jj0T$lVqE#Q2h z+P%hV^7*r?^b}1rf!xXQneM&^`RA92#rC9N#tp*4S7q#r@8~TyIyDa$w5c%Oy>b54 zmH||qxj*Jb;1h5E>r8KIv;#~+Vzf6HmSS_w6^NynLPy`R3LAxj`3i-vbRGd7tGPs} z#5CIYC${s+?H|cY$n|(_a43DE4JKfcmNisN>hhM>dC3uWcq6MlOoL6yq=#F3DUG!+ z3FqpSR+L_U)W=YlnfDKaXnudpW+cEl;o;y|`&b9zVqvlGH|ty-H1X6N z$hSlwO-;Z*i|lM9Ju~yLRj%&4k0Fhim|mo0R0srH?SZaw21n3QX#oQcCLfm*2RnU( zbUsdiTF&rx`rlVa-gZ7qX7C^VS>?XVZ-59UvAhok3%!UfB%_;n7vvPKn;$f>ggNgHT%kwT-ee2Yf^fD-v$e3 zo*b;Qoj4hu6g2p#kmVlSJj zdwOJCTgS)8vj<*zVyzn?6nlMvf3Ho`QWlq(c(E};+g!0rC_RM*Jh@_llrXVF#~_>fv2TxOvM<37D|{pV~+Pnlr3cEX3ntQkH5}% zILAvn(3xCg(CJ~>`=Mp?0u55ngB0PT(;IEe$?y@PBr?*kM{eiS^;6{47@jFJ zxEgb>xL;nUdm_9#Z7TL|yW$B{7R> zg&@b}yDeze0ELkIeiW@drHHo-q_?-%cD7ol$O4wVUr- zbzJmVPn8J5!WmiZk4K~llaZ3jL4aRBxloz`g4(iqn)v>m@q#e`V1-zLSlnrCz`@CB ztaNZ_XracGN zo<>Hg{&v;Th7xIr0`#4{Hj&_%Jed&}O(U>!JS~gvNhwaEtir`PdcB&HYnj>AqY^$^ zxW?x70aJ(NZrax4XX%hjc$4o!TlmJu$jIT5zCW^Z*J&-c`Xa6&;T^g;T9`VV*Q=6; z${*nz+q=76^VUnZOSZC(T5{sLCZ?i{SLGa8h&PCC>AP)lb0(p2i)$k1H>8*@HJkX_&juhegY$*O-l9G!SW+{$NPOC=* zq~Sa5L2Rs1xUFU1UQ(m8PTiVELI;=O#Kij6!#`KPvl0--**2=E{K&XmAIppCSE))# z3g(6?B4hO*O6KQH28yj*8ikVf#WZrO6p3O03QA{+nzJUQ| zzGjc3wQX+w5;ZPDsE|bdCz)UAJdLZsM5WfBLg=*nR{Hwg(p5v^AHa08Gzz$~D-H4} z2QK~~i~q1(2q}G5FlOfdSk6nAX%rz{Xk?g!Yues1PPA$P=Wvi6J@K-q%~@rL+3e{i zL1pW@^mvELQ>k4vA$sGXm!VO>lOz~1nnt%Cqd3vq)iE~X-L=V;s#}K^e#`R!Z@lL_ zVzu}}SieB6f2FUX;sZpZ*X|E23?nSinfUys`Q#5r?Ft%P|7Ap2L?-SYz(-(mC4CG% z!hY*z;nFo2yX-&u{}2)oJ;Qt)mrDq7zMRzAkxzX0LJ8r)foMh&)1YL%-9arDtb55R zB3Gc+l_z3Q;icLA2@5Ok6oX@EQt51&CS+rzYP!2uIk=~LMz2Jbs@_whKn;Z3bt~Nk zGat+&#BE+dw>KL=JgU{)s;_jxxBCf-=kO+7S69jV_8Q_VBKXd$;O8ef{9-6|j#PB1 z#%)|Q7ZdHOy1cwdJAVE|mwqWtgfv7jTW#k>^4ESvjm8ANlfneGFOMI=q^d-iir!_Z z;z{BYbTZ+u^48#^smJzxObiPy?KO*(TpeioOltgM>8oPZB9HKGYa+R8`RT!gP^KR% zdU(>foT6{;;o8E0&rw>SV(t22!jd>FGQrxyUJNqj*FW6o-4|fdxSdT@`@>5U1E(N{ zG)I5%HczYhP)UT=i%I@{p9?m}49`u7ANI5OymUUp{2W0R?hm6YZ2{;&Ntt&$hve7Q z)tQl4o*y#hw6?YaNQ_+6w-I1~jIox8G!~L7AXmSBi4}e&WYN7o>}NCW{>}oj27`n1 zKwA}jf?hZ7kLJkFsA=Y?RnWjpD%=5_<#oEvz~>79k6EKH>^wXZgj@D(68XPY-YT*T z{$pg{BH($TDiX20XWXsOXnxNrp`g9qC~OF8fZ9;0|-= z&ZATeL*Eo`kM~s^^4}R_3t5i5spnumpOV}<8H@?lAMh;pg%@S3& z50t#Qb26?I33fDoLgz;d=vOJlsg0?P!NL81hNy05y0Y}#Qs>&)!;(w3&eKf$g}=Gp z+P2I$9co(t!St~)Htt;ZiA}rxtUqL$KqnSV0B@sBY_IuyKv63Nvt79E?dHw4`?kS#4XWVr(Q`(OEtL1%??ygK6QMh$p zy&cI#uyIdMg7xCNH~ZGwExWkXjvwgkp4&7orOK!aHcMOME%YaUfl=8vn2M*!Wsn?H zHFz;aJDLV>#E(?WuKqUGx`~I!q`wPU=%cW)n?-nEo!31qo7Tr>hh5;Ipaqyrl^Ot< zg1c;K$;qJwwO7Dkwv)v(05o}mMgHzE?|Eis=47#s6M$^9vtLm=Iy$0ZVy5!iCPhR< z@UDTla+WIjjmxG+o>FSxE(a^C-OelwWGO=;BI0|^K)^~#NeM(BK)IXK6{e4m^o=Gi zcIO)afCn&STEb9}%WC=frwt&$R;UR8dtKVxEZoV?&+ln%{amtU#PhJ0lSFGx#(GfO z$cM*m7l}aSXY)kB3g?EVanEitEahLrsOIu6YqJCD8Lr>TMSN(G@K#`DM$g}@39>Ug zy<+6-$?F7}kmhjYE#9r$>Dm591tnc4f}K!Z+N(OcK4KB~MDmXjM^0}r>q!6xPo zt-HK|*M&a52}aqRUT2jYLD4EFR3%^Q?LV3<6d)#@4f*mtUyuBI3UP8~8HuHU~#X$y}C7@Kk(! zd@H{mxAA;c5NL5qqdmC$uosBML73D*D+=`1Dc$$QHxn7M4FYP*kHid4&rYi?P*^sV z!u6InClL}G;S)vLM1+L*8_*Ol4zK}#e}9)${0HL(7#vMsbWefxqR#aA^o$_*U<`1nucxbou1k2)15a*-?Pn9Q)cq0WKqKYb71+}qa zrQBG5L!{0@ApkEK3Q;;x??RB;g5*oYk!wIHSS)2ZaExE_};53hG# zh>ltP_J(#H`*E};3XPw(Di1F{@y9Psip(r5FqZq&umh{?_W4Lf@`Q)# z6`O!Jjk;Fx?o6AwN{QR!JAT8{F9CaSEz@=j%C0$)T!O0-s6dv$rl-Qf*l}i@A>EKx zVEs@|oK3o2&$1SLfM?0ccX8b8_-w?UhBhC44dWwpiLSIOP(G*uXJk1hGifNFl`*F1 z`&Y}5u)6u=#4Uk%-BG5Vr6$+OiD`BQbzdF>*TR_0jG_|!=g#6|IwrMMpnT4sh zJ&9UsT1IQ$H>JE^&Br(F!s=qcg}uCJ!87hc2s2wr+Q?fEr8_GxTi9}MqGta+o{o-E z__f4&%Rle0q;y-EUgF__{U6w9b|=Kl^hh~TmF-F5&nFe;cDgS8_hR>{_A`spw0J-O z$ccCL_lE{k;iZ7@cwV;%*2sts9|NP0Yh5X0xc9xfESX36m+TGIc6YolO zgwe@H*@s6*Tzq$yxLhECTv=YuPA%ZHu4w<_UXoR4l%&n@RDtr8N7WMz=Tsaj_ukg4S_fFuU=0-u_i8dPjbe6#>P<-9PX2)TcGApUYCBn`Y4 z-4_}a@4PpLUotTjIku|+V#$Yz!U-_34wHk)F@`3>#r`4fO#vFv{jg=C$G2Vdy`4Ad zP#YWXrH&BbYBe(AnzJ?*fYbm5zvEZLdU{>z&Y8ox15)AsDGT4*`8aPx>OIy<$J^SL zE>E^zzI;jWPu4&H=`h#<;L!~a565gT8OraT89LsnX?!n@zTd5zgQ=So%Fx}D8%9o+ zygCq%y6r8T92^w5;~91qJ!AyY?cd|SV*nE|YWBVuN!F3Jw*aIejJ@~sfCtoGdW!HExM=q+auBY)vz6D#%(BAEtsu|8RK$xiaIHH@IuC+HJBTEho!`SiIKRdJRM}h@o z)2j)y#ee$GzqWWY4r~O~n~y&~jOF@V9*?-Nssw?ozh;q^?5im7+24CTUZ~0BYJ7cu zFgv18Mn*Aw_{ae~jEKO1=;1OOu{umW}; zOqP?2t0;)5>z<)d*a>J5+a6Cb?_VsnsNRn;?^o;psFTn!=JM$09jkubkF>P3xVX5a zB*y1Yaq;k6QdL^agd~ex`9KNL^^=+DMziq7x2hHlnC_JtJklk=XQV3 zAL|^mP|!UA3*nNO$&$!Y zr_Tbf_)qP|W7|(D6-fh+fzee7!Y5eKzco!2vmqSyiz;<0pw(w(V`GA`^D(gr^1R$k zs(d$8GdDf$eSOf4_gX1N=2h%A8X(YhfoWYFt+N?5>*uK9M5Z>h*vnwYOSM|?4%I6u z@|9A|GP4aF+0Ltj(cLeg2c_5R)dQdPz_*xsE`XS)610CFsH%;XJO}6b`$lF8E=CcR zoalWK;qpW()6>h?EU!Z}yq?hI;$z?P6;Q`FOQCFQL#Yk#TOS1)8#b^2Ye)jpY9RCw z@;YU1XSY+Fed0p3`kNqsD;q55?-oUqEyfBL%%>Dl$L!aaBP9oCrOdk38z2z^6fdl{ zw#;1*m?{*o`@;Z83J`zE3ELL3_?&EHZD9Ei=)tpdBoCgYeAJCYq-1B{4p=gNes|zl zUYwt6ls~hhe`3E0paQT{D)jiJzAvemZ?b$R>qx`vG5Q!8tY3 zj=dvgrh@tQ)_NB^HWJ^<ixF6%{~j5w{G+o*m@-~{Ot3z!VBIx5x@OEC+Tr|+ahqc3%}6C z#ahR2$$rVR%4NIn-=wgb5?%%#4H9c*YUn-j{23sGRX z7R0D?Ih-1si_;fuEHFn@Y~#n9=(GkH6z!(WW&P+6mhoy8^J!%-xeQxuvDggHYJsH8 z5bO^bV2qfRg&A)?;*G_2cMD%n&{3V%S&(`s4H!U>(b)kkdBXU3`F%)*c6q6>v@6O1rjnbc>Y&w;wQyME%%7g zBhxCJ(6es}EY7J)sn5N(kgYJTYHSiL?JO;vcB?$)$0y`t7GgdZBxJ*kJ-x_lS!Htv zoU0%G%SAD0SV2WiLDi`ZcMV51e_7uSAxydb)OziJND1nXnsQPvYhzC$%dQe;8+Zd7svA1tqiHyA8 zLX2rz#KMa@u{NMo(CPT>cplb3$1N6DG3~1#EGBZdooy<1!kzbvHzi`i781p!_h^CS z3u&z{bYTajIpg;#4d%@i0g42iHiUL^FYG)e7#wz{=w7)JNg#<8z$Oh0D4>>!MdVTd z&%vOLz163y32H8u=N8_P3roZrrvQt-L_!?f&^I){2y-aX9RftjCyKMPb(e7s-|XqF z7F-}K>nJW?hdUa-Q2Ene>^=?d5zMc$_3r{)a-b4eV1Vkaktm+=4(>>c^Vo$7sIAQu zHI#Z?;=Yn~In0f?uNg?sokf&-T4Va!w5zjEyQ1tddZj-pvqCl+_L|ihWB-G_OCjnj z^zvmZa){t=wC~{CLj#OeaX3mnabJKVsxwCndKu|(r-~gMi87b0BPi^9eGdG}|K$A& zxO@vHt=Uwy-<#I1sJy@Dv1jKeu#y?b`)(e^^8F0WKx!Kke^>sf?WvP#1)@$y)3TSA zi*fZz*`63KK|=1mi&H#opnOZ0X`_#be3v zb#=>UVYE8E2SHPQg-AlG=8A%@8r690PIA4A^Tg_|s>1%tsPqki09_M1lk5>I z-LrK42~2Rx?Cf;#qls^LD+{Yk>{7;E&|uv{Mx;X4KAM&S3(k2+^>B%NE6AETm^@_JKu zhWXcEIpp(D$*t4Q1nQJtp{7PBCr~F+X+I9b-$-aTH02=0f`)E?T(5ZgzE4&tDzs02 z?xGl%wS5cE3aBz3w0t5!;3DS1h#D$)TMa*%c5lzXFks0?9KddCOK@(9!2@oad zyL0~-zU@}zbR)s8T3$r+V(qRX@A@He%WgtZVUXQ+pSzDrfRJADoAYPZuSoI*E2CC; zrpcPW+ z0DlAWdCKXNS2y>;qgeRwin}=w!U7^iEMVnGdfvY-0SmRpZhp2$^c_e4f+?(q*M_ZJ^bbkk(|qhb>h5>`e`mFV%gZofl8`Hv&ywK-k@ zVo6SntfFf`@r{d*?`B2+=aE6qJ+$`Vj)k21TSSB<)zg4B*=Ra2>gPD^?7*vyrc zr+bS=IYLDc#@L}0el9Sv&Q3{s{6lx45C|?lel>933N-q<2GWF+h5rGnWG5LluB?o$ zp%7rFntkP8qIH^3?&mY?Mb5|}2at|BKu1u^vD5)PZGgi7Ep6cJ>tXqVPQg^$N9P?_Z~*0#}Tg`avCHL z?)mS+o-x6^fP4m+-c}Lc4cPhkfE{rAkI5z7`3>!kVf!u+;Y9!FTz5>qoDSQfA|_k` zzK^tBsPd38F((1pg~z+_zdMU89Zg?+y`S88Zw6&3@zN3O*-aIof&}T6s!7do@S@1@ zhuw|mAlvRpLxw%?Y_%%J=T)^yNrIW`_5R(IRMV`d2HpAplyKeRTcz!Ow6Ya*kE~0Wt0e$dEr>)vO_se+mk2x_$KUnt=+!M$K2N9 zq<;R!Wn(W3!I?%zN_@$;Pj)-hz>B-(NYhJT zrcBZ7$*h=ULC1@Zxxt?ADfFjj|p77vK^oYr?a${QCntDa%fcr=73L|DH}Pz_e(UWZ{IHmVNvucp%)kink(m0>ea4KD*G+mUS?t0K1vyf4xZ$% zWW}4zaK;Dw8Xy}axYoCknPYrQqJ|F8p`L4wrsT%n-O0VCljQ|Hrrf|9kOyT}qpUyQ zSb?2mUp1?y+bd;g5cJ?@5mM-IRv6rUU+9!O3DA2M>m3Bjf6j&MW=`Q*63hw#JgEhC zN#e*e5!ie5${QEPrhG;o71w+D)*yxNS-q``7o_GR7aP^R`oCs+HyPLRB&^TvPX)$=CaYbs zxH#C`7OSdzyWifJ&e$}GL$dr1j-i%n^qL|<$yL@}(WO-s;!<&UY1x$xR}8Cdhys+j zhPql#*0_Q_ir()6(PI|lWG5GE8fcjDi19&W_20h&p?S2e<&Kr~w6mW$!Ae85jyyHUX4}5WUkc(E{}?@xdUq0JdvJ^WnpXHU)hE2m<`= z*O~Wd0OJrK;8)qqaJs?)G6CTRRVTnzXTV2uU1%#eZf6uVeOsbs?X-V*s9R|kQu7Zm zciW3Cey}5N772-V0F4$KG@Kr;_Jc@1ARvIY2rv@Ewzq9UAftd2{sfa$$oD!SxW;Ct z();3YdU_h%P;R^(7I0s|VYXTHDAA;I$hyUQCd)_NvWAwqM-y<-ae~_S>&Tfx_UDJ1 z1HE@GMN{s622n-yC${`)yFKFY2Sov!s;&d{TBIHp<;sqzS*x4R>d5dLk zIz4ZjHq~V6L`02?j?r~&*Cx_r?k~SalAgk4JvgI>tv(PIz6MayvMeGTkJCl=o%x?x z@ylwQN2txqM>9QIHv8fED+P zj)CcpcZsS*G28gXZtLg&F79~4-K?P3{_%q|I>;;b=g#PxnJ+PMVli10E#+J{0pXlV zIFtarW6#aAR&jX}a(sI@f--l~aQa(H%TP=3u4XR)%h*2)&(!zLzNy_?yZ*qp(818q zY~<~tkx0G$*1{B}VSMmlF7~-Q!pP5Cz|4Y1+lbl`=8(wae%UQLuz@!^CS}6qeo(%+ zzWe*=98&%M3U}w%X%X(2>(=VVi4fOCRx{oV_u5@$xl@&r?Tu~=EUy~+4ShUMOZ4u2 zR*>Z!kzY1hU=lQxfZF6u#~%(8dEcYfIDM3%+Y4p?AUy~7fsB9<9Mr0BhnlXKkNvgl zbi9afIMxf8rQywf+(GgZT5z7HysTvHyLKH~n3a%sg zmGP(#0mWq3i5%rJ0dIsT+^*#)a{dNy6dALWd&5#c;Oj6b)RfrbW#R3c+g6qg$?_bL zfZzCyY`6x6)SN}ghnKjw`+h8IMH`e!qDfAkF=yUvJ2VK-n!GE^b?UyLO2#&--5w z0BVVOx!bTe4&}KAC82(dOQ0~eN$x!p7qus-z$@@6&#{yRekL&Kmhm%h^>@MoqKf)r zLFGkyI)WAO_3DugVj66SDS`iihE4^EqP3}tami6;6f0wmKl9lcZb)!E1U+up%_oKsHNc0^b9;}1qquRBF)h>ReB6dP=4-XG zq-UqFee@7MuL4?Cr;As0!= zL|v$kYANH1Dh>{un+S1Rbg+~!hTx@ZuoQlo`LN&MpWH@SKTp5YTG1w z=5DOrwu>M$?^$4SRpu)+Wv+CgyQtr1c0C>%s8>CBK=9}Odja0R74M3scGdjvIPFr9 zK9j*y2Zs#xZNdd~=MQw>udX`70}Utqv@);%gX>;=fb7fFo7 zN1%Z0p6tadrg#3GQg{}mI)bO!x<0&KgXV2&3AQ^b=Nk6)u|y>he@Hj36%n0vzF5fZ zKYPq6IrIMWOXc@H@oT*y`EG*BrWp_8+ZD)Wsi_4tGc;nu*~rwPZUm^-+5ytEM1%~v z7Y^Lh>Gjh9O~EBJy zA1|65Q8D~`xbHJ#>}3`~p3v1DxADb+w~oW(hDp1*{~4v8cg@qRQoJDT)(~AJf`)zN z!t0&3H^fE7(73rmWq>dVa{T|AP|s*Sb6&}j3$q)kK_D-QVQ}&;&YIH_tO6=N#BIZSXx=o%Yy(ZeA`>bEhe?y7?TyMkv z|3Han{`r58vaRIHlDG>{y5y{;%M4aXNn96!AOiv+WKwWghyMBl)k72#oX((ivTyLg zC%Vs7Ltn<>zV`oig-v2SxTd}gk5w!ygvTnBDYcrbZ+cv~j4nS`q@KRZRFY?z4;!Gs zG-X}E9ciMOS=dp;>_h^g%-av97Z8|jYx|N)R%mW#M@dRbN^)Vs{F#ORKl${&037(Y z!g)YsI;1M+czb3H0Gy1meXEBqTa%i%l;}V?Q%43L;J?RyV%T$7T*7^6)Db3jt+6p;VmYTKMq2pR!TsQ-);hR5E&et{rVv4p1T=JZy_|P<@yPt=#nV$s85){K22}txG+ht_jnWk-tx!)Cly~0Q1OHFW$ljyQL9J; zlcdP|pu(f|g%{%tLev6)Ob7Jcg4bTtONqd0o0+I4vaOS?DHs(j6hbX1C`i5J2nXq7 z0r&kEI6I(j9KbPlc6PJPl~q->HZ!BZ-~ajZ=hW`>@bE{#QWL$q=E7kCc~A;eP&RKf zbI7yEum(C1bXx#0T@qbDAOgz1F zqY4R$M+iX!*9*;OE#HE&vfcC|f)mEe<4R*^T+&a|tbJP!xcS$8^*!Io*G3f;4@$~@ z$O*bEbcP758}F4)=I@Dy96Nd4GzO53{Gq1F$ck-`jyV_hyMcReu zbq6T*Xg-gFwxh6a%Pq=APqZ2hUMVbZKxbjpfCLX z4lC}8ct@C%K!{9M#!CL7pjimZ#oAC{)sPkx8a^Fm^y37vm~_p&S`@{wt}#A=+$04O z7ChjQ>-vONFX=cc<>n16N4J;i6(X50!XQpA2Ly$n!e6KSeQOvAmw?OW{TJO>PZsyxoqus% z_;OnFY&P!OV7h2}lg>jNKuYSFpKnr57Xgfp>Z+=_>JRGS>%El#2y=Eei|4bQ<%W*u zD~sN6)6;|RE2%=BgP^o(>?2HW@Lm1^#z`39?w{P9?g|(FU%j09Kh)bF$K@t&AxoC5 z5fZ~tLe?6hjO^P8L&`2O)(A0(WQnqKZP%K8$uh_lWuLK(%P?h&Fm@Be_#VFBzv27& z`Fzf2IiJTl=ktEOUe9P{>>s~9-hB&aVR(&Z5Vq)`ryVnrcwgpJU(`cSXWg}8FI6!< zJ7-omIlDHiT4>tX`SCZ+N3(HD%L{#omWKP1^_GuX)L4*ohBjvm1@gY$MC&?`1hL75 znh#!Q5H^nZjyvYblmP|Q_l*IWn+Q2-yV2J6kZI{?tj<7Y(~Asm$`3n49Jc1|MH9q6 zp4~Ucs@Up~cQQNEBh8rp;WU*KI4Xe*o6qz-3~auAz{Fc8z1vmC;t~BDsYn09uAk*hPUBo3 ztyW*@X#ZHvIeTQ{m*|MufTVmsfd|k}h~n|$F&>}9npE#V^M5?cKa9yYHfA<&%~1)l zso$_c0`0YB#=Cm_?S{@;fnSDT_GRJaOfPeZ?0mPv$wx&%&G?0>9ouqoM#Td;aMm{t}Xfj;KSeqF>ayF4EnNaJP3c)At za2;vvx7s`-*xiK%&h%}P5U%g>`f@9A&8C^|qUfb~Clti)a>beeO7`bWqPjVzbv#So z*qXoGqSw!hiw!m?_$2&l6|=V4yyZGUoC))UWELYxv*IRaq=~5T~-189Q;^^_EVFS_E&<)XrZ| z6}1L_QL7oX89W6f-ch1aGiGtwvm(hGu>&LajTW2_8J2^kAw8Z47k6+cg0+`d4YeH@ z)Ij;zs=*E6=;#QC!?m=u;yEb6ZEhA86DJO1Ny%MyiUq3YEpH0&4FEBXlHYDrG8&RF zHS)EjF<{%l+H}mNzWHjsQHeJ|TurN=%WDBno@MnvVPZ+38m_vAmUkE<{5+@p?@Rxs z)tni1vA+WDwr#~eyt!-bZZ~TfBOJGvMN^xYAuew34>4YD6LQF+9%2WOLHAj8gg-Ev`&at=1S~CWq7%TE zc!W8^7ho1Y!@|04#EuCxUEa@s<=#i?Kw-b z^PMPTOPrqZ*uzg(I^N!U{}XAWq-sVU#VuC{#*zANzw9z5-NvEN)t|-a9_kKKmt?D@ z#8vc!_#ukfUX)rR4*fe!OjXFk>Ua{@O(Bu14as@0Ctj@!T#2R*Kk~a~SZTX_Gne_g z@tY?aXWQ)JcJh_QBieI+Ln^GwesHdDZw6qo!`y+6O6&imN7m@&q7@#$b30HL7}U6j zVIKd19mNeDw&|3sQL+3n!X$eUR0FlIuwoi3JR?Xxm~YL$q`Z|C71OFw5dS9uWp3dq z?;7rrL1Lzs=pOql!OW*4v)^*>>;^VcKjC}ODyqJ4WL&zsYBHJrd3iJqPwP-Sv+b6Htg0Ym4< zrav)g`=O>L`q^^;@2PVhc`QwHRpn_c!pa=oLjUn0X>C?i-#>U{p z!9l%?7cWlVMQB|6z9(uY=(pJ31CSFlFUixJtbLt}(4dFBw*&_bLzK3s3-QEoikia(xUJ?<<{@LR;}%GEI4K^|^A{rt953ZB#j+f33{ ze-Pk)&ud&eaMo}4#r`z=0I~Jcn`O(|W4;_twE%Ag9-p3yPcqfXIVLKkZ}~rtGh*>N za6S1UM9Lz+;^&Dbq=-~$8N@PaWu4XOY9kFjMvy$V5NyDH-!c-5^96ZH4fqYXMgHp`j5=n0%m4^dH6nwveuz!Lv>m zR^dc(Aecg-9-U|N^;J&P*HCH)mQVx>(K+Q>S)7ggFYt;9HgIYRN&}%K21i!ZBQqK`o6yvIi=LxFTerw2*KF3+#yjfd7p!oKN2_?|;; z5v^+#RP7@gD&za%j#J8Wu??slev*e`n*7;CYT_uiOuP#XmM|TP#LMoiS>{@8T2~pn zY8C%ZFLtp~<*7Bk%muF|D(lJBv$C>E>q}}eU(ijoiCwq1<~T;i9Q5hNLwkzuvC*@O zZ8_)qF1kwE#K;GVRI!N~U4vZ?8GW1A{4A*X@z3z01cvf31CfOht@dLf^y{^!hLYQg zX0ChpZJC^MEw0quw0rFM=uK(;0|@7FL-M}S=g_|blSZ*##JXkLM9nMjQg5+N(5gw* zp;#=H=qv9#CsAVcF!*qX;`xX$7Mxe*IPUJrum_J2 z{G(JPB$SGqY%>8LukT6C-_4~Bf4_h`o+!~*&1?4RN+sMlO;VxcJ5X_-~xVW@= z$wfL<_{tSqU@NxN+P3aKW{Ioy<^#QPzgCPp+Dm#^{sHJOmw|L0?+7ld3H(qM6&1a% z?N(}O?#mF+P=>|2SKZ1w$R^idmC&?J9s+M6`qKF?fIh|`R8-qQ#Q2QhJV8TSTjyel z{o9UQ_YCQo`JVgu939bs=e0I583pQJnzYaO2hm#!=cV}RLF02VkMPhZ?ubsOQGiSX zx!xro#xFm*be8BpJWYWjgMramO)3-PiAM4TwYCU(Ffqx> z8s=j^`Ty2UZ}j!IO)b;_LmkTW<5NtTdd}d%Qt(G3@k>CLe+g^=@j0*3FF2rel__yi_slQ0mrK6I%1v7{n~g^im#_0-_G(-i;)NDm;) zK-wJ?%F8M%uc0@be+(ynwz2PSVdfR`@l8@>u1QitoW>n2WaEtM75wCguI?_M0#_V- zu>Yp>a@EI1vH-*x8ynl~?5w7+A<_&?Y}@wSVu0re48kCM@@tc6k)+Vjuv%IecJd(a zd1u-Ei&k~W+Tt + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-app-categories + * @short_description: GData APP categories object + * @stability: Stable + * @include: gdata/app/gdata-app-categories.h + * + * #GDataAPPCategories is a list of categories (#GDataCategory) returned as the result of querying an + * Atom Publishing Protocol Category Document. + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-app-categories.h" +#include "atom/gdata-category.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" + +static void gdata_app_categories_dispose (GObject *object); +static void gdata_app_categories_finalize (GObject *object); +static void gdata_app_categories_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, + GError **error); +static gboolean +post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error); +static const gchar * +get_content_type (void); + +struct _GDataAPPCategoriesPrivate { + GList *categories; + gchar *scheme; + gboolean fixed; +}; + +enum { + PROP_IS_FIXED = 1 +}; + +G_DEFINE_TYPE (GDataAPPCategories, gdata_app_categories, GDATA_TYPE_PARSABLE) + +static void +gdata_app_categories_class_init (GDataAPPCategoriesClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataAPPCategoriesPrivate)); + + gobject_class->get_property = gdata_app_categories_get_property; + gobject_class->dispose = gdata_app_categories_dispose; + gobject_class->finalize = gdata_app_categories_finalize; + + parsable_class->parse_json = parse_json; + parsable_class->post_parse_json = post_parse_json; + parsable_class->get_content_type = get_content_type; + + parsable_class->element_name = "categories"; + parsable_class->element_namespace = "app"; + + /** + * GDataAPPCategories:is-fixed: + * + * Whether entries may use categories not in this category list. + * + * API reference: app:categories + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_FIXED, + g_param_spec_boolean ("is-fixed", + "Fixed?", "Whether entries may use categories not in this category list.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_app_categories_init (GDataAPPCategories *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_APP_CATEGORIES, GDataAPPCategoriesPrivate); +} + +static void +gdata_app_categories_dispose (GObject *object) +{ + GDataAPPCategoriesPrivate *priv = GDATA_APP_CATEGORIES (object)->priv; + + if (priv->categories != NULL) { + g_list_foreach (priv->categories, (GFunc) g_object_unref, NULL); + g_list_free (priv->categories); + } + priv->categories = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_app_categories_parent_class)->dispose (object); +} + +static void +gdata_app_categories_finalize (GObject *object) +{ + GDataAPPCategoriesPrivate *priv = GDATA_APP_CATEGORIES (object)->priv; + + g_free (priv->scheme); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_app_categories_parent_class)->finalize (object); +} + +static void +gdata_app_categories_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataAPPCategoriesPrivate *priv = GDATA_APP_CATEGORIES (object)->priv; + + switch (property_id) { + case PROP_IS_FIXED: + g_value_set_boolean (value, priv->fixed); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/* Reference: https://developers.google.com/youtube/v3/docs/videoCategories/list */ +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataAPPCategories *self = GDATA_APP_CATEGORIES (parsable); + GDataAPPCategoriesPrivate *priv = self->priv; + GType category_type; + + category_type = (user_data == NULL) ? + GDATA_TYPE_CATEGORY : GPOINTER_TO_SIZE (user_data); + + if (g_strcmp0 (json_reader_get_member_name (reader), "items") == 0) { + guint i, elements; + + /* Loop through the elements array. */ + for (i = 0, elements = (guint) json_reader_count_elements (reader); i < elements; i++) { + GDataCategory *category = NULL; + const gchar *id, *title; + const GError *child_error = NULL; + + json_reader_read_element (reader, i); + + json_reader_read_member (reader, "id"); + id = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "snippet"); + + json_reader_read_member (reader, "title"); + title = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + return gdata_parser_error_from_json_error (reader, + child_error, + error); + } + + /* Create the category. */ + category = g_object_new (category_type, + "term", id, + "label", title, + NULL); + priv->categories = g_list_prepend (priv->categories, + category); + + json_reader_end_member (reader); /* snippet */ + json_reader_end_element (reader); /* category */ + } + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "kind") == 0 || + g_strcmp0 (json_reader_get_member_name (reader), "etag") == 0 || + g_strcmp0 (json_reader_get_member_name (reader), "id") == 0) { + /* Ignore. */ + return TRUE; + } else { + return GDATA_PARSABLE_CLASS (gdata_app_categories_parent_class)->parse_json (parsable, reader, user_data, error); + } +} + +static gboolean +post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataAPPCategoriesPrivate *priv = GDATA_APP_CATEGORIES (parsable)->priv; + + /* Reverse our lists of stuff. */ + priv->categories = g_list_reverse (priv->categories); + + return TRUE; +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +/** + * gdata_app_categories_get_categories: + * @self: a #GDataAPPCategories + * + * Returns a list of the categories in this category list. + * + * Return value: (element-type GData.Category) (transfer none): a #GList of #GDataCategorys + * + * Since: 0.7.0 + */ +GList * +gdata_app_categories_get_categories (GDataAPPCategories *self) +{ + g_return_val_if_fail (GDATA_IS_APP_CATEGORIES (self), NULL); + return self->priv->categories; +} + +/** + * gdata_app_categories_is_fixed: + * @self: a #GDataAPPCategories + * + * Returns #GDataAPPCategories:is-fixed. + * + * Return value: whether entries may use categories not in this category list + * + * Since: 0.7.0 + */ +gboolean +gdata_app_categories_is_fixed (GDataAPPCategories *self) +{ + g_return_val_if_fail (GDATA_IS_APP_CATEGORIES (self), FALSE); + return self->priv->fixed; +} diff --git a/gdata/app/gdata-app-categories.h b/gdata/app/gdata-app-categories.h new file mode 100644 index 0000000..cf2f54b --- /dev/null +++ b/gdata/app/gdata-app-categories.h @@ -0,0 +1,77 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_APP_CATEGORIES_H +#define GDATA_APP_CATEGORIES_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_APP_CATEGORIES (gdata_app_categories_get_type ()) +#define GDATA_APP_CATEGORIES(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_APP_CATEGORIES, GDataAPPCategories)) +#define GDATA_APP_CATEGORIES_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_APP_CATEGORIES, GDataAPPCategoriesClass)) +#define GDATA_IS_APP_CATEGORIES(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_APP_CATEGORIES)) +#define GDATA_IS_APP_CATEGORIES_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_APP_CATEGORIES)) +#define GDATA_APP_CATEGORIES_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_APP_CATEGORIES, GDataAPPCategoriesClass)) + +typedef struct _GDataAPPCategoriesPrivate GDataAPPCategoriesPrivate; + +/** + * GDataAPPCategories: + * + * All the fields in the #GDataAPPCategories structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataParsable parent; + GDataAPPCategoriesPrivate *priv; +} GDataAPPCategories; + +/** + * GDataAPPCategoriesClass: + * + * All the fields in the #GDataAPPCategoriesClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataAPPCategoriesClass; + +GType gdata_app_categories_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataAPPCategories, g_object_unref) + +GList *gdata_app_categories_get_categories (GDataAPPCategories *self) G_GNUC_PURE; +gboolean gdata_app_categories_is_fixed (GDataAPPCategories *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_APP_CATEGORIES_H */ diff --git a/gdata/atom/gdata-author.c b/gdata/atom/gdata-author.c new file mode 100644 index 0000000..09bf03f --- /dev/null +++ b/gdata/atom/gdata-author.c @@ -0,0 +1,377 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-author + * @short_description: Atom author element + * @stability: Stable + * @include: gdata/atom/gdata-author.h + * + * #GDataAuthor represents a "author" element from the + * Atom specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-author.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_author_comparable_init (GDataComparableIface *iface); +static void gdata_author_finalize (GObject *object); +static void gdata_author_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_author_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static gboolean post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error); +static void get_xml (GDataParsable *parsable, GString *xml_string); + +struct _GDataAuthorPrivate { + gchar *name; + gchar *uri; + gchar *email_address; +}; + +enum { + PROP_NAME = 1, + PROP_URI, + PROP_EMAIL_ADDRESS +}; + +G_DEFINE_TYPE_WITH_CODE (GDataAuthor, gdata_author, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_author_comparable_init)) + +static void +gdata_author_class_init (GDataAuthorClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataAuthorPrivate)); + + gobject_class->set_property = gdata_author_set_property; + gobject_class->get_property = gdata_author_get_property; + gobject_class->finalize = gdata_author_finalize; + + parsable_class->parse_xml = parse_xml; + parsable_class->post_parse_xml = post_parse_xml; + parsable_class->get_xml = get_xml; + parsable_class->element_name = "author"; + + /** + * GDataAuthor:name: + * + * A human-readable name for the person. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_NAME, + g_param_spec_string ("name", + "Name", "A human-readable name for the person.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataAuthor:uri: + * + * An IRI associated with the person. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", + "URI", "An IRI associated with the person.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataAuthor:email-address: + * + * An e-mail address associated with the person. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_EMAIL_ADDRESS, + g_param_spec_string ("email-address", + "E-mail address", "An e-mail address associated with the person.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + return g_strcmp0 (((GDataAuthor*) self)->priv->name, ((GDataAuthor*) other)->priv->name); +} + +static void +gdata_author_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_author_init (GDataAuthor *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_AUTHOR, GDataAuthorPrivate); +} + +static void +gdata_author_finalize (GObject *object) +{ + GDataAuthorPrivate *priv = GDATA_AUTHOR (object)->priv; + + g_free (priv->name); + g_free (priv->uri); + g_free (priv->email_address); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_author_parent_class)->finalize (object); +} + +static void +gdata_author_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataAuthorPrivate *priv = GDATA_AUTHOR (object)->priv; + + switch (property_id) { + case PROP_NAME: + g_value_set_string (value, priv->name); + break; + case PROP_URI: + g_value_set_string (value, priv->uri); + break; + case PROP_EMAIL_ADDRESS: + g_value_set_string (value, priv->email_address); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_author_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataAuthor *self = GDATA_AUTHOR (object); + + switch (property_id) { + case PROP_NAME: + gdata_author_set_name (self, g_value_get_string (value)); + break; + case PROP_URI: + gdata_author_set_uri (self, g_value_get_string (value)); + break; + case PROP_EMAIL_ADDRESS: + gdata_author_set_email_address (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataAuthorPrivate *priv = GDATA_AUTHOR (parsable)->priv; + + if (gdata_parser_is_namespace (node, "http://www.w3.org/2005/Atom") == TRUE && + (gdata_parser_string_from_element (node, "name", P_NO_DUPES | P_REQUIRED | P_NON_EMPTY, &(priv->name), &success, error) == TRUE || + gdata_parser_string_from_element (node, "uri", P_NO_DUPES | P_REQUIRED | P_NON_EMPTY, &(priv->uri), &success, error) == TRUE || + gdata_parser_string_from_element (node, "email", P_NO_DUPES | P_REQUIRED | P_NON_EMPTY, &(priv->email_address), &success, error) == TRUE + )) { + return success; + } else { + return GDATA_PARSABLE_CLASS (gdata_author_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } +} + +static gboolean +post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataAuthorPrivate *priv = GDATA_AUTHOR (parsable)->priv; + + if (priv->name == NULL || *(priv->name) == '\0') + return gdata_parser_error_required_element_missing ("name", "author", error); + + return TRUE; +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataAuthorPrivate *priv = GDATA_AUTHOR (parsable)->priv; + + gdata_parser_string_append_escaped (xml_string, "", priv->name, ""); + + if (priv->uri != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->uri, ""); + + if (priv->email_address != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->email_address, ""); +} + +/** + * gdata_author_new: + * @name: the author's name + * @uri: (allow-none): an IRI describing the author, or %NULL + * @email_address: (allow-none): the author's e-mail address, or %NULL + * + * Creates a new #GDataAuthor. More information is available in the Atom specification. + * + * @name must be non-%NULL and non-empty. + * + * Return value: a new #GDataAuthor, or %NULL; unref with g_object_unref() + */ +GDataAuthor * +gdata_author_new (const gchar *name, const gchar *uri, const gchar *email_address) +{ + g_return_val_if_fail (name != NULL && *name != '\0', NULL); + return g_object_new (GDATA_TYPE_AUTHOR, "name", name, "uri", uri, "email-address", email_address, NULL); +} + +/** + * gdata_author_get_name: + * @self: a #GDataAuthor + * + * Gets the #GDataAuthor:name property. The name will always be a non-%NULL, non-empty string. + * + * Return value: the author's name + * + * Since: 0.4.0 + */ +const gchar * +gdata_author_get_name (GDataAuthor *self) +{ + g_return_val_if_fail (GDATA_IS_AUTHOR (self), NULL); + return self->priv->name; +} + +/** + * gdata_author_set_name: + * @self: a #GDataAuthor + * @name: the new name for the author + * + * Sets the #GDataAuthor:name property to @name. @name must be non-%NULL and non-empty. + * + * Since: 0.4.0 + */ +void +gdata_author_set_name (GDataAuthor *self, const gchar *name) +{ + g_return_if_fail (GDATA_IS_AUTHOR (self)); + g_return_if_fail (name != NULL && *name != '\0'); + + g_free (self->priv->name); + self->priv->name = g_strdup (name); + g_object_notify (G_OBJECT (self), "name"); +} + +/** + * gdata_author_get_uri: + * @self: a #GDataAuthor + * + * Gets the #GDataAuthor:uri property. If the URI is non-%NULL, it will be non-empty. + * + * Return value: the author's URI, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_author_get_uri (GDataAuthor *self) +{ + g_return_val_if_fail (GDATA_IS_AUTHOR (self), NULL); + return self->priv->uri; +} + +/** + * gdata_author_set_uri: + * @self: a #GDataAuthor + * @uri: (allow-none): the new URI for the author, or %NULL + * + * Sets the #GDataAuthor:uri property to @uri. @uri must be %NULL or non-empty. + * + * Set @uri to %NULL to unset the property in the author. + * + * Since: 0.4.0 + */ +void +gdata_author_set_uri (GDataAuthor *self, const gchar *uri) +{ + g_return_if_fail (GDATA_IS_AUTHOR (self)); + + g_free (self->priv->uri); + self->priv->uri = g_strdup (uri); + g_object_notify (G_OBJECT (self), "uri"); +} + +/** + * gdata_author_get_email_address: + * @self: a #GDataAuthor + * + * Gets the #GDataAuthor:email-address property. If the e-mail address is non-%NULL, it will be non-empty. + * + * Return value: the author's e-mail address, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_author_get_email_address (GDataAuthor *self) +{ + g_return_val_if_fail (GDATA_IS_AUTHOR (self), NULL); + return self->priv->email_address; +} + +/** + * gdata_author_set_email_address: + * @self: a #GDataAuthor + * @email_address: (allow-none): the new e-mail address for the author, or %NULL + * + * Sets the #GDataAuthor:email-address property to @email_address. @email_address must be %NULL or non-empty. + * + * Set @email_address to %NULL to unset the property in the author. + * + * Since: 0.4.0 + */ +void +gdata_author_set_email_address (GDataAuthor *self, const gchar *email_address) +{ + g_return_if_fail (GDATA_IS_AUTHOR (self)); + + g_free (self->priv->email_address); + self->priv->email_address = g_strdup (email_address); + g_object_notify (G_OBJECT (self), "email-address"); +} diff --git a/gdata/atom/gdata-author.h b/gdata/atom/gdata-author.h new file mode 100644 index 0000000..7487b4c --- /dev/null +++ b/gdata/atom/gdata-author.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_AUTHOR_H +#define GDATA_AUTHOR_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_AUTHOR (gdata_author_get_type ()) +#define GDATA_AUTHOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_AUTHOR, GDataAuthor)) +#define GDATA_AUTHOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_AUTHOR, GDataAuthorClass)) +#define GDATA_IS_AUTHOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_AUTHOR)) +#define GDATA_IS_AUTHOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_AUTHOR)) +#define GDATA_AUTHOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_AUTHOR, GDataAuthorClass)) + +typedef struct _GDataAuthorPrivate GDataAuthorPrivate; + +/** + * GDataAuthor: + * + * All the fields in the #GDataAuthor structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataAuthorPrivate *priv; +} GDataAuthor; + +/** + * GDataAuthorClass: + * + * All the fields in the #GDataAuthorClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataAuthorClass; + +GType gdata_author_get_type (void) G_GNUC_CONST; + +GDataAuthor *gdata_author_new (const gchar *name, const gchar *uri, const gchar *email_address) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_author_get_name (GDataAuthor *self) G_GNUC_PURE; +void gdata_author_set_name (GDataAuthor *self, const gchar *name); + +const gchar *gdata_author_get_uri (GDataAuthor *self) G_GNUC_PURE; +void gdata_author_set_uri (GDataAuthor *self, const gchar *uri); + +const gchar *gdata_author_get_email_address (GDataAuthor *self) G_GNUC_PURE; +void gdata_author_set_email_address (GDataAuthor *self, const gchar *email_address); + +G_END_DECLS + +#endif /* !GDATA_AUTHOR_H */ diff --git a/gdata/atom/gdata-category.c b/gdata/atom/gdata-category.c new file mode 100644 index 0000000..c02771c --- /dev/null +++ b/gdata/atom/gdata-category.c @@ -0,0 +1,377 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-category + * @short_description: Atom category element + * @stability: Stable + * @include: gdata/atom/gdata-category.h + * + * #GDataCategory represents a "category" element from the + * Atom specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-category.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_category_comparable_init (GDataComparableIface *iface); +static void gdata_category_finalize (GObject *object); +static void gdata_category_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_category_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); + +struct _GDataCategoryPrivate { + gchar *term; + gchar *scheme; + gchar *label; +}; + +enum { + PROP_TERM = 1, + PROP_SCHEME, + PROP_LABEL +}; + +G_DEFINE_TYPE_WITH_CODE (GDataCategory, gdata_category, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_category_comparable_init)) + +static void +gdata_category_class_init (GDataCategoryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataCategoryPrivate)); + + gobject_class->set_property = gdata_category_set_property; + gobject_class->get_property = gdata_category_get_property; + gobject_class->finalize = gdata_category_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->element_name = "category"; + + /** + * GDataCategory:term: + * + * Identifies the category to which the entry or feed belongs. + * + * For more information, see the + * + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TERM, + g_param_spec_string ("term", + "Term", "Identifies the category to which the entry or feed belongs.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCategory:scheme: + * + * An IRI that identifies a categorization scheme. + * + * For more information, see the + * + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_SCHEME, + g_param_spec_string ("scheme", + "Scheme", "An IRI that identifies a categorization scheme.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCategory:label: + * + * A human-readable label for display in end-user applications. + * + * For more information, see the + * + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A human-readable label for display in end-user applications.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + return g_strcmp0 (((GDataCategory*) self)->priv->term, ((GDataCategory*) other)->priv->term); +} + +static void +gdata_category_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_category_init (GDataCategory *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_CATEGORY, GDataCategoryPrivate); +} + +static void +gdata_category_finalize (GObject *object) +{ + GDataCategoryPrivate *priv = GDATA_CATEGORY (object)->priv; + + g_free (priv->term); + g_free (priv->scheme); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_category_parent_class)->finalize (object); +} + +static void +gdata_category_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataCategoryPrivate *priv = GDATA_CATEGORY (object)->priv; + + switch (property_id) { + case PROP_TERM: + g_value_set_string (value, priv->term); + break; + case PROP_SCHEME: + g_value_set_string (value, priv->scheme); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_category_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataCategory *self = GDATA_CATEGORY (object); + + switch (property_id) { + case PROP_TERM: + gdata_category_set_term (self, g_value_get_string (value)); + break; + case PROP_SCHEME: + gdata_category_set_scheme (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_category_set_label (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *term, *scheme; + GDataCategory *self = GDATA_CATEGORY (parsable); + + term = xmlGetProp (root_node, (xmlChar*) "term"); + if (term == NULL || *term == '\0') { + xmlFree (term); + return gdata_parser_error_required_property_missing (root_node, "term", error); + } + + scheme = xmlGetProp (root_node, (xmlChar*) "scheme"); + if (scheme != NULL && *scheme == '\0') { + xmlFree (term); + xmlFree (scheme); + return gdata_parser_error_required_property_missing (root_node, "scheme", error); + } + + self->priv->term = (gchar*) term; + self->priv->scheme = (gchar*) scheme; + self->priv->label = (gchar*) xmlGetProp (root_node, (xmlChar*) "label"); + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataCategoryPrivate *priv = GDATA_CATEGORY (parsable)->priv; + + gdata_parser_string_append_escaped (xml_string, " term='", priv->term, "'"); + + if (priv->scheme != NULL) + gdata_parser_string_append_escaped (xml_string, " scheme='", priv->scheme, "'"); + + if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); +} + +/** + * gdata_category_new: + * @term: a category identifier + * @scheme: (allow-none): an IRI to define the categorisation scheme, or %NULL + * @label: (allow-none): a human-readable label for the category, or %NULL + * + * Creates a new #GDataCategory. More information is available in the Atom specification. + * + * @term must be non-%NULL and non-empty. @scheme must be %NULL or non-empty. + * + * Return value: a new #GDataCategory, or %NULL; unref with g_object_unref() + */ +GDataCategory * +gdata_category_new (const gchar *term, const gchar *scheme, const gchar *label) +{ + g_return_val_if_fail (term != NULL && *term != '\0', NULL); + g_return_val_if_fail (scheme == NULL || *scheme != '\0', NULL); + return g_object_new (GDATA_TYPE_CATEGORY, "term", term, "scheme", scheme, "label", label, NULL); +} + +/** + * gdata_category_get_term: + * @self: a #GDataCategory + * + * Gets the #GDataCategory:term property. The term will always be a non-%NULL, non-empty string. + * + * Return value: the category's term + * + * Since: 0.4.0 + */ +const gchar * +gdata_category_get_term (GDataCategory *self) +{ + g_return_val_if_fail (GDATA_IS_CATEGORY (self), NULL); + return self->priv->term; +} + +/** + * gdata_category_set_term: + * @self: a #GDataCategory + * @term: the new term for the category + * + * Sets the #GDataCategory:term property to @term. @term must be non-%NULL and non-empty. + * + * Since: 0.4.0 + */ +void +gdata_category_set_term (GDataCategory *self, const gchar *term) +{ + g_return_if_fail (GDATA_IS_CATEGORY (self)); + g_return_if_fail (term != NULL && *term != '\0'); + + g_free (self->priv->term); + self->priv->term = g_strdup (term); + g_object_notify (G_OBJECT (self), "term"); +} + +/** + * gdata_category_get_scheme: + * @self: a #GDataCategory + * + * Gets the #GDataCategory:scheme property. If the scheme is non-%NULL, it will be non-empty. + * + * Return value: the category's scheme, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_category_get_scheme (GDataCategory *self) +{ + g_return_val_if_fail (GDATA_IS_CATEGORY (self), NULL); + return self->priv->scheme; +} + +/** + * gdata_category_set_scheme: + * @self: a #GDataCategory + * @scheme: (allow-none): the new scheme for the category, or %NULL + * + * Sets the #GDataCategory:scheme property to @scheme. @scheme must be %NULL or non-empty. + * + * Set @scheme to %NULL to unset the property in the category. + * + * Since: 0.4.0 + */ +void +gdata_category_set_scheme (GDataCategory *self, const gchar *scheme) +{ + g_return_if_fail (GDATA_IS_CATEGORY (self)); + + g_free (self->priv->scheme); + self->priv->scheme = g_strdup (scheme); + g_object_notify (G_OBJECT (self), "scheme"); +} + +/** + * gdata_category_get_label: + * @self: a #GDataCategory + * + * Gets the #GDataCategory:label property. + * + * Return value: the category's label, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_category_get_label (GDataCategory *self) +{ + g_return_val_if_fail (GDATA_IS_CATEGORY (self), NULL); + return self->priv->label; +} + +/** + * gdata_category_set_label: + * @self: a #GDataCategory + * @label: (allow-none): the new label for the category, or %NULL + * + * Sets the #GDataCategory:label property to @label. + * + * Set @label to %NULL to unset the property in the category. + * + * Since: 0.4.0 + */ +void +gdata_category_set_label (GDataCategory *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_CATEGORY (self)); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} diff --git a/gdata/atom/gdata-category.h b/gdata/atom/gdata-category.h new file mode 100644 index 0000000..20f7cac --- /dev/null +++ b/gdata/atom/gdata-category.h @@ -0,0 +1,121 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CATEGORY_H +#define GDATA_CATEGORY_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_CATEGORY_SCHEMA_LABELS: + * + * A schema for categories which label the entry they're applied to in some way, such as starring it. The semantics of the various labels + * (such as %GDATA_CATEGORY_SCHEMA_LABELS_STARRED) are service-specific. + * + * Since: 0.11.0 + */ +#define GDATA_CATEGORY_SCHEMA_LABELS "http://schemas.google.com/g/2005/labels" + +/** + * GDATA_CATEGORY_SCHEMA_LABELS_SHARED: + * + * A term for categories of the %GDATA_CATEGORY_SCHEMA_LABELS schema which labels an entry as being “shared”. The semantics of this label are + * service-specific, but are obvious for services such as Google Documents. + * + * Since: 0.17.0 + */ +#define GDATA_CATEGORY_SCHEMA_LABELS_SHARED GDATA_CATEGORY_SCHEMA_LABELS"#shared" + +/** + * GDATA_CATEGORY_SCHEMA_LABELS_STARRED: + * + * A term for categories of the %GDATA_CATEGORY_SCHEMA_LABELS schema which labels an entry as being “starred”. The semantics of this label are + * service-specific, but are obvious for services such as Google Documents. + * + * Since: 0.11.0 + */ +#define GDATA_CATEGORY_SCHEMA_LABELS_STARRED GDATA_CATEGORY_SCHEMA_LABELS"#starred" + +/** + * GDATA_CATEGORY_SCHEMA_LABELS_VIEWED: + * + * A term for categories of the %GDATA_CATEGORY_SCHEMA_LABELS schema which labels an entry as being “viewed”. The semantics of this label are + * service-specific, but are obvious for services such as Google Documents. + * + * Since: 0.17.0 + */ +#define GDATA_CATEGORY_SCHEMA_LABELS_VIEWED GDATA_CATEGORY_SCHEMA_LABELS"#viewed" + +#define GDATA_TYPE_CATEGORY (gdata_category_get_type ()) +#define GDATA_CATEGORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CATEGORY, GDataCategory)) +#define GDATA_CATEGORY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CATEGORY, GDataCategoryClass)) +#define GDATA_IS_CATEGORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CATEGORY)) +#define GDATA_IS_CATEGORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CATEGORY)) +#define GDATA_CATEGORY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CATEGORY, GDataCategoryClass)) + +typedef struct _GDataCategoryPrivate GDataCategoryPrivate; + +/** + * GDataCategory: + * + * All the fields in the #GDataCategory structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataCategoryPrivate *priv; +} GDataCategory; + +/** + * GDataCategoryClass: + * + * All the fields in the #GDataCategoryClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataCategoryClass; + +GType gdata_category_get_type (void) G_GNUC_CONST; + +GDataCategory *gdata_category_new (const gchar *term, const gchar *scheme, const gchar *label) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_category_get_term (GDataCategory *self) G_GNUC_PURE; +void gdata_category_set_term (GDataCategory *self, const gchar *term); + +const gchar *gdata_category_get_scheme (GDataCategory *self) G_GNUC_PURE; +void gdata_category_set_scheme (GDataCategory *self, const gchar *scheme); + +const gchar *gdata_category_get_label (GDataCategory *self) G_GNUC_PURE; +void gdata_category_set_label (GDataCategory *self, const gchar *label); + +G_END_DECLS + +#endif /* !GDATA_CATEGORY_H */ diff --git a/gdata/atom/gdata-generator.c b/gdata/atom/gdata-generator.c new file mode 100644 index 0000000..69a17d2 --- /dev/null +++ b/gdata/atom/gdata-generator.c @@ -0,0 +1,264 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-generator + * @short_description: Atom generator element + * @stability: Stable + * @include: gdata/atom/gdata-generator.h + * + * #GDataGenerator represents a "generator" element from the + * Atom specification. + */ + +#include +#include + +#include "gdata-generator.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_generator_comparable_init (GDataComparableIface *iface); +static void gdata_generator_finalize (GObject *object); +static void gdata_generator_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); + +struct _GDataGeneratorPrivate { + gchar *name; + gchar *uri; + gchar *version; +}; + +enum { + PROP_NAME = 1, + PROP_URI, + PROP_VERSION +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGenerator, gdata_generator, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_generator_comparable_init)) + +static void +gdata_generator_class_init (GDataGeneratorClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGeneratorPrivate)); + + gobject_class->get_property = gdata_generator_get_property; + gobject_class->finalize = gdata_generator_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->element_name = "generator"; + + /** + * GDataGenerator:name: + * + * A human-readable name for the generating agent. + * + * For more information, see the + * + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_NAME, + g_param_spec_string ("name", + "Name", "A human-readable name for the generating agent.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGenerator:uri: + * + * An IRI reference that is relevant to the agent. + * + * For more information, see the + * + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", + "URI", "An IRI reference that is relevant to the agent.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGenerator:version: + * + * Indicates the version of the generating agent. + * + * For more information, see the + * + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_VERSION, + g_param_spec_string ("version", + "Version", "Indicates the version of the generating agent.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + return g_strcmp0 (((GDataGenerator*) self)->priv->name, ((GDataGenerator*) other)->priv->name); +} + +static void +gdata_generator_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_generator_init (GDataGenerator *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GENERATOR, GDataGeneratorPrivate); +} + +static void +gdata_generator_finalize (GObject *object) +{ + GDataGeneratorPrivate *priv = GDATA_GENERATOR (object)->priv; + + g_free (priv->name); + g_free (priv->uri); + g_free (priv->version); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_generator_parent_class)->finalize (object); +} + +static void +gdata_generator_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGeneratorPrivate *priv = GDATA_GENERATOR (object)->priv; + + switch (property_id) { + case PROP_NAME: + g_value_set_string (value, priv->name); + break; + case PROP_URI: + g_value_set_string (value, priv->uri); + break; + case PROP_VERSION: + g_value_set_string (value, priv->version); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *uri, *name; + GDataGeneratorPrivate *priv = GDATA_GENERATOR (parsable)->priv; + + uri = xmlGetProp (root_node, (xmlChar*) "uri"); + if (uri != NULL && *uri == '\0') { + xmlFree (uri); + return gdata_parser_error_required_property_missing (root_node, "uri", error); + } + + name = xmlNodeListGetString (doc, root_node->children, TRUE); + if (name != NULL && *name == '\0') { + xmlFree (uri); + xmlFree (name); + return gdata_parser_error_required_content_missing (root_node, error); + } + + priv->uri = (gchar*) uri; + priv->name = (gchar*) name; + priv->version = (gchar*) xmlGetProp (root_node, (xmlChar*) "version"); + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + /* Textual content's handled in pre_parse_xml */ + if (node->type != XML_ELEMENT_NODE) + return TRUE; + + return GDATA_PARSABLE_CLASS (gdata_generator_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +/** + * gdata_generator_get_name: + * @self: a #GDataGenerator + * + * Gets the #GDataGenerator:name property. The name will be %NULL or non-empty. + * + * Return value: (nullable): the generator's name + * + * Since: 0.4.0 + */ +const gchar * +gdata_generator_get_name (GDataGenerator *self) +{ + g_return_val_if_fail (GDATA_IS_GENERATOR (self), NULL); + return self->priv->name; +} + +/** + * gdata_generator_get_uri: + * @self: a #GDataGenerator + * + * Gets the #GDataGenerator:uri property. The URI will be %NULL or non-empty. + * + * Return value: (nullable): the generator's URI, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_generator_get_uri (GDataGenerator *self) +{ + g_return_val_if_fail (GDATA_IS_GENERATOR (self), NULL); + return self->priv->uri; +} + +/** + * gdata_generator_get_version: + * @self: a #GDataGenerator + * + * Gets the #GDataGenerator:version property. + * + * Return value: the generator's version, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_generator_get_version (GDataGenerator *self) +{ + g_return_val_if_fail (GDATA_IS_GENERATOR (self), NULL); + return self->priv->version; +} diff --git a/gdata/atom/gdata-generator.h b/gdata/atom/gdata-generator.h new file mode 100644 index 0000000..d4d81d6 --- /dev/null +++ b/gdata/atom/gdata-generator.h @@ -0,0 +1,74 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GENERATOR_H +#define GDATA_GENERATOR_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_GENERATOR (gdata_generator_get_type ()) +#define GDATA_GENERATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GENERATOR, GDataGenerator)) +#define GDATA_GENERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GENERATOR, GDataGeneratorClass)) +#define GDATA_IS_GENERATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GENERATOR)) +#define GDATA_IS_GENERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GENERATOR)) +#define GDATA_GENERATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GENERATOR, GDataGeneratorClass)) + +typedef struct _GDataGeneratorPrivate GDataGeneratorPrivate; + +/** + * GDataGenerator: + * + * All the fields in the #GDataGenerator structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataGeneratorPrivate *priv; +} GDataGenerator; + +/** + * GDataGeneratorClass: + * + * All the fields in the #GDataGeneratorClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGeneratorClass; + +GType gdata_generator_get_type (void) G_GNUC_CONST; + +const gchar *gdata_generator_get_name (GDataGenerator *self) G_GNUC_PURE; +const gchar *gdata_generator_get_uri (GDataGenerator *self) G_GNUC_PURE; +const gchar *gdata_generator_get_version (GDataGenerator *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_GENERATOR_H */ diff --git a/gdata/atom/gdata-link.c b/gdata/atom/gdata-link.c new file mode 100644 index 0000000..49facc5 --- /dev/null +++ b/gdata/atom/gdata-link.c @@ -0,0 +1,625 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-link + * @short_description: Atom link element + * @stability: Stable + * @include: gdata/atom/gdata-link.h + * + * #GDataLink represents a "link" element from the + * Atom specification. + * + * Since: 0.4.0 + */ + +#include +#include +#include + +#include "gdata-link.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_link_comparable_init (GDataComparableIface *iface); +static void gdata_link_finalize (GObject *object); +static void gdata_link_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_link_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); + +struct _GDataLinkPrivate { + gchar *uri; + gchar *relation_type; + gchar *content_type; + gchar *language; + gchar *title; + gint length; +}; + +enum { + PROP_URI = 1, + PROP_RELATION_TYPE, + PROP_CONTENT_TYPE, + PROP_LANGUAGE, + PROP_TITLE, + PROP_LENGTH +}; + +G_DEFINE_TYPE_WITH_CODE (GDataLink, gdata_link, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_link_comparable_init)) + +static void +gdata_link_class_init (GDataLinkClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataLinkPrivate)); + + gobject_class->set_property = gdata_link_set_property; + gobject_class->get_property = gdata_link_get_property; + gobject_class->finalize = gdata_link_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->element_name = "link"; + + /** + * GDataLink:uri: + * + * The link's IRI. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", + "URI", "The link's IRI.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataLink:relation-type: + * + * The link relation type. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "The link relation type.", + GDATA_LINK_ALTERNATE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataLink:content-type: + * + * An advisory media type: it is a hint about the type of the representation that is expected to be returned when the value + * of the #GDataLink:uri property is dereferenced. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_CONTENT_TYPE, + g_param_spec_string ("content-type", + "Content type", "An advisory media type.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataLink:language: + * + * Describes the language of the resource pointed to by the #GDataLink:uri property. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LANGUAGE, + g_param_spec_string ("language", + "Language", "Describes the language of the resource pointed to by the uri property.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataLink:title: + * + * Conveys human-readable information about the link. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TITLE, + g_param_spec_string ("title", + "Title", "Conveys human-readable information about the link.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataLink:length: + * + * Indicates an advisory length of the linked content in octets. -1 means the length is unspecified. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LENGTH, + g_param_spec_int ("length", + "Length", "Indicates an advisory length of the linked content in octets.", + -1, G_MAXINT, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataLinkPrivate *a = ((GDataLink*) self)->priv, *b = ((GDataLink*) other)->priv; + + if (g_strcmp0 (a->uri, b->uri) == 0 && g_strcmp0 (a->relation_type, b->relation_type) == 0) + return 0; + return 1; +} + +static void +gdata_link_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_link_init (GDataLink *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_LINK, GDataLinkPrivate); + self->priv->length = -1; + self->priv->relation_type = g_strdup (GDATA_LINK_ALTERNATE); +} + +static void +gdata_link_finalize (GObject *object) +{ + GDataLinkPrivate *priv = GDATA_LINK (object)->priv; + + g_free (priv->uri); + g_free (priv->relation_type); + g_free (priv->content_type); + g_free (priv->language); + g_free (priv->title); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_link_parent_class)->finalize (object); +} + +static void +gdata_link_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataLinkPrivate *priv = GDATA_LINK (object)->priv; + + switch (property_id) { + case PROP_URI: + g_value_set_string (value, priv->uri); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_CONTENT_TYPE: + g_value_set_string (value, priv->content_type); + break; + case PROP_LANGUAGE: + g_value_set_string (value, priv->language); + break; + case PROP_TITLE: + g_value_set_string (value, priv->title); + break; + case PROP_LENGTH: + g_value_set_int (value, priv->length); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_link_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataLink *self = GDATA_LINK (object); + + switch (property_id) { + case PROP_URI: + gdata_link_set_uri (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_link_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_CONTENT_TYPE: + gdata_link_set_content_type (self, g_value_get_string (value)); + break; + case PROP_LANGUAGE: + gdata_link_set_language (self, g_value_get_string (value)); + break; + case PROP_TITLE: + gdata_link_set_title (self, g_value_get_string (value)); + break; + case PROP_LENGTH: + gdata_link_set_length (self, g_value_get_int (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *uri, *relation_type, *content_type, *language, *length; + GDataLink *self = GDATA_LINK (parsable); + + /* href */ + uri = xmlGetProp (root_node, (xmlChar*) "href"); + if (uri == NULL || *uri == '\0') { + xmlFree (uri); + return gdata_parser_error_required_property_missing (root_node, "href", error); + } + + /* rel */ + relation_type = xmlGetProp (root_node, (xmlChar*) "rel"); + if (relation_type != NULL && *relation_type == '\0') { + xmlFree (uri); + xmlFree (relation_type); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + /* type */ + content_type = xmlGetProp (root_node, (xmlChar*) "type"); + if (content_type != NULL && *content_type == '\0') { + xmlFree (uri); + xmlFree (relation_type); + xmlFree (content_type); + return gdata_parser_error_required_property_missing (root_node, "type", error); + } + + /* hreflang */ + language = xmlGetProp (root_node, (xmlChar*) "hreflang"); + if (language != NULL && *language == '\0') { + xmlFree (uri); + xmlFree (relation_type); + xmlFree (content_type); + xmlFree (language); + return gdata_parser_error_required_property_missing (root_node, "hreflang", error); + } + + self->priv->uri = (gchar*) uri; + gdata_link_set_relation_type (self, (const gchar*) relation_type); + xmlFree (relation_type); + self->priv->content_type = (gchar*) content_type; + self->priv->language = (gchar*) language; + self->priv->title = (gchar*) xmlGetProp (root_node, (xmlChar*) "title"); + + length = xmlGetProp (root_node, (xmlChar*) "length"); + if (length == NULL) + self->priv->length = -1; + else + self->priv->length = g_ascii_strtoull ((gchar*) length, NULL, 10); + xmlFree (length); + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataLinkPrivate *priv = GDATA_LINK (parsable)->priv; + + gdata_parser_string_append_escaped (xml_string, " href='", priv->uri, "'"); + + if (priv->title != NULL) + gdata_parser_string_append_escaped (xml_string, " title='", priv->title, "'"); + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + if (priv->content_type != NULL) + gdata_parser_string_append_escaped (xml_string, " type='", priv->content_type, "'"); + if (priv->language != NULL) + gdata_parser_string_append_escaped (xml_string, " hreflang='", priv->language, "'"); + if (priv->length != -1) + g_string_append_printf (xml_string, " length='%i'", priv->length); +} + +/** + * gdata_link_new: + * @uri: the link's IRI + * @relation_type: (allow-none): the relationship of the link to the current document, or %NULL + * + * Creates a new #GDataLink. More information is available in the Atom specification. + * + * @uri must be non-%NULL and non-empty. @relation_type must be %NULL or non-empty. + * + * Return value: a new #GDataLink, or %NULL; unref with g_object_unref() + */ +GDataLink * +gdata_link_new (const gchar *uri, const gchar *relation_type) +{ + g_return_val_if_fail (uri != NULL && *uri != '\0', NULL); + g_return_val_if_fail (relation_type == NULL || *relation_type != '\0', NULL); + + return g_object_new (GDATA_TYPE_LINK, "uri", uri, "relation-type", relation_type, NULL); +} + +/** + * gdata_link_get_uri: + * @self: a #GDataLink + * + * Gets the #GDataLink:uri property. The return value is guaranteed to be a valid IRI, as + * specified by the Atom protocol. Common relationship values such as alternate + * are returned as http://www.iana.org/assignments/relation/alternate. + * + * For more information, see the + * Atom specification. + * + * Return value: the link's URI + * + * Since: 0.4.0 + */ +const gchar * +gdata_link_get_uri (GDataLink *self) +{ + g_return_val_if_fail (GDATA_IS_LINK (self), NULL); + return self->priv->uri; +} + +/** + * gdata_link_set_uri: + * @self: a #GDataLink + * @uri: the new URI for the link + * + * Sets the #GDataLink:uri property to @uri. @uri must be non-%NULL and non-empty. + * + * Since: 0.4.0 + */ +void +gdata_link_set_uri (GDataLink *self, const gchar *uri) +{ + g_return_if_fail (GDATA_IS_LINK (self)); + g_return_if_fail (uri != NULL && *uri != '\0'); + + g_free (self->priv->uri); + self->priv->uri = g_strdup (uri); + g_object_notify (G_OBJECT (self), "uri"); +} + +/** + * gdata_link_get_relation_type: + * @self: a #GDataLink + * + * Gets the #GDataLink:relation-type property. If the relation type is non-%NULL, it will be non-empty. + * + * Return value: (nullable): the link's relation type + * + * Since: 0.4.0 + */ +const gchar * +gdata_link_get_relation_type (GDataLink *self) +{ + g_return_val_if_fail (GDATA_IS_LINK (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_link_set_relation_type: + * @self: a #GDataLink + * @relation_type: (allow-none): the new relation type for the link, or %NULL + * + * Sets the #GDataLink:relation-type property to @relation_type. If @relation_type is one of the standard Atom relation types, + * use one of the defined relation type values, instead of a static string. e.g. %GDATA_LINK_EDIT or %GDATA_LINK_SELF. + * + * Set @relation_type to %NULL to unset the property in the link. + * + * Since: 0.4.0 + */ +void +gdata_link_set_relation_type (GDataLink *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_LINK (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + /* If the relation type is unset, use the default "alternate" relation type. If it's set, and isn't an IRI, turn it into an IRI + * by appending it to "http://www.iana.org/assignments/relation/". If it's set and is an IRI, just use the IRI. + * See: http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rel_attribute + */ + g_free (self->priv->relation_type); + if (relation_type == NULL) + self->priv->relation_type = g_strdup (GDATA_LINK_ALTERNATE); + else if (strchr ((char*) relation_type, ':') == NULL) + self->priv->relation_type = g_strconcat ("http://www.iana.org/assignments/relation/", (const gchar*) relation_type, NULL); + else + self->priv->relation_type = g_strdup ((gchar*) relation_type); + + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_link_get_content_type: + * @self: a #GDataLink + * + * Gets the #GDataLink:content-type property. If the content type is non-%NULL, it will be non-empty. + * + * Return value: (nullable): the link's content type, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_link_get_content_type (GDataLink *self) +{ + g_return_val_if_fail (GDATA_IS_LINK (self), NULL); + return self->priv->content_type; +} + +/** + * gdata_link_set_content_type: + * @self: a #GDataLink + * @content_type: (allow-none): the new content type for the link, or %NULL + * + * Sets the #GDataLink:content-type property to @content_type. @content_type must be %NULL or non-empty. + * + * Set @content_type to %NULL to unset the property in the link. + * + * Since: 0.4.0 + */ +void +gdata_link_set_content_type (GDataLink *self, const gchar *content_type) +{ + g_return_if_fail (GDATA_IS_LINK (self)); + g_return_if_fail (content_type == NULL || *content_type != '\0'); + + g_free (self->priv->content_type); + self->priv->content_type = g_strdup (content_type); + g_object_notify (G_OBJECT (self), "content-type"); +} + +/** + * gdata_link_get_language: + * @self: a #GDataLink + * + * Gets the #GDataLink:language property. If the language is non-%NULL, it will be non-empty. + * + * Return value: (nullable): the link's language, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_link_get_language (GDataLink *self) +{ + g_return_val_if_fail (GDATA_IS_LINK (self), NULL); + return self->priv->language; +} + +/** + * gdata_link_set_language: + * @self: a #GDataLink + * @language: (allow-none): the new language for the link, or %NULL + * + * Sets the #GDataLink:language property to @language. @language must be %NULL or non-empty. + * + * Set @language to %NULL to unset the property in the link. + * + * Since: 0.4.0 + */ +void +gdata_link_set_language (GDataLink *self, const gchar *language) +{ + g_return_if_fail (GDATA_IS_LINK (self)); + g_return_if_fail (language == NULL || *language != '\0'); + + g_free (self->priv->language); + self->priv->language = g_strdup (language); + g_object_notify (G_OBJECT (self), "language"); +} + +/** + * gdata_link_get_title: + * @self: a #GDataLink + * + * Gets the #GDataLink:title property. + * + * Return value: the link's title, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_link_get_title (GDataLink *self) +{ + g_return_val_if_fail (GDATA_IS_LINK (self), NULL); + return self->priv->title; +} + +/** + * gdata_link_set_title: + * @self: a #GDataLink + * @title: (allow-none): the new title for the link, or %NULL + * + * Sets the #GDataLink:title property to @title. + * + * Set @title to %NULL to unset the property in the link. + * + * Since: 0.4.0 + */ +void +gdata_link_set_title (GDataLink *self, const gchar *title) +{ + g_return_if_fail (GDATA_IS_LINK (self)); + + g_free (self->priv->title); + self->priv->title = g_strdup (title); + g_object_notify (G_OBJECT (self), "title"); +} + +/** + * gdata_link_get_length: + * @self: a #GDataLink + * + * Gets the #GDataLink:length property. + * + * Return value: the link's length, or -1 + * + * Since: 0.4.0 + */ +gint +gdata_link_get_length (GDataLink *self) +{ + g_return_val_if_fail (GDATA_IS_LINK (self), -1); + return self->priv->length; +} + +/** + * gdata_link_set_length: + * @self: a #GDataLink + * @length: the new length for the link, or -1 + * + * Sets the #GDataLink:length property to @length. + * + * Set @length to -1 to unset the property in the link. + * + * Since: 0.4.0 + */ +void +gdata_link_set_length (GDataLink *self, gint length) +{ + g_return_if_fail (GDATA_IS_LINK (self)); + g_return_if_fail (length >= -1); + + self->priv->length = length; + g_object_notify (G_OBJECT (self), "length"); +} diff --git a/gdata/atom/gdata-link.h b/gdata/atom/gdata-link.h new file mode 100644 index 0000000..75ba5d6 --- /dev/null +++ b/gdata/atom/gdata-link.h @@ -0,0 +1,190 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_LINK_H +#define GDATA_LINK_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_LINK_ALTERNATE: + * + * The relation type URI for alternate resources to the current one. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ +#define GDATA_LINK_ALTERNATE "http://www.iana.org/assignments/relation/alternate" + +/** + * GDATA_LINK_RELATED: + * + * The relation type URI for resources related to the current one. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ +#define GDATA_LINK_RELATED "http://www.iana.org/assignments/relation/related" + +/** + * GDATA_LINK_SELF: + * + * The relation type URI for the current resource. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ +#define GDATA_LINK_SELF "http://www.iana.org/assignments/relation/self" + +/** + * GDATA_LINK_ENCLOSURE: + * + * The relation type URI for attached objects which may be large in size. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ +#define GDATA_LINK_ENCLOSURE "http://www.iana.org/assignments/relation/enclosure" + +/** + * GDATA_LINK_VIA: + * + * The relation type URI for the source document of the current resource. + * + * For more information, see the + * Atom specification. + * + * Since: 0.4.0 + */ +#define GDATA_LINK_VIA "http://www.iana.org/assignments/relation/via" + +/** + * GDATA_LINK_EDIT: + * + * The relation type URI of the edit location for this resource. + * + * For more information, see the + * Atom Publishing Protocol specification. + * + * Since: 0.4.0 + */ +#define GDATA_LINK_EDIT "http://www.iana.org/assignments/relation/edit" + +/** + * GDATA_LINK_EDIT_MEDIA: + * + * The relation type URI of the edit location for media resources attached to this resource. + * + * For more information, see the + * + * Atom Publishing Protocol specification. + * + * Since: 0.4.0 + */ +#define GDATA_LINK_EDIT_MEDIA "http://www.iana.org/assignments/relation/edit-media" + +/** + * GDATA_LINK_PARENT: + * + * The relation type URI of the of the location of the parent resource in a + * hierarchy of entries. + * + * This is an undocumented GData-specific addition to the Atom specification, + * and is not included in the GData documentation except in examples and in the + * + * RelaxNG schema. + * + * Since: 0.15.1 + */ +#define GDATA_LINK_PARENT "http://schemas.google.com/docs/2007#parent" + +#define GDATA_TYPE_LINK (gdata_link_get_type ()) +#define GDATA_LINK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_LINK, GDataLink)) +#define GDATA_LINK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_LINK, GDataLinkClass)) +#define GDATA_IS_LINK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_LINK)) +#define GDATA_IS_LINK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_LINK)) +#define GDATA_LINK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_LINK, GDataLinkClass)) + +typedef struct _GDataLinkPrivate GDataLinkPrivate; + +/** + * GDataLink: + * + * All the fields in the #GDataLink structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataLinkPrivate *priv; +} GDataLink; + +/** + * GDataLinkClass: + * + * All the fields in the #GDataLinkClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataLinkClass; + +GType gdata_link_get_type (void) G_GNUC_CONST; + +GDataLink *gdata_link_new (const gchar *uri, const gchar *relation_type) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_link_get_uri (GDataLink *self) G_GNUC_PURE; +void gdata_link_set_uri (GDataLink *self, const gchar *uri); + +const gchar *gdata_link_get_relation_type (GDataLink *self) G_GNUC_PURE; +void gdata_link_set_relation_type (GDataLink *self, const gchar *relation_type); + +const gchar *gdata_link_get_content_type (GDataLink *self) G_GNUC_PURE; +void gdata_link_set_content_type (GDataLink *self, const gchar *content_type); + +const gchar *gdata_link_get_language (GDataLink *self) G_GNUC_PURE; +void gdata_link_set_language (GDataLink *self, const gchar *language); + +const gchar *gdata_link_get_title (GDataLink *self) G_GNUC_PURE; +void gdata_link_set_title (GDataLink *self, const gchar *title); + +gint gdata_link_get_length (GDataLink *self) G_GNUC_PURE; +void gdata_link_set_length (GDataLink *self, gint length); + +G_END_DECLS + +#endif /* !GDATA_LINK_H */ diff --git a/gdata/exif/gdata-exif-tags.c b/gdata/exif/gdata-exif-tags.c new file mode 100644 index 0000000..0a456cf --- /dev/null +++ b/gdata/exif/gdata-exif-tags.c @@ -0,0 +1,343 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/* + * SECTION:gdata-exif-tags + * @short_description: EXIF tags element + * @stability: Stable + * @include: gdata/exif/gdata-exif-tags.h + * + * #GDataExifTags represents a "tags" element from the + * EXIF specification. + * + * It is private API, since implementing classes are likely to proxy the properties and functions + * of #GDataExifTags as appropriate; most entry types which implement #GDataExifTags have no use + * for most of its properties, and it would be unnecessary and confusing to expose #GDataExifTags itself. + * + * Also note that modified EXIF values submitted back to the Google (in an update or on the original + * upload) appear to be ignored. Google's EXIF values for the uploaded image will be set to the EXIF + * metadata found in the image itself. + * + * For these reasons, properties have not been implemented on #GDataExifTags (yet). + * + * Since: 0.5.0 + */ + +#include +#include +#include + +#include "gdata-exif-tags.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_exif_tags_finalize (GObject *object); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataExifTagsPrivate { + gdouble distance; + gdouble exposure; + gboolean flash; + gdouble focal_length; + gdouble fstop; + gchar *image_unique_id; + gint iso; + gchar *make; + gchar *model; + gint64 _time; /* in milliseconds! */ +}; + +G_DEFINE_TYPE (GDataExifTags, gdata_exif_tags, GDATA_TYPE_PARSABLE) + +static void +gdata_exif_tags_class_init (GDataExifTagsClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataExifTagsPrivate)); + + gobject_class->finalize = gdata_exif_tags_finalize; + + parsable_class->parse_xml = parse_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "tags"; + parsable_class->element_namespace = "exif"; +} + +static void +gdata_exif_tags_init (GDataExifTags *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_EXIF_TAGS, GDataExifTagsPrivate); + self->priv->_time = -1; +} + +static void +gdata_exif_tags_finalize (GObject *object) +{ + GDataExifTagsPrivate *priv = GDATA_EXIF_TAGS (object)->priv; + + g_free (priv->make); + g_free (priv->model); + g_free (priv->image_unique_id); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_exif_tags_parent_class)->finalize (object); +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataExifTags *self = GDATA_EXIF_TAGS (parsable); + + if (gdata_parser_is_namespace (node, "http://schemas.google.com/photos/exif/2007") == FALSE) + return GDATA_PARSABLE_CLASS (gdata_exif_tags_parent_class)->parse_xml (parsable, doc, node, user_data, error); + + if (xmlStrcmp (node->name, (xmlChar*) "distance") == 0 ) { + /* exif:distance */ + xmlChar *distance = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->distance = g_ascii_strtod ((gchar*) distance, NULL); + xmlFree (distance); + } else if (xmlStrcmp (node->name, (xmlChar*) "fstop") == 0) { + /* exif:fstop */ + xmlChar *fstop = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->fstop = g_ascii_strtod ((gchar*) fstop, NULL); + xmlFree (fstop); + } else if (gdata_parser_string_from_element (node, "make", P_NONE, &(self->priv->make), &success, error) == TRUE || + gdata_parser_string_from_element (node, "model", P_NONE, &(self->priv->model), &success, error) == TRUE || + gdata_parser_string_from_element (node, "imageUniqueID", P_NONE, &(self->priv->image_unique_id), &success, error) == TRUE) { + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "exposure") == 0) { + /* exif:exposure */ + xmlChar *exposure = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->exposure = g_ascii_strtod ((gchar*) exposure, NULL); + xmlFree (exposure); + } else if (xmlStrcmp (node->name, (xmlChar*) "flash") == 0) { + /* exif:flash */ + xmlChar *flash = xmlNodeListGetString (doc, node->children, TRUE); + if (flash == NULL) + return gdata_parser_error_required_content_missing (node, error); + self->priv->flash = (xmlStrcmp (flash, (xmlChar*) "true") == 0 ? TRUE : FALSE); + xmlFree (flash); + } else if (xmlStrcmp (node->name, (xmlChar*) "focallength") == 0) { + /* exif:focal-length */ + xmlChar *focal_length = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->focal_length = g_ascii_strtod ((gchar*) focal_length, NULL); + xmlFree (focal_length); + } else if (xmlStrcmp (node->name, (xmlChar*) "iso") == 0) { + /* exif:iso */ + xmlChar *iso = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->iso = g_ascii_strtoll ((gchar*) iso, NULL, 10); + xmlFree (iso); + } else if (xmlStrcmp (node->name, (xmlChar*) "time") == 0) { + /* exif:time */ + xmlChar *time_str; + guint64 milliseconds; + + time_str = xmlNodeListGetString (doc, node->children, TRUE); + milliseconds = g_ascii_strtoull ((gchar*) time_str, NULL, 10); + xmlFree (time_str); + + self->priv->_time = (gint64) milliseconds; + } else { + return GDATA_PARSABLE_CLASS (gdata_exif_tags_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "exif", (gchar*) "http://schemas.google.com/photos/exif/2007"); +} + +/** + * gdata_exif_tags_get_distance: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:distance property. + * + * Return value: the distance value, or -1 if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_exif_tags_get_distance (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), -1); + return self->priv->distance; +} + +/** + * gdata_exif_tags_get_exposure: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:exposure property. + * + * Return value: the exposure value, or 0 if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_exif_tags_get_exposure (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), 0); + return self->priv->exposure; +} + +/** + * gdata_exif_tags_get_flash: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:flash property. + * + * Return value: %TRUE if flash was used, %FALSE otherwise + * + * Since: 0.5.0 + */ +gboolean +gdata_exif_tags_get_flash (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), FALSE); + return self->priv->flash; +} + +/** + * gdata_exif_tags_get_focal_length: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:focal-length property. + * + * Return value: the focal-length value, or -1 if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_exif_tags_get_focal_length (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), -1); + return self->priv->focal_length; +} + +/** + * gdata_exif_tags_get_fstop: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:fstop property. + * + * Return value: the F-stop value, or 0 if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_exif_tags_get_fstop (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), 0); + return self->priv->fstop; +} + +/** + * gdata_exif_tags_get_image_unique_id: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:image-unique-id property. + * + * Return value: the photo's unique EXIF identifier, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_exif_tags_get_image_unique_id (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), NULL); + return self->priv->image_unique_id; +} + +/** + * gdata_exif_tags_get_iso: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:iso property. + * + * Return value: the ISO speed, or -1 if unknown + * + * Since: 0.5.0 + */ +gint +gdata_exif_tags_get_iso (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), -1); + return self->priv->iso; +} + +/** + * gdata_exif_tags_get_make: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:make property. + * + * Return value: the name of the manufacturer of the camera, or %NULL if unknown + * + * Since: 0.5.0 + */ +const gchar * +gdata_exif_tags_get_make (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), NULL); + return self->priv->make; +} + +/** + * gdata_exif_tags_get_model: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:model property. + * + * Return value: the model name of the camera, or %NULL if unknown + * + * Since: 0.5.0 + */ +const gchar * +gdata_exif_tags_get_model (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), NULL); + return self->priv->model; +} + +/** + * gdata_exif_tags_get_time: + * @self: a #GDataExifTags + * + * Gets the #GDataExifTags:time property as a number of milliseconds since the epoch. If the property is unset, -1 will + * be returned. + * + * Return value: the UNIX timestamp for the time property in milliseconds, or -1 + * + * Since: 0.5.0 + */ +gint64 +gdata_exif_tags_get_time (GDataExifTags *self) +{ + g_return_val_if_fail (GDATA_IS_EXIF_TAGS (self), -1); + return self->priv->_time; +} diff --git a/gdata/exif/gdata-exif-tags.h b/gdata/exif/gdata-exif-tags.h new file mode 100644 index 0000000..efb586f --- /dev/null +++ b/gdata/exif/gdata-exif-tags.h @@ -0,0 +1,83 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_EXIF_TAGS_H +#define GDATA_EXIF_TAGS_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_EXIF_TAGS (gdata_exif_tags_get_type ()) +#define GDATA_EXIF_TAGS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_EXIF_TAGS, GDataExifTags)) +#define GDATA_EXIF_TAGS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_EXIF_TAGS, GDataExifTagsClass)) +#define GDATA_IS_EXIF_TAGS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_EXIF_TAGS)) +#define GDATA_IS_EXIF_TAGS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_EXIF_TAGS)) +#define GDATA_EXIF_TAGS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_EXIF_TAGS, GDataExifTagsClass)) + +typedef struct _GDataExifTagsPrivate GDataExifTagsPrivate; + +/** + * GDataExifTags: + * + * All the fields in the #GDataExifTags structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + GDataParsable parent; + GDataExifTagsPrivate *priv; +} GDataExifTags; + +/** + * GDataExifTagsClass: + * + * All the fields in the #GDataExifTagsClass structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataExifTagsClass; + +GType gdata_exif_tags_get_type (void) G_GNUC_CONST; + +gdouble gdata_exif_tags_get_distance (GDataExifTags *self) G_GNUC_PURE; +gdouble gdata_exif_tags_get_exposure (GDataExifTags *self) G_GNUC_PURE; +gboolean gdata_exif_tags_get_flash (GDataExifTags *self) G_GNUC_PURE; +gdouble gdata_exif_tags_get_focal_length (GDataExifTags *self) G_GNUC_PURE; +gdouble gdata_exif_tags_get_fstop (GDataExifTags *self) G_GNUC_PURE; +const gchar *gdata_exif_tags_get_image_unique_id (GDataExifTags *self) G_GNUC_PURE; +gint gdata_exif_tags_get_iso (GDataExifTags *self) G_GNUC_PURE; +const gchar *gdata_exif_tags_get_make (GDataExifTags *self) G_GNUC_PURE; +const gchar *gdata_exif_tags_get_model (GDataExifTags *self) G_GNUC_PURE; +gint64 gdata_exif_tags_get_time (GDataExifTags *self); + +G_END_DECLS + +#endif /* !GDATA_EXIF_TAGS_H */ diff --git a/gdata/gcontact/gdata-gcontact-calendar.c b/gdata/gcontact/gdata-gcontact-calendar.c new file mode 100644 index 0000000..90562d2 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-calendar.c @@ -0,0 +1,478 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gcontact-calendar + * @short_description: gContact calendar element + * @stability: Stable + * @include: gdata/gcontact/gdata-gcontact-calendar.h + * + * #GDataGContactCalendar represents a "calendarLink" element from the + * gContact specification. + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-gcontact-calendar.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gcontact_calendar_comparable_init (GDataComparableIface *iface); +static void gdata_gcontact_calendar_finalize (GObject *object); +static void gdata_gcontact_calendar_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gcontact_calendar_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGContactCalendarPrivate { + gchar *uri; + gchar *relation_type; + gchar *label; + gboolean is_primary; +}; + +enum { + PROP_URI = 1, + PROP_RELATION_TYPE, + PROP_LABEL, + PROP_IS_PRIMARY +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGContactCalendar, gdata_gcontact_calendar, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gcontact_calendar_comparable_init)) + +static void +gdata_gcontact_calendar_class_init (GDataGContactCalendarClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGContactCalendarPrivate)); + + gobject_class->get_property = gdata_gcontact_calendar_get_property; + gobject_class->set_property = gdata_gcontact_calendar_set_property; + gobject_class->finalize = gdata_gcontact_calendar_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "calendarLink"; + parsable_class->element_namespace = "gContact"; + + /** + * GDataGContactCalendar:uri: + * + * The URI of the calendar. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", + "URI", "The URI of the calendar.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactCalendar:relation-type: + * + * A programmatic value that identifies the type of calendar. It is mutually exclusive with #GDataGContactCalendar:label. + * Examples are %GDATA_GCONTACT_CALENDAR_HOME or %GDATA_GCONTACT_CALENDAR_FREE_BUSY. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of calendar.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactCalendar:label: + * + * A free-form string that identifies the type of calendar. It is mutually exclusive with #GDataGContactCalendar:relation-type. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A free-form string that identifies the type of calendar.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactCalendar:is-primary: + * + * Indicates which calendar out of a group is primary. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_PRIMARY, + g_param_spec_boolean ("is-primary", + "Primary?", "Indicates which calendar out of a group is primary.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGContactCalendarPrivate *a = ((GDataGContactCalendar*) self)->priv, *b = ((GDataGContactCalendar*) other)->priv; + + if (g_strcmp0 (a->uri, b->uri) == 0 && g_strcmp0 (a->relation_type, b->relation_type) == 0 && g_strcmp0 (a->label, b->label) == 0) + return 0; + return 1; +} + +static void +gdata_gcontact_calendar_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gcontact_calendar_init (GDataGContactCalendar *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GCONTACT_CALENDAR, GDataGContactCalendarPrivate); +} + +static void +gdata_gcontact_calendar_finalize (GObject *object) +{ + GDataGContactCalendarPrivate *priv = GDATA_GCONTACT_CALENDAR (object)->priv; + + g_free (priv->uri); + g_free (priv->relation_type); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gcontact_calendar_parent_class)->finalize (object); +} + +static void +gdata_gcontact_calendar_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGContactCalendarPrivate *priv = GDATA_GCONTACT_CALENDAR (object)->priv; + + switch (property_id) { + case PROP_URI: + g_value_set_string (value, priv->uri); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + case PROP_IS_PRIMARY: + g_value_set_boolean (value, priv->is_primary); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gcontact_calendar_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGContactCalendar *self = GDATA_GCONTACT_CALENDAR (object); + + switch (property_id) { + case PROP_URI: + gdata_gcontact_calendar_set_uri (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gcontact_calendar_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gcontact_calendar_set_label (self, g_value_get_string (value)); + break; + case PROP_IS_PRIMARY: + gdata_gcontact_calendar_set_is_primary (self, g_value_get_boolean (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *uri, *rel, *label; + gboolean primary_bool; + GDataGContactCalendarPrivate *priv = GDATA_GCONTACT_CALENDAR (parsable)->priv; + + /* Is it the primary calendar? */ + if (gdata_parser_boolean_from_property (root_node, "primary", &primary_bool, 0, error) == FALSE) + return FALSE; + + uri = xmlGetProp (root_node, (xmlChar*) "href"); + if (uri == NULL || *uri == '\0') { + xmlFree (uri); + return gdata_parser_error_required_property_missing (root_node, "href", error); + } + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + label = xmlGetProp (root_node, (xmlChar*) "label"); + if ((rel == NULL || *rel == '\0') && (label == NULL || *label == '\0')) { + xmlFree (uri); + xmlFree (rel); + xmlFree (label); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } else if (rel != NULL && label != NULL) { + /* Can't have both set at once */ + xmlFree (uri); + xmlFree (rel); + xmlFree (label); + return gdata_parser_error_mutexed_properties (root_node, "rel", "label", error); + } + + priv->uri = (gchar*) uri; + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) label; + priv->is_primary = primary_bool; + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGContactCalendarPrivate *priv = GDATA_GCONTACT_CALENDAR (parsable)->priv; + + gdata_parser_string_append_escaped (xml_string, " href='", priv->uri, "'"); + + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + else if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + else + g_assert_not_reached (); + + if (priv->is_primary == TRUE) + g_string_append (xml_string, " primary='true'"); + else + g_string_append (xml_string, " primary='false'"); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); +} + +/** + * gdata_gcontact_calendar_new: + * @uri: the URI of the calendar + * @relation_type: (allow-none): the type of calendar, or %NULL + * @label: (allow-none): a free-form label for the calendar, or %NULL + * @is_primary: %TRUE if this calendar is its owner's primary calendar, %FALSE otherwise + * + * Creates a new #GDataGContactCalendar. More information is available in the gContact specification. + * + * Exactly one of @relation_type and @label should be provided; the other must be %NULL. + * + * Return value: a new #GDataGContactCalendar; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataGContactCalendar * +gdata_gcontact_calendar_new (const gchar *uri, const gchar *relation_type, const gchar *label, gboolean is_primary) +{ + g_return_val_if_fail (uri != NULL && *uri != '\0', NULL); + g_return_val_if_fail ((relation_type != NULL && *relation_type != '\0' && label == NULL) || + (relation_type == NULL && label != NULL && *label != '\0'), NULL); + + return g_object_new (GDATA_TYPE_GCONTACT_CALENDAR, + "uri", uri, "relation-type", relation_type, "label", label, "is-primary", is_primary, NULL); +} + +/** + * gdata_gcontact_calendar_get_uri: + * @self: a #GDataGContactCalendar + * + * Gets the #GDataGContactCalendar:uri property. + * + * Return value: the calendar's URI + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_calendar_get_uri (GDataGContactCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_CALENDAR (self), NULL); + return self->priv->uri; +} + +/** + * gdata_gcontact_calendar_set_uri: + * @self: a #GDataGContactCalendar + * @uri: the new URI for the calendar + * + * Sets the #GDataGContactCalendar:uri property to @uri. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_calendar_set_uri (GDataGContactCalendar *self, const gchar *uri) +{ + g_return_if_fail (GDATA_IS_GCONTACT_CALENDAR (self)); + g_return_if_fail (uri != NULL && *uri != '\0'); + + g_free (self->priv->uri); + self->priv->uri = g_strdup (uri); + g_object_notify (G_OBJECT (self), "uri"); +} + +/** + * gdata_gcontact_calendar_get_relation_type: + * @self: a #GDataGContactCalendar + * + * Gets the #GDataGContactCalendar:relation-type property. + * + * Return value: the type of the relation, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_calendar_get_relation_type (GDataGContactCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_CALENDAR (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gcontact_calendar_set_relation_type: + * @self: a #GDataGContactCalendar + * @relation_type: (allow-none): the new type for the calendar, or %NULL + * + * Sets the #GDataGContactCalendar:relation-type property to @relation_type, + * such as %GDATA_GCONTACT_CALENDAR_HOME or %GDATA_GCONTACT_CALENDAR_FREE_BUSY. + * + * If @relation_type is %NULL, the relation type will be unset. When the #GDataGContactCalendar is used in a query, however, + * exactly one of #GDataGContactCalendar:relation-type and #GDataGContactCalendar:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_calendar_set_relation_type (GDataGContactCalendar *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GCONTACT_CALENDAR (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gcontact_calendar_get_label: + * @self: a #GDataGContactCalendar + * + * Gets the #GDataGContactCalendar:label property. + * + * Return value: a free-form label for the calendar, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_calendar_get_label (GDataGContactCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_CALENDAR (self), NULL); + return self->priv->label; +} + +/** + * gdata_gcontact_calendar_set_label: + * @self: a #GDataGContactCalendar + * @label: (allow-none): the new free-form label for the calendar, or %NULL + * + * Sets the #GDataGContactCalendar:label property to @label. + * + * If @label is %NULL, the label will be unset. When the #GDataGContactCalendar is used in a query, however, + * exactly one of #GDataGContactCalendar:relation-type and #GDataGContactCalendar:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_calendar_set_label (GDataGContactCalendar *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GCONTACT_CALENDAR (self)); + g_return_if_fail (label == NULL || *label != '\0'); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} + +/** + * gdata_gcontact_calendar_is_primary: + * @self: a #GDataGContactCalendar + * + * Gets the #GDataGContactCalendar:is-primary property. + * + * Return value: %TRUE if this is the contact's primary calendar, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_gcontact_calendar_is_primary (GDataGContactCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_CALENDAR (self), FALSE); + return self->priv->is_primary; +} + +/** + * gdata_gcontact_calendar_set_is_primary: + * @self: a #GDataGContactCalendar + * @is_primary: %TRUE if this is the contact's primary calendar, %FALSE otherwise + * + * Sets the #GDataGContactCalendar:is-primary property to @is_primary. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_calendar_set_is_primary (GDataGContactCalendar *self, gboolean is_primary) +{ + g_return_if_fail (GDATA_IS_GCONTACT_CALENDAR (self)); + + self->priv->is_primary = is_primary; + g_object_notify (G_OBJECT (self), "is-primary"); +} diff --git a/gdata/gcontact/gdata-gcontact-calendar.h b/gdata/gcontact/gdata-gcontact-calendar.h new file mode 100644 index 0000000..125ee6d --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-calendar.h @@ -0,0 +1,123 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GCONTACT_CALENDAR_H +#define GDATA_GCONTACT_CALENDAR_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GCONTACT_CALENDAR_WORK: + * + * The relation type URI for a contact's work calendar. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_CALENDAR_WORK "work" + +/** + * GDATA_GCONTACT_CALENDAR_HOME: + * + * The relation type URI for a contact's home calendar. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_CALENDAR_HOME "home" + +/** + * GDATA_GCONTACT_CALENDAR_FREE_BUSY: + * + * The relation type URI for a contact's free/busy calendar. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_CALENDAR_FREE_BUSY "free-busy" + +#define GDATA_TYPE_GCONTACT_CALENDAR (gdata_gcontact_calendar_get_type ()) +#define GDATA_GCONTACT_CALENDAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GCONTACT_CALENDAR, GDataGContactCalendar)) +#define GDATA_GCONTACT_CALENDAR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GCONTACT_CALENDAR, GDataGContactCalendarClass)) +#define GDATA_IS_GCONTACT_CALENDAR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GCONTACT_CALENDAR)) +#define GDATA_IS_GCONTACT_CALENDAR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GCONTACT_CALENDAR)) +#define GDATA_GCONTACT_CALENDAR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GCONTACT_CALENDAR, GDataGContactCalendarClass)) + +typedef struct _GDataGContactCalendarPrivate GDataGContactCalendarPrivate; + +/** + * GDataGContactCalendar: + * + * All the fields in the #GDataGContactCalendar structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataParsable parent; + GDataGContactCalendarPrivate *priv; +} GDataGContactCalendar; + +/** + * GDataGContactCalendarClass: + * + * All the fields in the #GDataGContactCalendarClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGContactCalendarClass; + +GType gdata_gcontact_calendar_get_type (void) G_GNUC_CONST; + +GDataGContactCalendar *gdata_gcontact_calendar_new (const gchar *uri, const gchar *relation_type, + const gchar *label, gboolean is_primary) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gcontact_calendar_get_uri (GDataGContactCalendar *self) G_GNUC_PURE; +void gdata_gcontact_calendar_set_uri (GDataGContactCalendar *self, const gchar *uri); + +const gchar *gdata_gcontact_calendar_get_relation_type (GDataGContactCalendar *self) G_GNUC_PURE; +void gdata_gcontact_calendar_set_relation_type (GDataGContactCalendar *self, const gchar *relation_type); + +const gchar *gdata_gcontact_calendar_get_label (GDataGContactCalendar *self) G_GNUC_PURE; +void gdata_gcontact_calendar_set_label (GDataGContactCalendar *self, const gchar *label); + +gboolean gdata_gcontact_calendar_is_primary (GDataGContactCalendar *self) G_GNUC_PURE; +void gdata_gcontact_calendar_set_is_primary (GDataGContactCalendar *self, gboolean is_primary); + +G_END_DECLS + +#endif /* !GDATA_GCONTACT_CALENDAR_H */ diff --git a/gdata/gcontact/gdata-gcontact-event.c b/gdata/gcontact/gdata-gcontact-event.c new file mode 100644 index 0000000..6ea8257 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-event.c @@ -0,0 +1,446 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gcontact-event + * @short_description: gContact event element + * @stability: Stable + * @include: gdata/gcontact/gdata-gcontact-event.h + * + * #GDataGContactEvent represents a "event" element from the + * gContact specification. + * + * Since: 0.7.0 + */ + +#include +#include +#include + +#include "gdata-gcontact-event.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" + +static void gdata_gcontact_event_finalize (GObject *object); +static void gdata_gcontact_event_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gcontact_event_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGContactEventPrivate { + GDate date; + gchar *relation_type; + gchar *label; +}; + +enum { + PROP_DATE = 1, + PROP_RELATION_TYPE, + PROP_LABEL +}; + +G_DEFINE_TYPE (GDataGContactEvent, gdata_gcontact_event, GDATA_TYPE_PARSABLE) + +static void +gdata_gcontact_event_class_init (GDataGContactEventClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGContactEventPrivate)); + + gobject_class->get_property = gdata_gcontact_event_get_property; + gobject_class->set_property = gdata_gcontact_event_set_property; + gobject_class->finalize = gdata_gcontact_event_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->post_parse_xml = post_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "event"; + parsable_class->element_namespace = "gContact"; + + /** + * GDataGContactEvent:date: + * + * The date of the event. + * + * For more information, see the + * GContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_DATE, + g_param_spec_boxed ("date", + "Date", "The date of the event.", + G_TYPE_DATE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactEvent:relation-type: + * + * A programmatic value that identifies the type of event. It is mutually exclusive with #GDataGContactEvent:label. + * Examples are %GDATA_GCONTACT_EVENT_ANNIVERSARY or %GDATA_GCONTACT_EVENT_OTHER. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of website.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactEvent:label: + * + * A simple string value used to name this event. It is mutually exclusive with #GDataGContactEvent:relation-type. + * It allows UIs to display a label such as "Wedding anniversary". + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A simple string value used to name this event.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_gcontact_event_init (GDataGContactEvent *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GCONTACT_EVENT, GDataGContactEventPrivate); + + /* Clear the date to an invalid but sane value */ + g_date_clear (&(self->priv->date), 1); +} + +static void +gdata_gcontact_event_finalize (GObject *object) +{ + GDataGContactEventPrivate *priv = GDATA_GCONTACT_EVENT (object)->priv; + + g_free (priv->relation_type); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gcontact_event_parent_class)->finalize (object); +} + +static void +gdata_gcontact_event_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGContactEventPrivate *priv = GDATA_GCONTACT_EVENT (object)->priv; + + switch (property_id) { + case PROP_DATE: + g_value_set_boxed (value, &(priv->date)); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gcontact_event_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGContactEvent *self = GDATA_GCONTACT_EVENT (object); + + switch (property_id) { + case PROP_DATE: + gdata_gcontact_event_set_date (self, g_value_get_boxed (value)); + break; + case PROP_RELATION_TYPE: + gdata_gcontact_event_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gcontact_event_set_label (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *rel, *label; + GDataGContactEventPrivate *priv = GDATA_GCONTACT_EVENT (parsable)->priv; + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + label = xmlGetProp (root_node, (xmlChar*) "label"); + if ((rel == NULL || *rel == '\0') && (label == NULL || *label == '\0')) { + xmlFree (rel); + xmlFree (label); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } else if (rel != NULL && label != NULL) { + /* Can't have both set at once */ + xmlFree (rel); + xmlFree (label); + return gdata_parser_error_mutexed_properties (root_node, "rel", "label", error); + } + + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) label; + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + GDataGContactEventPrivate *priv = GDATA_GCONTACT_EVENT (parsable)->priv; + + if (gdata_parser_is_namespace (node, "http://schemas.google.com/g/2005") == TRUE && xmlStrcmp (node->name, (xmlChar*) "when") == 0) { + xmlChar *start_time; + guint year, month, day; + + /* gd:when; note we don't use GDataGDWhen here because gContact:event only uses a limited subset + * of gd:when (i.e. only the startTime property in date format) */ + if (g_date_valid (&(priv->date)) == TRUE) + return gdata_parser_error_duplicate_element (node, error); + + start_time = xmlGetProp (node, (xmlChar*) "startTime"); + if (start_time == NULL) + return gdata_parser_error_required_property_missing (node, "startTime", error); + + /* Try parsing the date format: YYYY-MM-DD */ + if (strlen ((char*) start_time) == 10 && + sscanf ((char*) start_time, "%4u-%2u-%2u", &year, &month, &day) == 3 && g_date_valid_dmy (day, month, year) == TRUE) { + /* Store the values in the GDate */ + g_date_set_dmy (&(priv->date), day, month, year); + xmlFree (start_time); + } else { + /* Parsing failed */ + gdata_parser_error_not_iso8601_format (node, (gchar*) start_time, error); + xmlFree (start_time); + return FALSE; + } + + return TRUE; + } + + return GDATA_PARSABLE_CLASS (gdata_gcontact_event_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +static gboolean +post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataGContactEventPrivate *priv = GDATA_GCONTACT_EVENT (parsable)->priv; + + /* Check for missing required elements */ + if (g_date_valid (&(priv->date)) == FALSE) + return gdata_parser_error_required_element_missing ("gd:when", "gContact:event", error); + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGContactEventPrivate *priv = GDATA_GCONTACT_EVENT (parsable)->priv; + + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + else if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + else + g_assert_not_reached (); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGContactEventPrivate *priv = GDATA_GCONTACT_EVENT (parsable)->priv; + + g_string_append_printf (xml_string, "", + g_date_get_year (&(priv->date)), + g_date_get_month (&(priv->date)), + g_date_get_day (&(priv->date))); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); + g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); +} + +/** + * gdata_gcontact_event_new: + * @date: the date of the event + * @relation_type: (allow-none): the relationship between the event and its owner, or %NULL + * @label: (allow-none): a human-readable label for the event, or %NULL + * + * Creates a new #GDataGContactEvent. More information is available in the gContact specification. + * + * Exactly one of @relation_type and @label should be provided; the other must be %NULL. + * + * Return value: a new #GDataGContactEvent; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataGContactEvent * +gdata_gcontact_event_new (const GDate *date, const gchar *relation_type, const gchar *label) +{ + g_return_val_if_fail (date != NULL && g_date_valid (date) == TRUE, NULL); + g_return_val_if_fail ((relation_type != NULL && *relation_type != '\0' && label == NULL) || + (relation_type == NULL && label != NULL && *label != '\0'), NULL); + + return g_object_new (GDATA_TYPE_GCONTACT_EVENT, "date", date, "relation-type", relation_type, "label", label, NULL); +} + +/** + * gdata_gcontact_event_get_date: + * @self: a #GDataGContactEvent + * @date: (out caller-allocates): return location for the date of the event + * + * Gets the #GDataGContactEvent:date property. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_event_get_date (GDataGContactEvent *self, GDate *date) +{ + g_return_if_fail (GDATA_IS_GCONTACT_EVENT (self)); + g_return_if_fail (date != NULL); + *date = self->priv->date; +} + +/** + * gdata_gcontact_event_set_date: + * @self: a #GDataGContactEvent + * @date: the new date for the event + * + * Sets the #GDataGContactEvent:date property to @date. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_event_set_date (GDataGContactEvent *self, const GDate *date) +{ + g_return_if_fail (GDATA_IS_GCONTACT_EVENT (self)); + g_return_if_fail (date != NULL && g_date_valid (date) == TRUE); + + self->priv->date = *date; + g_object_notify (G_OBJECT (self), "date"); +} + +/** + * gdata_gcontact_event_get_relation_type: + * @self: a #GDataGContactEvent + * + * Gets the #GDataGContactEvent:relation-type property. + * + * Return value: the event's relation type, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_event_get_relation_type (GDataGContactEvent *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_EVENT (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gcontact_event_set_relation_type: + * @self: a #GDataGContactEvent + * @relation_type: (allow-none): the new relation type for the event, or %NULL + * + * Sets the #GDataGContactEvent:relation-type property to @relation_type + * such as %GDATA_GCONTACT_EVENT_ANNIVERSARY or %GDATA_GCONTACT_EVENT_OTHER. + * + * If @relation_type is %NULL, the relation type will be unset. When the #GDataGContactEvent is used in a query, however, + * exactly one of #GDataGContactEvent:relation-type and #GDataGContactEvent:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_event_set_relation_type (GDataGContactEvent *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GCONTACT_EVENT (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gcontact_event_get_label: + * @self: a #GDataGContactEvent + * + * Gets the #GDataGContactEvent:label property. + * + * Return value: the event's label, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_event_get_label (GDataGContactEvent *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_EVENT (self), NULL); + return self->priv->label; +} + +/** + * gdata_gcontact_event_set_label: + * @self: a #GDataGContactEvent + * @label: (allow-none): the new label for the event, or %NULL + * + * Sets the #GDataGContactEvent:label property to @label. + * + * If @label is %NULL, the label will be unset. When the #GDataGContactEvent is used in a query, however, + * exactly one of #GDataGContactEvent:relation-type and #GDataGContactEvent:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_event_set_label (GDataGContactEvent *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GCONTACT_EVENT (self)); + g_return_if_fail (label == NULL || *label != '\0'); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} diff --git a/gdata/gcontact/gdata-gcontact-event.h b/gdata/gcontact/gdata-gcontact-event.h new file mode 100644 index 0000000..d1c6875 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-event.h @@ -0,0 +1,108 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GCONTACT_EVENT_H +#define GDATA_GCONTACT_EVENT_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GCONTACT_EVENT_ANNIVERSARY: + * + * The relation type URI for an anniversary event. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_EVENT_ANNIVERSARY "anniversary" + +/** + * GDATA_GCONTACT_EVENT_OTHER: + * + * The relation type URI for a miscellaneous event. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_EVENT_OTHER "other" + +#define GDATA_TYPE_GCONTACT_EVENT (gdata_gcontact_event_get_type ()) +#define GDATA_GCONTACT_EVENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GCONTACT_EVENT, GDataGContactEvent)) +#define GDATA_GCONTACT_EVENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GCONTACT_EVENT, GDataGContactEventClass)) +#define GDATA_IS_GCONTACT_EVENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GCONTACT_EVENT)) +#define GDATA_IS_GCONTACT_EVENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GCONTACT_EVENT)) +#define GDATA_GCONTACT_EVENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GCONTACT_EVENT, GDataGContactEventClass)) + +typedef struct _GDataGContactEventPrivate GDataGContactEventPrivate; + +/** + * GDataGContactEvent: + * + * All the fields in the #GDataGContactEvent structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataParsable parent; + GDataGContactEventPrivate *priv; +} GDataGContactEvent; + +/** + * GDataGContactEventClass: + * + * All the fields in the #GDataGContactEventClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGContactEventClass; + +GType gdata_gcontact_event_get_type (void) G_GNUC_CONST; + +GDataGContactEvent *gdata_gcontact_event_new (const GDate *date, const gchar *relation_type, + const gchar *label) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +void gdata_gcontact_event_get_date (GDataGContactEvent *self, GDate *date); +void gdata_gcontact_event_set_date (GDataGContactEvent *self, const GDate *date); + +const gchar *gdata_gcontact_event_get_relation_type (GDataGContactEvent *self) G_GNUC_PURE; +void gdata_gcontact_event_set_relation_type (GDataGContactEvent *self, const gchar *relation_type); + +const gchar *gdata_gcontact_event_get_label (GDataGContactEvent *self) G_GNUC_PURE; +void gdata_gcontact_event_set_label (GDataGContactEvent *self, const gchar *label); + +G_END_DECLS + +#endif /* !GDATA_GCONTACT_EVENT_H */ diff --git a/gdata/gcontact/gdata-gcontact-external-id.c b/gdata/gcontact/gdata-gcontact-external-id.c new file mode 100644 index 0000000..3da3ef0 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-external-id.c @@ -0,0 +1,406 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gcontact-external-id + * @short_description: gContact externalId element + * @stability: Stable + * @include: gdata/gcontact/gdata-gcontact-external-id.h + * + * #GDataGContactExternalID represents an "externalId" element from the + * gContact specification. + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-gcontact-external-id.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gcontact_external_id_comparable_init (GDataComparableIface *iface); +static void gdata_gcontact_external_id_finalize (GObject *object); +static void gdata_gcontact_external_id_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gcontact_external_id_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGContactExternalIDPrivate { + gchar *value; + gchar *relation_type; + gchar *label; +}; + +enum { + PROP_VALUE = 1, + PROP_RELATION_TYPE, + PROP_LABEL +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGContactExternalID, gdata_gcontact_external_id, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gcontact_external_id_comparable_init)) + +static void +gdata_gcontact_external_id_class_init (GDataGContactExternalIDClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGContactExternalIDPrivate)); + + gobject_class->get_property = gdata_gcontact_external_id_get_property; + gobject_class->set_property = gdata_gcontact_external_id_set_property; + gobject_class->finalize = gdata_gcontact_external_id_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "externalId"; + parsable_class->element_namespace = "gContact"; + + /** + * GDataGContactExternalID:value: + * + * The value of the external ID. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_VALUE, + g_param_spec_string ("value", + "Value", "The value of the external ID.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactExternalID:relation-type: + * + * A programmatic value that identifies the type of external ID. It is mutually exclusive with #GDataGContactExternalID:label. + * Examples are %GDATA_GCONTACT_EXTERNAL_ID_NETWORK or %GDATA_GCONTACT_EXTERNAL_ID_ACCOUNT. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of external ID.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactExternalID:label: + * + * A free-form string that identifies the type of external ID. It is mutually exclusive with #GDataGContactExternalID:relation-type. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A free-form string that identifies the type of external ID.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGContactExternalIDPrivate *a = ((GDataGContactExternalID*) self)->priv, *b = ((GDataGContactExternalID*) other)->priv; + + if (g_strcmp0 (a->value, b->value) == 0 && g_strcmp0 (a->relation_type, b->relation_type) == 0 && g_strcmp0 (a->label, b->label) == 0) + return 0; + return 1; +} + +static void +gdata_gcontact_external_id_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gcontact_external_id_init (GDataGContactExternalID *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GCONTACT_EXTERNAL_ID, GDataGContactExternalIDPrivate); +} + +static void +gdata_gcontact_external_id_finalize (GObject *object) +{ + GDataGContactExternalIDPrivate *priv = GDATA_GCONTACT_EXTERNAL_ID (object)->priv; + + g_free (priv->value); + g_free (priv->relation_type); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gcontact_external_id_parent_class)->finalize (object); +} + +static void +gdata_gcontact_external_id_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGContactExternalIDPrivate *priv = GDATA_GCONTACT_EXTERNAL_ID (object)->priv; + + switch (property_id) { + case PROP_VALUE: + g_value_set_string (value, priv->value); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gcontact_external_id_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGContactExternalID *self = GDATA_GCONTACT_EXTERNAL_ID (object); + + switch (property_id) { + case PROP_VALUE: + gdata_gcontact_external_id_set_value (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gcontact_external_id_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gcontact_external_id_set_label (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *value, *rel, *label; + GDataGContactExternalIDPrivate *priv = GDATA_GCONTACT_EXTERNAL_ID (parsable)->priv; + + value = xmlGetProp (root_node, (xmlChar*) "value"); + if (value == NULL) { + xmlFree (value); + return gdata_parser_error_required_property_missing (root_node, "value", error); + } + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + label = xmlGetProp (root_node, (xmlChar*) "label"); + if ((rel == NULL || *rel == '\0') && (label == NULL || *label == '\0')) { + xmlFree (value); + xmlFree (rel); + xmlFree (label); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } else if (rel != NULL && label != NULL) { + /* Can't have both set at once */ + xmlFree (value); + xmlFree (rel); + xmlFree (label); + return gdata_parser_error_mutexed_properties (root_node, "rel", "label", error); + } + + priv->value = (gchar*) value; + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) label; + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGContactExternalIDPrivate *priv = GDATA_GCONTACT_EXTERNAL_ID (parsable)->priv; + + gdata_parser_string_append_escaped (xml_string, " value='", priv->value, "'"); + + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + else if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + else + g_assert_not_reached (); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); +} + +/** + * gdata_gcontact_external_id_new: + * @value: the value of the external ID + * @relation_type: (allow-none): the type of external ID, or %NULL + * @label: (allow-none): a free-form label for the external ID, or %NULL + * + * Creates a new #GDataGContactExternalID. More information is available in the gContact specification. + * + * Exactly one of @relation_type and @label should be provided; the other must be %NULL. + * + * Return value: a new #GDataGContactExternalID; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataGContactExternalID * +gdata_gcontact_external_id_new (const gchar *value, const gchar *relation_type, const gchar *label) +{ + g_return_val_if_fail (value != NULL, NULL); + g_return_val_if_fail ((relation_type != NULL && *relation_type != '\0' && label == NULL) || + (relation_type == NULL && label != NULL && *label != '\0'), NULL); + + return g_object_new (GDATA_TYPE_GCONTACT_EXTERNAL_ID, "value", value, "relation-type", relation_type, "label", label, NULL); +} + +/** + * gdata_gcontact_external_id_get_value: + * @self: a #GDataGContactExternalID + * + * Gets the #GDataGContactExternalID:value property. + * + * Return value: the external ID's value + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_external_id_get_value (GDataGContactExternalID *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_EXTERNAL_ID (self), NULL); + return self->priv->value; +} + +/** + * gdata_gcontact_external_id_set_value: + * @self: a #GDataGContactExternalID + * @value: the new value for the external ID + * + * Sets the #GDataGContactExternalID:value property to @value. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_external_id_set_value (GDataGContactExternalID *self, const gchar *value) +{ + g_return_if_fail (GDATA_IS_GCONTACT_EXTERNAL_ID (self)); + g_return_if_fail (value != NULL); + + g_free (self->priv->value); + self->priv->value = g_strdup (value); + g_object_notify (G_OBJECT (self), "value"); +} + +/** + * gdata_gcontact_external_id_get_relation_type: + * @self: a #GDataGContactExternalID + * + * Gets the #GDataGContactExternalID:relation-type property. + * + * Return value: the type of the relation, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_external_id_get_relation_type (GDataGContactExternalID *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_EXTERNAL_ID (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gcontact_external_id_set_relation_type: + * @self: a #GDataGContactExternalID + * @relation_type: (allow-none): the new type for the external ID, or %NULL + * + * Sets the #GDataGContactExternalID:relation-type property to @relation_type, + * such as %GDATA_GCONTACT_EXTERNAL_ID_NETWORK or %GDATA_GCONTACT_EXTERNAL_ID_ACCOUNT. + * + * If @relation_type is %NULL, the relation type will be unset. When the #GDataGContactExternalID is used in a query, however, + * exactly one of #GDataGContactExternalID:relation-type and #GDataGContactExternalID:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_external_id_set_relation_type (GDataGContactExternalID *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GCONTACT_EXTERNAL_ID (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gcontact_external_id_get_label: + * @self: a #GDataGContactExternalID + * + * Gets the #GDataGContactExternalID:label property. + * + * Return value: a free-form label for the external ID, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_external_id_get_label (GDataGContactExternalID *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_EXTERNAL_ID (self), NULL); + return self->priv->label; +} + +/** + * gdata_gcontact_external_id_set_label: + * @self: a #GDataGContactExternalID + * @label: (allow-none): the new free-form label for the external ID, or %NULL + * + * Sets the #GDataGContactExternalID:label property to @label. + * + * If @label is %NULL, the label will be unset. When the #GDataGContactExternalID is used in a query, however, + * exactly one of #GDataGContactExternalID:relation-type and #GDataGContactExternalID:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_external_id_set_label (GDataGContactExternalID *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GCONTACT_EXTERNAL_ID (self)); + g_return_if_fail (label == NULL || *label != '\0'); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} diff --git a/gdata/gcontact/gdata-gcontact-external-id.h b/gdata/gcontact/gdata-gcontact-external-id.h new file mode 100644 index 0000000..e0a35f4 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-external-id.h @@ -0,0 +1,132 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GCONTACT_EXTERNAL_ID_H +#define GDATA_GCONTACT_EXTERNAL_ID_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GCONTACT_EXTERNAL_ID_ACCOUNT: + * + * The relation type URI for an account number identifier. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_EXTERNAL_ID_ACCOUNT "account" + +/** + * GDATA_GCONTACT_EXTERNAL_ID_CUSTOMER: + * + * The relation type URI for a customer identifier. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_EXTERNAL_ID_CUSTOMER "customer" + +/** + * GDATA_GCONTACT_EXTERNAL_ID_NETWORK: + * + * The relation type URI for a network identifier. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_EXTERNAL_ID_NETWORK "network" + +/** + * GDATA_GCONTACT_EXTERNAL_ID_ORGANIZATION: + * + * The relation type URI for an identifier related to an organization the contact is associated with. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_EXTERNAL_ID_ORGANIZATION "organization" + +#define GDATA_TYPE_GCONTACT_EXTERNAL_ID (gdata_gcontact_external_id_get_type ()) +#define GDATA_GCONTACT_EXTERNAL_ID(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GCONTACT_EXTERNAL_ID, GDataGContactExternalID)) +#define GDATA_GCONTACT_EXTERNAL_ID_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GCONTACT_EXTERNAL_ID, GDataGContactExternalIDClass)) +#define GDATA_IS_GCONTACT_EXTERNAL_ID(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GCONTACT_EXTERNAL_ID)) +#define GDATA_IS_GCONTACT_EXTERNAL_ID_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GCONTACT_EXTERNAL_ID)) +#define GDATA_GCONTACT_EXTERNAL_ID_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GCONTACT_EXTERNAL_ID, GDataGContactExternalIDClass)) + +typedef struct _GDataGContactExternalIDPrivate GDataGContactExternalIDPrivate; + +/** + * GDataGContactExternalID: + * + * All the fields in the #GDataGContactExternalID structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataParsable parent; + GDataGContactExternalIDPrivate *priv; +} GDataGContactExternalID; + +/** + * GDataGContactExternalIDClass: + * + * All the fields in the #GDataGContactExternalIDClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGContactExternalIDClass; + +GType gdata_gcontact_external_id_get_type (void) G_GNUC_CONST; + +GDataGContactExternalID *gdata_gcontact_external_id_new (const gchar *value, const gchar *relation_type, + const gchar *label) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gcontact_external_id_get_value (GDataGContactExternalID *self) G_GNUC_PURE; +void gdata_gcontact_external_id_set_value (GDataGContactExternalID *self, const gchar *value); + +const gchar *gdata_gcontact_external_id_get_relation_type (GDataGContactExternalID *self) G_GNUC_PURE; +void gdata_gcontact_external_id_set_relation_type (GDataGContactExternalID *self, const gchar *relation_type); + +const gchar *gdata_gcontact_external_id_get_label (GDataGContactExternalID *self) G_GNUC_PURE; +void gdata_gcontact_external_id_set_label (GDataGContactExternalID *self, const gchar *label); + +G_END_DECLS + +#endif /* !GDATA_GCONTACT_EXTERNAL_ID_H */ diff --git a/gdata/gcontact/gdata-gcontact-jot.c b/gdata/gcontact/gdata-gcontact-jot.c new file mode 100644 index 0000000..0e58d1b --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-jot.c @@ -0,0 +1,308 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gcontact-jot + * @short_description: gContact jot element + * @stability: Stable + * @include: gdata/gcontact/gdata-gcontact-jot.h + * + * #GDataGContactJot represents a "jot" element from the + * gContact specification. + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-gcontact-jot.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" + +static void gdata_gcontact_jot_finalize (GObject *object); +static void gdata_gcontact_jot_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gcontact_jot_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGContactJotPrivate { + gchar *content; + gchar *relation_type; +}; + +enum { + PROP_CONTENT = 1, + PROP_RELATION_TYPE +}; + +G_DEFINE_TYPE (GDataGContactJot, gdata_gcontact_jot, GDATA_TYPE_PARSABLE) + +static void +gdata_gcontact_jot_class_init (GDataGContactJotClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGContactJotPrivate)); + + gobject_class->get_property = gdata_gcontact_jot_get_property; + gobject_class->set_property = gdata_gcontact_jot_set_property; + gobject_class->finalize = gdata_gcontact_jot_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "jot"; + parsable_class->element_namespace = "gContact"; + + /** + * GDataGContactJot:content: + * + * The content of the jot. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_CONTENT, + g_param_spec_string ("content", + "Content", "The content of the jot.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactJot:relation-type: + * + * A programmatic value that identifies the type of jot. Examples are %GDATA_GCONTACT_JOT_HOME or %GDATA_GCONTACT_JOT_OTHER. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of jot.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_gcontact_jot_init (GDataGContactJot *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GCONTACT_JOT, GDataGContactJotPrivate); +} + +static void +gdata_gcontact_jot_finalize (GObject *object) +{ + GDataGContactJotPrivate *priv = GDATA_GCONTACT_JOT (object)->priv; + + g_free (priv->content); + g_free (priv->relation_type); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gcontact_jot_parent_class)->finalize (object); +} + +static void +gdata_gcontact_jot_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGContactJotPrivate *priv = GDATA_GCONTACT_JOT (object)->priv; + + switch (property_id) { + case PROP_CONTENT: + g_value_set_string (value, priv->content); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gcontact_jot_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGContactJot *self = GDATA_GCONTACT_JOT (object); + + switch (property_id) { + case PROP_CONTENT: + gdata_gcontact_jot_set_content (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gcontact_jot_set_relation_type (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *rel; + GDataGContactJotPrivate *priv = GDATA_GCONTACT_JOT (parsable)->priv; + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + if (rel == NULL || *rel == '\0') { + xmlFree (rel); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + priv->content = (gchar*) xmlNodeListGetString (doc, root_node->children, TRUE); + priv->relation_type = (gchar*) rel; + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + /* Textual content's handled in pre_parse_xml */ + if (node->type != XML_ELEMENT_NODE) + return TRUE; + + return GDATA_PARSABLE_CLASS (gdata_gcontact_jot_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + gdata_parser_string_append_escaped (xml_string, " rel='", GDATA_GCONTACT_JOT (parsable)->priv->relation_type, "'"); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + gdata_parser_string_append_escaped (xml_string, NULL, GDATA_GCONTACT_JOT (parsable)->priv->content, NULL); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); +} + +/** + * gdata_gcontact_jot_new: + * @content: the content of the jot + * @relation_type: the relationship between the jot and its owner + * + * Creates a new #GDataGContactJot. More information is available in the gContact specification. + * + * Return value: a new #GDataGContactJot; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataGContactJot * +gdata_gcontact_jot_new (const gchar *content, const gchar *relation_type) +{ + g_return_val_if_fail (content != NULL, NULL); + g_return_val_if_fail (relation_type != NULL && *relation_type != '\0', NULL); + return g_object_new (GDATA_TYPE_GCONTACT_JOT, "content", content, "relation-type", relation_type, NULL); +} + +/** + * gdata_gcontact_jot_get_content: + * @self: a #GDataGContactJot + * + * Gets the #GDataGContactJot:content property. + * + * Return value: the jot's content + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_jot_get_content (GDataGContactJot *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_JOT (self), NULL); + return self->priv->content; +} + +/** + * gdata_gcontact_jot_set_content: + * @self: a #GDataGContactJot + * @content: the new content + * + * Sets the #GDataGContactJot:content property to @content. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_jot_set_content (GDataGContactJot *self, const gchar *content) +{ + g_return_if_fail (GDATA_IS_GCONTACT_JOT (self)); + g_return_if_fail (content != NULL); + + g_free (self->priv->content); + self->priv->content = g_strdup (content); + g_object_notify (G_OBJECT (self), "content"); +} + +/** + * gdata_gcontact_jot_get_relation_type: + * @self: a #GDataGContactJot + * + * Gets the #GDataGContactJot:relation-type property. + * + * Return value: the jot's relation type + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_jot_get_relation_type (GDataGContactJot *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_JOT (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gcontact_jot_set_relation_type: + * @self: a #GDataGContactJot + * @relation_type: the new relation type for the jot, or %NULL + * + * Sets the #GDataGContactJot:relation-type property to @relation_type + * such as %GDATA_GCONTACT_JOT_HOME or %GDATA_GCONTACT_JOT_OTHER. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_jot_set_relation_type (GDataGContactJot *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GCONTACT_JOT (self)); + g_return_if_fail (relation_type != NULL && *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} diff --git a/gdata/gcontact/gdata-gcontact-jot.h b/gdata/gcontact/gdata-gcontact-jot.h new file mode 100644 index 0000000..b9272b9 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-jot.h @@ -0,0 +1,140 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GCONTACT_JOT_H +#define GDATA_GCONTACT_JOT_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GCONTACT_JOT_HOME: + * + * The relation type URI for a jot about a contact's home. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_JOT_HOME "home" + +/** + * GDATA_GCONTACT_JOT_WORK: + * + * The relation type URI for a jot about a contact's work. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_JOT_WORK "work" + +/** + * GDATA_GCONTACT_JOT_OTHER: + * + * The relation type URI for a jot about an other facet of a contact. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_JOT_OTHER "other" + +/** + * GDATA_GCONTACT_JOT_KEYWORDS: + * + * The relation type URI for a jot with keywords about a contact. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_JOT_KEYWORDS "keywords" + +/** + * GDATA_GCONTACT_JOT_USER: + * + * The relation type URI for a jot about the relationship between a contact and the user. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_JOT_USER "user" + +#define GDATA_TYPE_GCONTACT_JOT (gdata_gcontact_jot_get_type ()) +#define GDATA_GCONTACT_JOT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GCONTACT_JOT, GDataGContactJot)) +#define GDATA_GCONTACT_JOT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GCONTACT_JOT, GDataGContactJotClass)) +#define GDATA_IS_GCONTACT_JOT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GCONTACT_JOT)) +#define GDATA_IS_GCONTACT_JOT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GCONTACT_JOT)) +#define GDATA_GCONTACT_JOT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GCONTACT_JOT, GDataGContactJotClass)) + +typedef struct _GDataGContactJotPrivate GDataGContactJotPrivate; + +/** + * GDataGContactJot: + * + * All the fields in the #GDataGContactJot structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataParsable parent; + GDataGContactJotPrivate *priv; +} GDataGContactJot; + +/** + * GDataGContactJotClass: + * + * All the fields in the #GDataGContactJotClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGContactJotClass; + +GType gdata_gcontact_jot_get_type (void) G_GNUC_CONST; + +GDataGContactJot *gdata_gcontact_jot_new (const gchar *content, const gchar *relation_type) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gcontact_jot_get_content (GDataGContactJot *self) G_GNUC_PURE; +void gdata_gcontact_jot_set_content (GDataGContactJot *self, const gchar *content); + +const gchar *gdata_gcontact_jot_get_relation_type (GDataGContactJot *self) G_GNUC_PURE; +void gdata_gcontact_jot_set_relation_type (GDataGContactJot *self, const gchar *relation_type); + +G_END_DECLS + +#endif /* !GDATA_GCONTACT_JOT_H */ diff --git a/gdata/gcontact/gdata-gcontact-language.c b/gdata/gcontact/gdata-gcontact-language.c new file mode 100644 index 0000000..5fe867f --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-language.c @@ -0,0 +1,327 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gcontact-language + * @short_description: gContact language element + * @stability: Stable + * @include: gdata/gcontact/gdata-gcontact-language.h + * + * #GDataGContactLanguage represents a "language" element from the + * gContact specification. + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-gcontact-language.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gcontact_language_comparable_init (GDataComparableIface *iface); +static void gdata_gcontact_language_finalize (GObject *object); +static void gdata_gcontact_language_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gcontact_language_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGContactLanguagePrivate { + gchar *code; + gchar *label; +}; + +enum { + PROP_CODE = 1, + PROP_LABEL +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGContactLanguage, gdata_gcontact_language, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gcontact_language_comparable_init)) + +static void +gdata_gcontact_language_class_init (GDataGContactLanguageClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGContactLanguagePrivate)); + + gobject_class->get_property = gdata_gcontact_language_get_property; + gobject_class->set_property = gdata_gcontact_language_set_property; + gobject_class->finalize = gdata_gcontact_language_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "language"; + parsable_class->element_namespace = "gContact"; + + /** + * GDataGContactLanguage:code: + * + * A code identifying the language, conforming to the IETF BCP 47 specification. It is mutually exclusive with #GDataGContactLanguage:label. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_CODE, + g_param_spec_string ("code", + "Code", "A code identifying the language, conforming to the IETF BCP 47 specification.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactLanguage:label: + * + * A free-form string that identifies the language. It is mutually exclusive with #GDataGContactLanguage:code. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A free-form string that identifies the language.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGContactLanguagePrivate *a = ((GDataGContactLanguage*) self)->priv, *b = ((GDataGContactLanguage*) other)->priv; + + if (g_strcmp0 (a->code, b->code) == 0 && g_strcmp0 (a->label, b->label) == 0) + return 0; + return 1; +} + +static void +gdata_gcontact_language_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gcontact_language_init (GDataGContactLanguage *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GCONTACT_LANGUAGE, GDataGContactLanguagePrivate); +} + +static void +gdata_gcontact_language_finalize (GObject *object) +{ + GDataGContactLanguagePrivate *priv = GDATA_GCONTACT_LANGUAGE (object)->priv; + + g_free (priv->code); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gcontact_language_parent_class)->finalize (object); +} + +static void +gdata_gcontact_language_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGContactLanguagePrivate *priv = GDATA_GCONTACT_LANGUAGE (object)->priv; + + switch (property_id) { + case PROP_CODE: + g_value_set_string (value, priv->code); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gcontact_language_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGContactLanguage *self = GDATA_GCONTACT_LANGUAGE (object); + + switch (property_id) { + case PROP_CODE: + gdata_gcontact_language_set_code (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gcontact_language_set_label (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *code, *label; + GDataGContactLanguagePrivate *priv = GDATA_GCONTACT_LANGUAGE (parsable)->priv; + + code = xmlGetProp (root_node, (xmlChar*) "code"); + label = xmlGetProp (root_node, (xmlChar*) "label"); + if ((code == NULL || *code == '\0') && (label == NULL || *label == '\0')) { + xmlFree (code); + xmlFree (label); + return gdata_parser_error_required_property_missing (root_node, "code", error); + } else if (code != NULL && label != NULL) { + /* Can't have both set at once */ + xmlFree (code); + xmlFree (label); + return gdata_parser_error_mutexed_properties (root_node, "code", "label", error); + } + + priv->code = (gchar*) code; + priv->label = (gchar*) label; + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGContactLanguagePrivate *priv = GDATA_GCONTACT_LANGUAGE (parsable)->priv; + + if (priv->code != NULL) + gdata_parser_string_append_escaped (xml_string, " code='", priv->code, "'"); + else if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + else + g_assert_not_reached (); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); +} + +/** + * gdata_gcontact_language_new: + * @code: (allow-none): the language code, or %NULL + * @label: (allow-none): a free-form label for the language, or %NULL + * + * Creates a new #GDataGContactLanguage. More information is available in the gContact specification. + * + * Exactly one of @code and @label should be provided; the other must be %NULL. + * + * Return value: a new #GDataGContactLanguage; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataGContactLanguage * +gdata_gcontact_language_new (const gchar *code, const gchar *label) +{ + g_return_val_if_fail ((code != NULL && *code != '\0' && label == NULL) || (code == NULL && label != NULL && *label != '\0'), NULL); + return g_object_new (GDATA_TYPE_GCONTACT_LANGUAGE, "code", code, "label", label, NULL); +} + +/** + * gdata_gcontact_language_get_code: + * @self: a #GDataGContactLanguage + * + * Gets the #GDataGContactLanguage:code property. + * + * Return value: the language's code, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_language_get_code (GDataGContactLanguage *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_LANGUAGE (self), NULL); + return self->priv->code; +} + +/** + * gdata_gcontact_language_set_code: + * @self: a #GDataGContactLanguage + * @code: (allow-none): the new code for the language, or %NULL + * + * Sets the #GDataGContactLanguage:code property to @code. + * + * If @code is %NULL, the code will be unset. When the #GDataGContactLanguage is used in a query, however, + * exactly one of #GDataGContactLanguage:code and #GDataGContactLanguage:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_language_set_code (GDataGContactLanguage *self, const gchar *code) +{ + g_return_if_fail (GDATA_IS_GCONTACT_LANGUAGE (self)); + g_return_if_fail (code == NULL || *code != '\0'); + + g_free (self->priv->code); + self->priv->code = g_strdup (code); + g_object_notify (G_OBJECT (self), "code"); +} + +/** + * gdata_gcontact_language_get_label: + * @self: a #GDataGContactLanguage + * + * Gets the #GDataGContactLanguage:label property. + * + * Return value: a free-form label for the language, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_language_get_label (GDataGContactLanguage *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_LANGUAGE (self), NULL); + return self->priv->label; +} + +/** + * gdata_gcontact_language_set_label: + * @self: a #GDataGContactLanguage + * @label: (allow-none): the new free-form label for the language, or %NULL + * + * Sets the #GDataGContactLanguage:label property to @label. + * + * If @label is %NULL, the label will be unset. When the #GDataGContactLanguage is used in a query, however, + * exactly one of #GDataGContactLanguage:code and #GDataGContactLanguage:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_language_set_label (GDataGContactLanguage *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GCONTACT_LANGUAGE (self)); + g_return_if_fail (label == NULL || *label != '\0'); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} diff --git a/gdata/gcontact/gdata-gcontact-language.h b/gdata/gcontact/gdata-gcontact-language.h new file mode 100644 index 0000000..acd9265 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-language.h @@ -0,0 +1,80 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GCONTACT_LANGUAGE_H +#define GDATA_GCONTACT_LANGUAGE_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_GCONTACT_LANGUAGE (gdata_gcontact_language_get_type ()) +#define GDATA_GCONTACT_LANGUAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GCONTACT_LANGUAGE, GDataGContactLanguage)) +#define GDATA_GCONTACT_LANGUAGE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GCONTACT_LANGUAGE, GDataGContactLanguageClass)) +#define GDATA_IS_GCONTACT_LANGUAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GCONTACT_LANGUAGE)) +#define GDATA_IS_GCONTACT_LANGUAGE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GCONTACT_LANGUAGE)) +#define GDATA_GCONTACT_LANGUAGE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GCONTACT_LANGUAGE, GDataGContactLanguageClass)) + +typedef struct _GDataGContactLanguagePrivate GDataGContactLanguagePrivate; + +/** + * GDataGContactLanguage: + * + * All the fields in the #GDataGContactLanguage structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataParsable parent; + GDataGContactLanguagePrivate *priv; +} GDataGContactLanguage; + +/** + * GDataGContactLanguageClass: + * + * All the fields in the #GDataGContactLanguageClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGContactLanguageClass; + +GType gdata_gcontact_language_get_type (void) G_GNUC_CONST; + +GDataGContactLanguage *gdata_gcontact_language_new (const gchar *code, const gchar *label) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gcontact_language_get_code (GDataGContactLanguage *self) G_GNUC_PURE; +void gdata_gcontact_language_set_code (GDataGContactLanguage *self, const gchar *code); + +const gchar *gdata_gcontact_language_get_label (GDataGContactLanguage *self) G_GNUC_PURE; +void gdata_gcontact_language_set_label (GDataGContactLanguage *self, const gchar *label); + +G_END_DECLS + +#endif /* !GDATA_GCONTACT_LANGUAGE_H */ diff --git a/gdata/gcontact/gdata-gcontact-relation.c b/gdata/gcontact/gdata-gcontact-relation.c new file mode 100644 index 0000000..b562fa4 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-relation.c @@ -0,0 +1,406 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gcontact-relation + * @short_description: gContact relation element + * @stability: Stable + * @include: gdata/gcontact/gdata-gcontact-relation.h + * + * #GDataGContactRelation represents a "relation" element from the + * gContact specification. + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-gcontact-relation.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" + +static void gdata_gcontact_relation_finalize (GObject *object); +static void gdata_gcontact_relation_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gcontact_relation_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGContactRelationPrivate { + gchar *name; + gchar *relation_type; + gchar *label; +}; + +enum { + PROP_NAME = 1, + PROP_RELATION_TYPE, + PROP_LABEL +}; + +G_DEFINE_TYPE (GDataGContactRelation, gdata_gcontact_relation, GDATA_TYPE_PARSABLE) + +static void +gdata_gcontact_relation_class_init (GDataGContactRelationClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGContactRelationPrivate)); + + gobject_class->get_property = gdata_gcontact_relation_get_property; + gobject_class->set_property = gdata_gcontact_relation_set_property; + gobject_class->finalize = gdata_gcontact_relation_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "relation"; + parsable_class->element_namespace = "gContact"; + + /** + * GDataGContactRelation:name: + * + * The name of the relation. It need not be a full name, and there need not be a contact representing the name. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_NAME, + g_param_spec_string ("name", + "Name", "The name of the relation.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactRelation:relation-type: + * + * A programmatic value that identifies the type of relation. It is mutually exclusive with #GDataGContactRelation:label. + * Examples are %GDATA_GCONTACT_RELATION_MANAGER or %GDATA_GCONTACT_RELATION_CHILD. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of relation.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactRelation:label: + * + * A free-form string that identifies the type of relation. It is mutually exclusive with #GDataGContactRelation:relation-type. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A free-form string that identifies the type of relation.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_gcontact_relation_init (GDataGContactRelation *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GCONTACT_RELATION, GDataGContactRelationPrivate); +} + +static void +gdata_gcontact_relation_finalize (GObject *object) +{ + GDataGContactRelationPrivate *priv = GDATA_GCONTACT_RELATION (object)->priv; + + g_free (priv->name); + g_free (priv->relation_type); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gcontact_relation_parent_class)->finalize (object); +} + +static void +gdata_gcontact_relation_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGContactRelationPrivate *priv = GDATA_GCONTACT_RELATION (object)->priv; + + switch (property_id) { + case PROP_NAME: + g_value_set_string (value, priv->name); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gcontact_relation_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGContactRelation *self = GDATA_GCONTACT_RELATION (object); + + switch (property_id) { + case PROP_NAME: + gdata_gcontact_relation_set_name (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gcontact_relation_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gcontact_relation_set_label (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *rel, *label, *name; + GDataGContactRelationPrivate *priv = GDATA_GCONTACT_RELATION (parsable)->priv; + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + label = xmlGetProp (root_node, (xmlChar*) "label"); + if ((rel == NULL || *rel == '\0') && (label == NULL || *label == '\0')) { + xmlFree (rel); + xmlFree (label); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } else if (rel != NULL && label != NULL) { + /* Can't have both set at once */ + xmlFree (rel); + xmlFree (label); + return gdata_parser_error_mutexed_properties (root_node, "rel", "label", error); + } + + /* Get the name */ + name = xmlNodeListGetString (doc, root_node->children, TRUE); + if (name == NULL || *name == '\0') { + xmlFree (rel); + xmlFree (label); + xmlFree (name); + return gdata_parser_error_required_content_missing (root_node, error); + } + + priv->name = (gchar*) name; + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) label; + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + /* Textual content's handled in pre_parse_xml */ + if (node->type != XML_ELEMENT_NODE) + return TRUE; + + return GDATA_PARSABLE_CLASS (gdata_gcontact_relation_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGContactRelationPrivate *priv = GDATA_GCONTACT_RELATION (parsable)->priv; + + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + else if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + else + g_assert_not_reached (); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + gdata_parser_string_append_escaped (xml_string, NULL, GDATA_GCONTACT_RELATION (parsable)->priv->name, NULL); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); +} + +/** + * gdata_gcontact_relation_new: + * @name: the name of the relation + * @relation_type: (allow-none): the type of relation, or %NULL + * @label: (allow-none): a free-form label for the type of relation, or %NULL + * + * Creates a new #GDataGContactRelation. More information is available in the gContact specification. + * + * Exactly one of @relation_type and @label should be provided; the other must be %NULL. + * + * Return value: a new #GDataGContactRelation; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataGContactRelation * +gdata_gcontact_relation_new (const gchar *name, const gchar *relation_type, const gchar *label) +{ + g_return_val_if_fail (name != NULL && *name != '\0', NULL); + g_return_val_if_fail ((relation_type != NULL && *relation_type != '\0' && label == NULL) || + (relation_type == NULL && label != NULL && *label != '\0'), NULL); + + return g_object_new (GDATA_TYPE_GCONTACT_RELATION, "name", name, "relation-type", relation_type, "label", label, NULL); +} + +/** + * gdata_gcontact_relation_get_name: + * @self: a #GDataGContactRelation + * + * Gets the #GDataGContactRelation:name property. + * + * Return value: the relation's name + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_relation_get_name (GDataGContactRelation *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_RELATION (self), NULL); + return self->priv->name; +} + +/** + * gdata_gcontact_relation_set_name: + * @self: a #GDataGContactRelation + * @name: (allow-none): the new name for the relation + * + * Sets the #GDataGContactRelation:name property to @name. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_relation_set_name (GDataGContactRelation *self, const gchar *name) +{ + g_return_if_fail (GDATA_IS_GCONTACT_RELATION (self)); + g_return_if_fail (name != NULL && *name != '\0'); + + g_free (self->priv->name); + self->priv->name = g_strdup (name); + g_object_notify (G_OBJECT (self), "name"); +} + +/** + * gdata_gcontact_relation_get_relation_type: + * @self: a #GDataGContactRelation + * + * Gets the #GDataGContactRelation:relation-type property. + * + * Return value: the type of the relation, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_relation_get_relation_type (GDataGContactRelation *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_RELATION (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gcontact_relation_set_relation_type: + * @self: a #GDataGContactRelation + * @relation_type: (allow-none): the new type for the relation, or %NULL + * + * Sets the #GDataGContactRelation:relation-type property to @relation_type, + * such as %GDATA_GCONTACT_RELATION_MANAGER or %GDATA_GCONTACT_RELATION_CHILD. + * + * If @relation_type is %NULL, the relation type will be unset. When the #GDataGContactRelation is used in a query, however, + * exactly one of #GDataGContactRelation:relation-type and #GDataGContactRelation:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_relation_set_relation_type (GDataGContactRelation *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GCONTACT_RELATION (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gcontact_relation_get_label: + * @self: a #GDataGContactRelation + * + * Gets the #GDataGContactRelation:label property. + * + * Return value: a free-form label for the type of the relation, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_relation_get_label (GDataGContactRelation *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_RELATION (self), NULL); + return self->priv->label; +} + +/** + * gdata_gcontact_relation_set_label: + * @self: a #GDataGContactRelation + * @label: (allow-none): the new free-form type for the relation, or %NULL + * + * Sets the #GDataGContactRelation:label property to @label. + * + * If @label is %NULL, the label will be unset. When the #GDataGContactRelation is used in a query, however, + * exactly one of #GDataGContactRelation:relation-type and #GDataGContactRelation:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_relation_set_label (GDataGContactRelation *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GCONTACT_RELATION (self)); + g_return_if_fail (label == NULL || *label != '\0'); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} diff --git a/gdata/gcontact/gdata-gcontact-relation.h b/gdata/gcontact/gdata-gcontact-relation.h new file mode 100644 index 0000000..74cad06 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-relation.h @@ -0,0 +1,252 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GCONTACT_RELATION_H +#define GDATA_GCONTACT_RELATION_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GCONTACT_RELATION_ASSISTANT: + * + * The relation type URI for a contact's assistant. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_ASSISTANT "assistant" + +/** + * GDATA_GCONTACT_RELATION_BROTHER: + * + * The relation type URI for a contact's brother. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_BROTHER "brother" + +/** + * GDATA_GCONTACT_RELATION_CHILD: + * + * The relation type URI for a contact's child. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_CHILD "child" + +/** + * GDATA_GCONTACT_RELATION_DOMESTIC_PARTNER: + * + * The relation type URI for a contact's domestic partner. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_DOMESTIC_PARTNER "domestic-partner" + +/** + * GDATA_GCONTACT_RELATION_FATHER: + * + * The relation type URI for a contact's father. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_FATHER "father" + +/** + * GDATA_GCONTACT_RELATION_FRIEND: + * + * The relation type URI for a contact's friend. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_FRIEND "friend" + +/** + * GDATA_GCONTACT_RELATION_MANAGER: + * + * The relation type URI for a contact's manager. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_MANAGER "manager" + +/** + * GDATA_GCONTACT_RELATION_MOTHER: + * + * The relation type URI for a contact's mother. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_MOTHER "mother" + +/** + * GDATA_GCONTACT_RELATION_PARENT: + * + * The relation type URI for a contact's parent. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_PARENT "parent" + +/** + * GDATA_GCONTACT_RELATION_PARTNER: + * + * The relation type URI for a contact's business partner. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_PARTNER "partner" + +/** + * GDATA_GCONTACT_RELATION_REFERRER: + * + * The relation type URI for a contact's referrer. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_REFERRER "referred-by" + +/** + * GDATA_GCONTACT_RELATION_RELATIVE: + * + * The relation type URI for a contact's (general) family relative. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_RELATIVE "relative" + +/** + * GDATA_GCONTACT_RELATION_SISTER: + * + * The relation type URI for a contact's sister. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_SISTER "sister" + +/** + * GDATA_GCONTACT_RELATION_SPOUSE: + * + * The relation type URI for a contact's spouse. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_RELATION_SPOUSE "spouse" + +#define GDATA_TYPE_GCONTACT_RELATION (gdata_gcontact_relation_get_type ()) +#define GDATA_GCONTACT_RELATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GCONTACT_RELATION, GDataGContactRelation)) +#define GDATA_GCONTACT_RELATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GCONTACT_RELATION, GDataGContactRelationClass)) +#define GDATA_IS_GCONTACT_RELATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GCONTACT_RELATION)) +#define GDATA_IS_GCONTACT_RELATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GCONTACT_RELATION)) +#define GDATA_GCONTACT_RELATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GCONTACT_RELATION, GDataGContactRelationClass)) + +typedef struct _GDataGContactRelationPrivate GDataGContactRelationPrivate; + +/** + * GDataGContactRelation: + * + * All the fields in the #GDataGContactRelation structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataParsable parent; + GDataGContactRelationPrivate *priv; +} GDataGContactRelation; + +/** + * GDataGContactRelationClass: + * + * All the fields in the #GDataGContactRelationClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGContactRelationClass; + +GType gdata_gcontact_relation_get_type (void) G_GNUC_CONST; + +GDataGContactRelation *gdata_gcontact_relation_new (const gchar *name, const gchar *relation_type, + const gchar *label) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gcontact_relation_get_name (GDataGContactRelation *self) G_GNUC_PURE; +void gdata_gcontact_relation_set_name (GDataGContactRelation *self, const gchar *name); + +const gchar *gdata_gcontact_relation_get_relation_type (GDataGContactRelation *self) G_GNUC_PURE; +void gdata_gcontact_relation_set_relation_type (GDataGContactRelation *self, const gchar *relation_type); + +const gchar *gdata_gcontact_relation_get_label (GDataGContactRelation *self) G_GNUC_PURE; +void gdata_gcontact_relation_set_label (GDataGContactRelation *self, const gchar *label); + +G_END_DECLS + +#endif /* !GDATA_GCONTACT_RELATION_H */ diff --git a/gdata/gcontact/gdata-gcontact-website.c b/gdata/gcontact/gdata-gcontact-website.c new file mode 100644 index 0000000..e0ec4c6 --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-website.c @@ -0,0 +1,481 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gcontact-website + * @short_description: gContact website element + * @stability: Stable + * @include: gdata/gcontact/gdata-gcontact-website.h + * + * #GDataGContactWebsite represents a "website" element from the + * gContact specification. + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-gcontact-website.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gcontact_website_comparable_init (GDataComparableIface *iface); +static void gdata_gcontact_website_finalize (GObject *object); +static void gdata_gcontact_website_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gcontact_website_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGContactWebsitePrivate { + gchar *uri; + gchar *relation_type; + gchar *label; + gboolean is_primary; +}; + +enum { + PROP_URI = 1, + PROP_RELATION_TYPE, + PROP_LABEL, + PROP_IS_PRIMARY +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGContactWebsite, gdata_gcontact_website, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gcontact_website_comparable_init)) + +static void +gdata_gcontact_website_class_init (GDataGContactWebsiteClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGContactWebsitePrivate)); + + gobject_class->get_property = gdata_gcontact_website_get_property; + gobject_class->set_property = gdata_gcontact_website_set_property; + gobject_class->finalize = gdata_gcontact_website_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "website"; + parsable_class->element_namespace = "gContact"; + + /** + * GDataGContactWebsite:uri: + * + * The URI of the website. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", + "URI", "The URI of the website.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactWebsite:relation-type: + * + * A programmatic value that identifies the type of website. Examples are %GDATA_GCONTACT_WEBSITE_HOME_PAGE or %GDATA_GCONTACT_WEBSITE_FTP. + * It is mutually exclusive with #GDataGContactWebsite:label. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of website.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactWebsite:label: + * + * A simple string value used to name this website. It allows UIs to display a label such as "Work", "Travel blog", "Personal blog", etc. + * It is mutually exclusive with #GDataGContactWebsite:relation-type. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A simple string value used to name this website.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGContactWebsite:is-primary: + * + * Indicates which website out of a group is primary. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_PRIMARY, + g_param_spec_boolean ("is-primary", + "Primary?", "Indicates which website out of a group is primary.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGContactWebsitePrivate *a = ((GDataGContactWebsite*) self)->priv, *b = ((GDataGContactWebsite*) other)->priv; + + if (g_strcmp0 (a->uri, b->uri) == 0 && g_strcmp0 (a->relation_type, b->relation_type) == 0 && g_strcmp0 (a->label, b->label) == 0) + return 0; + return 1; +} + +static void +gdata_gcontact_website_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gcontact_website_init (GDataGContactWebsite *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GCONTACT_WEBSITE, GDataGContactWebsitePrivate); +} + +static void +gdata_gcontact_website_finalize (GObject *object) +{ + GDataGContactWebsitePrivate *priv = GDATA_GCONTACT_WEBSITE (object)->priv; + + g_free (priv->uri); + g_free (priv->relation_type); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gcontact_website_parent_class)->finalize (object); +} + +static void +gdata_gcontact_website_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGContactWebsitePrivate *priv = GDATA_GCONTACT_WEBSITE (object)->priv; + + switch (property_id) { + case PROP_URI: + g_value_set_string (value, priv->uri); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + case PROP_IS_PRIMARY: + g_value_set_boolean (value, priv->is_primary); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gcontact_website_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGContactWebsite *self = GDATA_GCONTACT_WEBSITE (object); + + switch (property_id) { + case PROP_URI: + gdata_gcontact_website_set_uri (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gcontact_website_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gcontact_website_set_label (self, g_value_get_string (value)); + break; + case PROP_IS_PRIMARY: + gdata_gcontact_website_set_is_primary (self, g_value_get_boolean (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *uri, *rel, *label; + gboolean primary_bool; + GDataGContactWebsitePrivate *priv = GDATA_GCONTACT_WEBSITE (parsable)->priv; + + /* Is it the primary website? */ + if (gdata_parser_boolean_from_property (root_node, "primary", &primary_bool, 0, error) == FALSE) + return FALSE; + + uri = xmlGetProp (root_node, (xmlChar*) "href"); + if (uri == NULL || *uri == '\0') { + xmlFree (uri); + return gdata_parser_error_required_property_missing (root_node, "href", error); + } + + /* NOTE: We allow both rel and label to be present when we should probably be asserting that they're mutually exclusive. See the comment in + * pre_get_xml() for details. */ + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + label = xmlGetProp (root_node, (xmlChar*) "label"); + if ((rel == NULL || *rel == '\0') && (label == NULL || *label == '\0')) { + xmlFree (rel); + xmlFree (label); + xmlFree (uri); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) label; + priv->uri = (gchar*) uri; + priv->is_primary = primary_bool; + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGContactWebsitePrivate *priv = GDATA_GCONTACT_WEBSITE (parsable)->priv; + + gdata_parser_string_append_escaped (xml_string, " href='", priv->uri, "'"); + + /* NOTE: We previously allowed both rel and label to be set, making rel mandatory. Since bgo#659016, we treat rel and label as mutually + * exclusive attributes when parsing. We should treat them as mutually exclusive here as well, and g_assert_not_reached() if neither or + * both are set (as in gdata-gcontact-event.c:pre_get_xml()), but in order to maintain backwards compatibility, we don't. + * Sigh, Google. */ + if (priv->relation_type != NULL) { + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + } + + if (priv->label != NULL) { + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + } + + if (priv->is_primary == TRUE) + g_string_append (xml_string, " primary='true'"); + else + g_string_append (xml_string, " primary='false'"); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); +} + +/** + * gdata_gcontact_website_new: + * @uri: the website URI + * @relation_type: the relationship between the website and its owner, or %NULL + * @label: (allow-none): a human-readable label for the website, or %NULL + * @is_primary: %TRUE if this website is its owner's primary website, %FALSE otherwise + * + * Creates a new #GDataGContactWebsite. More information is available in the gContact specification. + * + * Exactly one of @relation_type and @label should be provided; the other must be %NULL. + * + * Return value: a new #GDataGContactWebsite; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataGContactWebsite * +gdata_gcontact_website_new (const gchar *uri, const gchar *relation_type, const gchar *label, gboolean is_primary) +{ + g_return_val_if_fail (uri != NULL && *uri != '\0', NULL); + g_return_val_if_fail ((relation_type != NULL && *relation_type != '\0'/* && label == NULL*/) || + (relation_type == NULL && label != NULL && *label != '\0'), NULL); + /* NOTE: As in pre_get_xml(), we should treat rel and label as mutually exclusive here, but we can't for backwards compatibility reasons. */ + + return g_object_new (GDATA_TYPE_GCONTACT_WEBSITE, "uri", uri, "relation-type", relation_type, "label", label, "is-primary", is_primary, NULL); +} + +/** + * gdata_gcontact_website_get_uri: + * @self: a #GDataGContactWebsite + * + * Gets the #GDataGContactWebsite:uri property. + * + * Return value: the URI of the website + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_website_get_uri (GDataGContactWebsite *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_WEBSITE (self), NULL); + return self->priv->uri; +} + +/** + * gdata_gcontact_website_set_uri: + * @self: a #GDataGContactWebsite + * @uri: the new website URI + * + * Sets the #GDataGContactWebsite:uri property to @uri. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_website_set_uri (GDataGContactWebsite *self, const gchar *uri) +{ + g_return_if_fail (GDATA_IS_GCONTACT_WEBSITE (self)); + g_return_if_fail (uri != NULL && *uri != '\0'); + + g_free (self->priv->uri); + self->priv->uri = g_strdup (uri); + g_object_notify (G_OBJECT (self), "uri"); +} + +/** + * gdata_gcontact_website_get_relation_type: + * @self: a #GDataGContactWebsite + * + * Gets the #GDataGContactWebsite:relation-type property. + * + * Return value: the website's relation type + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_website_get_relation_type (GDataGContactWebsite *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_WEBSITE (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gcontact_website_set_relation_type: + * @self: a #GDataGContactWebsite + * @relation_type: the new relation type for the website + * + * Sets the #GDataGContactWebsite:relation-type property to @relation_type + * such as %GDATA_GCONTACT_WEBSITE_HOME_PAGE or %GDATA_GCONTACT_WEBSITE_FTP. + * + * If @relation_type is %NULL, the relation type will be unset. When the #GDataGContactWebsite is used in a query, however, + * exactly one of #GDataGContactWebsite:relation-type and #GDataGContactWebsite:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_website_set_relation_type (GDataGContactWebsite *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GCONTACT_WEBSITE (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gcontact_website_get_label: + * @self: a #GDataGContactWebsite + * + * Gets the #GDataGContactWebsite:label property. + * + * Return value: the website's label, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_gcontact_website_get_label (GDataGContactWebsite *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_WEBSITE (self), NULL); + return self->priv->label; +} + +/** + * gdata_gcontact_website_set_label: + * @self: a #GDataGContactWebsite + * @label: (allow-none): the new label for the website, or %NULL + * + * Sets the #GDataGContactWebsite:label property to @label. + * + * If @label is %NULL, the label will be unset. When the #GDataGContactWebsite is used in a query, however, + * exactly one of #GDataGContactWebsite:relation-type and #GDataGContactWebsite:label must be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_website_set_label (GDataGContactWebsite *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GCONTACT_WEBSITE (self)); + /* NOTE: We should be validating using the code below, but we can't. See pre_get_xml() for details. */ + g_return_if_fail (label == NULL || *label != '\0'); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} + +/** + * gdata_gcontact_website_is_primary: + * @self: a #GDataGContactWebsite + * + * Gets the #GDataGContactWebsite:is-primary property. + * + * Return value: %TRUE if this is the primary website, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_gcontact_website_is_primary (GDataGContactWebsite *self) +{ + g_return_val_if_fail (GDATA_IS_GCONTACT_WEBSITE (self), FALSE); + return self->priv->is_primary; +} + +/** + * gdata_gcontact_website_set_is_primary: + * @self: a #GDataGContactWebsite + * @is_primary: %TRUE if this is the primary website, %FALSE otherwise + * + * Sets the #GDataGContactWebsite:is-primary property to @is_primary. + * + * Since: 0.7.0 + */ +void +gdata_gcontact_website_set_is_primary (GDataGContactWebsite *self, gboolean is_primary) +{ + g_return_if_fail (GDATA_IS_GCONTACT_WEBSITE (self)); + + self->priv->is_primary = is_primary; + g_object_notify (G_OBJECT (self), "is-primary"); +} diff --git a/gdata/gcontact/gdata-gcontact-website.h b/gdata/gcontact/gdata-gcontact-website.h new file mode 100644 index 0000000..c96d30b --- /dev/null +++ b/gdata/gcontact/gdata-gcontact-website.h @@ -0,0 +1,171 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GCONTACT_WEBSITE_H +#define GDATA_GCONTACT_WEBSITE_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GCONTACT_WEBSITE_HOME_PAGE: + * + * The relation type URI for a contact's home page. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_WEBSITE_HOME_PAGE "home-page" + +/** + * GDATA_GCONTACT_WEBSITE_BLOG: + * + * The relation type URI for a contact's blog. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_WEBSITE_BLOG "blog" + +/** + * GDATA_GCONTACT_WEBSITE_PROFILE: + * + * The relation type URI for a contact's online profile. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_WEBSITE_PROFILE "profile" + +/** + * GDATA_GCONTACT_WEBSITE_HOME: + * + * The relation type URI for a contact's home website. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_WEBSITE_HOME "home" + +/** + * GDATA_GCONTACT_WEBSITE_WORK: + * + * The relation type URI for a contact's work website. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_WEBSITE_WORK "work" + +/** + * GDATA_GCONTACT_WEBSITE_OTHER: + * + * The relation type URI for a miscellaneous website of the contact. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_WEBSITE_OTHER "other" + +/** + * GDATA_GCONTACT_WEBSITE_FTP: + * + * The relation type URI for a contact's FTP site. + * + * For more information, see the + * gContact specification. + * + * Since: 0.7.0 + */ +#define GDATA_GCONTACT_WEBSITE_FTP "ftp" + +#define GDATA_TYPE_GCONTACT_WEBSITE (gdata_gcontact_website_get_type ()) +#define GDATA_GCONTACT_WEBSITE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GCONTACT_WEBSITE, GDataGContactWebsite)) +#define GDATA_GCONTACT_WEBSITE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GCONTACT_WEBSITE, GDataGContactWebsiteClass)) +#define GDATA_IS_GCONTACT_WEBSITE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GCONTACT_WEBSITE)) +#define GDATA_IS_GCONTACT_WEBSITE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GCONTACT_WEBSITE)) +#define GDATA_GCONTACT_WEBSITE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GCONTACT_WEBSITE, GDataGContactWebsiteClass)) + +typedef struct _GDataGContactWebsitePrivate GDataGContactWebsitePrivate; + +/** + * GDataGContactWebsite: + * + * All the fields in the #GDataGContactWebsite structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataParsable parent; + GDataGContactWebsitePrivate *priv; +} GDataGContactWebsite; + +/** + * GDataGContactWebsiteClass: + * + * All the fields in the #GDataGContactWebsiteClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGContactWebsiteClass; + +GType gdata_gcontact_website_get_type (void) G_GNUC_CONST; + +GDataGContactWebsite *gdata_gcontact_website_new (const gchar *uri, const gchar *relation_type, + const gchar *label, gboolean is_primary) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gcontact_website_get_uri (GDataGContactWebsite *self) G_GNUC_PURE; +void gdata_gcontact_website_set_uri (GDataGContactWebsite *self, const gchar *uri); + +const gchar *gdata_gcontact_website_get_relation_type (GDataGContactWebsite *self) G_GNUC_PURE; +void gdata_gcontact_website_set_relation_type (GDataGContactWebsite *self, const gchar *relation_type); + +const gchar *gdata_gcontact_website_get_label (GDataGContactWebsite *self) G_GNUC_PURE; +void gdata_gcontact_website_set_label (GDataGContactWebsite *self, const gchar *label); + +gboolean gdata_gcontact_website_is_primary (GDataGContactWebsite *self) G_GNUC_PURE; +void gdata_gcontact_website_set_is_primary (GDataGContactWebsite *self, gboolean is_primary); + +G_END_DECLS + +#endif /* !GDATA_GCONTACT_WEBSITE_H */ diff --git a/gdata/gd/gdata-gd-email-address.c b/gdata/gd/gdata-gd-email-address.c new file mode 100644 index 0000000..63ae95b --- /dev/null +++ b/gdata/gd/gdata-gd-email-address.c @@ -0,0 +1,520 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-email-address + * @short_description: GData e-mail address element + * @stability: Stable + * @include: gdata/gd/gdata-gd-email-address.h + * + * #GDataGDEmailAddress represents an "email" element from the + * GData specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-gd-email-address.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gd_email_address_comparable_init (GDataComparableIface *iface); +static void gdata_gd_email_address_finalize (GObject *object); +static void gdata_gd_email_address_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_email_address_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDEmailAddressPrivate { + gchar *address; + gchar *relation_type; + gchar *label; + gboolean is_primary; + gchar *display_name; +}; + +enum { + PROP_ADDRESS = 1, + PROP_RELATION_TYPE, + PROP_LABEL, + PROP_IS_PRIMARY, + PROP_DISPLAY_NAME +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDEmailAddress, gdata_gd_email_address, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_email_address_comparable_init)) + +static void +gdata_gd_email_address_class_init (GDataGDEmailAddressClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDEmailAddressPrivate)); + + gobject_class->get_property = gdata_gd_email_address_get_property; + gobject_class->set_property = gdata_gd_email_address_set_property; + gobject_class->finalize = gdata_gd_email_address_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "email"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDEmailAddress:address: + * + * The e-mail address itself. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_ADDRESS, + g_param_spec_string ("address", + "Address", "The e-mail address itself.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDEmailAddress:relation-type: + * + * A programmatic value that identifies the type of e-mail address. For example: %GDATA_GD_EMAIL_ADDRESS_HOME or %GDATA_GD_EMAIL_ADDRESS_WORK. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of e-mail address.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDEmailAddress:label: + * + * A simple string value used to name this e-mail address. It allows UIs to display a label such as "Work", "Personal", "Preferred", etc. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A simple string value used to name this e-mail address.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDEmailAddress:is-primary: + * + * Indicates which e-mail address out of a group is primary. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_PRIMARY, + g_param_spec_boolean ("is-primary", + "Primary?", "Indicates which e-mail address out of a group is primary.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDEmailAddress:display-name: + * + * A display name of the entity (e.g. a person) the e-mail address belongs to. + * + * For more information, see the + * GData specification. + * + * Since: 0.6.0 + */ + g_object_class_install_property (gobject_class, PROP_DISPLAY_NAME, + g_param_spec_string ("display-name", + "Display name", "A display name of the entity the e-mail address belongs to.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + return g_strcmp0 (((GDataGDEmailAddress*) self)->priv->address, ((GDataGDEmailAddress*) other)->priv->address); +} + +static void +gdata_gd_email_address_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_email_address_init (GDataGDEmailAddress *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_EMAIL_ADDRESS, GDataGDEmailAddressPrivate); +} + +static void +gdata_gd_email_address_finalize (GObject *object) +{ + GDataGDEmailAddressPrivate *priv = GDATA_GD_EMAIL_ADDRESS (object)->priv; + + g_free (priv->address); + g_free (priv->relation_type); + g_free (priv->label); + g_free (priv->display_name); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_email_address_parent_class)->finalize (object); +} + +static void +gdata_gd_email_address_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDEmailAddressPrivate *priv = GDATA_GD_EMAIL_ADDRESS (object)->priv; + + switch (property_id) { + case PROP_ADDRESS: + g_value_set_string (value, priv->address); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + case PROP_IS_PRIMARY: + g_value_set_boolean (value, priv->is_primary); + break; + case PROP_DISPLAY_NAME: + g_value_set_string (value, priv->display_name); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_email_address_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDEmailAddress *self = GDATA_GD_EMAIL_ADDRESS (object); + + switch (property_id) { + case PROP_ADDRESS: + gdata_gd_email_address_set_address (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gd_email_address_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gd_email_address_set_label (self, g_value_get_string (value)); + break; + case PROP_IS_PRIMARY: + gdata_gd_email_address_set_is_primary (self, g_value_get_boolean (value)); + break; + case PROP_DISPLAY_NAME: + gdata_gd_email_address_set_display_name (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *address, *rel; + gboolean primary_bool; + GDataGDEmailAddressPrivate *priv = GDATA_GD_EMAIL_ADDRESS (parsable)->priv; + + /* Is it the primary e-mail address? */ + if (gdata_parser_boolean_from_property (root_node, "primary", &primary_bool, 0, error) == FALSE) + return FALSE; + + address = xmlGetProp (root_node, (xmlChar*) "address"); + if (address == NULL || *address == '\0') { + xmlFree (address); + return gdata_parser_error_required_property_missing (root_node, "address", error); + } + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + if (rel != NULL && *rel == '\0') { + xmlFree (address); + xmlFree (rel); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + priv->address = (gchar*) address; + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) xmlGetProp (root_node, (xmlChar*) "label"); + priv->is_primary = primary_bool; + priv->display_name = (gchar*) xmlGetProp (root_node, (xmlChar*) "displayName"); + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDEmailAddressPrivate *priv = GDATA_GD_EMAIL_ADDRESS (parsable)->priv; + + gdata_parser_string_append_escaped (xml_string, " address='", priv->address, "'"); + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + if (priv->display_name != NULL) + gdata_parser_string_append_escaped (xml_string, " displayName='", priv->display_name, "'"); + + if (priv->is_primary == TRUE) + g_string_append (xml_string, " primary='true'"); + else + g_string_append (xml_string, " primary='false'"); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_email_address_new: + * @address: the e-mail address + * @relation_type: (allow-none): the relationship between the e-mail address and its owner, or %NULL + * @label: (allow-none): a human-readable label for the e-mail address, or %NULL + * @is_primary: %TRUE if this e-mail address is its owner's primary address, %FALSE otherwise + * + * Creates a new #GDataGDEmailAddress. More information is available in the GData specification. + * + * Return value: a new #GDataGDEmailAddress, or %NULL; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataGDEmailAddress * +gdata_gd_email_address_new (const gchar *address, const gchar *relation_type, const gchar *label, gboolean is_primary) +{ + g_return_val_if_fail (address != NULL && *address != '\0', NULL); + g_return_val_if_fail (relation_type == NULL || *relation_type != '\0', NULL); + return g_object_new (GDATA_TYPE_GD_EMAIL_ADDRESS, "address", address, "relation-type", relation_type, + "label", label, "is-primary", is_primary, NULL); +} + +/** + * gdata_gd_email_address_get_address: + * @self: a #GDataGDEmailAddress + * + * Gets the #GDataGDEmailAddress:address property. + * + * Return value: the e-mail address itself, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_email_address_get_address (GDataGDEmailAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self), NULL); + return self->priv->address; +} + +/** + * gdata_gd_email_address_set_address: + * @self: a #GDataGDEmailAddress + * @address: the new e-mail address + * + * Sets the #GDataGDEmailAddress:address property to @address. + * + * Since: 0.4.0 + */ +void +gdata_gd_email_address_set_address (GDataGDEmailAddress *self, const gchar *address) +{ + g_return_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self)); + g_return_if_fail (address != NULL && *address != '\0'); + + g_free (self->priv->address); + self->priv->address = g_strdup (address); + g_object_notify (G_OBJECT (self), "address"); +} + +/** + * gdata_gd_email_address_get_relation_type: + * @self: a #GDataGDEmailAddress + * + * Gets the #GDataGDEmailAddress:relation-type property. + * + * Return value: the e-mail address' relation type, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_email_address_get_relation_type (GDataGDEmailAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gd_email_address_set_relation_type: + * @self: a #GDataGDEmailAddress + * @relation_type: (allow-none): the new relation type for the email_address, or %NULL + * + * Sets the #GDataGDEmailAddress:relation-type property to @relation_type. + * + * Set @relation_type to %NULL to unset the property in the e-mail address. + * + * Since: 0.4.0 + */ +void +gdata_gd_email_address_set_relation_type (GDataGDEmailAddress *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gd_email_address_get_label: + * @self: a #GDataGDEmailAddress + * + * Gets the #GDataGDEmailAddress:label property. + * + * Return value: the e-mail address' label, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_email_address_get_label (GDataGDEmailAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self), NULL); + return self->priv->label; +} + +/** + * gdata_gd_email_address_set_label: + * @self: a #GDataGDEmailAddress + * @label: (allow-none): the new label for the e-mail address, or %NULL + * + * Sets the #GDataGDEmailAddress:label property to @label. + * + * Set @label to %NULL to unset the property in the e-mail address. + * + * Since: 0.4.0 + */ +void +gdata_gd_email_address_set_label (GDataGDEmailAddress *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self)); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} + +/** + * gdata_gd_email_address_is_primary: + * @self: a #GDataGDEmailAddress + * + * Gets the #GDataGDEmailAddress:is-primary property. + * + * Return value: %TRUE if this is the primary e-mail address, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_gd_email_address_is_primary (GDataGDEmailAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self), FALSE); + return self->priv->is_primary; +} + +/** + * gdata_gd_email_address_set_is_primary: + * @self: a #GDataGDEmailAddress + * @is_primary: %TRUE if this is the primary e-mail address, %FALSE otherwise + * + * Sets the #GDataGDEmailAddress:is-primary property to @is_primary. + * + * Since: 0.4.0 + */ +void +gdata_gd_email_address_set_is_primary (GDataGDEmailAddress *self, gboolean is_primary) +{ + g_return_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self)); + + self->priv->is_primary = is_primary; + g_object_notify (G_OBJECT (self), "is-primary"); +} + +/** + * gdata_gd_email_address_get_display_name: + * @self: a #GDataGDEmailAddress + * + * Gets the #GDataGDEmailAddress:display-name property. + * + * Return value: a display name for the e-mail address, or %NULL + * + * Since: 0.6.0 + */ +const gchar * +gdata_gd_email_address_get_display_name (GDataGDEmailAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self), NULL); + return self->priv->display_name; +} + +/** + * gdata_gd_email_address_set_display_name: + * @self: a #GDataGDEmailAddress + * @display_name: (allow-none): the new display name, or %NULL + * + * Sets the #GDataGDEmailAddress:display-name property to @display_name. + * + * Set @display_name to %NULL to unset the property in the e-mail address. + * + * Since: 0.6.0 + */ +void +gdata_gd_email_address_set_display_name (GDataGDEmailAddress *self, const gchar *display_name) +{ + g_return_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (self)); + + g_free (self->priv->display_name); + self->priv->display_name = g_strdup (display_name); + g_object_notify (G_OBJECT (self), "display-name"); +} diff --git a/gdata/gd/gdata-gd-email-address.h b/gdata/gd/gdata-gd-email-address.h new file mode 100644 index 0000000..588f9a9 --- /dev/null +++ b/gdata/gd/gdata-gd-email-address.h @@ -0,0 +1,117 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_EMAIL_ADDRESS_H +#define GDATA_GD_EMAIL_ADDRESS_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GD_EMAIL_ADDRESS_HOME: + * + * The relation type URI for a home e-mail address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EMAIL_ADDRESS_HOME "http://schemas.google.com/g/2005#home" + +/** + * GDATA_GD_EMAIL_ADDRESS_OTHER: + * + * The relation type URI for a miscellaneous e-mail address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EMAIL_ADDRESS_OTHER "http://schemas.google.com/g/2005#other" + +/** + * GDATA_GD_EMAIL_ADDRESS_WORK: + * + * The relation type URI for a work e-mail address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EMAIL_ADDRESS_WORK "http://schemas.google.com/g/2005#work" + +#define GDATA_TYPE_GD_EMAIL_ADDRESS (gdata_gd_email_address_get_type ()) +#define GDATA_GD_EMAIL_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_EMAIL_ADDRESS, GDataGDEmailAddress)) +#define GDATA_GD_EMAIL_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_EMAIL_ADDRESS, GDataGDEmailAddressClass)) +#define GDATA_IS_GD_EMAIL_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_EMAIL_ADDRESS)) +#define GDATA_IS_GD_EMAIL_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_EMAIL_ADDRESS)) +#define GDATA_GD_EMAIL_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_EMAIL_ADDRESS, GDataGDEmailAddressClass)) + +typedef struct _GDataGDEmailAddressPrivate GDataGDEmailAddressPrivate; + +/** + * GDataGDEmailAddress: + * + * All the fields in the #GDataGDEmailAddress structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataParsable parent; + GDataGDEmailAddressPrivate *priv; +} GDataGDEmailAddress; + +/** + * GDataGDEmailAddressClass: + * + * All the fields in the #GDataGDEmailAddressClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDEmailAddressClass; + +GType gdata_gd_email_address_get_type (void) G_GNUC_CONST; + +GDataGDEmailAddress *gdata_gd_email_address_new (const gchar *address, const gchar *relation_type, + const gchar *label, gboolean is_primary) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gd_email_address_get_address (GDataGDEmailAddress *self) G_GNUC_PURE; +void gdata_gd_email_address_set_address (GDataGDEmailAddress *self, const gchar *address); + +const gchar *gdata_gd_email_address_get_relation_type (GDataGDEmailAddress *self) G_GNUC_PURE; +void gdata_gd_email_address_set_relation_type (GDataGDEmailAddress *self, const gchar *relation_type); + +const gchar *gdata_gd_email_address_get_label (GDataGDEmailAddress *self) G_GNUC_PURE; +void gdata_gd_email_address_set_label (GDataGDEmailAddress *self, const gchar *label); + +const gchar *gdata_gd_email_address_get_display_name (GDataGDEmailAddress *self) G_GNUC_PURE; +void gdata_gd_email_address_set_display_name (GDataGDEmailAddress *self, const gchar *display_name); + +gboolean gdata_gd_email_address_is_primary (GDataGDEmailAddress *self) G_GNUC_PURE; +void gdata_gd_email_address_set_is_primary (GDataGDEmailAddress *self, gboolean is_primary); + +G_END_DECLS + +#endif /* !GDATA_GD_EMAIL_ADDRESS_H */ diff --git a/gdata/gd/gdata-gd-feed-link.c b/gdata/gd/gdata-gd-feed-link.c new file mode 100644 index 0000000..e29ee51 --- /dev/null +++ b/gdata/gd/gdata-gd-feed-link.c @@ -0,0 +1,447 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Richard Schwarting 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/* + * SECTION:gdata-gd-feed-link + * @short_description: GD feed link element + * @stability: Stable + * @include: gdata/gd/gdata-gd-feed-link.h + * + * #GDataGDFeedLink represents a "feedLink" element from the + * GData specification. + * + * It is private API, since implementing classes are likely to proxy the properties and functions + * of #GDataGDFeedLink as appropriate; most entry types which implement #GDataGDFeedLink have no use + * for most of its properties, and it would be unnecessary and confusing to expose #GDataGDFeedLink itself. + * + * In its current state, #GDataGDFeedLink supports the href attribute, but doesn't support inline + * feed elements, since they don't seem to appear in the wild. + * + * Since: 0.10.0 + */ + +#include +#include +#include + +#include "gdata-gd-feed-link.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_gd_feed_link_finalize (GObject *object); +static void gdata_gd_feed_link_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_feed_link_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDFeedLinkPrivate { + gchar *uri; + gchar *relation_type; + gint count_hint; + gboolean is_read_only; +}; + +enum { + PROP_RELATION_TYPE = 1, + PROP_URI, + PROP_COUNT_HINT, + PROP_IS_READ_ONLY, +}; + +G_DEFINE_TYPE (GDataGDFeedLink, gdata_gd_feed_link, GDATA_TYPE_PARSABLE) + +static void +gdata_gd_feed_link_class_init (GDataGDFeedLinkClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDFeedLinkPrivate)); + + gobject_class->set_property = gdata_gd_feed_link_set_property; + gobject_class->get_property = gdata_gd_feed_link_get_property; + gobject_class->finalize = gdata_gd_feed_link_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "feedLink"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDFeedLink:relation-type: + * + * Describes the relation type of the given feed to its parent feed. + * + * For more information, see the + * GData specification. + * + * Since: 0.10.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "Describes the relation type of the given feed to its parent feed.", + GDATA_LINK_ALTERNATE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDFeedLink:uri: + * + * A URI describing the location of the designated feed. + * + * For more information, see the + * GData specification. + * + * Since: 0.10.0 + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", + "URI", "A URI describing the location of the designated feed.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDFeedLink:count-hint: + * + * Hints at the number of entries contained in the designated feed, and may not be reliable. + * + * For more information, see the + * GData specification. + * + * Since: 0.10.0 + */ + g_object_class_install_property (gobject_class, PROP_COUNT_HINT, + g_param_spec_int ("count-hint", + "Count hint", "Hints at the number of entries contained in the designated feed.", + -1, G_MAXINT, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDFeedLink:is-read-only: + * + * Indicates whether the feed is read only. + * + * For more information, see the + * GData specification. + * + * Since: 0.10.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_READ_ONLY, + g_param_spec_boolean ("is-read-only", + "Read only?", "Indicates whether the feed is read only.", + TRUE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_gd_feed_link_init (GDataGDFeedLink *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_FEED_LINK, GDataGDFeedLinkPrivate); + self->priv->count_hint = -1; + self->priv->relation_type = g_strdup (GDATA_LINK_ALTERNATE); +} + +static void +gdata_gd_feed_link_finalize (GObject *object) +{ + GDataGDFeedLinkPrivate *priv = GDATA_GD_FEED_LINK (object)->priv; + + g_free (priv->uri); + g_free (priv->relation_type); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_feed_link_parent_class)->finalize (object); +} + +static void +gdata_gd_feed_link_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDFeedLinkPrivate *priv = GDATA_GD_FEED_LINK (object)->priv; + + switch (property_id) { + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_URI: + g_value_set_string (value, priv->uri); + break; + case PROP_COUNT_HINT: + g_value_set_int (value, priv->count_hint); + break; + case PROP_IS_READ_ONLY: + g_value_set_boolean (value, priv->is_read_only); + break; + default: + /* We don't have any other properties... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_feed_link_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDFeedLink *self = GDATA_GD_FEED_LINK (object); + + switch (property_id) { + case PROP_RELATION_TYPE: + gdata_gd_feed_link_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_URI: + gdata_gd_feed_link_set_uri (self, g_value_get_string (value)); + break; + case PROP_COUNT_HINT: + gdata_gd_feed_link_set_count_hint (self, g_value_get_int (value)); + break; + case PROP_IS_READ_ONLY: + gdata_gd_feed_link_set_is_read_only (self, g_value_get_boolean (value)); + break; + default: + /* We don't have any other properties... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *rel, *href, *count_hint; + GDataGDFeedLink *self = GDATA_GD_FEED_LINK (parsable); + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + if (rel != NULL && *rel == '\0') { + xmlFree (rel); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + gdata_gd_feed_link_set_relation_type (self, (const gchar*) rel); + xmlFree (rel); + + href = xmlGetProp (root_node, (xmlChar*) "href"); + if (href == NULL || *href == '\0') { + xmlFree (href); + return gdata_parser_error_required_property_missing (root_node, "href", error); + } + self->priv->uri = (gchar*) href; + + count_hint = xmlGetProp (root_node, (xmlChar*) "countHint"); + self->priv->count_hint = (count_hint != NULL) ? g_ascii_strtoll ((char*) count_hint, NULL, 10) : -1; + xmlFree (count_hint); + + return gdata_parser_boolean_from_property (root_node, "readOnly", &(self->priv->is_read_only), 0, error); +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDFeedLinkPrivate *priv = GDATA_GD_FEED_LINK (parsable)->priv; + + if (priv->relation_type != NULL) { + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + } + + if (priv->uri != NULL) { + gdata_parser_string_append_escaped (xml_string, " href='", priv->uri, "'"); + } + + if (priv->count_hint != -1) { + g_string_append_printf (xml_string, " countHint='%i'", priv->count_hint); + } + + if (priv->is_read_only == TRUE) { + g_string_append_printf (xml_string, " readOnly='true'"); + } else { + g_string_append_printf (xml_string, " readOnly='false'"); + } +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_feed_link_get_relation_type: + * @self: a #GDataGDFeedLink + * + * Gets the #GDataGDFeedLink:relation-type property. + * + * Return value: the feed's relation to its owner, or %NULL + * + * Since: 0.10.0 + */ +const gchar * +gdata_gd_feed_link_get_relation_type (GDataGDFeedLink *self) +{ + g_return_val_if_fail (GDATA_IS_GD_FEED_LINK (self), NULL); + + return self->priv->relation_type; +} + +/** + * gdata_gd_feed_link_get_uri: + * @self: a #GDataGDFeedLink + * + * Gets the #GDataGDFeedLink:uri property. + * + * Return value: the related feed's URI + * + * Since: 0.10.0 + */ +const gchar * +gdata_gd_feed_link_get_uri (GDataGDFeedLink *self) +{ + g_return_val_if_fail (GDATA_IS_GD_FEED_LINK (self), NULL); + + return self->priv->uri; +} + +/** + * gdata_gd_feed_link_get_count_hint: + * @self: a #GDataGDFeedLink + * + * Gets the #GDataGDFeedLink:count-hint property. + * + * Return value: the potential number of entries in the related feed, or -1 if not set + * + * Since: 0.10.0 + */ +gint +gdata_gd_feed_link_get_count_hint (GDataGDFeedLink *self) +{ + g_return_val_if_fail (GDATA_IS_GD_FEED_LINK (self), -1); + + return self->priv->count_hint; +} + +/** + * gdata_gd_feed_link_get_read_only: + * @self: a #GDataGDFeedLink + * + * Gets the #GDataGDFeedLink:read-only property. + * + * Return value: %TRUE if the feed is read only, %FALSE otherwise + * + * Since: 0.10.0 + */ +gboolean +gdata_gd_feed_link_is_read_only (GDataGDFeedLink *self) +{ + g_return_val_if_fail (GDATA_IS_GD_FEED_LINK (self), FALSE); + + return self->priv->is_read_only; +} + +/** + * gdata_gd_feed_link_set_relation_type: + * @self: a #GDataGDFeedLink + * @relation_type: (allow-none): the new relation type between the feed and its owner, or %NULL + * + * Sets the relation type of the #GDataGDFeedLink's related feed to @relation_type. If @relation_type is one of the standard Atom relation types, + * use one of the defined relation type values, instead of a static string. e.g. %GDATA_LINK_EDIT or %GDATA_LINK_SELF. + * + * Since: 0.10.0 + */ +void +gdata_gd_feed_link_set_relation_type (GDataGDFeedLink *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GD_FEED_LINK (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + /* If the relation type is unset, use the default "alternate" relation type. If it's set, and isn't an IRI, turn it into an IRI + * by appending it to "http://www.iana.org/assignments/relation/". If it's set and is an IRI, just use the IRI. + * See: http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rel_attribute + */ + g_free (self->priv->relation_type); + if (relation_type == NULL) { + self->priv->relation_type = g_strdup (GDATA_LINK_ALTERNATE); + } else if (strchr ((char*) relation_type, ':') == NULL) { + self->priv->relation_type = g_strconcat ("http://www.iana.org/assignments/relation/", (const gchar*) relation_type, NULL); + } else { + self->priv->relation_type = g_strdup ((gchar*) relation_type); + } + + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gd_feed_link_set_uri: + * @self: a #GDataGDFeedLink + * @uri: the new URI for the related feed + * + * Sets the URI of the #GDataGDFeedLink's related feed to @uri. + * + * Since: 0.10.0 + */ +void +gdata_gd_feed_link_set_uri (GDataGDFeedLink *self, const gchar *uri) +{ + g_return_if_fail (GDATA_IS_GD_FEED_LINK (self)); + g_return_if_fail (uri != NULL && *uri != '\0'); + + g_free (self->priv->uri); + self->priv->uri = g_strdup (uri); + + g_object_notify (G_OBJECT (self), "uri"); +} + +/** + * gdata_gd_feed_link_set_count_hint: + * @self: a #GDataGDFeedLink + * @count_hint: the new number of entries in the related feed, or -1 if unknown + * + * Sets the number of entries in the #GDataGDFeedLink's related feed to @count_hint. This number may be an imprecise estimate. + * + * Since: 0.10.0 + */ +void +gdata_gd_feed_link_set_count_hint (GDataGDFeedLink *self, gint count_hint) +{ + g_return_if_fail (GDATA_IS_GD_FEED_LINK (self)); + g_return_if_fail (count_hint >= -1); + + self->priv->count_hint = count_hint; + + g_object_notify (G_OBJECT (self), "count-hint"); +} + +/** + * gdata_gd_feed_link_set_is_read_only: + * @self: a #GDataGDFeedLink + * @is_read_only: %TRUE if the #GDataGDFeedLink's related feed is read only, %FALSE otherwise + * + * Sets the read only status of the #GDataGDFeedLink's related feed to @is_read_only. + * + * Since: 0.10.0 + */ +void +gdata_gd_feed_link_set_is_read_only (GDataGDFeedLink *self, gboolean is_read_only) +{ + g_return_if_fail (GDATA_IS_GD_FEED_LINK (self)); + + self->priv->is_read_only = is_read_only; + + g_object_notify (G_OBJECT (self), "is-read-only"); +} + diff --git a/gdata/gd/gdata-gd-feed-link.h b/gdata/gd/gdata-gd-feed-link.h new file mode 100644 index 0000000..8a970b6 --- /dev/null +++ b/gdata/gd/gdata-gd-feed-link.h @@ -0,0 +1,84 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_FEED_LINK_H +#define GDATA_GD_FEED_LINK_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_GD_FEED_LINK (gdata_gd_feed_link_get_type ()) +#define GDATA_GD_FEED_LINK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_FEED_LINK, GDataGDFeedLink)) +#define GDATA_GD_FEED_LINK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_FEED_LINK, GDataGDFeedLinkClass)) +#define GDATA_IS_GD_FEED_LINK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_FEED_LINK)) +#define GDATA_IS_GD_FEED_LINK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_FEED_LINK)) +#define GDATA_GD_FEED_LINK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_FEED_LINK, GDataGDFeedLinkClass)) + +typedef struct _GDataGDFeedLinkPrivate GDataGDFeedLinkPrivate; + +/** + * GDataGDFeedLink: + * + * All the fields in the #GDataGDFeedLink structure are private and should never be accessed directly. + * + * Since: 0.10.0 + */ +typedef struct { + GDataParsable parent; + GDataGDFeedLinkPrivate *priv; +} GDataGDFeedLink; + +/** + * GDataGDFeedLinkClass: + * + * All the fields in the #GDataGDFeedLinkClass structure are private and should never be accessed directly. + * + * Since: 0.10.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDFeedLinkClass; + +GType gdata_gd_feed_link_get_type (void) G_GNUC_CONST; + +const gchar *gdata_gd_feed_link_get_relation_type (GDataGDFeedLink *self) G_GNUC_PURE; +void gdata_gd_feed_link_set_relation_type (GDataGDFeedLink *self, const gchar *relation_type); + +const gchar *gdata_gd_feed_link_get_uri (GDataGDFeedLink *self) G_GNUC_PURE; +void gdata_gd_feed_link_set_uri (GDataGDFeedLink *self, const gchar *uri); + +gint gdata_gd_feed_link_get_count_hint (GDataGDFeedLink *self) G_GNUC_PURE; +void gdata_gd_feed_link_set_count_hint (GDataGDFeedLink *self, gint count_hint); + +gboolean gdata_gd_feed_link_is_read_only (GDataGDFeedLink *self) G_GNUC_PURE; +void gdata_gd_feed_link_set_is_read_only (GDataGDFeedLink *self, gboolean is_read_only); + +G_END_DECLS + +#endif /* !GDATA_GD_FEED_LINK_H */ diff --git a/gdata/gd/gdata-gd-im-address.c b/gdata/gd/gdata-gd-im-address.c new file mode 100644 index 0000000..5b44680 --- /dev/null +++ b/gdata/gd/gdata-gd-im-address.c @@ -0,0 +1,526 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-im-address + * @short_description: GData instant messaging address element + * @stability: Stable + * @include: gdata/gd/gdata-gd-im-address.h + * + * #GDataGDIMAddress represents an "im" element from the + * GData specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-gd-im-address.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gd_im_address_comparable_init (GDataComparableIface *iface); +static void gdata_gd_im_address_finalize (GObject *object); +static void gdata_gd_im_address_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_im_address_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDIMAddressPrivate { + gchar *address; + gchar *protocol; + gchar *relation_type; + gchar *label; + gboolean is_primary; +}; + +enum { + PROP_ADDRESS = 1, + PROP_PROTOCOL, + PROP_RELATION_TYPE, + PROP_LABEL, + PROP_IS_PRIMARY +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDIMAddress, gdata_gd_im_address, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_im_address_comparable_init)) + +static void +gdata_gd_im_address_class_init (GDataGDIMAddressClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDIMAddressPrivate)); + + gobject_class->get_property = gdata_gd_im_address_get_property; + gobject_class->set_property = gdata_gd_im_address_set_property; + gobject_class->finalize = gdata_gd_im_address_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "im"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDIMAddress:address: + * + * The IM address itself. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_ADDRESS, + g_param_spec_string ("address", + "Address", "The IM address itself.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDIMAddress:protocol: + * + * Identifies the IM network. For example: %GDATA_GD_IM_PROTOCOL_JABBER or %GDATA_GD_IM_PROTOCOL_GOOGLE_TALK. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_PROTOCOL, + g_param_spec_string ("protocol", + "Protocol", "Identifies the IM network.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDIMAddress:relation-type: + * + * A programmatic value that identifies the type of IM address. For example: %GDATA_GD_IM_ADDRESS_HOME or %GDATA_GD_IM_ADDRESS_WORK. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of IM address.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDIMAddress:label: + * + * A simple string value used to name this IM address. It allows UIs to display a label such as "Work", "Personal", "Preferred", etc. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A simple string value used to name this IM address.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDIMAddress:is-primary: + * + * Indicates which IM address out of a group is primary. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_PRIMARY, + g_param_spec_boolean ("is-primary", + "Primary?", "Indicates which IM address out of a group is primary.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGDIMAddressPrivate *a = ((GDataGDIMAddress*) self)->priv, *b = ((GDataGDIMAddress*) other)->priv; + + if (g_strcmp0 (a->address, b->address) == 0 && g_strcmp0 (a->protocol, b->protocol) == 0) + return 0; + return 1; +} + +static void +gdata_gd_im_address_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_im_address_init (GDataGDIMAddress *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_IM_ADDRESS, GDataGDIMAddressPrivate); +} + +static void +gdata_gd_im_address_finalize (GObject *object) +{ + GDataGDIMAddressPrivate *priv = GDATA_GD_IM_ADDRESS (object)->priv; + + g_free (priv->address); + g_free (priv->protocol); + g_free (priv->relation_type); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_im_address_parent_class)->finalize (object); +} + +static void +gdata_gd_im_address_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDIMAddressPrivate *priv = GDATA_GD_IM_ADDRESS (object)->priv; + + switch (property_id) { + case PROP_ADDRESS: + g_value_set_string (value, priv->address); + break; + case PROP_PROTOCOL: + g_value_set_string (value, priv->protocol); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + case PROP_IS_PRIMARY: + g_value_set_boolean (value, priv->is_primary); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_im_address_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDIMAddress *self = GDATA_GD_IM_ADDRESS (object); + + switch (property_id) { + case PROP_ADDRESS: + gdata_gd_im_address_set_address (self, g_value_get_string (value)); + break; + case PROP_PROTOCOL: + gdata_gd_im_address_set_protocol (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gd_im_address_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gd_im_address_set_label (self, g_value_get_string (value)); + break; + case PROP_IS_PRIMARY: + gdata_gd_im_address_set_is_primary (self, g_value_get_boolean (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *address, *rel; + gboolean primary_bool; + GDataGDIMAddressPrivate *priv = GDATA_GD_IM_ADDRESS (parsable)->priv; + + /* Is it the primary IM address? */ + if (gdata_parser_boolean_from_property (root_node, "primary", &primary_bool, 0, error) == FALSE) + return FALSE; + + address = xmlGetProp (root_node, (xmlChar*) "address"); + if (address == NULL || *address == '\0') { + xmlFree (address); + return gdata_parser_error_required_property_missing (root_node, "address", error); + } + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + if (rel != NULL && *rel == '\0') { + xmlFree (address); + xmlFree (rel); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + priv->address = (gchar*) address; + priv->protocol = (gchar*) xmlGetProp (root_node, (xmlChar*) "protocol"); + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) xmlGetProp (root_node, (xmlChar*) "label"); + priv->is_primary = primary_bool; + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDIMAddressPrivate *priv = GDATA_GD_IM_ADDRESS (parsable)->priv; + + gdata_parser_string_append_escaped (xml_string, " address='", priv->address, "'"); + if (priv->protocol != NULL) + gdata_parser_string_append_escaped (xml_string, " protocol='", priv->protocol, "'"); + + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + + if (priv->is_primary == TRUE) + g_string_append (xml_string, " primary='true'"); + else + g_string_append (xml_string, " primary='false'"); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_im_address_new: + * @address: the IM address + * @protocol: (allow-none): a URI identifying the IM protocol, or %NULL + * @relation_type: (allow-none): the relationship between the IM address and its owner, or %NULL + * @label: (allow-none): a human-readable label for the IM address, or %NULL + * @is_primary: %TRUE if this IM address is its owner's primary address, %FALSE otherwise + * + * Creates a new #GDataGDIMAddress. More information is available in the GData specification. + * + * Return value: a new #GDataGDIMAddress, or %NULL; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataGDIMAddress * +gdata_gd_im_address_new (const gchar *address, const gchar *protocol, const gchar *relation_type, const gchar *label, gboolean is_primary) +{ + g_return_val_if_fail (address != NULL && *address != '\0', NULL); + g_return_val_if_fail (protocol == NULL || *protocol != '\0', NULL); + g_return_val_if_fail (relation_type == NULL || *relation_type != '\0', NULL); + return g_object_new (GDATA_TYPE_GD_IM_ADDRESS, "address", address, "protocol", protocol, "relation-type", relation_type, + "label", label, "is-primary", is_primary, NULL); +} + +/** + * gdata_gd_im_address_get_address: + * @self: a #GDataGDIMAddress + * + * Gets the #GDataGDIMAddress:address property. + * + * Return value: the IM address itself, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_im_address_get_address (GDataGDIMAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_IM_ADDRESS (self), NULL); + return self->priv->address; +} + +/** + * gdata_gd_im_address_set_address: + * @self: a #GDataGDIMAddress + * @address: the new IM address + * + * Sets the #GDataGDIMAddress:address property to @address. + * + * Since: 0.4.0 + */ +void +gdata_gd_im_address_set_address (GDataGDIMAddress *self, const gchar *address) +{ + g_return_if_fail (GDATA_IS_GD_IM_ADDRESS (self)); + g_return_if_fail (address != NULL && *address != '\0'); + + g_free (self->priv->address); + self->priv->address = g_strdup (address); + g_object_notify (G_OBJECT (self), "address"); +} + +/** + * gdata_gd_im_address_get_protocol: + * @self: a #GDataGDIMAddress + * + * Gets the #GDataGDIMAddress:protocol property. + * + * Return value: the IM address' protocol, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_im_address_get_protocol (GDataGDIMAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_IM_ADDRESS (self), NULL); + return self->priv->protocol; +} + +/** + * gdata_gd_im_address_set_protocol: + * @self: a #GDataGDIMAddress + * @protocol: (allow-none): the new IM protocol, or %NULL + * + * Sets the #GDataGDIMAddress:protocol property to @protocol. + * + * Since: 0.4.0 + */ +void +gdata_gd_im_address_set_protocol (GDataGDIMAddress *self, const gchar *protocol) +{ + g_return_if_fail (GDATA_IS_GD_IM_ADDRESS (self)); + g_return_if_fail (protocol == NULL || *protocol != '\0'); + + g_free (self->priv->protocol); + self->priv->protocol = g_strdup (protocol); + g_object_notify (G_OBJECT (self), "protocol"); +} + +/** + * gdata_gd_im_address_get_relation_type: + * @self: a #GDataGDIMAddress + * + * Gets the #GDataGDIMAddress:relation-type property. + * + * Return value: the IM address' relation type, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_im_address_get_relation_type (GDataGDIMAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_IM_ADDRESS (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gd_im_address_set_relation_type: + * @self: a #GDataGDIMAddress + * @relation_type: (allow-none): the new relation type for the im_address, or %NULL + * + * Sets the #GDataGDIMAddress:relation-type property to @relation_type. + * + * Set @relation_type to %NULL to unset the property in the IM address. + * + * Since: 0.4.0 + */ +void +gdata_gd_im_address_set_relation_type (GDataGDIMAddress *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GD_IM_ADDRESS (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gd_im_address_get_label: + * @self: a #GDataGDIMAddress + * + * Gets the #GDataGDIMAddress:label property. + * + * Return value: the IM address' label, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_im_address_get_label (GDataGDIMAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_IM_ADDRESS (self), NULL); + return self->priv->label; +} + +/** + * gdata_gd_im_address_set_label: + * @self: a #GDataGDIMAddress + * @label: (allow-none): the new label for the IM address, or %NULL + * + * Sets the #GDataGDIMAddress:label property to @label. + * + * Set @label to %NULL to unset the property in the IM address. + * + * Since: 0.4.0 + */ +void +gdata_gd_im_address_set_label (GDataGDIMAddress *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GD_IM_ADDRESS (self)); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} + +/** + * gdata_gd_im_address_is_primary: + * @self: a #GDataGDIMAddress + * + * Gets the #GDataGDIMAddress:is-primary property. + * + * Return value: %TRUE if this is the primary IM address, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_gd_im_address_is_primary (GDataGDIMAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_IM_ADDRESS (self), FALSE); + return self->priv->is_primary; +} + +/** + * gdata_gd_im_address_set_is_primary: + * @self: a #GDataGDIMAddress + * @is_primary: %TRUE if this is the primary IM address, %FALSE otherwise + * + * Sets the #GDataGDIMAddress:is-primary property to @is_primary. + * + * Since: 0.4.0 + */ +void +gdata_gd_im_address_set_is_primary (GDataGDIMAddress *self, gboolean is_primary) +{ + g_return_if_fail (GDATA_IS_GD_IM_ADDRESS (self)); + + self->priv->is_primary = is_primary; + g_object_notify (G_OBJECT (self), "is-primary"); +} diff --git a/gdata/gd/gdata-gd-im-address.h b/gdata/gd/gdata-gd-im-address.h new file mode 100644 index 0000000..9e717c1 --- /dev/null +++ b/gdata/gd/gdata-gd-im-address.h @@ -0,0 +1,198 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_IM_ADDRESS_H +#define GDATA_GD_IM_ADDRESS_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GD_IM_ADDRESS_HOME: + * + * The relation type URI for a home IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_ADDRESS_HOME "http://schemas.google.com/g/2005#home" + +/** + * GDATA_GD_IM_ADDRESS_NETMEETING: + * + * The relation type URI for a Microsoft NetMeeting IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_ADDRESS_NETMEETING "http://schemas.google.com/g/2005#netmeeting" + +/** + * GDATA_GD_IM_ADDRESS_OTHER: + * + * The relation type URI for a miscellaneous IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_ADDRESS_OTHER "http://schemas.google.com/g/2005#other" + +/** + * GDATA_GD_IM_ADDRESS_WORK: + * + * The relation type URI for a work IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_ADDRESS_WORK "http://schemas.google.com/g/2005#work" + +/** + * GDATA_GD_IM_PROTOCOL_AIM: + * + * The protocol type URI for an AIM IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_PROTOCOL_AIM "http://schemas.google.com/g/2005#AIM" + +/** + * GDATA_GD_IM_PROTOCOL_LIVE_MESSENGER: + * + * The protocol type URI for an Windows Live Messenger IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_PROTOCOL_LIVE_MESSENGER "http://schemas.google.com/g/2005#MSN" + +/** + * GDATA_GD_IM_PROTOCOL_YAHOO_MESSENGER: + * + * The protocol type URI for a Yahoo! Messenger IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_PROTOCOL_YAHOO_MESSENGER "http://schemas.google.com/g/2005#YAHOO" + +/** + * GDATA_GD_IM_PROTOCOL_SKYPE: + * + * The protocol type URI for a Skype IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_PROTOCOL_SKYPE "http://schemas.google.com/g/2005#SKYPE" + +/** + * GDATA_GD_IM_PROTOCOL_QQ: + * + * The protocol type URI for a QQ IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_PROTOCOL_QQ "http://schemas.google.com/g/2005#QQ" + +/** + * GDATA_GD_IM_PROTOCOL_GOOGLE_TALK: + * + * The protocol type URI for a Google Talk IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_PROTOCOL_GOOGLE_TALK "http://schemas.google.com/g/2005#GOOGLE_TALK" + +/** + * GDATA_GD_IM_PROTOCOL_ICQ: + * + * The protocol type URI for an ICQ IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_PROTOCOL_ICQ "http://schemas.google.com/g/2005#ICQ" + +/** + * GDATA_GD_IM_PROTOCOL_JABBER: + * + * The protocol type URI for a Jabber IM address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_IM_PROTOCOL_JABBER "http://schemas.google.com/g/2005#JABBER" + +#define GDATA_TYPE_GD_IM_ADDRESS (gdata_gd_im_address_get_type ()) +#define GDATA_GD_IM_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_IM_ADDRESS, GDataGDIMAddress)) +#define GDATA_GD_IM_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_IM_ADDRESS, GDataGDIMAddressClass)) +#define GDATA_IS_GD_IM_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_IM_ADDRESS)) +#define GDATA_IS_GD_IM_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_IM_ADDRESS)) +#define GDATA_GD_IM_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_IM_ADDRESS, GDataGDIMAddressClass)) + +typedef struct _GDataGDIMAddressPrivate GDataGDIMAddressPrivate; + +/** + * GDataGDIMAddress: + * + * All the fields in the #GDataGDIMAddress structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataParsable parent; + GDataGDIMAddressPrivate *priv; +} GDataGDIMAddress; + +/** + * GDataGDIMAddressClass: + * + * All the fields in the #GDataGDIMAddressClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDIMAddressClass; + +GType gdata_gd_im_address_get_type (void) G_GNUC_CONST; + +GDataGDIMAddress *gdata_gd_im_address_new (const gchar *address, const gchar *protocol, const gchar *relation_type, const gchar *label, + gboolean is_primary) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gd_im_address_get_address (GDataGDIMAddress *self) G_GNUC_PURE; +void gdata_gd_im_address_set_address (GDataGDIMAddress *self, const gchar *address); + +const gchar *gdata_gd_im_address_get_protocol (GDataGDIMAddress *self) G_GNUC_PURE; +void gdata_gd_im_address_set_protocol (GDataGDIMAddress *self, const gchar *protocol); + +const gchar *gdata_gd_im_address_get_relation_type (GDataGDIMAddress *self) G_GNUC_PURE; +void gdata_gd_im_address_set_relation_type (GDataGDIMAddress *self, const gchar *relation_type); + +const gchar *gdata_gd_im_address_get_label (GDataGDIMAddress *self) G_GNUC_PURE; +void gdata_gd_im_address_set_label (GDataGDIMAddress *self, const gchar *label); + +gboolean gdata_gd_im_address_is_primary (GDataGDIMAddress *self) G_GNUC_PURE; +void gdata_gd_im_address_set_is_primary (GDataGDIMAddress *self, gboolean is_primary); + +G_END_DECLS + +#endif /* !GDATA_GD_IM_ADDRESS_H */ diff --git a/gdata/gd/gdata-gd-name.c b/gdata/gd/gdata-gd-name.c new file mode 100644 index 0000000..4c1fde6 --- /dev/null +++ b/gdata/gd/gdata-gd-name.c @@ -0,0 +1,589 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-name + * @short_description: GData name element + * @stability: Stable + * @include: gdata/gd/gdata-gd-name.h + * + * #GDataGDName represents a "name" element from the + * GData specification. + * + * Given a name such as Sir Winston Leonard Spencer-Churchill, KG, the properties of the #GDataGDName should be + * set as follows: + * + * #GDataGDName:given-nameWinston + * #GDataGDName:additional-nameLeonard + * #GDataGDName:family-nameSpencer-Churchill + * #GDataGDName:prefixSir + * #GDataGDName:suffixKG + * + * + * Since: 0.5.0 + */ + +#include +#include + +#include "gdata-gd-name.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gd_name_comparable_init (GDataComparableIface *iface); +static void gdata_gd_name_finalize (GObject *object); +static void gdata_gd_name_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_name_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDNamePrivate { + gchar *given_name; + gchar *additional_name; + gchar *family_name; + gchar *prefix; + gchar *suffix; + gchar *full_name; +}; + +enum { + PROP_GIVEN_NAME = 1, + PROP_ADDITIONAL_NAME, + PROP_FAMILY_NAME, + PROP_PREFIX, + PROP_SUFFIX, + PROP_FULL_NAME +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDName, gdata_gd_name, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_name_comparable_init)) + +static void +gdata_gd_name_class_init (GDataGDNameClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDNamePrivate)); + + gobject_class->get_property = gdata_gd_name_get_property; + gobject_class->set_property = gdata_gd_name_set_property; + gobject_class->finalize = gdata_gd_name_finalize; + + parsable_class->parse_xml = parse_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "name"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDName:given-name: + * + * The person's given name. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_GIVEN_NAME, + g_param_spec_string ("given-name", + "Given name", "The person's given name.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDName:additional-name: + * + * An additional name for the person (e.g. a middle name). + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_ADDITIONAL_NAME, + g_param_spec_string ("additional-name", + "Additional name", "An additional name for the person (e.g. a middle name).", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDName:family-name: + * + * The person's family name. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_FAMILY_NAME, + g_param_spec_string ("family-name", + "Family name", "The person's family name.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDName:prefix: + * + * An honorific prefix (e.g. Mr or Mrs). + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_PREFIX, + g_param_spec_string ("prefix", + "Prefix", "An honorific prefix.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDName:suffix: + * + * An honorific suffix (e.g. san or III). + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_SUFFIX, + g_param_spec_string ("suffix", + "Suffix", "An honorific suffix.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDName:full-name: + * + * An unstructured representation of the person's full name. It's generally advised to use the other individual properties in preference + * to this one, which can fall out of synchronisation with the other properties. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_FULL_NAME, + g_param_spec_string ("full-name", + "Full name", "An unstructured representation of the person's full name.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGDNamePrivate *a = ((GDataGDName*) self)->priv, *b = ((GDataGDName*) other)->priv; + + if (g_strcmp0 (a->given_name, b->given_name) == 0 && g_strcmp0 (a->additional_name, b->additional_name) == 0 && + g_strcmp0 (a->family_name, b->family_name) == 0 && g_strcmp0 (a->prefix, b->prefix) == 0) + return 0; + return 1; +} + +static void +gdata_gd_name_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_name_init (GDataGDName *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_NAME, GDataGDNamePrivate); +} + +static void +gdata_gd_name_finalize (GObject *object) +{ + GDataGDNamePrivate *priv = GDATA_GD_NAME (object)->priv; + + g_free (priv->given_name); + g_free (priv->additional_name); + g_free (priv->family_name); + g_free (priv->prefix); + g_free (priv->suffix); + g_free (priv->full_name); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_name_parent_class)->finalize (object); +} + +static void +gdata_gd_name_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDNamePrivate *priv = GDATA_GD_NAME (object)->priv; + + switch (property_id) { + case PROP_GIVEN_NAME: + g_value_set_string (value, priv->given_name); + break; + case PROP_ADDITIONAL_NAME: + g_value_set_string (value, priv->additional_name); + break; + case PROP_FAMILY_NAME: + g_value_set_string (value, priv->family_name); + break; + case PROP_PREFIX: + g_value_set_string (value, priv->prefix); + break; + case PROP_SUFFIX: + g_value_set_string (value, priv->suffix); + break; + case PROP_FULL_NAME: + g_value_set_string (value, priv->full_name); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_name_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDName *self = GDATA_GD_NAME (object); + + switch (property_id) { + case PROP_GIVEN_NAME: + gdata_gd_name_set_given_name (self, g_value_get_string (value)); + break; + case PROP_ADDITIONAL_NAME: + gdata_gd_name_set_additional_name (self, g_value_get_string (value)); + break; + case PROP_FAMILY_NAME: + gdata_gd_name_set_family_name (self, g_value_get_string (value)); + break; + case PROP_PREFIX: + gdata_gd_name_set_prefix (self, g_value_get_string (value)); + break; + case PROP_SUFFIX: + gdata_gd_name_set_suffix (self, g_value_get_string (value)); + break; + case PROP_FULL_NAME: + gdata_gd_name_set_full_name (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataGDNamePrivate *priv = GDATA_GD_NAME (parsable)->priv; + + if (gdata_parser_is_namespace (node, "http://schemas.google.com/g/2005") == TRUE && ( + gdata_parser_string_from_element (node, "givenName", P_NO_DUPES, &(priv->given_name), &success, error) == TRUE || + gdata_parser_string_from_element (node, "additionalName", P_NO_DUPES, &(priv->additional_name), &success, error) == TRUE || + gdata_parser_string_from_element (node, "familyName", P_NO_DUPES, &(priv->family_name), &success, error) == TRUE || + gdata_parser_string_from_element (node, "namePrefix", P_NO_DUPES, &(priv->prefix), &success, error) == TRUE || + gdata_parser_string_from_element (node, "nameSuffix", P_NO_DUPES, &(priv->suffix), &success, error) == TRUE || + gdata_parser_string_from_element (node, "fullName", P_NO_DUPES, &(priv->full_name), &success, error) == TRUE)) { + return success; + } else { + return GDATA_PARSABLE_CLASS (gdata_gd_name_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDNamePrivate *priv = GDATA_GD_NAME (parsable)->priv; + +#define OUTPUT_STRING_ELEMENT(E,F) \ + if (priv->F != NULL) \ + gdata_parser_string_append_escaped (xml_string, "", priv->F, ""); + + OUTPUT_STRING_ELEMENT ("givenName", given_name) + OUTPUT_STRING_ELEMENT ("additionalName", additional_name) + OUTPUT_STRING_ELEMENT ("familyName", family_name) + OUTPUT_STRING_ELEMENT ("namePrefix", prefix) + OUTPUT_STRING_ELEMENT ("nameSuffix", suffix) + + /* We can't guarantee that priv->full_name is non-empty without breaking API. */ + if (priv->full_name != NULL && *(priv->full_name) != '\0') { + gdata_parser_string_append_escaped (xml_string, "", priv->full_name, ""); + } + +#undef OUTPUT_STRING_ELEMENT +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_name_new: + * @given_name: (allow-none): the person's given name, or %NULL + * @family_name: (allow-none): the person's family name, or %NULL + * + * Creates a new #GDataGDName. More information is available in the GData specification. + * + * Return value: a new #GDataGDName, or %NULL; unref with g_object_unref() + * + * Since: 0.5.0 + */ +GDataGDName * +gdata_gd_name_new (const gchar *given_name, const gchar *family_name) +{ + g_return_val_if_fail (given_name == NULL || *given_name != '\0', NULL); + g_return_val_if_fail (family_name == NULL || *family_name != '\0', NULL); + return g_object_new (GDATA_TYPE_GD_NAME, "given-name", given_name, "family-name", family_name, NULL); +} + +/** + * gdata_gd_name_get_given_name: + * @self: a #GDataGDName + * + * Gets the #GDataGDName:given-name property. + * + * Return value: the person's given name, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_name_get_given_name (GDataGDName *self) +{ + g_return_val_if_fail (GDATA_IS_GD_NAME (self), NULL); + return self->priv->given_name; +} + +/** + * gdata_gd_name_set_given_name: + * @self: a #GDataGDName + * @given_name: (allow-none): the new given name, or %NULL + * + * Sets the #GDataGDName:given-name property to @given_name. + * + * Since: 0.5.0 + */ +void +gdata_gd_name_set_given_name (GDataGDName *self, const gchar *given_name) +{ + g_return_if_fail (GDATA_IS_GD_NAME (self)); + g_return_if_fail (given_name == NULL || *given_name != '\0'); + + g_free (self->priv->given_name); + self->priv->given_name = g_strdup (given_name); + g_object_notify (G_OBJECT (self), "given-name"); +} + +/** + * gdata_gd_name_get_additional_name: + * @self: a #GDataGDName + * + * Gets the #GDataGDName:additional-name property. + * + * Return value: the person's additional name, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_name_get_additional_name (GDataGDName *self) +{ + g_return_val_if_fail (GDATA_IS_GD_NAME (self), NULL); + return self->priv->additional_name; +} + +/** + * gdata_gd_name_set_additional_name: + * @self: a #GDataGDName + * @additional_name: (allow-none): the new additional name, or %NULL + * + * Sets the #GDataGDName:additional-name property to @additional_name. + * + * Since: 0.5.0 + */ +void +gdata_gd_name_set_additional_name (GDataGDName *self, const gchar *additional_name) +{ + g_return_if_fail (GDATA_IS_GD_NAME (self)); + g_return_if_fail (additional_name == NULL || *additional_name != '\0'); + + g_free (self->priv->additional_name); + self->priv->additional_name = g_strdup (additional_name); + g_object_notify (G_OBJECT (self), "additional-name"); +} + +/** + * gdata_gd_name_get_family_name: + * @self: a #GDataGDName + * + * Gets the #GDataGDName:family-name property. + * + * Return value: the person's family name, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_name_get_family_name (GDataGDName *self) +{ + g_return_val_if_fail (GDATA_IS_GD_NAME (self), NULL); + return self->priv->family_name; +} + +/** + * gdata_gd_name_set_family_name: + * @self: a #GDataGDName + * @family_name: (allow-none): the new family name, or %NULL + * + * Sets the #GDataGDName:family-name property to @family_name. + * + * Since: 0.5.0 + */ +void +gdata_gd_name_set_family_name (GDataGDName *self, const gchar *family_name) +{ + g_return_if_fail (GDATA_IS_GD_NAME (self)); + g_return_if_fail (family_name == NULL || *family_name != '\0'); + + g_free (self->priv->family_name); + self->priv->family_name = g_strdup (family_name); + g_object_notify (G_OBJECT (self), "family-name"); +} + +/** + * gdata_gd_name_get_prefix: + * @self: a #GDataGDName + * + * Gets the #GDataGDName:prefix property. + * + * Return value: the person's name prefix, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_name_get_prefix (GDataGDName *self) +{ + g_return_val_if_fail (GDATA_IS_GD_NAME (self), NULL); + return self->priv->prefix; +} + +/** + * gdata_gd_name_set_prefix: + * @self: a #GDataGDName + * @prefix: (allow-none): the new prefix, or %NULL + * + * Sets the #GDataGDName:prefix property to @prefix. + * + * Since: 0.5.0 + */ +void +gdata_gd_name_set_prefix (GDataGDName *self, const gchar *prefix) +{ + g_return_if_fail (GDATA_IS_GD_NAME (self)); + g_return_if_fail (prefix == NULL || *prefix != '\0'); + + g_free (self->priv->prefix); + self->priv->prefix = g_strdup (prefix); + g_object_notify (G_OBJECT (self), "prefix"); +} + +/** + * gdata_gd_name_get_suffix: + * @self: a #GDataGDName + * + * Gets the #GDataGDName:suffix property. + * + * Return value: the person's name suffix, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_name_get_suffix (GDataGDName *self) +{ + g_return_val_if_fail (GDATA_IS_GD_NAME (self), NULL); + return self->priv->suffix; +} + +/** + * gdata_gd_name_set_suffix: + * @self: a #GDataGDName + * @suffix: (allow-none): the new suffix, or %NULL + * + * Sets the #GDataGDName:suffix property to @suffix. + * + * Since: 0.5.0 + */ +void +gdata_gd_name_set_suffix (GDataGDName *self, const gchar *suffix) +{ + g_return_if_fail (GDATA_IS_GD_NAME (self)); + g_return_if_fail (suffix == NULL || *suffix != '\0'); + + g_free (self->priv->suffix); + self->priv->suffix = g_strdup (suffix); + g_object_notify (G_OBJECT (self), "suffix"); +} + +/** + * gdata_gd_name_get_full_name: + * @self: a #GDataGDName + * + * Gets the #GDataGDName:full-name property. + * + * Return value: the person's full name, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_name_get_full_name (GDataGDName *self) +{ + g_return_val_if_fail (GDATA_IS_GD_NAME (self), NULL); + return self->priv->full_name; +} + +/** + * gdata_gd_name_set_full_name: + * @self: a #GDataGDName + * @full_name: (allow-none): the new full name, or %NULL + * + * Sets the #GDataGDName:full-name property to @full_name. + * + * Since: 0.5.0 + */ +void +gdata_gd_name_set_full_name (GDataGDName *self, const gchar *full_name) +{ + g_return_if_fail (GDATA_IS_GD_NAME (self)); + + /* Coerce empty strings to NULL. Ideally, we should have this as a precondition (as all the other setters in GDataGDName have) but that would + * break API. */ + if (full_name != NULL && *full_name == '\0') { + full_name = NULL; + } + + g_free (self->priv->full_name); + self->priv->full_name = g_strdup (full_name); + g_object_notify (G_OBJECT (self), "full-name"); +} diff --git a/gdata/gd/gdata-gd-name.h b/gdata/gd/gdata-gd-name.h new file mode 100644 index 0000000..2044564 --- /dev/null +++ b/gdata/gd/gdata-gd-name.h @@ -0,0 +1,92 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_NAME_H +#define GDATA_GD_NAME_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_GD_NAME (gdata_gd_name_get_type ()) +#define GDATA_GD_NAME(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_NAME, GDataGDName)) +#define GDATA_GD_NAME_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_NAME, GDataGDNameClass)) +#define GDATA_IS_GD_NAME(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_NAME)) +#define GDATA_IS_GD_NAME_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_NAME)) +#define GDATA_GD_NAME_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_NAME, GDataGDNameClass)) + +typedef struct _GDataGDNamePrivate GDataGDNamePrivate; + +/** + * GDataGDName: + * + * All the fields in the #GDataGDName structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + GDataParsable parent; + GDataGDNamePrivate *priv; +} GDataGDName; + +/** + * GDataGDNameClass: + * + * All the fields in the #GDataGDNameClass structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDNameClass; + +GType gdata_gd_name_get_type (void) G_GNUC_CONST; + +GDataGDName *gdata_gd_name_new (const gchar *given_name, const gchar *family_name) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gd_name_get_given_name (GDataGDName *self) G_GNUC_PURE; +void gdata_gd_name_set_given_name (GDataGDName *self, const gchar *given_name); + +const gchar *gdata_gd_name_get_additional_name (GDataGDName *self) G_GNUC_PURE; +void gdata_gd_name_set_additional_name (GDataGDName *self, const gchar *additional_name); + +const gchar *gdata_gd_name_get_family_name (GDataGDName *self) G_GNUC_PURE; +void gdata_gd_name_set_family_name (GDataGDName *self, const gchar *family_name); + +const gchar *gdata_gd_name_get_prefix (GDataGDName *self) G_GNUC_PURE; +void gdata_gd_name_set_prefix (GDataGDName *self, const gchar *prefix); + +const gchar *gdata_gd_name_get_suffix (GDataGDName *self) G_GNUC_PURE; +void gdata_gd_name_set_suffix (GDataGDName *self, const gchar *suffix); + +const gchar *gdata_gd_name_get_full_name (GDataGDName *self) G_GNUC_PURE; +void gdata_gd_name_set_full_name (GDataGDName *self, const gchar *full_name); + +G_END_DECLS + +#endif /* !GDATA_GD_NAME_H */ diff --git a/gdata/gd/gdata-gd-organization.c b/gdata/gd/gdata-gd-organization.c new file mode 100644 index 0000000..c5d6a23 --- /dev/null +++ b/gdata/gd/gdata-gd-organization.c @@ -0,0 +1,826 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-organization + * @short_description: GData organization element + * @stability: Stable + * @include: gdata/gd/gdata-gd-organization.h + * + * #GDataGDOrganization represents an "organization" element from the + * GData specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-gd-organization.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-gd-where.h" +#include "gdata-private.h" +#include "gdata-comparable.h" + +static void gdata_gd_organization_comparable_init (GDataComparableIface *iface); +static void gdata_gd_organization_dispose (GObject *object); +static void gdata_gd_organization_finalize (GObject *object); +static void gdata_gd_organization_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_organization_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDOrganizationPrivate { + gchar *name; + gchar *title; + gchar *relation_type; + gchar *label; + gboolean is_primary; + gchar *department; + gchar *job_description; + gchar *symbol; + GDataGDWhere *location; +}; + +enum { + PROP_NAME = 1, + PROP_TITLE, + PROP_RELATION_TYPE, + PROP_LABEL, + PROP_IS_PRIMARY, + PROP_DEPARTMENT, + PROP_JOB_DESCRIPTION, + PROP_SYMBOL, + PROP_LOCATION +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDOrganization, gdata_gd_organization, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_organization_comparable_init)) + +static void +gdata_gd_organization_class_init (GDataGDOrganizationClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDOrganizationPrivate)); + + gobject_class->get_property = gdata_gd_organization_get_property; + gobject_class->set_property = gdata_gd_organization_set_property; + gobject_class->dispose = gdata_gd_organization_dispose; + gobject_class->finalize = gdata_gd_organization_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "organization"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDOrganization:name: + * + * The name of the organization. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_NAME, + g_param_spec_string ("name", + "Name", "The name of the organization.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDOrganization:title: + * + * The title of a person within the organization. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TITLE, + g_param_spec_string ("title", + "Title", "The title of a person within the organization.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDOrganization:relation-type: + * + * A programmatic value that identifies the type of organization. For example: %GDATA_GD_ORGANIZATION_WORK or %GDATA_GD_ORGANIZATION_OTHER. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of organization.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDOrganization:label: + * + * A simple string value used to name this organization. It allows UIs to display a label such as "Work", "Volunteer", + * "Professional Society", etc. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A simple string value used to name this organization.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDOrganization:is-primary: + * + * Indicates which organization out of a group is primary. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_PRIMARY, + g_param_spec_boolean ("is-primary", + "Primary?", "Indicates which organization out of a group is primary.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDOrganization:department: + * + * Specifies a department within the organization. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_DEPARTMENT, + g_param_spec_string ("department", + "Department", "Specifies a department within the organization.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDOrganization:job-description: + * + * Description of a job within the organization. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_JOB_DESCRIPTION, + g_param_spec_string ("job-description", + "Job description", "Description of a job within the organization.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDOrganization:symbol: + * + * Stock symbol of the organization. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_SYMBOL, + g_param_spec_string ("symbol", + "Symbol", "Symbol of the organization.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDOrganization:location: + * + * A place associated with the organization, e.g. office location. + * + * For more information, see the + * GData specification. + * + * Since: 0.6.0 + */ + g_object_class_install_property (gobject_class, PROP_LOCATION, + g_param_spec_object ("location", + "Location", "A place associated with the organization, e.g. office location.", + GDATA_TYPE_GD_WHERE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGDOrganizationPrivate *a = ((GDataGDOrganization*) self)->priv, *b = ((GDataGDOrganization*) other)->priv; + + if (g_strcmp0 (a->name, b->name) == 0 && g_strcmp0 (a->title, b->title) == 0 && g_strcmp0 (a->department, b->department) == 0) + return 0; + return 1; +} + +static void +gdata_gd_organization_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_organization_init (GDataGDOrganization *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_ORGANIZATION, GDataGDOrganizationPrivate); +} + +static void +gdata_gd_organization_dispose (GObject *object) +{ + GDataGDOrganizationPrivate *priv = GDATA_GD_ORGANIZATION (object)->priv; + + if (priv->location != NULL) + g_object_unref (priv->location); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_organization_parent_class)->dispose (object); +} + +static void +gdata_gd_organization_finalize (GObject *object) +{ + GDataGDOrganizationPrivate *priv = GDATA_GD_ORGANIZATION (object)->priv; + + g_free (priv->name); + g_free (priv->title); + g_free (priv->relation_type); + g_free (priv->label); + g_free (priv->department); + g_free (priv->job_description); + g_free (priv->symbol); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_organization_parent_class)->finalize (object); +} + +static void +gdata_gd_organization_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDOrganizationPrivate *priv = GDATA_GD_ORGANIZATION (object)->priv; + + switch (property_id) { + case PROP_NAME: + g_value_set_string (value, priv->name); + break; + case PROP_TITLE: + g_value_set_string (value, priv->title); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + case PROP_IS_PRIMARY: + g_value_set_boolean (value, priv->is_primary); + break; + case PROP_DEPARTMENT: + g_value_set_string (value, priv->department); + break; + case PROP_JOB_DESCRIPTION: + g_value_set_string (value, priv->job_description); + break; + case PROP_SYMBOL: + g_value_set_string (value, priv->symbol); + break; + case PROP_LOCATION: + g_value_set_object (value, priv->location); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_organization_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDOrganization *self = GDATA_GD_ORGANIZATION (object); + + switch (property_id) { + case PROP_NAME: + gdata_gd_organization_set_name (self, g_value_get_string (value)); + break; + case PROP_TITLE: + gdata_gd_organization_set_title (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gd_organization_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gd_organization_set_label (self, g_value_get_string (value)); + break; + case PROP_IS_PRIMARY: + gdata_gd_organization_set_is_primary (self, g_value_get_boolean (value)); + break; + case PROP_DEPARTMENT: + gdata_gd_organization_set_department (self, g_value_get_string (value)); + break; + case PROP_JOB_DESCRIPTION: + gdata_gd_organization_set_job_description (self, g_value_get_string (value)); + break; + case PROP_SYMBOL: + gdata_gd_organization_set_symbol (self, g_value_get_string (value)); + break; + case PROP_LOCATION: + gdata_gd_organization_set_location (self, g_value_get_object (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *rel; + gboolean primary_bool; + GDataGDOrganizationPrivate *priv = GDATA_GD_ORGANIZATION (parsable)->priv; + + /* Is it the primary organisation? */ + if (gdata_parser_boolean_from_property (root_node, "primary", &primary_bool, 0, error) == FALSE) + return FALSE; + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + if (rel != NULL && *rel == '\0') { + xmlFree (rel); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) xmlGetProp (root_node, (xmlChar*) "label"); + priv->is_primary = primary_bool; + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataGDOrganizationPrivate *priv = GDATA_GD_ORGANIZATION (parsable)->priv; + + if (gdata_parser_is_namespace (node, "http://schemas.google.com/g/2005") == TRUE && ( + gdata_parser_string_from_element (node, "orgName", P_NO_DUPES, &(priv->name), &success, error) == TRUE || + gdata_parser_string_from_element (node, "orgTitle", P_NO_DUPES, &(priv->title), &success, error) == TRUE || + gdata_parser_string_from_element (node, "orgDepartment", P_NO_DUPES, &(priv->department), &success, error) == TRUE || + gdata_parser_string_from_element (node, "orgJobDescription", P_NO_DUPES, &(priv->job_description), &success, error) == TRUE || + gdata_parser_string_from_element (node, "orgSymbol", P_NO_DUPES, &(priv->symbol), &success, error) == TRUE || + gdata_parser_object_from_element (node, "where", P_REQUIRED | P_NO_DUPES, GDATA_TYPE_GD_WHERE, + &(priv->location), &success, error) == TRUE)) { + return success; + } else { + return GDATA_PARSABLE_CLASS (gdata_gd_organization_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDOrganizationPrivate *priv = GDATA_GD_ORGANIZATION (parsable)->priv; + + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + + if (priv->is_primary == TRUE) + g_string_append (xml_string, " primary='true'"); + else + g_string_append (xml_string, " primary='false'"); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDOrganizationPrivate *priv = GDATA_GD_ORGANIZATION (parsable)->priv; + + if (priv->name != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->name, ""); + if (priv->title != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->title, ""); + if (priv->department != NULL && *(priv->department) != '\0') + gdata_parser_string_append_escaped (xml_string, "", priv->department, ""); + if (priv->job_description != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->job_description, ""); + if (priv->symbol != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->symbol, ""); + if (priv->location != NULL) + _gdata_parsable_get_xml (GDATA_PARSABLE (priv->location), xml_string, FALSE); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_organization_new: + * @name: (allow-none): the name of the organization, or %NULL + * @title: (allow-none): the owner's title within the organization, or %NULL + * @relation_type: (allow-none): the relationship between the organization and its owner, or %NULL + * @label: (allow-none): a human-readable label for the organization, or %NULL + * @is_primary: %TRUE if this organization is its owner's primary organization, %FALSE otherwise + * + * Creates a new #GDataGDOrganization. More information is available in the GData specification. + * + * Return value: a new #GDataGDOrganization, or %NULL; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataGDOrganization * +gdata_gd_organization_new (const gchar *name, const gchar *title, const gchar *relation_type, const gchar *label, gboolean is_primary) +{ + g_return_val_if_fail (relation_type == NULL || *relation_type != '\0', NULL); + return g_object_new (GDATA_TYPE_GD_ORGANIZATION, "name", name, "title", title, "relation-type", relation_type, + "label", label, "is-primary", is_primary, NULL); +} + +/** + * gdata_gd_organization_get_name: + * @self: a #GDataGDOrganization + * + * Gets the #GDataGDOrganization:name property. + * + * Return value: the organization's name, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_organization_get_name (GDataGDOrganization *self) +{ + g_return_val_if_fail (GDATA_IS_GD_ORGANIZATION (self), NULL); + return self->priv->name; +} + +/** + * gdata_gd_organization_set_name: + * @self: a #GDataGDOrganization + * @name: (allow-none): the new name for the organization, or %NULL + * + * Sets the #GDataGDOrganization:name property to @name. + * + * Set @name to %NULL to unset the property in the organization. + * + * Since: 0.4.0 + */ +void +gdata_gd_organization_set_name (GDataGDOrganization *self, const gchar *name) +{ + g_return_if_fail (GDATA_IS_GD_ORGANIZATION (self)); + + g_free (self->priv->name); + self->priv->name = g_strdup (name); + g_object_notify (G_OBJECT (self), "name"); +} + +/** + * gdata_gd_organization_get_title: + * @self: a #GDataGDOrganization + * + * Gets the #GDataGDOrganization:title property. + * + * Return value: the organization's title, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_organization_get_title (GDataGDOrganization *self) +{ + g_return_val_if_fail (GDATA_IS_GD_ORGANIZATION (self), NULL); + return self->priv->title; +} + +/** + * gdata_gd_organization_set_title: + * @self: a #GDataGDOrganization + * @title: (allow-none): the new title for the organization, or %NULL + * + * Sets the #GDataGDOrganization:title property to @title. + * + * Set @title to %NULL to unset the property in the organization. + * + * Since: 0.4.0 + */ +void +gdata_gd_organization_set_title (GDataGDOrganization *self, const gchar *title) +{ + g_return_if_fail (GDATA_IS_GD_ORGANIZATION (self)); + + g_free (self->priv->title); + self->priv->title = g_strdup (title); + g_object_notify (G_OBJECT (self), "title"); +} + +/** + * gdata_gd_organization_get_relation_type: + * @self: a #GDataGDOrganization + * + * Gets the #GDataGDOrganization:relation-type property. + * + * Return value: the organization's relation type, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_organization_get_relation_type (GDataGDOrganization *self) +{ + g_return_val_if_fail (GDATA_IS_GD_ORGANIZATION (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gd_organization_set_relation_type: + * @self: a #GDataGDOrganization + * @relation_type: (allow-none): the new relation type for the organization, or %NULL + * + * Sets the #GDataGDOrganization:relation-type property to @relation_type. + * + * Set @relation_type to %NULL to unset the property in the organization. + * + * Since: 0.4.0 + */ +void +gdata_gd_organization_set_relation_type (GDataGDOrganization *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GD_ORGANIZATION (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gd_organization_get_label: + * @self: a #GDataGDOrganization + * + * Gets the #GDataGDOrganization:label property. + * + * Return value: the organization's label, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_organization_get_label (GDataGDOrganization *self) +{ + g_return_val_if_fail (GDATA_IS_GD_ORGANIZATION (self), NULL); + return self->priv->label; +} + +/** + * gdata_gd_organization_set_label: + * @self: a #GDataGDOrganization + * @label: (allow-none): the new label for the organization, or %NULL + * + * Sets the #GDataGDOrganization:label property to @label. + * + * Set @label to %NULL to unset the property in the organization. + * + * Since: 0.4.0 + */ +void +gdata_gd_organization_set_label (GDataGDOrganization *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GD_ORGANIZATION (self)); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} + +/** + * gdata_gd_organization_is_primary: + * @self: a #GDataGDOrganization + * + * Gets the #GDataGDOrganization:is-primary property. + * + * Return value: %TRUE if this is the primary organization, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_gd_organization_is_primary (GDataGDOrganization *self) +{ + g_return_val_if_fail (GDATA_IS_GD_ORGANIZATION (self), FALSE); + return self->priv->is_primary; +} + +/** + * gdata_gd_organization_set_is_primary: + * @self: a #GDataGDOrganization + * @is_primary: %TRUE if this is the primary organization, %FALSE otherwise + * + * Sets the #GDataGDOrganization:is-primary property to @is_primary. + * + * Since: 0.4.0 + */ +void +gdata_gd_organization_set_is_primary (GDataGDOrganization *self, gboolean is_primary) +{ + g_return_if_fail (GDATA_IS_GD_ORGANIZATION (self)); + + self->priv->is_primary = is_primary; + g_object_notify (G_OBJECT (self), "is-primary"); +} + +/** + * gdata_gd_organization_get_department: + * @self: a #GDataGDOrganization + * + * Gets the #GDataGDOrganization:department property. + * + * Return value: the department in which the person works in this organization, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_organization_get_department (GDataGDOrganization *self) +{ + g_return_val_if_fail (GDATA_IS_GD_ORGANIZATION (self), NULL); + return self->priv->department; +} + +/** + * gdata_gd_organization_set_department: + * @self: a #GDataGDOrganization + * @department: (allow-none): the new department for the person working in the organization, or %NULL + * + * Sets the #GDataGDOrganization:department property to @department. + * + * Set @department to %NULL to unset the property in the organization. + * + * Since: 0.5.0 + */ +void +gdata_gd_organization_set_department (GDataGDOrganization *self, const gchar *department) +{ + g_return_if_fail (GDATA_IS_GD_ORGANIZATION (self)); + + g_free (self->priv->department); + self->priv->department = g_strdup (department); + g_object_notify (G_OBJECT (self), "department"); +} + +/** + * gdata_gd_organization_get_job_description: + * @self: a #GDataGDOrganization + * + * Gets the #GDataGDOrganization:job-description property. + * + * Return value: the job description of the person in the organization, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_organization_get_job_description (GDataGDOrganization *self) +{ + g_return_val_if_fail (GDATA_IS_GD_ORGANIZATION (self), NULL); + return self->priv->job_description; +} + +/** + * gdata_gd_organization_set_job_description: + * @self: a #GDataGDOrganization + * @job_description: (allow-none): the new job description for the person in the organization, or %NULL + * + * Sets the #GDataGDOrganization:job-description property to @job_description. + * + * Set @job_description to %NULL to unset the property in the organization. + * + * Since: 0.5.0 + */ +void +gdata_gd_organization_set_job_description (GDataGDOrganization *self, const gchar *job_description) +{ + g_return_if_fail (GDATA_IS_GD_ORGANIZATION (self)); + + g_free (self->priv->job_description); + self->priv->job_description = g_strdup (job_description); + g_object_notify (G_OBJECT (self), "job-description"); +} + +/** + * gdata_gd_organization_get_symbol: + * @self: a #GDataGDOrganization + * + * Gets the #GDataGDOrganization:symbol property. + * + * Return value: the organization's stock symbol, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_organization_get_symbol (GDataGDOrganization *self) +{ + g_return_val_if_fail (GDATA_IS_GD_ORGANIZATION (self), NULL); + return self->priv->symbol; +} + +/** + * gdata_gd_organization_set_symbol: + * @self: a #GDataGDOrganization + * @symbol: (allow-none): the new stock symbol for the organization, or %NULL + * + * Sets the #GDataGDOrganization:symbol property to @symbol. + * + * Set @symbol to %NULL to unset the property in the organization. + * + * Since: 0.5.0 + */ +void +gdata_gd_organization_set_symbol (GDataGDOrganization *self, const gchar *symbol) +{ + g_return_if_fail (GDATA_IS_GD_ORGANIZATION (self)); + + g_free (self->priv->symbol); + self->priv->symbol = g_strdup (symbol); + g_object_notify (G_OBJECT (self), "symbol"); +} + +/** + * gdata_gd_organization_get_location: + * @self: a #GDataGDOrganization + * + * Gets the #GDataGDOrganization:location property. + * + * Return value: (transfer none): the organization's location, or %NULL + * + * Since: 0.6.0 + */ +GDataGDWhere * +gdata_gd_organization_get_location (GDataGDOrganization *self) +{ + g_return_val_if_fail (GDATA_IS_GD_ORGANIZATION (self), NULL); + return self->priv->location; +} + +/** + * gdata_gd_organization_set_location: + * @self: a #GDataGDOrganization + * @location: (allow-none): the new location for the organization, or %NULL + * + * Sets the #GDataGDOrganization:location property to @location. + * + * Set @location to %NULL to unset the property in the organization. + * + * Since: 0.6.0 + */ +void +gdata_gd_organization_set_location (GDataGDOrganization *self, GDataGDWhere *location) +{ + g_return_if_fail (GDATA_IS_GD_ORGANIZATION (self)); + g_return_if_fail (location == NULL || GDATA_IS_GD_WHERE (location)); + + if (self->priv->location != NULL) + g_object_unref (self->priv->location); + self->priv->location = (location != NULL) ? g_object_ref (location) : NULL; + g_object_notify (G_OBJECT (self), "location"); +} diff --git a/gdata/gd/gdata-gd-organization.h b/gdata/gd/gdata-gd-organization.h new file mode 100644 index 0000000..331d31a --- /dev/null +++ b/gdata/gd/gdata-gd-organization.h @@ -0,0 +1,121 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_ORGANIZATION_H +#define GDATA_GD_ORGANIZATION_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_GD_ORGANIZATION_WORK: + * + * The relation type URI for a work organization. + * + * Since: 0.7.0 + */ +#define GDATA_GD_ORGANIZATION_WORK "http://schemas.google.com/g/2005#work" + +/** + * GDATA_GD_ORGANIZATION_OTHER: + * + * The relation type URI for a miscellaneous organization. + * + * Since: 0.7.0 + */ +#define GDATA_GD_ORGANIZATION_OTHER "http://schemas.google.com/g/2005#other" + +#define GDATA_TYPE_GD_ORGANIZATION (gdata_gd_organization_get_type ()) +#define GDATA_GD_ORGANIZATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_ORGANIZATION, GDataGDOrganization)) +#define GDATA_GD_ORGANIZATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_ORGANIZATION, GDataGDOrganizationClass)) +#define GDATA_IS_GD_ORGANIZATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_ORGANIZATION)) +#define GDATA_IS_GD_ORGANIZATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_ORGANIZATION)) +#define GDATA_GD_ORGANIZATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_ORGANIZATION, GDataGDOrganizationClass)) + +typedef struct _GDataGDOrganizationPrivate GDataGDOrganizationPrivate; + +/** + * GDataGDOrganization: + * + * All the fields in the #GDataGDOrganization structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataParsable parent; + GDataGDOrganizationPrivate *priv; +} GDataGDOrganization; + +/** + * GDataGDOrganizationClass: + * + * All the fields in the #GDataGDOrganizationClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDOrganizationClass; + +GType gdata_gd_organization_get_type (void) G_GNUC_CONST; + +GDataGDOrganization *gdata_gd_organization_new (const gchar *name, const gchar *title, const gchar *relation_type, + const gchar *label, gboolean is_primary) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gd_organization_get_name (GDataGDOrganization *self) G_GNUC_PURE; +void gdata_gd_organization_set_name (GDataGDOrganization *self, const gchar *name); + +const gchar *gdata_gd_organization_get_title (GDataGDOrganization *self) G_GNUC_PURE; +void gdata_gd_organization_set_title (GDataGDOrganization *self, const gchar *title); + +const gchar *gdata_gd_organization_get_relation_type (GDataGDOrganization *self) G_GNUC_PURE; +void gdata_gd_organization_set_relation_type (GDataGDOrganization *self, const gchar *relation_type); + +const gchar *gdata_gd_organization_get_label (GDataGDOrganization *self) G_GNUC_PURE; +void gdata_gd_organization_set_label (GDataGDOrganization *self, const gchar *label); + +gboolean gdata_gd_organization_is_primary (GDataGDOrganization *self) G_GNUC_PURE; +void gdata_gd_organization_set_is_primary (GDataGDOrganization *self, gboolean is_primary); + +const gchar *gdata_gd_organization_get_department (GDataGDOrganization *self) G_GNUC_PURE; +void gdata_gd_organization_set_department (GDataGDOrganization *self, const gchar *department); + +const gchar *gdata_gd_organization_get_job_description (GDataGDOrganization *self) G_GNUC_PURE; +void gdata_gd_organization_set_job_description (GDataGDOrganization *self, const gchar *job_description); + +const gchar *gdata_gd_organization_get_symbol (GDataGDOrganization *self) G_GNUC_PURE; +void gdata_gd_organization_set_symbol (GDataGDOrganization *self, const gchar *symbol); + +GDataGDWhere *gdata_gd_organization_get_location (GDataGDOrganization *self) G_GNUC_PURE; +void gdata_gd_organization_set_location (GDataGDOrganization *self, GDataGDWhere *location); + +G_END_DECLS + +#endif /* !GDATA_GD_ORGANIZATION_H */ diff --git a/gdata/gd/gdata-gd-phone-number.c b/gdata/gd/gdata-gd-phone-number.c new file mode 100644 index 0000000..06c0be9 --- /dev/null +++ b/gdata/gd/gdata-gd-phone-number.c @@ -0,0 +1,562 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-phone-number + * @short_description: GData phone number element + * @stability: Stable + * @include: gdata/gd/gdata-gd-phone-number.h + * + * #GDataGDPhoneNumber represents a "phoneNumber" element from the + * GData specification. + * + * Since: 0.4.0 + */ + +#include +#include +#include + +#include "gdata-gd-phone-number.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gd_phone_number_comparable_init (GDataComparableIface *iface); +static void gdata_gd_phone_number_finalize (GObject *object); +static void gdata_gd_phone_number_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_phone_number_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDPhoneNumberPrivate { + gchar *number; + gchar *uri; + gchar *relation_type; + gchar *label; + gboolean is_primary; +}; + +enum { + PROP_NUMBER = 1, + PROP_URI, + PROP_RELATION_TYPE, + PROP_LABEL, + PROP_IS_PRIMARY +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDPhoneNumber, gdata_gd_phone_number, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_phone_number_comparable_init)) + +static void +gdata_gd_phone_number_class_init (GDataGDPhoneNumberClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDPhoneNumberPrivate)); + + gobject_class->get_property = gdata_gd_phone_number_get_property; + gobject_class->set_property = gdata_gd_phone_number_set_property; + gobject_class->finalize = gdata_gd_phone_number_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "phoneNumber"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDPhoneNumber:number: + * + * Human-readable phone number; may be in any telephone number format. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_NUMBER, + g_param_spec_string ("number", + "Number", "Human-readable phone number; may be in any telephone number format.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPhoneNumber:uri: + * + * An optional "tel URI" used to represent the number in a formal way. Useful for programmatic access, such as a VoIP/PSTN bridge. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", + "URI", "An optional \"tel URI\" used to represent the number in a formal way.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPhoneNumber:relation-type: + * + * A programmatic value that identifies the type of phone number. For example: %GDATA_GD_PHONE_NUMBER_WORK or %GDATA_GD_PHONE_NUMBER_PAGER. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of phone number.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPhoneNumber:label: + * + * A simple string value used to name this phone number. It allows UIs to display a label such as "Mobile", "Home", "Work", etc. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A simple string value used to name this phone number.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPhoneNumber:is-primary: + * + * Indicates which phone number out of a group is primary. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_PRIMARY, + g_param_spec_boolean ("is-primary", + "Primary?", "Indicates which phone number out of a group is primary.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGDPhoneNumber *a = (GDataGDPhoneNumber*) self, *b = (GDataGDPhoneNumber*) other; + gint number_comparison, uri_comparison; + + number_comparison = g_strcmp0 (a->priv->number, b->priv->number); + uri_comparison = g_strcmp0 (a->priv->uri, b->priv->uri); + + /* NULL URIs should not compare equal. */ + if (a->priv->uri == NULL && b->priv->uri == NULL) { + uri_comparison = 1; + } + + /* If the numbers or the URIs are equal, the objects are equal. */ + if (number_comparison == 0 || uri_comparison == 0) { + return 0; + } + + return number_comparison; +} + +static void +gdata_gd_phone_number_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_phone_number_init (GDataGDPhoneNumber *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_PHONE_NUMBER, GDataGDPhoneNumberPrivate); +} + +static void +gdata_gd_phone_number_finalize (GObject *object) +{ + GDataGDPhoneNumberPrivate *priv = GDATA_GD_PHONE_NUMBER (object)->priv; + + g_free (priv->number); + g_free (priv->uri); + g_free (priv->relation_type); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_phone_number_parent_class)->finalize (object); +} + +static void +gdata_gd_phone_number_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDPhoneNumberPrivate *priv = GDATA_GD_PHONE_NUMBER (object)->priv; + + switch (property_id) { + case PROP_NUMBER: + g_value_set_string (value, priv->number); + break; + case PROP_URI: + g_value_set_string (value, priv->uri); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + case PROP_IS_PRIMARY: + g_value_set_boolean (value, priv->is_primary); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_phone_number_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDPhoneNumber *self = GDATA_GD_PHONE_NUMBER (object); + + switch (property_id) { + case PROP_NUMBER: + gdata_gd_phone_number_set_number (self, g_value_get_string (value)); + break; + case PROP_URI: + gdata_gd_phone_number_set_uri (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gd_phone_number_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gd_phone_number_set_label (self, g_value_get_string (value)); + break; + case PROP_IS_PRIMARY: + gdata_gd_phone_number_set_is_primary (self, g_value_get_boolean (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *number, *rel; + gboolean primary_bool; + GDataGDPhoneNumberPrivate *priv = GDATA_GD_PHONE_NUMBER (parsable)->priv; + + /* Is it the primary phone number? */ + if (gdata_parser_boolean_from_property (root_node, "primary", &primary_bool, 0, error) == FALSE) + return FALSE; + + number = xmlNodeListGetString (doc, root_node->children, TRUE); + if (number == NULL || *number == '\0') { + xmlFree (number); + return gdata_parser_error_required_content_missing (root_node, error); + } + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + if (rel != NULL && *rel == '\0') { + xmlFree (rel); + xmlFree (number); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + gdata_gd_phone_number_set_number (GDATA_GD_PHONE_NUMBER (parsable), (gchar*) number); + priv->uri = (gchar*) xmlGetProp (root_node, (xmlChar*) "uri"); + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) xmlGetProp (root_node, (xmlChar*) "label"); + priv->is_primary = primary_bool; + + xmlFree (number); + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + /* Textual content's handled in pre_parse_xml */ + if (node->type != XML_ELEMENT_NODE) + return TRUE; + + return GDATA_PARSABLE_CLASS (gdata_gd_phone_number_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDPhoneNumberPrivate *priv = GDATA_GD_PHONE_NUMBER (parsable)->priv; + + if (priv->uri != NULL) + gdata_parser_string_append_escaped (xml_string, " uri='", priv->uri, "'"); + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + + if (priv->is_primary == TRUE) + g_string_append (xml_string, " primary='true'"); + else + g_string_append (xml_string, " primary='false'"); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + gdata_parser_string_append_escaped (xml_string, NULL, GDATA_GD_PHONE_NUMBER (parsable)->priv->number, NULL); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_phone_number_new: + * @number: the phone number, in human-readable format + * @relation_type: (allow-none): the relationship between the phone number and its owner, or %NULL + * @label: (allow-none): a human-readable label for the phone number, or %NULL + * @uri: (allow-none): a "tel URI" to represent the number formally (see + * RFC 3966), or %NULL + * @is_primary: %TRUE if this phone number is its owner's primary number, %FALSE otherwise + * + * Creates a new #GDataGDPhoneNumber. More information is available in the GData specification. + * + * Return value: a new #GDataGDPhoneNumber, or %NULL; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataGDPhoneNumber * +gdata_gd_phone_number_new (const gchar *number, const gchar *relation_type, const gchar *label, const gchar *uri, gboolean is_primary) +{ + g_return_val_if_fail (number != NULL && *number != '\0', NULL); + g_return_val_if_fail (relation_type == NULL || *relation_type != '\0', NULL); + return g_object_new (GDATA_TYPE_GD_PHONE_NUMBER, "number", number, "uri", uri, "relation-type", relation_type, + "label", label, "is-primary", is_primary, NULL); +} + +/** + * gdata_gd_phone_number_get_number: + * @self: a #GDataGDPhoneNumber + * + * Gets the #GDataGDPhoneNumber:number property. + * + * Return value: the phone number itself + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_phone_number_get_number (GDataGDPhoneNumber *self) +{ + g_return_val_if_fail (GDATA_IS_GD_PHONE_NUMBER (self), NULL); + return self->priv->number; +} + +/** + * gdata_gd_phone_number_set_number: + * @self: a #GDataGDPhoneNumber + * @number: the new phone number + * + * Sets the #GDataGDPhoneNumber:number property to @number. + * + * Since: 0.4.0 + */ +void +gdata_gd_phone_number_set_number (GDataGDPhoneNumber *self, const gchar *number) +{ + g_return_if_fail (GDATA_IS_GD_PHONE_NUMBER (self)); + g_return_if_fail (number != NULL && *number != '\0'); + + /* Trim leading and trailing whitespace from the number. + * See here: http://code.google.com/apis/gdata/docs/1.0/elements.html#gdPhoneNumber */ + g_free (self->priv->number); + self->priv->number = gdata_parser_utf8_trim_whitespace (number); + g_object_notify (G_OBJECT (self), "number"); +} + +/** + * gdata_gd_phone_number_get_uri: + * @self: a #GDataGDPhoneNumber + * + * Gets the #GDataGDPhoneNumber:uri property. + * + * Return value: the phone number's URI, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_phone_number_get_uri (GDataGDPhoneNumber *self) +{ + g_return_val_if_fail (GDATA_IS_GD_PHONE_NUMBER (self), NULL); + return self->priv->uri; +} + +/** + * gdata_gd_phone_number_set_uri: + * @self: a #GDataGDPhoneNumber + * @uri: (allow-none): the new URI for the phone number, or %NULL + * + * Sets the #GDataGDPhoneNumber:uri property to @uri. + * + * Set @uri to %NULL to unset the property in the phone number. + * + * Since: 0.4.0 + */ +void +gdata_gd_phone_number_set_uri (GDataGDPhoneNumber *self, const gchar *uri) +{ + g_return_if_fail (GDATA_IS_GD_PHONE_NUMBER (self)); + + g_free (self->priv->uri); + self->priv->uri = g_strdup (uri); + g_object_notify (G_OBJECT (self), "uri"); +} + +/** + * gdata_gd_phone_number_get_relation_type: + * @self: a #GDataGDPhoneNumber + * + * Gets the #GDataGDPhoneNumber:relation-type property. + * + * Return value: the phone number's relation type, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_phone_number_get_relation_type (GDataGDPhoneNumber *self) +{ + g_return_val_if_fail (GDATA_IS_GD_PHONE_NUMBER (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gd_phone_number_set_relation_type: + * @self: a #GDataGDPhoneNumber + * @relation_type: (allow-none): the new relation type for the phone number, or %NULL + * + * Sets the #GDataGDPhoneNumber:relation-type property to @relation_type. + * + * Set @relation_type to %NULL to unset the property in the phone number. + * + * Since: 0.4.0 + */ +void +gdata_gd_phone_number_set_relation_type (GDataGDPhoneNumber *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GD_PHONE_NUMBER (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gd_phone_number_get_label: + * @self: a #GDataGDPhoneNumber + * + * Gets the #GDataGDPhoneNumber:label property. + * + * Return value: the phone number's label, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_phone_number_get_label (GDataGDPhoneNumber *self) +{ + g_return_val_if_fail (GDATA_IS_GD_PHONE_NUMBER (self), NULL); + return self->priv->label; +} + +/** + * gdata_gd_phone_number_set_label: + * @self: a #GDataGDPhoneNumber + * @label: (allow-none): the new label for the phone number, or %NULL + * + * Sets the #GDataGDPhoneNumber:label property to @label. + * + * Set @label to %NULL to unset the property in the phone number. + * + * Since: 0.4.0 + */ +void +gdata_gd_phone_number_set_label (GDataGDPhoneNumber *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GD_PHONE_NUMBER (self)); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} + +/** + * gdata_gd_phone_number_is_primary: + * @self: a #GDataGDPhoneNumber + * + * Gets the #GDataGDPhoneNumber:is-primary property. + * + * Return value: %TRUE if this is the primary phone number, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_gd_phone_number_is_primary (GDataGDPhoneNumber *self) +{ + g_return_val_if_fail (GDATA_IS_GD_PHONE_NUMBER (self), FALSE); + return self->priv->is_primary; +} + +/** + * gdata_gd_phone_number_set_is_primary: + * @self: a #GDataGDPhoneNumber + * @is_primary: %TRUE if this is the primary phone number, %FALSE otherwise + * + * Sets the #GDataGDPhoneNumber:is-primary property to @is_primary. + * + * Since: 0.4.0 + */ +void +gdata_gd_phone_number_set_is_primary (GDataGDPhoneNumber *self, gboolean is_primary) +{ + g_return_if_fail (GDATA_IS_GD_PHONE_NUMBER (self)); + + self->priv->is_primary = is_primary; + g_object_notify (G_OBJECT (self), "is-primary"); +} diff --git a/gdata/gd/gdata-gd-phone-number.h b/gdata/gd/gdata-gd-phone-number.h new file mode 100644 index 0000000..4a2995f --- /dev/null +++ b/gdata/gd/gdata-gd-phone-number.h @@ -0,0 +1,270 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_PHONE_NUMBER_H +#define GDATA_GD_PHONE_NUMBER_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GD_PHONE_NUMBER_ASSISTANT: + * + * The relation type URI for the phone number of an assistant. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_ASSISTANT "http://schemas.google.com/g/2005#assistant" + +/** + * GDATA_GD_PHONE_NUMBER_CALLBACK: + * + * The relation type URI for the phone number of a callback service. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_CALLBACK "http://schemas.google.com/g/2005#callback" + +/** + * GDATA_GD_PHONE_NUMBER_CAR: + * + * The relation type URI for the phone number of a car phone. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_CAR "http://schemas.google.com/g/2005#car" + +/** + * GDATA_GD_PHONE_NUMBER_COMPANY_MAIN: + * + * The relation type URI for the main phone number of a company. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_COMPANY_MAIN "http://schemas.google.com/g/2005#company_main" + +/** + * GDATA_GD_PHONE_NUMBER_FAX: + * + * The relation type URI for the phone number of a fax machine. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_FAX "http://schemas.google.com/g/2005#fax" + +/** + * GDATA_GD_PHONE_NUMBER_HOME: + * + * The relation type URI for a home phone number. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_HOME "http://schemas.google.com/g/2005#home" + +/** + * GDATA_GD_PHONE_NUMBER_HOME_FAX: + * + * The relation type URI for the phone number of a home fax machine. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_HOME_FAX "http://schemas.google.com/g/2005#home_fax" + +/** + * GDATA_GD_PHONE_NUMBER_ISDN: + * + * The relation type URI for the phone number of an ISDN phone. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_ISDN "http://schemas.google.com/g/2005#isdn" + +/** + * GDATA_GD_PHONE_NUMBER_MAIN: + * + * The relation type URI for the main phone number of a person. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_MAIN "http://schemas.google.com/g/2005#main" + +/** + * GDATA_GD_PHONE_NUMBER_MOBILE: + * + * The relation type URI for the phone number of a mobile phone. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_MOBILE "http://schemas.google.com/g/2005#mobile" + +/** + * GDATA_GD_PHONE_NUMBER_OTHER: + * + * The relation type URI for a miscellaneous phone number. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_OTHER "http://schemas.google.com/g/2005#other" + +/** + * GDATA_GD_PHONE_NUMBER_OTHER_FAX: + * + * The relation type URI for a miscellaneous fax machine's phone number. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_OTHER_FAX "http://schemas.google.com/g/2005#other_fax" + +/** + * GDATA_GD_PHONE_NUMBER_PAGER: + * + * The relation type URI for the phone number of a pager. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_PAGER "http://schemas.google.com/g/2005#pager" + +/** + * GDATA_GD_PHONE_NUMBER_RADIO: + * + * The relation type URI for the phone number of a radio phone. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_RADIO "http://schemas.google.com/g/2005#radio" + +/** + * GDATA_GD_PHONE_NUMBER_TELEX: + * + * The relation type URI for the phone number of a telex machine. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_TELEX "http://schemas.google.com/g/2005#telex" + +/** + * GDATA_GD_PHONE_NUMBER_TTY_TDD: + * + * The relation type URI for the phone number of a TTY TTD. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_TTY_TDD "http://schemas.google.com/g/2005#tty_tdd" + +/** + * GDATA_GD_PHONE_NUMBER_WORK: + * + * The relation type URI for the phone number of a work place. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_WORK "http://schemas.google.com/g/2005#work" + +/** + * GDATA_GD_PHONE_NUMBER_WORK_FAX: + * + * The relation type URI for the phone number of a work fax machine. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_WORK_FAX "http://schemas.google.com/g/2005#work_fax" + +/** + * GDATA_GD_PHONE_NUMBER_WORK_MOBILE: + * + * The relation type URI for the phone number of a work mobile phone. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_WORK_MOBILE "http://schemas.google.com/g/2005#work_mobile" + +/** + * GDATA_GD_PHONE_NUMBER_WORK_PAGER: + * + * The relation type URI for the phone number of a work pager. + * + * Since: 0.7.0 + */ +#define GDATA_GD_PHONE_NUMBER_WORK_PAGER "http://schemas.google.com/g/2005#work_pager" + +#define GDATA_TYPE_GD_PHONE_NUMBER (gdata_gd_phone_number_get_type ()) +#define GDATA_GD_PHONE_NUMBER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_PHONE_NUMBER, GDataGDPhoneNumber)) +#define GDATA_GD_PHONE_NUMBER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_PHONE_NUMBER, GDataGDPhoneNumberClass)) +#define GDATA_IS_GD_PHONE_NUMBER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_PHONE_NUMBER)) +#define GDATA_IS_GD_PHONE_NUMBER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_PHONE_NUMBER)) +#define GDATA_GD_PHONE_NUMBER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_PHONE_NUMBER, GDataGDPhoneNumberClass)) + +typedef struct _GDataGDPhoneNumberPrivate GDataGDPhoneNumberPrivate; + +/** + * GDataGDPhoneNumber: + * + * All the fields in the #GDataGDPhoneNumber structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataParsable parent; + GDataGDPhoneNumberPrivate *priv; +} GDataGDPhoneNumber; + +/** + * GDataGDPhoneNumberClass: + * + * All the fields in the #GDataGDPhoneNumberClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDPhoneNumberClass; + +GType gdata_gd_phone_number_get_type (void) G_GNUC_CONST; + +GDataGDPhoneNumber *gdata_gd_phone_number_new (const gchar *number, const gchar *relation_type, const gchar *label, const gchar *uri, + gboolean is_primary) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gd_phone_number_get_number (GDataGDPhoneNumber *self) G_GNUC_PURE; +void gdata_gd_phone_number_set_number (GDataGDPhoneNumber *self, const gchar *number); + +const gchar *gdata_gd_phone_number_get_uri (GDataGDPhoneNumber *self) G_GNUC_PURE; +void gdata_gd_phone_number_set_uri (GDataGDPhoneNumber *self, const gchar *uri); + +const gchar *gdata_gd_phone_number_get_relation_type (GDataGDPhoneNumber *self) G_GNUC_PURE; +void gdata_gd_phone_number_set_relation_type (GDataGDPhoneNumber *self, const gchar *relation_type); + +const gchar *gdata_gd_phone_number_get_label (GDataGDPhoneNumber *self) G_GNUC_PURE; +void gdata_gd_phone_number_set_label (GDataGDPhoneNumber *self, const gchar *label); + +gboolean gdata_gd_phone_number_is_primary (GDataGDPhoneNumber *self) G_GNUC_PURE; +void gdata_gd_phone_number_set_is_primary (GDataGDPhoneNumber *self, gboolean is_primary); + +G_END_DECLS + +#endif /* !GDATA_GD_PHONE_NUMBER_H */ diff --git a/gdata/gd/gdata-gd-postal-address.c b/gdata/gd/gdata-gd-postal-address.c new file mode 100644 index 0000000..7adc68d --- /dev/null +++ b/gdata/gd/gdata-gd-postal-address.c @@ -0,0 +1,1342 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-postal-address + * @short_description: GData postal address element + * @stability: Stable + * @include: gdata/gd/gdata-gd-postal-address.h + * + * #GDataGDPostalAddress represents a "structuredPostalAddress" element from the + * GData specification. + * Note that it does not represent a simple "postalAddress" element, as "structuredPostalAddress" is now used wherever possible in the GData API. + * + * Since: 0.4.0 + */ + +#include +#include +#include + +#include "gdata-gd-postal-address.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gd_postal_address_comparable_init (GDataComparableIface *iface); +static void gdata_gd_postal_address_finalize (GObject *object); +static void gdata_gd_postal_address_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_postal_address_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDPostalAddressPrivate { + gchar *formatted_address; + gchar *relation_type; + gchar *label; + gboolean is_primary; + gchar *mail_class; + gchar *usage; + gchar *agent; + gchar *house_name; + gchar *street; + gchar *po_box; + gchar *neighborhood; + gchar *city; + gchar *subregion; + gchar *region; + gchar *postcode; + gchar *country; + gchar *country_code; +}; + +enum { + PROP_FORMATTED_ADDRESS = 1, + PROP_RELATION_TYPE, + PROP_LABEL, + PROP_IS_PRIMARY, + PROP_MAIL_CLASS, + PROP_USAGE, + PROP_AGENT, + PROP_HOUSE_NAME, + PROP_STREET, + PROP_PO_BOX, + PROP_NEIGHBORHOOD, + PROP_CITY, + PROP_SUBREGION, + PROP_REGION, + PROP_POSTCODE, + PROP_COUNTRY, + PROP_COUNTRY_CODE +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDPostalAddress, gdata_gd_postal_address, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_postal_address_comparable_init)) + +static void +gdata_gd_postal_address_class_init (GDataGDPostalAddressClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDPostalAddressPrivate)); + + gobject_class->get_property = gdata_gd_postal_address_get_property; + gobject_class->set_property = gdata_gd_postal_address_set_property; + gobject_class->finalize = gdata_gd_postal_address_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "structuredPostalAddress"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDPostalAddress:address: + * + * The postal address itself, formatted and unstructured. It is preferred to use the other, structured properties rather than this one. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_FORMATTED_ADDRESS, + g_param_spec_string ("address", + "Address", "The postal address itself.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:relation-type: + * + * A programmatic value that identifies the type of postal address. For example: %GDATA_GD_POSTAL_ADDRESS_WORK or + * %GDATA_GD_POSTAL_ADDRESS_OTHER. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "A programmatic value that identifies the type of postal address.", + GDATA_GD_POSTAL_ADDRESS_WORK, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:label: + * + * A simple string value used to name this postal address. It allows UIs to display a label such as "Work", "Personal", "Preferred", etc. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A simple string value used to name this postal address.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:is-primary: + * + * Indicates which postal address out of a group is primary. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_PRIMARY, + g_param_spec_boolean ("is-primary", + "Primary?", "Indicates which postal address out of a group is primary.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:mail-class: + * + * Classes of mail accepted at this address. For example: %GDATA_GD_MAIL_CLASS_LETTERS or %GDATA_GD_MAIL_CLASS_BOTH. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_MAIL_CLASS, + g_param_spec_string ("mail-class", + "Mail class", "Classes of mail accepted at this address.", + GDATA_GD_MAIL_CLASS_BOTH, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:usage: + * + * The context in which this addess can be used. For example: %GDATA_GD_ADDRESS_USAGE_GENERAL or %GDATA_GD_ADDRESS_USAGE_LOCAL. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_USAGE, + g_param_spec_string ("usage", + "Usage", "The context in which this addess can be used.", + GDATA_GD_ADDRESS_USAGE_GENERAL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:agent: + * + * The agent who actually receives the mail. Used in work addresses. Also for "in care of" or "c/o". + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_AGENT, + g_param_spec_string ("agent", + "Agent", "The agent who actually receives the mail.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:house-name: + * + * Used in places where houses or buildings have names (and not necessarily numbers). + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_HOUSE_NAME, + g_param_spec_string ("house-name", + "House name", "Used in places where houses or buildings have names (and not numbers).", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:street: + * + * Can be street, avenue, road, etc. This element also includes the house number and room/apartment/flat/floor number. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_STREET, + g_param_spec_string ("street", + "Street", "Can be street, avenue, road, etc.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:po-box: + * + * Covers actual P.O. boxes, drawers, locked bags, etc. This is usually but not always mutually exclusive with #GDataGDPostalAddress:street. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_PO_BOX, + g_param_spec_string ("po-box", + "PO box", "Covers actual P.O. boxes, drawers, locked bags, etc.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:neighborhood: + * + * This is used to disambiguate a street address when a city contains more than one street with the same name, or to specify a small place + * whose mail is routed through a larger postal town. In China it could be a county or a minor city. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_NEIGHBORHOOD, + g_param_spec_string ("neighborhood", + "Neighborhood", "This is used to disambiguate a street address.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:city: + * + * Can be city, village, town, borough, etc. This is the postal town and not necessarily the place of residence or place of business. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_CITY, + g_param_spec_string ("city", + "City", "Can be city, village, town, borough, etc.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:subregion: + * + * Handles administrative districts such as U.S. or U.K. counties that are not used for mail addressing purposes. + * Subregion is not intended for delivery addresses. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_SUBREGION, + g_param_spec_string ("subregion", + "Subregion", "Handles administrative districts such as U.S. or U.K. counties.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:region: + * + * A state, province, county (in Ireland), Land (in Germany), departement (in France), etc. + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_REGION, + g_param_spec_string ("region", + "Region", "A state, province, county, Land, departement, etc.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:postcode: + * + * Postal code. Usually country-wide, but sometimes specific to the city (e.g. "2" in "Dublin 2, Ireland" addresses). + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_POSTCODE, + g_param_spec_string ("postcode", + "Postcode", "Postal code.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:country: + * + * The name of the country. Since this is paired with #GDataGDPostalAddress:country-code, they must both be set with + * gdata_gd_postal_address_set_country(). + * + * For more information, see the + * GData specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_COUNTRY, + g_param_spec_string ("country", + "Country", "The name of the country.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDPostalAddress:country-code: + * + * The ISO 3166-1 alpha-2 country code for the country in #GDataGDPostalAddress:country. Since this is paired with + * #GDataGDPostalAddress:country, they must both be set with gdata_gd_postal_address_set_country(). + * + * For more information, see the + * GData specification + * or ISO 3166-1 alpha-2. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_COUNTRY_CODE, + g_param_spec_string ("country-code", + "Country code", "The ISO 3166-1 alpha-2 country code for the country.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGDPostalAddressPrivate *a = ((GDataGDPostalAddress*) self)->priv, *b = ((GDataGDPostalAddress*) other)->priv; + + if (g_strcmp0 (a->street, b->street) == 0 && g_strcmp0 (a->po_box, b->po_box) == 0 && + g_strcmp0 (a->city, b->city) == 0 && g_strcmp0 (a->postcode, b->postcode) == 0) + return 0; + return 1; +} + +static void +gdata_gd_postal_address_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_postal_address_init (GDataGDPostalAddress *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_POSTAL_ADDRESS, GDataGDPostalAddressPrivate); +} + +static void +gdata_gd_postal_address_finalize (GObject *object) +{ + GDataGDPostalAddressPrivate *priv = GDATA_GD_POSTAL_ADDRESS (object)->priv; + + g_free (priv->formatted_address); + g_free (priv->relation_type); + g_free (priv->label); + g_free (priv->mail_class); + g_free (priv->usage); + g_free (priv->agent); + g_free (priv->house_name); + g_free (priv->street); + g_free (priv->po_box); + g_free (priv->neighborhood); + g_free (priv->city); + g_free (priv->subregion); + g_free (priv->region); + g_free (priv->postcode); + g_free (priv->country); + g_free (priv->country_code); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_postal_address_parent_class)->finalize (object); +} + +static void +gdata_gd_postal_address_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDPostalAddressPrivate *priv = GDATA_GD_POSTAL_ADDRESS (object)->priv; + + switch (property_id) { + case PROP_FORMATTED_ADDRESS: + g_value_set_string (value, priv->formatted_address); + break; + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + case PROP_IS_PRIMARY: + g_value_set_boolean (value, priv->is_primary); + break; + case PROP_MAIL_CLASS: + g_value_set_string (value, priv->mail_class); + break; + case PROP_USAGE: + g_value_set_string (value, priv->usage); + break; + case PROP_AGENT: + g_value_set_string (value, priv->agent); + break; + case PROP_HOUSE_NAME: + g_value_set_string (value, priv->house_name); + break; + case PROP_STREET: + g_value_set_string (value, priv->street); + break; + case PROP_PO_BOX: + g_value_set_string (value, priv->po_box); + break; + case PROP_NEIGHBORHOOD: + g_value_set_string (value, priv->neighborhood); + break; + case PROP_CITY: + g_value_set_string (value, priv->city); + break; + case PROP_SUBREGION: + g_value_set_string (value, priv->subregion); + break; + case PROP_REGION: + g_value_set_string (value, priv->region); + break; + case PROP_POSTCODE: + g_value_set_string (value, priv->postcode); + break; + case PROP_COUNTRY: + g_value_set_string (value, priv->country); + break; + case PROP_COUNTRY_CODE: + g_value_set_string (value, priv->country_code); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_postal_address_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDPostalAddress *self = GDATA_GD_POSTAL_ADDRESS (object); + + switch (property_id) { + case PROP_FORMATTED_ADDRESS: + gdata_gd_postal_address_set_address (self, g_value_get_string (value)); + break; + case PROP_RELATION_TYPE: + gdata_gd_postal_address_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gd_postal_address_set_label (self, g_value_get_string (value)); + break; + case PROP_IS_PRIMARY: + gdata_gd_postal_address_set_is_primary (self, g_value_get_boolean (value)); + break; + case PROP_MAIL_CLASS: + gdata_gd_postal_address_set_mail_class (self, g_value_get_string (value)); + break; + case PROP_USAGE: + gdata_gd_postal_address_set_usage (self, g_value_get_string (value)); + break; + case PROP_AGENT: + gdata_gd_postal_address_set_agent (self, g_value_get_string (value)); + break; + case PROP_HOUSE_NAME: + gdata_gd_postal_address_set_house_name (self, g_value_get_string (value)); + break; + case PROP_STREET: + gdata_gd_postal_address_set_street (self, g_value_get_string (value)); + break; + case PROP_PO_BOX: + gdata_gd_postal_address_set_po_box (self, g_value_get_string (value)); + break; + case PROP_NEIGHBORHOOD: + gdata_gd_postal_address_set_neighborhood (self, g_value_get_string (value)); + break; + case PROP_CITY: + gdata_gd_postal_address_set_city (self, g_value_get_string (value)); + break; + case PROP_SUBREGION: + gdata_gd_postal_address_set_subregion (self, g_value_get_string (value)); + break; + case PROP_REGION: + gdata_gd_postal_address_set_region (self, g_value_get_string (value)); + break; + case PROP_POSTCODE: + gdata_gd_postal_address_set_postcode (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *rel; + gboolean primary_bool; + GDataGDPostalAddressPrivate *priv = GDATA_GD_POSTAL_ADDRESS (parsable)->priv; + + /* Is it the primary postal address? */ + if (gdata_parser_boolean_from_property (root_node, "primary", &primary_bool, 0, error) == FALSE) + return FALSE; + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + if (rel != NULL && *rel == '\0') { + xmlFree (rel); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + priv->relation_type = (gchar*) rel; + priv->label = (gchar*) xmlGetProp (root_node, (xmlChar*) "label"); + priv->mail_class = (gchar*) xmlGetProp (root_node, (xmlChar*) "mailClass"); + priv->usage = (gchar*) xmlGetProp (root_node, (xmlChar*) "usage"); + priv->is_primary = primary_bool; + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataGDPostalAddressPrivate *priv = GDATA_GD_POSTAL_ADDRESS (parsable)->priv; + + if (gdata_parser_is_namespace (node, "http://schemas.google.com/g/2005") == TRUE) { + if (gdata_parser_string_from_element (node, "agent", P_NO_DUPES, &(priv->agent), &success, error) == TRUE || + gdata_parser_string_from_element (node, "housename", P_NO_DUPES, &(priv->house_name), &success, error) == TRUE || + gdata_parser_string_from_element (node, "pobox", P_NO_DUPES, &(priv->po_box), &success, error) == TRUE || + gdata_parser_string_from_element (node, "street", P_NO_DUPES, &(priv->street), &success, error) == TRUE || + gdata_parser_string_from_element (node, "neighborhood", P_NO_DUPES, &(priv->neighborhood), &success, error) == TRUE || + gdata_parser_string_from_element (node, "city", P_NO_DUPES, &(priv->city), &success, error) == TRUE || + gdata_parser_string_from_element (node, "subregion", P_NO_DUPES, &(priv->subregion), &success, error) == TRUE || + gdata_parser_string_from_element (node, "region", P_NO_DUPES, &(priv->region), &success, error) == TRUE || + gdata_parser_string_from_element (node, "postcode", P_NO_DUPES, &(priv->postcode), &success, error) == TRUE || + gdata_parser_string_from_element (node, "formattedAddress", P_NO_DUPES, &(priv->formatted_address), &success, error) == TRUE) { + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "country") == 0) { + /* gd:country */ + priv->country_code = (gchar*) xmlGetProp (node, (xmlChar*) "code"); + priv->country = (gchar*) xmlNodeListGetString (doc, node->children, TRUE); + + return TRUE; + } + } + + return GDATA_PARSABLE_CLASS (gdata_gd_postal_address_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDPostalAddressPrivate *priv = GDATA_GD_POSTAL_ADDRESS (parsable)->priv; + + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + if (priv->mail_class != NULL) + gdata_parser_string_append_escaped (xml_string, " mailClass='", priv->mail_class, "'"); + if (priv->usage != NULL) + gdata_parser_string_append_escaped (xml_string, " usage='", priv->usage, "'"); + + if (priv->is_primary == TRUE) + g_string_append (xml_string, " primary='true'"); + else + g_string_append (xml_string, " primary='false'"); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDPostalAddressPrivate *priv = GDATA_GD_POSTAL_ADDRESS (parsable)->priv; + +#define OUTPUT_STRING_ELEMENT(E,F) \ + if (priv->F != NULL) \ + gdata_parser_string_append_escaped (xml_string, "", priv->F, ""); + + OUTPUT_STRING_ELEMENT ("agent", agent) + OUTPUT_STRING_ELEMENT ("housename", house_name) + OUTPUT_STRING_ELEMENT ("street", street) + OUTPUT_STRING_ELEMENT ("pobox", po_box) + OUTPUT_STRING_ELEMENT ("neighborhood", neighborhood) + OUTPUT_STRING_ELEMENT ("city", city) + OUTPUT_STRING_ELEMENT ("subregion", subregion) + OUTPUT_STRING_ELEMENT ("region", region) + OUTPUT_STRING_ELEMENT ("postcode", postcode) + + if (priv->country != NULL) { + if (priv->country_code != NULL) + gdata_parser_string_append_escaped (xml_string, ""); + else + g_string_append (xml_string, ""); + gdata_parser_string_append_escaped (xml_string, NULL, priv->country, ""); + } + + OUTPUT_STRING_ELEMENT ("formattedAddress", formatted_address) + +#undef OUTPUT_STRING_ELEMENT +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_postal_address_new: + * @relation_type: (allow-none): the relationship between the address and its owner, or %NULL + * @label: (allow-none): a human-readable label for the address, or %NULL + * @is_primary: %TRUE if this phone number is its owner's primary number, %FALSE otherwise + * + * Creates a new #GDataGDPostalAddress. More information is available in the GData specification. + * + * Return value: a new #GDataGDPostalAddress, or %NULL; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataGDPostalAddress * +gdata_gd_postal_address_new (const gchar *relation_type, const gchar *label, gboolean is_primary) +{ + g_return_val_if_fail (relation_type == NULL || *relation_type != '\0', NULL); + return g_object_new (GDATA_TYPE_GD_POSTAL_ADDRESS, "relation-type", relation_type, "label", label, "is-primary", is_primary, NULL); +} + +/** + * gdata_gd_postal_address_get_address: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:address property. + * + * Return value: the postal address itself, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_postal_address_get_address (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->formatted_address; +} + +/** + * gdata_gd_postal_address_set_address: + * @self: a #GDataGDPostalAddress + * @address: (allow-none): the new postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:address property to @address. + * + * Since: 0.4.0 + */ +void +gdata_gd_postal_address_set_address (GDataGDPostalAddress *self, const gchar *address) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + + /* Trim leading and trailing whitespace from the address. + * See here: http://code.google.com/apis/gdata/docs/1.0/elements.html#gdPostalAddress */ + g_free (self->priv->formatted_address); + self->priv->formatted_address = gdata_parser_utf8_trim_whitespace (address); + g_object_notify (G_OBJECT (self), "address"); +} + +/** + * gdata_gd_postal_address_get_relation_type: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:relation-type property. + * + * Return value: the postal address' relation type, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_postal_address_get_relation_type (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gd_postal_address_set_relation_type: + * @self: a #GDataGDPostalAddress + * @relation_type: (allow-none): the new relation type for the postal_address, or %NULL + * + * Sets the #GDataGDPostalAddress:relation-type property to @relation_type. + * + * Set @relation_type to %NULL to unset the property in the postal address. + * + * Since: 0.4.0 + */ +void +gdata_gd_postal_address_set_relation_type (GDataGDPostalAddress *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gd_postal_address_get_label: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:label property. + * + * Return value: the postal address' label, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_postal_address_get_label (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->label; +} + +/** + * gdata_gd_postal_address_set_label: + * @self: a #GDataGDPostalAddress + * @label: (allow-none): the new label for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:label property to @label. + * + * Set @label to %NULL to unset the property in the postal address. + * + * Since: 0.4.0 + */ +void +gdata_gd_postal_address_set_label (GDataGDPostalAddress *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} + +/** + * gdata_gd_postal_address_is_primary: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:is-primary property. + * + * Return value: %TRUE if this is the primary postal address, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_gd_postal_address_is_primary (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), FALSE); + return self->priv->is_primary; +} + +/** + * gdata_gd_postal_address_set_is_primary: + * @self: a #GDataGDPostalAddress + * @is_primary: %TRUE if this is the primary postal address, %FALSE otherwise + * + * Sets the #GDataGDPostalAddress:is-primary property to @is_primary. + * + * Since: 0.4.0 + */ +void +gdata_gd_postal_address_set_is_primary (GDataGDPostalAddress *self, gboolean is_primary) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + + self->priv->is_primary = is_primary; + g_object_notify (G_OBJECT (self), "is-primary"); +} + +/** + * gdata_gd_postal_address_get_mail_class: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:mail-class property. + * + * Return value: the postal address' mail class, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_mail_class (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->mail_class; +} + +/** + * gdata_gd_postal_address_set_mail_class: + * @self: a #GDataGDPostalAddress + * @mail_class: (allow-none): the new mail class for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:mail-class property to @mail_class. + * + * Set @mail_class to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_mail_class (GDataGDPostalAddress *self, const gchar *mail_class) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (mail_class == NULL || *mail_class != '\0'); + + g_free (self->priv->mail_class); + self->priv->mail_class = g_strdup (mail_class); + g_object_notify (G_OBJECT (self), "mail-class"); +} + +/** + * gdata_gd_postal_address_get_usage: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:usage property. + * + * Return value: the postal address' usage, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_usage (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->usage; +} + +/** + * gdata_gd_postal_address_set_usage: + * @self: a #GDataGDPostalAddress + * @usage: (allow-none): the new usage for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:usage property to @usage. + * + * Set @usage to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_usage (GDataGDPostalAddress *self, const gchar *usage) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (usage == NULL || *usage != '\0'); + + g_free (self->priv->usage); + self->priv->usage = g_strdup (usage); + g_object_notify (G_OBJECT (self), "usage"); +} + +/** + * gdata_gd_postal_address_get_agent: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:agent property. + * + * Return value: the postal address' agent, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_agent (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->agent; +} + +/** + * gdata_gd_postal_address_set_agent: + * @self: a #GDataGDPostalAddress + * @agent: (allow-none): the new agent for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:agent property to @agent. + * + * Set @agent to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_agent (GDataGDPostalAddress *self, const gchar *agent) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (agent == NULL || *agent != '\0'); + + g_free (self->priv->agent); + self->priv->agent = g_strdup (agent); + g_object_notify (G_OBJECT (self), "agent"); +} + +/** + * gdata_gd_postal_address_get_house_name: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:house-name property. + * + * Return value: the postal address' house name, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_house_name (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->house_name; +} + +/** + * gdata_gd_postal_address_set_house_name: + * @self: a #GDataGDPostalAddress + * @house_name: (allow-none): the new house name for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:house-name property to @house_name. + * + * Set @house_name to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_house_name (GDataGDPostalAddress *self, const gchar *house_name) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (house_name == NULL || *house_name != '\0'); + + g_free (self->priv->house_name); + self->priv->house_name = g_strdup (house_name); + g_object_notify (G_OBJECT (self), "house-name"); +} + +/** + * gdata_gd_postal_address_get_street: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:street property. + * + * Return value: the postal address' street, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_street (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->street; +} + +/** + * gdata_gd_postal_address_set_street: + * @self: a #GDataGDPostalAddress + * @street: (allow-none): the new street for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:street property to @street. + * + * Set @street to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_street (GDataGDPostalAddress *self, const gchar *street) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (street == NULL || *street != '\0'); + + g_free (self->priv->street); + self->priv->street = g_strdup (street); + g_object_notify (G_OBJECT (self), "street"); +} + +/** + * gdata_gd_postal_address_get_po_box: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:po-box property. + * + * Return value: the postal address' P.O. box, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_po_box (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->po_box; +} + +/** + * gdata_gd_postal_address_set_po_box: + * @self: a #GDataGDPostalAddress + * @po_box: (allow-none): the new P.O. box for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:po-box property to @po_box. + * + * Set @po_box to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_po_box (GDataGDPostalAddress *self, const gchar *po_box) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (po_box == NULL || *po_box != '\0'); + + g_free (self->priv->po_box); + self->priv->po_box = g_strdup (po_box); + g_object_notify (G_OBJECT (self), "po-box"); +} + +/** + * gdata_gd_postal_address_get_neighborhood: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:neighborhood property. + * + * Return value: the postal address' neighborhood, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_neighborhood (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->neighborhood; +} + +/** + * gdata_gd_postal_address_set_neighborhood: + * @self: a #GDataGDPostalAddress + * @neighborhood: (allow-none): the new neighborhood for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:neighborhood property to @neighborhood. + * + * Set @neighborhood to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_neighborhood (GDataGDPostalAddress *self, const gchar *neighborhood) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (neighborhood == NULL || *neighborhood != '\0'); + + g_free (self->priv->neighborhood); + self->priv->neighborhood = g_strdup (neighborhood); + g_object_notify (G_OBJECT (self), "neighborhood"); +} + +/** + * gdata_gd_postal_address_get_city: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:city property. + * + * Return value: the postal address' city, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_city (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->city; +} + +/** + * gdata_gd_postal_address_set_city: + * @self: a #GDataGDPostalAddress + * @city: (allow-none): the new city for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:city property to @city. + * + * Set @city to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_city (GDataGDPostalAddress *self, const gchar *city) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (city == NULL || *city != '\0'); + + g_free (self->priv->city); + self->priv->city = g_strdup (city); + g_object_notify (G_OBJECT (self), "city"); +} + +/** + * gdata_gd_postal_address_get_subregion: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:subregion property. + * + * Return value: the postal address' subregion, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_subregion (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->subregion; +} + +/** + * gdata_gd_postal_address_set_subregion: + * @self: a #GDataGDPostalAddress + * @subregion: (allow-none): the new subregion for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:subregion property to @subregion. + * + * Set @subregion to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_subregion (GDataGDPostalAddress *self, const gchar *subregion) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (subregion == NULL || *subregion != '\0'); + + g_free (self->priv->subregion); + self->priv->subregion = g_strdup (subregion); + g_object_notify (G_OBJECT (self), "subregion"); +} + +/** + * gdata_gd_postal_address_get_region: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:region property. + * + * Return value: the postal address' region, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_region (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->region; +} + +/** + * gdata_gd_postal_address_set_region: + * @self: a #GDataGDPostalAddress + * @region: (allow-none): the new region for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:region property to @region. + * + * Set @region to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_region (GDataGDPostalAddress *self, const gchar *region) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (region == NULL || *region != '\0'); + + g_free (self->priv->region); + self->priv->region = g_strdup (region); + g_object_notify (G_OBJECT (self), "region"); +} + +/** + * gdata_gd_postal_address_get_postcode: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:postcode property. + * + * Return value: the postal address' postcode, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_postcode (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->postcode; +} + +/** + * gdata_gd_postal_address_set_postcode: + * @self: a #GDataGDPostalAddress + * @postcode: (allow-none): the new postcode for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:postcode property to @postcode. + * + * Set @postcode to %NULL to unset the property in the postal address. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_postcode (GDataGDPostalAddress *self, const gchar *postcode) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (postcode == NULL || *postcode != '\0'); + + g_free (self->priv->postcode); + self->priv->postcode = g_strdup (postcode); + g_object_notify (G_OBJECT (self), "postcode"); +} + +/** + * gdata_gd_postal_address_get_country: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:country property. + * + * Return value: the postal address' country, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_country (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->country; +} + +/** + * gdata_gd_postal_address_get_country_code: + * @self: a #GDataGDPostalAddress + * + * Gets the #GDataGDPostalAddress:country-code property. + * + * Return value: the postal address' ISO 3166-1 alpha-2 country code, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_gd_postal_address_get_country_code (GDataGDPostalAddress *self) +{ + g_return_val_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self), NULL); + return self->priv->country_code; +} + +/** + * gdata_gd_postal_address_set_country: + * @self: a #GDataGDPostalAddress + * @country: (allow-none): the new country for the postal address, or %NULL + * @country_code: (allow-none): the new country code for the postal address, or %NULL + * + * Sets the #GDataGDPostalAddress:country property to @country, and #GDataGDPostalAddress:country-code to @country_code. + * + * Set @country or @country_code to %NULL to unset the relevant property in the postal address. If a @country_code is provided, a @country must + * also be provided. + * + * Since: 0.5.0 + */ +void +gdata_gd_postal_address_set_country (GDataGDPostalAddress *self, const gchar *country, const gchar *country_code) +{ + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (self)); + g_return_if_fail (country != NULL || country_code == NULL); + g_return_if_fail (country == NULL || *country != '\0'); + g_return_if_fail (country_code == NULL || *country_code != '\0'); + + g_free (self->priv->country); + g_free (self->priv->country_code); + self->priv->country = g_strdup (country); + self->priv->country_code = g_strdup (country_code); + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "country"); + g_object_notify (G_OBJECT (self), "country-code"); + g_object_thaw_notify (G_OBJECT (self)); +} diff --git a/gdata/gd/gdata-gd-postal-address.h b/gdata/gd/gdata-gd-postal-address.h new file mode 100644 index 0000000..c544c41 --- /dev/null +++ b/gdata/gd/gdata-gd-postal-address.h @@ -0,0 +1,205 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_POSTAL_ADDRESS_H +#define GDATA_GD_POSTAL_ADDRESS_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GD_POSTAL_ADDRESS_WORK: + * + * The relation type URI for the postal address of a workplace. + * + * Since: 0.7.0 + */ +#define GDATA_GD_POSTAL_ADDRESS_WORK "http://schemas.google.com/g/2005#work" + +/** + * GDATA_GD_POSTAL_ADDRESS_HOME: + * + * The relation type URI for the postal address of a home. + * + * Since: 0.7.0 + */ +#define GDATA_GD_POSTAL_ADDRESS_HOME "http://schemas.google.com/g/2005#home" + +/** + * GDATA_GD_POSTAL_ADDRESS_OTHER: + * + * The relation type URI for a miscellaneous postal address. + * + * Since: 0.7.0 + */ +#define GDATA_GD_POSTAL_ADDRESS_OTHER "http://schemas.google.com/g/2005#other" + +/** + * GDATA_GD_MAIL_CLASS_BOTH: + * + * Parcels and letters can be sent to the address. Value for #GDataGDPostalAddress:mail-class. + * + * Since: 0.5.0 + */ +#define GDATA_GD_MAIL_CLASS_BOTH "http://schemas.google.com/g/2005#both" + +/** + * GDATA_GD_MAIL_CLASS_LETTERS: + * + * Only letters can be sent to the address. Value for #GDataGDPostalAddress:mail-class. + * + * Since: 0.5.0 + */ +#define GDATA_GD_MAIL_CLASS_LETTERS "http://schemas.google.com/g/2005#letters" + +/** + * GDATA_GD_MAIL_CLASS_PARCELS: + * + * Only parcels can be sent to the address. Value for #GDataGDPostalAddress:mail-class. + * + * Since: 0.5.0 + */ +#define GDATA_GD_MAIL_CLASS_PARCELS "http://schemas.google.com/g/2005#parcels" + +/** + * GDATA_GD_MAIL_CLASS_NEITHER: + * + * Address is purely locational and cannot be used for mail. Value for #GDataGDPostalAddress:mail-class. + * + * Since: 0.5.0 + */ +#define GDATA_GD_MAIL_CLASS_NEITHER "http://schemas.google.com/g/2005#neither" + +/** + * GDATA_GD_ADDRESS_USAGE_GENERAL: + * + * The address is for general usage. Value for #GDataGDPostalAddress:usage. + * + * Since: 0.5.0 + */ +#define GDATA_GD_ADDRESS_USAGE_GENERAL "http://schemas.google.com/g/2005#general" + +/** + * GDATA_GD_ADDRESS_USAGE_LOCAL: + * + * The address is for local usage. Value for #GDataGDPostalAddress:usage. + * + * Since: 0.5.0 + */ +#define GDATA_GD_ADDRESS_USAGE_LOCAL "http://schemas.google.com/g/2005#local" + +#define GDATA_TYPE_GD_POSTAL_ADDRESS (gdata_gd_postal_address_get_type ()) +#define GDATA_GD_POSTAL_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_POSTAL_ADDRESS, GDataGDPostalAddress)) +#define GDATA_GD_POSTAL_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_POSTAL_ADDRESS, GDataGDPostalAddressClass)) +#define GDATA_IS_GD_POSTAL_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_POSTAL_ADDRESS)) +#define GDATA_IS_GD_POSTAL_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_POSTAL_ADDRESS)) +#define GDATA_GD_POSTAL_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_POSTAL_ADDRESS, GDataGDPostalAddressClass)) + +typedef struct _GDataGDPostalAddressPrivate GDataGDPostalAddressPrivate; + +/** + * GDataGDPostalAddress: + * + * All the fields in the #GDataGDPostalAddress structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataParsable parent; + GDataGDPostalAddressPrivate *priv; +} GDataGDPostalAddress; + +/** + * GDataGDPostalAddressClass: + * + * All the fields in the #GDataGDPostalAddressClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDPostalAddressClass; + +GType gdata_gd_postal_address_get_type (void) G_GNUC_CONST; + +GDataGDPostalAddress *gdata_gd_postal_address_new (const gchar *relation_type, const gchar *label, + gboolean is_primary) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gd_postal_address_get_address (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_address (GDataGDPostalAddress *self, const gchar *address); + +const gchar *gdata_gd_postal_address_get_relation_type (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_relation_type (GDataGDPostalAddress *self, const gchar *relation_type); + +const gchar *gdata_gd_postal_address_get_label (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_label (GDataGDPostalAddress *self, const gchar *label); + +gboolean gdata_gd_postal_address_is_primary (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_is_primary (GDataGDPostalAddress *self, gboolean is_primary); + +const gchar *gdata_gd_postal_address_get_mail_class (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_mail_class (GDataGDPostalAddress *self, const gchar *mail_class); + +const gchar *gdata_gd_postal_address_get_usage (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_usage (GDataGDPostalAddress *self, const gchar *usage); + +const gchar *gdata_gd_postal_address_get_agent (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_agent (GDataGDPostalAddress *self, const gchar *agent); + +const gchar *gdata_gd_postal_address_get_house_name (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_house_name (GDataGDPostalAddress *self, const gchar *house_name); + +const gchar *gdata_gd_postal_address_get_street (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_street (GDataGDPostalAddress *self, const gchar *street); + +const gchar *gdata_gd_postal_address_get_po_box (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_po_box (GDataGDPostalAddress *self, const gchar *po_box); + +const gchar *gdata_gd_postal_address_get_neighborhood (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_neighborhood (GDataGDPostalAddress *self, const gchar *neighborhood); + +const gchar *gdata_gd_postal_address_get_city (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_city (GDataGDPostalAddress *self, const gchar *city); + +const gchar *gdata_gd_postal_address_get_subregion (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_subregion (GDataGDPostalAddress *self, const gchar *subregion); + +const gchar *gdata_gd_postal_address_get_region (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_region (GDataGDPostalAddress *self, const gchar *region); + +const gchar *gdata_gd_postal_address_get_postcode (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_postcode (GDataGDPostalAddress *self, const gchar *postcode); + +const gchar *gdata_gd_postal_address_get_country (GDataGDPostalAddress *self) G_GNUC_PURE; +const gchar *gdata_gd_postal_address_get_country_code (GDataGDPostalAddress *self) G_GNUC_PURE; +void gdata_gd_postal_address_set_country (GDataGDPostalAddress *self, const gchar *country, const gchar *country_code); + +G_END_DECLS + +#endif /* !GDATA_GD_POSTAL_ADDRESS_H */ diff --git a/gdata/gd/gdata-gd-reminder.c b/gdata/gd/gdata-gd-reminder.c new file mode 100644 index 0000000..6c1e25d --- /dev/null +++ b/gdata/gd/gdata-gd-reminder.c @@ -0,0 +1,467 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-reminder + * @short_description: GData reminder element + * @stability: Stable + * @include: gdata/gd/gdata-gd-reminder.h + * + * #GDataGDReminder represents a "reminder" element from the + * GData specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-gd-reminder.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-comparable.h" + +static void gdata_gd_reminder_comparable_init (GDataComparableIface *iface); +static void gdata_gd_reminder_finalize (GObject *object); +static void gdata_gd_reminder_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_reminder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDReminderPrivate { + gchar *method; + gint64 absolute_time; + gint relative_time; +}; + +enum { + PROP_METHOD = 1, + PROP_ABSOLUTE_TIME, + PROP_IS_ABSOLUTE_TIME, + PROP_RELATIVE_TIME +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDReminder, gdata_gd_reminder, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_reminder_comparable_init)) + +static void +gdata_gd_reminder_class_init (GDataGDReminderClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDReminderPrivate)); + + gobject_class->get_property = gdata_gd_reminder_get_property; + gobject_class->set_property = gdata_gd_reminder_set_property; + gobject_class->finalize = gdata_gd_reminder_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "reminder"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDReminder:method: + * + * The notification method the reminder should use. For example: %GDATA_GD_REMINDER_ALERT or %GDATA_GD_REMINDER_EMAIL. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_METHOD, + g_param_spec_string ("method", + "Method", "The notification method the reminder should use.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDReminder:absolute-time: + * + * Absolute time at which the reminder should be issued. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_ABSOLUTE_TIME, + g_param_spec_int64 ("absolute-time", + "Absolute time", "Absolute time at which the reminder should be issued.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDReminder:is-absolute-time: + * + * Whether the reminder is specified as an absolute or relative time. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_ABSOLUTE_TIME, + g_param_spec_boolean ("is-absolute-time", + "Absolute time?", "Whether the reminder is specified as an absolute or relative time.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDReminder:relative-time: + * + * Time at which the reminder should be issued, in minutes relative to the start time of the corresponding event. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATIVE_TIME, + g_param_spec_int ("relative-time", + "Relative time", "Time at which the reminder should be issued, in minutes.", + -1, G_MAXINT, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + gint method_cmp, time_cmp; + GDataGDReminder *a = (GDataGDReminder*) self, *b = (GDataGDReminder*) other; + + if (gdata_gd_reminder_is_absolute_time (a) != gdata_gd_reminder_is_absolute_time (b)) + return 1; + + method_cmp = g_strcmp0 (a->priv->method, b->priv->method); + if (gdata_gd_reminder_is_absolute_time (a) == TRUE) { + time_cmp = a->priv->absolute_time - b->priv->absolute_time; + } else { + time_cmp = a->priv->relative_time - b->priv->relative_time; + } + + if (method_cmp == 0) + return time_cmp; + else + return method_cmp; +} + +static void +gdata_gd_reminder_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_reminder_init (GDataGDReminder *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_REMINDER, GDataGDReminderPrivate); + self->priv->absolute_time = -1; +} + +static void +gdata_gd_reminder_finalize (GObject *object) +{ + GDataGDReminderPrivate *priv = GDATA_GD_REMINDER (object)->priv; + + g_free (priv->method); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_reminder_parent_class)->finalize (object); +} + +static void +gdata_gd_reminder_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDReminderPrivate *priv = GDATA_GD_REMINDER (object)->priv; + + switch (property_id) { + case PROP_METHOD: + g_value_set_string (value, priv->method); + break; + case PROP_ABSOLUTE_TIME: + g_value_set_int64 (value, priv->absolute_time); + break; + case PROP_IS_ABSOLUTE_TIME: + g_value_set_boolean (value, gdata_gd_reminder_is_absolute_time (GDATA_GD_REMINDER (object))); + break; + case PROP_RELATIVE_TIME: + g_value_set_int (value, priv->relative_time); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_reminder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDReminder *self = GDATA_GD_REMINDER (object); + + switch (property_id) { + case PROP_METHOD: + gdata_gd_reminder_set_method (self, g_value_get_string (value)); + break; + case PROP_ABSOLUTE_TIME: + gdata_gd_reminder_set_absolute_time (self, g_value_get_int64 (value)); + break; + case PROP_RELATIVE_TIME: + gdata_gd_reminder_set_relative_time (self, g_value_get_int (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + GDataGDReminderPrivate *priv = GDATA_GD_REMINDER (parsable)->priv; + xmlChar *absolute_time, *relative_time; + gint64 absolute_time_int64; + gint relative_time_int = -1; + gboolean is_absolute_time = FALSE; + + /* Absolute time */ + absolute_time = xmlGetProp (root_node, (xmlChar*) "absoluteTime"); + if (absolute_time != NULL) { + is_absolute_time = TRUE; + if (gdata_parser_int64_from_iso8601 ((gchar*) absolute_time, &absolute_time_int64) == FALSE) { + /* Error */ + gdata_parser_error_not_iso8601_format (root_node, (gchar*) absolute_time, error); + xmlFree (absolute_time); + return FALSE; + } + xmlFree (absolute_time); + } + + /* Relative time */ + relative_time = xmlGetProp (root_node, (xmlChar*) "days"); + if (relative_time != NULL) { + relative_time_int = g_ascii_strtoll ((gchar*) relative_time, NULL, 10) * 60 * 24; + } else { + relative_time = xmlGetProp (root_node, (xmlChar*) "hours"); + if (relative_time != NULL) { + relative_time_int = g_ascii_strtoll ((gchar*) relative_time, NULL, 10) * 60; + } else { + relative_time = xmlGetProp (root_node, (xmlChar*) "minutes"); + if (relative_time != NULL) + relative_time_int = g_ascii_strtoll ((gchar*) relative_time, NULL, 10); + } + } + xmlFree (relative_time); + + if (is_absolute_time == TRUE) { + priv->absolute_time = absolute_time_int64; + priv->relative_time = -1; + } else { + priv->absolute_time = -1; + priv->relative_time = relative_time_int; + } + + priv->method = (gchar*) xmlGetProp (root_node, (xmlChar*) "method"); + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDReminderPrivate *priv = GDATA_GD_REMINDER (parsable)->priv; + + if (priv->relative_time == -1) { + gchar *absolute_time = gdata_parser_int64_to_iso8601 (priv->absolute_time); + g_string_append_printf (xml_string, " absoluteTime='%s'", absolute_time); + g_free (absolute_time); + } else { + g_string_append_printf (xml_string, " minutes='%i'", priv->relative_time); + } + + if (priv->method != NULL) + gdata_parser_string_append_escaped (xml_string, " method='", priv->method, "'"); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_reminder_new: + * @method: (allow-none): the notification method the reminder should use, or %NULL + * @absolute_time: the absolute time for the reminder, or -1 + * @relative_time: the relative time for the reminder, in minutes, or -1 + * + * Creates a new #GDataGDReminder. More information is available in the GData specification. + * + * Return value: a new #GDataGDReminder, or %NULL; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataGDReminder * +gdata_gd_reminder_new (const gchar *method, gint64 absolute_time, gint relative_time) +{ + g_return_val_if_fail (absolute_time == -1 || relative_time == -1, NULL); + g_return_val_if_fail (absolute_time >= -1, NULL); + g_return_val_if_fail (relative_time >= -1, NULL); + return g_object_new (GDATA_TYPE_GD_REMINDER, "absolute-time", absolute_time, "relative-time", relative_time, "method", method, NULL); +} + +/** + * gdata_gd_reminder_get_method: + * @self: a #GDataGDReminder + * + * Gets the #GDataGDReminder:method property. + * + * Return value: the method, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_reminder_get_method (GDataGDReminder *self) +{ + g_return_val_if_fail (GDATA_IS_GD_REMINDER (self), NULL); + return self->priv->method; +} + +/** + * gdata_gd_reminder_set_method: + * @self: a #GDataGDReminder + * @method: (allow-none): the new method, or %NULL + * + * Sets the #GDataGDReminder:method property to @method. + * + * Set @method to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_reminder_set_method (GDataGDReminder *self, const gchar *method) +{ + g_return_if_fail (GDATA_IS_GD_REMINDER (self)); + + g_free (self->priv->method); + self->priv->method = g_strdup (method); + g_object_notify (G_OBJECT (self), "method"); +} + +/** + * gdata_gd_reminder_get_absolute_time: + * @self: a #GDataGDReminder + * + * Gets the #GDataGDReminder:absolute-time property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp of the absolute time for the reminder, or -1 + * + * Since: 0.4.0 + */ +gint64 +gdata_gd_reminder_get_absolute_time (GDataGDReminder *self) +{ + g_return_val_if_fail (GDATA_IS_GD_REMINDER (self), -1); + return self->priv->absolute_time; +} + +/** + * gdata_gd_reminder_set_absolute_time: + * @self: a #GDataGDReminder + * @absolute_time: the new absolute time, or -1 + * + * Sets the #GDataGDReminder:absolute-time property to @absolute_time. + * + * Set @absolute_time to -1 to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_reminder_set_absolute_time (GDataGDReminder *self, gint64 absolute_time) +{ + g_return_if_fail (GDATA_IS_GD_REMINDER (self)); + g_return_if_fail (absolute_time >= -1); + + self->priv->absolute_time = absolute_time; + g_object_notify (G_OBJECT (self), "absolute-time"); +} + +/** + * gdata_gd_reminder_is_absolute_time: + * @self: a #GDataGDReminder + * + * Returns whether the reminder is specified as an absolute time, or as a number of minutes after + * the corresponding event's start time. + * + * Return value: %TRUE if the reminder is absolute, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_gd_reminder_is_absolute_time (GDataGDReminder *self) +{ + g_return_val_if_fail (GDATA_IS_GD_REMINDER (self), FALSE); + return (self->priv->relative_time == -1) ? TRUE : FALSE; +} + +/** + * gdata_gd_reminder_get_relative_time: + * @self: a #GDataGDReminder + * + * Gets the #GDataGDReminder:relative-time property. + * + * Return value: the relative time, or -1 + * + * Since: 0.4.0 + */ +gint +gdata_gd_reminder_get_relative_time (GDataGDReminder *self) +{ + g_return_val_if_fail (GDATA_IS_GD_REMINDER (self), -1); + return self->priv->relative_time; +} + +/** + * gdata_gd_reminder_set_relative_time: + * @self: a #GDataGDReminder + * @relative_time: the new relative time, or -1 + * + * Sets the #GDataGDReminder:relative-time property to @relative_time. + * + * Set @relative_time to -1 to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_reminder_set_relative_time (GDataGDReminder *self, gint relative_time) +{ + g_return_if_fail (GDATA_IS_GD_REMINDER (self)); + g_return_if_fail (relative_time >= -1); + + self->priv->relative_time = relative_time; + g_object_notify (G_OBJECT (self), "method"); +} diff --git a/gdata/gd/gdata-gd-reminder.h b/gdata/gd/gdata-gd-reminder.h new file mode 100644 index 0000000..9f7373d --- /dev/null +++ b/gdata/gd/gdata-gd-reminder.h @@ -0,0 +1,111 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_REMINDER_H +#define GDATA_GD_REMINDER_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GD_REMINDER_ALERT: + * + * The #GDataGDReminder:method for an alert to appear in the user's browser. + * + * Since: 0.7.0 + */ +#define GDATA_GD_REMINDER_ALERT "alert" + +/** + * GDATA_GD_REMINDER_EMAIL: + * + * The #GDataGDReminder:method for an alert to be sent to the user by e-mail. + * + * Since: 0.7.0 + */ +#define GDATA_GD_REMINDER_EMAIL "email" + +/** + * GDATA_GD_REMINDER_SMS: + * + * The #GDataGDReminder:method for an alert to be sent to the user by SMS. + * + * Since: 0.7.0 + */ +#define GDATA_GD_REMINDER_SMS "sms" + +#define GDATA_TYPE_GD_REMINDER (gdata_gd_reminder_get_type ()) +#define GDATA_GD_REMINDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_REMINDER, GDataGDReminder)) +#define GDATA_GD_REMINDER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_REMINDER, GDataGDReminderClass)) +#define GDATA_IS_GD_REMINDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_REMINDER)) +#define GDATA_IS_GD_REMINDER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_REMINDER)) +#define GDATA_GD_REMINDER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_REMINDER, GDataGDReminderClass)) + +typedef struct _GDataGDReminderPrivate GDataGDReminderPrivate; + +/** + * GDataGDReminder: + * + * All the fields in the #GDataGDReminder structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataParsable parent; + GDataGDReminderPrivate *priv; +} GDataGDReminder; + +/** + * GDataGDReminderClass: + * + * All the fields in the #GDataGDReminderClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDReminderClass; + +GType gdata_gd_reminder_get_type (void) G_GNUC_CONST; + +GDataGDReminder *gdata_gd_reminder_new (const gchar *method, gint64 absolute_time, gint relative_time) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gd_reminder_get_method (GDataGDReminder *self) G_GNUC_PURE; +void gdata_gd_reminder_set_method (GDataGDReminder *self, const gchar *method); + +gint64 gdata_gd_reminder_get_absolute_time (GDataGDReminder *self); +void gdata_gd_reminder_set_absolute_time (GDataGDReminder *self, gint64 absolute_time); +gboolean gdata_gd_reminder_is_absolute_time (GDataGDReminder *self); + +gint gdata_gd_reminder_get_relative_time (GDataGDReminder *self) G_GNUC_PURE; +void gdata_gd_reminder_set_relative_time (GDataGDReminder *self, gint relative_time); + +G_END_DECLS + +#endif /* !GDATA_GD_REMINDER_H */ diff --git a/gdata/gd/gdata-gd-when.c b/gdata/gd/gdata-gd-when.c new file mode 100644 index 0000000..5b45aaa --- /dev/null +++ b/gdata/gd/gdata-gd-when.c @@ -0,0 +1,596 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-when + * @short_description: GData when element + * @stability: Stable + * @include: gdata/gd/gdata-gd-when.h + * + * #GDataGDWhen represents a "when" element from the + * GData specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-gd-when.h" +#include "gdata-gd-reminder.h" +#include "gdata-private.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-comparable.h" + +static void gdata_gd_when_comparable_init (GDataComparableIface *iface); +static void gdata_gd_when_dispose (GObject *object); +static void gdata_gd_when_finalize (GObject *object); +static void gdata_gd_when_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_when_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDWhenPrivate { + gint64 start_time; + gint64 end_time; + gboolean is_date; + gchar *value_string; + GList *reminders; +}; + +enum { + PROP_START_TIME = 1, + PROP_END_TIME, + PROP_IS_DATE, + PROP_VALUE_STRING +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDWhen, gdata_gd_when, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_when_comparable_init)) + +static void +gdata_gd_when_class_init (GDataGDWhenClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDWhenPrivate)); + + gobject_class->get_property = gdata_gd_when_get_property; + gobject_class->set_property = gdata_gd_when_set_property; + gobject_class->dispose = gdata_gd_when_dispose; + gobject_class->finalize = gdata_gd_when_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->post_parse_xml = post_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "when"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDWhen:start-time: + * + * The name of the when. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_START_TIME, + g_param_spec_int64 ("start-time", + "Start time", "The name of the when.", + 0, G_MAXINT64, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDWhen:end-time: + * + * The title of a person within the when. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_END_TIME, + g_param_spec_int64 ("end-time", + "End time", "The title of a person within the when.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDWhen:is-date: + * + * A programmatic value that identifies the type of when. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_DATE, + g_param_spec_boolean ("is-date", + "Date?", "A programmatic value that identifies the type of when.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDWhen:value-string: + * + * A simple string value used to name this when. It allows UIs to display a label such as "Work", "Volunteer", + * "Professional Society", etc. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_VALUE_STRING, + g_param_spec_string ("value-string", + "Value string", "A simple string value used to name this when.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + gint64 start_diff, end_diff; + GDataGDWhenPrivate *a = ((GDataGDWhen*) self)->priv, *b = ((GDataGDWhen*) other)->priv; + + if (a->is_date != b->is_date) + return CLAMP (b->is_date - a->is_date, -1, 1); + + start_diff = b->start_time - a->start_time; + end_diff = b->end_time - a->end_time; + + if (start_diff == 0) + return CLAMP (end_diff, -1, 1); + return CLAMP (start_diff, -1, 1); +} + +static void +gdata_gd_when_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_when_init (GDataGDWhen *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_WHEN, GDataGDWhenPrivate); + self->priv->end_time = -1; +} + +static void +gdata_gd_when_dispose (GObject *object) +{ + GDataGDWhenPrivate *priv = GDATA_GD_WHEN (object)->priv; + + if (priv->reminders != NULL) { + g_list_foreach (priv->reminders, (GFunc) g_object_unref, NULL); + g_list_free (priv->reminders); + } + priv->reminders = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_when_parent_class)->dispose (object); +} + +static void +gdata_gd_when_finalize (GObject *object) +{ + GDataGDWhenPrivate *priv = GDATA_GD_WHEN (object)->priv; + + g_free (priv->value_string); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_when_parent_class)->finalize (object); +} + +static void +gdata_gd_when_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDWhenPrivate *priv = GDATA_GD_WHEN (object)->priv; + + switch (property_id) { + case PROP_START_TIME: + g_value_set_int64 (value, priv->start_time); + break; + case PROP_END_TIME: + g_value_set_int64 (value, priv->end_time); + break; + case PROP_IS_DATE: + g_value_set_boolean (value, priv->is_date); + break; + case PROP_VALUE_STRING: + g_value_set_string (value, priv->value_string); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_when_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDWhen *self = GDATA_GD_WHEN (object); + + switch (property_id) { + case PROP_START_TIME: + gdata_gd_when_set_start_time (self, g_value_get_int64 (value)); + break; + case PROP_END_TIME: + gdata_gd_when_set_end_time (self, g_value_get_int64 (value)); + break; + case PROP_IS_DATE: + gdata_gd_when_set_is_date (self, g_value_get_boolean (value)); + break; + case PROP_VALUE_STRING: + gdata_gd_when_set_value_string (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + GDataGDWhenPrivate *priv = GDATA_GD_WHEN (parsable)->priv; + xmlChar *start_time, *end_time; + gint64 start_time_int64, end_time_int64; + gboolean is_date = FALSE; + + /* Start time */ + start_time = xmlGetProp (root_node, (xmlChar*) "startTime"); + if (gdata_parser_int64_from_date ((gchar*) start_time, &start_time_int64) == TRUE) { + is_date = TRUE; + } else if (gdata_parser_int64_from_iso8601 ((gchar*) start_time, &start_time_int64) == FALSE) { + /* Error */ + gdata_parser_error_not_iso8601_format (root_node, (gchar*) start_time, error); + xmlFree (start_time); + return FALSE; + } + xmlFree (start_time); + + /* End time (optional) */ + end_time = xmlGetProp (root_node, (xmlChar*) "endTime"); + if (end_time != NULL) { + gboolean success; + + if (is_date == TRUE) + success = gdata_parser_int64_from_date ((gchar*) end_time, &end_time_int64); + else + success = gdata_parser_int64_from_iso8601 ((gchar*) end_time, &end_time_int64); + + if (success == FALSE) { + /* Error */ + gdata_parser_error_not_iso8601_format (root_node, (gchar*) end_time, error); + xmlFree (end_time); + return FALSE; + } + xmlFree (end_time); + } else { + /* Give a default */ + end_time_int64 = -1; + } + + priv->start_time = start_time_int64; + priv->end_time = end_time_int64; + priv->is_date = is_date; + priv->value_string = (gchar*) xmlGetProp (root_node, (xmlChar*) "valueString"); + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + + if (gdata_parser_is_namespace (node, "http://schemas.google.com/g/2005") == TRUE && + gdata_parser_object_from_element_setter (node, "reminder", P_REQUIRED, GDATA_TYPE_GD_REMINDER, + gdata_gd_when_add_reminder, parsable, &success, error) == TRUE) { + return success; + } else { + return GDATA_PARSABLE_CLASS (gdata_gd_when_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } +} + +static gboolean +post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataGDWhenPrivate *priv = GDATA_GD_WHEN (parsable)->priv; + + /* Reverse our lists of stuff */ + priv->reminders = g_list_reverse (priv->reminders); + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDWhenPrivate *priv = GDATA_GD_WHEN (parsable)->priv; + gchar *start_time; + + if (priv->is_date == TRUE) + start_time = gdata_parser_date_from_int64 (priv->start_time); + else + start_time = gdata_parser_int64_to_iso8601 (priv->start_time); + + g_string_append_printf (xml_string, " startTime='%s'", start_time); + g_free (start_time); + + if (priv->end_time != -1) { + gchar *end_time; + + if (priv->is_date == TRUE) + end_time = gdata_parser_date_from_int64 (priv->end_time); + else + end_time = gdata_parser_int64_to_iso8601 (priv->end_time); + + g_string_append_printf (xml_string, " endTime='%s'", end_time); + g_free (end_time); + } + + if (priv->value_string != NULL) + gdata_parser_string_append_escaped (xml_string, " valueString='", priv->value_string, "'"); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GList *reminders; + GDataGDWhenPrivate *priv = GDATA_GD_WHEN (parsable)->priv; + + for (reminders = priv->reminders; reminders != NULL; reminders = reminders->next) + _gdata_parsable_get_xml (GDATA_PARSABLE (reminders->data), xml_string, FALSE); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_when_new: + * @start_time: when the event starts or (for zero-duration events) when it occurs + * @end_time: when the event ends, or -1 + * @is_date: %TRUE if @start_time and @end_time specify dates rather than times, %FALSE otherwise + * + * Creates a new #GDataGDWhen. More information is available in the GData specification. + * + * Return value: a new #GDataGDWhen, or %NULL; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataGDWhen * +gdata_gd_when_new (gint64 start_time, gint64 end_time, gboolean is_date) +{ + g_return_val_if_fail (start_time >= 0, NULL); + g_return_val_if_fail (end_time >= -1, NULL); + + return g_object_new (GDATA_TYPE_GD_WHEN, "start-time", start_time, "end-time", end_time, "is-date", is_date, NULL); +} + +/** + * gdata_gd_when_get_start_time: + * @self: a #GDataGDWhen + * + * Gets the #GDataGDWhen:start-time property. + * + * Return value: the UNIX timestamp for the start time of the event + * + * Since: 0.4.0 + */ +gint64 +gdata_gd_when_get_start_time (GDataGDWhen *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHEN (self), -1); + return self->priv->start_time; +} + +/** + * gdata_gd_when_set_start_time: + * @self: a #GDataGDWhen + * @start_time: the new start time + * + * Sets the #GDataGDWhen:start-time property to @start_time. + * + * Since: 0.4.0 + */ +void +gdata_gd_when_set_start_time (GDataGDWhen *self, gint64 start_time) +{ + g_return_if_fail (GDATA_IS_GD_WHEN (self)); + g_return_if_fail (start_time >= 0); + + self->priv->start_time = start_time; + g_object_notify (G_OBJECT (self), "start-time"); +} + +/** + * gdata_gd_when_get_end_time: + * @self: a #GDataGDWhen + * + * Gets the #GDataGDWhen:end-time property. + * + * If the end time is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the end time of the event, or + * -1 + * + * Since: 0.4.0 + */ +gint64 +gdata_gd_when_get_end_time (GDataGDWhen *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHEN (self), -1); + return self->priv->end_time; +} + +/** + * gdata_gd_when_set_end_time: + * @self: a #GDataGDWhen + * @end_time: the new end time, or -1 + * + * Sets the #GDataGDWhen:end-time property to @end_time. + * + * Set @end_time to -1 to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_when_set_end_time (GDataGDWhen *self, gint64 end_time) +{ + g_return_if_fail (GDATA_IS_GD_WHEN (self)); + g_return_if_fail (end_time >= -1); + + self->priv->end_time = end_time; + g_object_notify (G_OBJECT (self), "end-time"); +} + +/** + * gdata_gd_when_is_date: + * @self: a #GDataGDWhen + * + * Gets the #GDataGDWhen:is-date property. + * + * Return value: %TRUE if #GDataGDWhen:start-time and #GDataGDWhen:end-time are dates rather than times, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_gd_when_is_date (GDataGDWhen *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHEN (self), FALSE); + return self->priv->is_date; +} + +/** + * gdata_gd_when_set_is_date: + * @self: a #GDataGDWhen + * @is_date: %TRUE if #GDataGDWhen:start-time and #GDataGDWhen:end-time should be dates rather than times, %FALSE otherwise + * + * Sets the #GDataGDWhen:is-date property to @is_date. + * + * Since: 0.4.0 + */ +void +gdata_gd_when_set_is_date (GDataGDWhen *self, gboolean is_date) +{ + g_return_if_fail (GDATA_IS_GD_WHEN (self)); + + self->priv->is_date = is_date; + g_object_notify (G_OBJECT (self), "is-date"); +} + +/** + * gdata_gd_when_get_value_string: + * @self: a #GDataGDWhen + * + * Gets the #GDataGDWhen:value-string property. + * + * Return value: the value string, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_when_get_value_string (GDataGDWhen *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHEN (self), NULL); + return self->priv->value_string; +} + +/** + * gdata_gd_when_set_value_string: + * @self: a #GDataGDWhen + * @value_string: (allow-none): the new value string, or %NULL + * + * Sets the #GDataGDWhen:value-string property to @value_string. + * + * Set @value_string to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_when_set_value_string (GDataGDWhen *self, const gchar *value_string) +{ + g_return_if_fail (GDATA_IS_GD_WHEN (self)); + + g_free (self->priv->value_string); + self->priv->value_string = g_strdup (value_string); + g_object_notify (G_OBJECT (self), "value-string"); +} + +/** + * gdata_gd_when_get_reminders: + * @self: a #GDataGDWhen + * + * Returns a list of the #GDataGDReminders which are associated with this #GDataGDWhen. + * + * Return value: (element-type GData.GDReminder) (transfer none): a #GList of #GDataGDReminders, or %NULL + * + * Since: 0.4.0 + */ +GList * +gdata_gd_when_get_reminders (GDataGDWhen *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHEN (self), NULL); + return self->priv->reminders; +} + +/** + * gdata_gd_when_add_reminder: + * @self: a #GDataGDWhen + * @reminder: a #GDataGDReminder to add + * + * Adds a reminder to the #GDataGDWhen's list of reminders and increments its reference count. + * + * Duplicate reminders will not be added to the list. + * + * Since: 0.7.0 + */ +void +gdata_gd_when_add_reminder (GDataGDWhen *self, GDataGDReminder *reminder) +{ + g_return_if_fail (GDATA_IS_GD_WHEN (self)); + g_return_if_fail (GDATA_IS_GD_REMINDER (reminder)); + + if (g_list_find_custom (self->priv->reminders, reminder, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->reminders = g_list_append (self->priv->reminders, g_object_ref (reminder)); +} diff --git a/gdata/gd/gdata-gd-when.h b/gdata/gd/gdata-gd-when.h new file mode 100644 index 0000000..6bf9f05 --- /dev/null +++ b/gdata/gd/gdata-gd-when.h @@ -0,0 +1,172 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_WHEN_H +#define GDATA_GD_WHEN_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_GD_EVENT_STATUS_CANCELED: + * + * The event has been canceled. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EVENT_STATUS_CANCELED "http://schemas.google.com/g/2005#event.canceled" + +/** + * GDATA_GD_EVENT_STATUS_CONFIRMED: + * + * The event has been planned and confirmed. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EVENT_STATUS_CONFIRMED "http://schemas.google.com/g/2005#event.confirmed" + +/** + * GDATA_GD_EVENT_STATUS_TENTATIVE: + * + * The event has been planned, but only tentatively scheduled. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EVENT_STATUS_TENTATIVE "http://schemas.google.com/g/2005#event.tentative" + +/** + * GDATA_GD_EVENT_VISIBILITY_CONFIDENTIAL: + * + * The event is visible to only certain people. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EVENT_VISIBILITY_CONFIDENTIAL "http://schemas.google.com/g/2005#event.confidential" + +/** + * GDATA_GD_EVENT_VISIBILITY_DEFAULT: + * + * The event's visibility is inherited from the preferences of its owner. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EVENT_VISIBILITY_DEFAULT "http://schemas.google.com/g/2005#event.default" + +/** + * GDATA_GD_EVENT_VISIBILITY_PRIVATE: + * + * The event is visible to very few people. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EVENT_VISIBILITY_PRIVATE "http://schemas.google.com/g/2005#event.private" + +/** + * GDATA_GD_EVENT_VISIBILITY_PUBLIC: + * + * The event is visible to most people. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EVENT_VISIBILITY_PUBLIC "http://schemas.google.com/g/2005#event.public" + +/** + * GDATA_GD_EVENT_TRANSPARENCY_OPAQUE: + * + * The event consumes time in calendars; its time will be marked as busy in a free/busy search. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EVENT_TRANSPARENCY_OPAQUE "http://schemas.google.com/g/2005#event.opaque" + +/** + * GDATA_GD_EVENT_TRANSPARENCY_TRANSPARENT: + * + * The event does not consume time in calendars; its time will be not marked as busy in a free/busy search. + * + * Since: 0.7.0 + */ +#define GDATA_GD_EVENT_TRANSPARENCY_TRANSPARENT "http://schemas.google.com/g/2005#event.transparent" + +#define GDATA_TYPE_GD_WHEN (gdata_gd_when_get_type ()) +#define GDATA_GD_WHEN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_WHEN, GDataGDWhen)) +#define GDATA_GD_WHEN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_WHEN, GDataGDWhenClass)) +#define GDATA_IS_GD_WHEN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_WHEN)) +#define GDATA_IS_GD_WHEN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_WHEN)) +#define GDATA_GD_WHEN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_WHEN, GDataGDWhenClass)) + +typedef struct _GDataGDWhenPrivate GDataGDWhenPrivate; + +/** + * GDataGDWhen: + * + * All the fields in the #GDataGDWhen structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataParsable parent; + GDataGDWhenPrivate *priv; +} GDataGDWhen; + +/** + * GDataGDWhenClass: + * + * All the fields in the #GDataGDWhenClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDWhenClass; + +GType gdata_gd_when_get_type (void) G_GNUC_CONST; + +GDataGDWhen *gdata_gd_when_new (gint64 start_time, gint64 end_time, gboolean is_date) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gint64 gdata_gd_when_get_start_time (GDataGDWhen *self); +void gdata_gd_when_set_start_time (GDataGDWhen *self, gint64 start_time); + +gint64 gdata_gd_when_get_end_time (GDataGDWhen *self); +void gdata_gd_when_set_end_time (GDataGDWhen *self, gint64 end_time); + +gboolean gdata_gd_when_is_date (GDataGDWhen *self) G_GNUC_PURE; +void gdata_gd_when_set_is_date (GDataGDWhen *self, gboolean is_date); + +const gchar *gdata_gd_when_get_value_string (GDataGDWhen *self) G_GNUC_PURE; +void gdata_gd_when_set_value_string (GDataGDWhen *self, const gchar *value_string); + +GList *gdata_gd_when_get_reminders (GDataGDWhen *self) G_GNUC_PURE; +void gdata_gd_when_add_reminder (GDataGDWhen *self, GDataGDReminder *reminder); +/* TODO: More reminder API */ + +G_END_DECLS + +#endif /* !GDATA_GD_WHEN_H */ diff --git a/gdata/gd/gdata-gd-where.c b/gdata/gd/gdata-gd-where.c new file mode 100644 index 0000000..ea299c0 --- /dev/null +++ b/gdata/gd/gdata-gd-where.c @@ -0,0 +1,407 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-where + * @short_description: GData where element + * @stability: Stable + * @include: gdata/gd/gdata-gd-where.h + * + * #GDataGDWhere represents a "where" element from the + * GData specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-gd-where.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gd_where_comparable_init (GDataComparableIface *iface); +static void gdata_gd_where_finalize (GObject *object); +static void gdata_gd_where_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_where_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +/*static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error);*/ +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +/*static void get_xml (GDataParsable *parsable, GString *xml_string);*/ +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDWherePrivate { + gchar *relation_type; + gchar *value_string; + gchar *label; +}; + +enum { + PROP_RELATION_TYPE = 1, + PROP_VALUE_STRING, + PROP_LABEL +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDWhere, gdata_gd_where, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_where_comparable_init)) + +static void +gdata_gd_where_class_init (GDataGDWhereClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDWherePrivate)); + + gobject_class->get_property = gdata_gd_where_get_property; + gobject_class->set_property = gdata_gd_where_set_property; + gobject_class->finalize = gdata_gd_where_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + /*parsable_class->parse_xml = parse_xml;*/ + parsable_class->pre_get_xml = pre_get_xml; + /*parsable_class->get_xml = get_xml;*/ + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "where"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDWhere:relation-type: + * + * Specifies the relationship between the containing entity and the contained location. For example: %GDATA_GD_WHERE_EVENT or + * %GDATA_GD_WHERE_EVENT_PARKING. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "Specifies the relationship between the container and the containee.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDWhere:value-string: + * + * A simple string representation of this location. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_VALUE_STRING, + g_param_spec_string ("value-string", + "Value string", "A simple string representation of this location.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDWhere:label: + * + * Specifies a user-readable label to distinguish this location from others. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "Specifies a user-readable label to distinguish this location from others.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGDWherePrivate *a = ((GDataGDWhere*) self)->priv, *b = ((GDataGDWhere*) other)->priv; + + if (g_strcmp0 (a->value_string, b->value_string) == 0 && g_strcmp0 (a->label, b->label) == 0) + return 0; + return 1; +} + +static void +gdata_gd_where_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_where_init (GDataGDWhere *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_WHERE, GDataGDWherePrivate); +} + +static void +gdata_gd_where_finalize (GObject *object) +{ + GDataGDWherePrivate *priv = GDATA_GD_WHERE (object)->priv; + + g_free (priv->relation_type); + g_free (priv->value_string); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_where_parent_class)->finalize (object); +} + +static void +gdata_gd_where_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDWherePrivate *priv = GDATA_GD_WHERE (object)->priv; + + switch (property_id) { + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_VALUE_STRING: + g_value_set_string (value, priv->value_string); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_where_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDWhere *self = GDATA_GD_WHERE (object); + + switch (property_id) { + case PROP_RELATION_TYPE: + gdata_gd_where_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_VALUE_STRING: + gdata_gd_where_set_value_string (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_gd_where_set_label (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *rel; + GDataGDWherePrivate *priv = GDATA_GD_WHERE (parsable)->priv; + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + if (rel != NULL && *rel == '\0') { + xmlFree (rel); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + priv->relation_type = (gchar*) rel; + priv->value_string = (gchar*) xmlGetProp (root_node, (xmlChar*) "valueString"); + priv->label = (gchar*) xmlGetProp (root_node, (xmlChar*) "label"); + + return TRUE; +} + +/*static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + GDataGDWherePrivate *priv = GDATA_GD_WHERE (parsable)->priv; + + TODO: deal with the entryLink + + return TRUE; +}*/ + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDWherePrivate *priv = GDATA_GD_WHERE (parsable)->priv; + + if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); + + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + + if (priv->value_string != NULL) + gdata_parser_string_append_escaped (xml_string, " valueString='", priv->value_string, "'"); +} + +/*static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDWherePrivate *priv = GDATA_GD_WHERE (parsable)->priv; + + TODO: deal with the entryLink +}*/ + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_where_new: + * @relation_type: (allow-none): the relationship between the item and this place, or %NULL + * @value_string: (allow-none): a string to represent the place, or %NULL + * @label: (allow-none): a human-readable label for the place, or %NULL + * + * Creates a new #GDataGDWhere. More information is available in the GData specification. + * + * Currently, entryLink functionality is not implemented in #GDataGDWhere. + * + * Return value: a new #GDataGDWhere; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataGDWhere * +gdata_gd_where_new (const gchar *relation_type, const gchar *value_string, const gchar *label) +{ + g_return_val_if_fail (relation_type == NULL || *relation_type != '\0', NULL); + return g_object_new (GDATA_TYPE_GD_WHERE, "relation-type", relation_type, "value-string", value_string, "label", label, NULL); +} + +/** + * gdata_gd_where_get_relation_type: + * @self: a #GDataGDWhere + * + * Gets the #GDataGDWhere:relation-type property. + * + * Return value: the relation type, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_where_get_relation_type (GDataGDWhere *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHERE (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gd_where_set_relation_type: + * @self: a #GDataGDWhere + * @relation_type: (allow-none): the new relation type, or %NULL + * + * Sets the #GDataGDWhere:relation-type property to @relation_type. + * + * Set @relation_type to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_where_set_relation_type (GDataGDWhere *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GD_WHERE (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gd_where_get_value_string: + * @self: a #GDataGDWhere + * + * Gets the #GDataGDWhere:value-string property. + * + * Return value: the value string, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_where_get_value_string (GDataGDWhere *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHERE (self), NULL); + return self->priv->value_string; +} + +/** + * gdata_gd_where_set_value_string: + * @self: a #GDataGDWhere + * @value_string: (allow-none): the new value string, or %NULL + * + * Sets the #GDataGDWhere:value-string property to @value_string. + * + * Set @value_string to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_where_set_value_string (GDataGDWhere *self, const gchar *value_string) +{ + g_return_if_fail (GDATA_IS_GD_WHERE (self)); + + g_free (self->priv->value_string); + self->priv->value_string = g_strdup (value_string); + g_object_notify (G_OBJECT (self), "value-string"); +} + +/** + * gdata_gd_where_get_label: + * @self: a #GDataGDWhere + * + * Gets the #GDataGDWhere:label property. + * + * Return value: the label, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_where_get_label (GDataGDWhere *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHERE (self), NULL); + return self->priv->label; +} + +/** + * gdata_gd_where_set_label: + * @self: a #GDataGDWhere + * @label: (allow-none): the new label, or %NULL + * + * Sets the #GDataGDWhere:label property to @label. + * + * Set @label to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_where_set_label (GDataGDWhere *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_GD_WHERE (self)); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} diff --git a/gdata/gd/gdata-gd-where.h b/gdata/gd/gdata-gd-where.h new file mode 100644 index 0000000..a44cac4 --- /dev/null +++ b/gdata/gd/gdata-gd-where.h @@ -0,0 +1,110 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_WHERE_H +#define GDATA_GD_WHERE_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GD_WHERE_EVENT: + * + * The relation type URI for an event location. + * + * Since: 0.7.0 + */ +#define GDATA_GD_WHERE_EVENT "http://schemas.google.com/g/2005#event" + +/** + * GDATA_GD_WHERE_EVENT_ALTERNATE: + * + * The relation type URI for an alternate event location, such as a video conference site. + * + * Since: 0.7.0 + */ +#define GDATA_GD_WHERE_EVENT_ALTERNATE "http://schemas.google.com/g/2005#event.alternate" + +/** + * GDATA_GD_WHERE_EVENT_PARKING: + * + * The relation type URI for an event's parking lot. + * + * Since: 0.7.0 + */ +#define GDATA_GD_WHERE_EVENT_PARKING "http://schemas.google.com/g/2005#event.parking" + +#define GDATA_TYPE_GD_WHERE (gdata_gd_where_get_type ()) +#define GDATA_GD_WHERE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_WHERE, GDataGDWhere)) +#define GDATA_GD_WHERE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_WHERE, GDataGDWhereClass)) +#define GDATA_IS_GD_WHERE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_WHERE)) +#define GDATA_IS_GD_WHERE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_WHERE)) +#define GDATA_GD_WHERE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_WHERE, GDataGDWhereClass)) + +typedef struct _GDataGDWherePrivate GDataGDWherePrivate; + +/** + * GDataGDWhere: + * + * All the fields in the #GDataGDWhere structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataParsable parent; + GDataGDWherePrivate *priv; +} GDataGDWhere; + +/** + * GDataGDWhereClass: + * + * All the fields in the #GDataGDWhereClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDWhereClass; + +GType gdata_gd_where_get_type (void) G_GNUC_CONST; + +GDataGDWhere *gdata_gd_where_new (const gchar *relation_type, const gchar *value_string, const gchar *label) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gd_where_get_relation_type (GDataGDWhere *self) G_GNUC_PURE; +void gdata_gd_where_set_relation_type (GDataGDWhere *self, const gchar *relation_type); + +const gchar *gdata_gd_where_get_value_string (GDataGDWhere *self) G_GNUC_PURE; +void gdata_gd_where_set_value_string (GDataGDWhere *self, const gchar *value_string); + +const gchar *gdata_gd_where_get_label (GDataGDWhere *self) G_GNUC_PURE; +void gdata_gd_where_set_label (GDataGDWhere *self, const gchar *label); + +G_END_DECLS + +#endif /* !GDATA_GD_WHERE_H */ diff --git a/gdata/gd/gdata-gd-who.c b/gdata/gd/gdata-gd-who.c new file mode 100644 index 0000000..f637ee9 --- /dev/null +++ b/gdata/gd/gdata-gd-who.c @@ -0,0 +1,414 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-gd-who + * @short_description: GData who element + * @stability: Stable + * @include: gdata/gd/gdata-gd-who.h + * + * #GDataGDWho represents an "who" element from the + * GData specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-gd-who.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-comparable.h" + +static void gdata_gd_who_comparable_init (GDataComparableIface *iface); +static void gdata_gd_who_finalize (GObject *object); +static void gdata_gd_who_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_gd_who_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +/*static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error);*/ +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +/*static void get_xml (GDataParsable *parsable, GString *xml_string);*/ +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataGDWhoPrivate { + gchar *relation_type; + gchar *value_string; + gchar *email_address; +}; + +enum { + PROP_RELATION_TYPE = 1, + PROP_VALUE_STRING, + PROP_EMAIL_ADDRESS +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGDWho, gdata_gd_who, GDATA_TYPE_PARSABLE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMPARABLE, gdata_gd_who_comparable_init)) + +static void +gdata_gd_who_class_init (GDataGDWhoClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGDWhoPrivate)); + + gobject_class->get_property = gdata_gd_who_get_property; + gobject_class->set_property = gdata_gd_who_set_property; + gobject_class->finalize = gdata_gd_who_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + /*parsable_class->parse_xml = parse_xml;*/ + parsable_class->pre_get_xml = pre_get_xml; + /*parsable_class->get_xml = get_xml;*/ + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "who"; + parsable_class->element_namespace = "gd"; + + /** + * GDataGDWho:relation-type: + * + * Specifies the relationship between the containing entity and the contained person. For example: %GDATA_GD_WHO_EVENT_PERFORMER or + * %GDATA_GD_WHO_EVENT_ATTENDEE. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_RELATION_TYPE, + g_param_spec_string ("relation-type", + "Relation type", "Specifies the relationship between the container and the containee.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDWho:value-string: + * + * A simple string representation of this person. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_VALUE_STRING, + g_param_spec_string ("value-string", + "Value string", "A simple string representation of this person.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataGDWho:email-address: + * + * The e-mail address of the person represented by the #GDataGDWho. + * + * For more information, see the + * GData specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_EMAIL_ADDRESS, + g_param_spec_string ("email-address", + "E-mail address", "The e-mail address of the person represented by the #GDataGDWho.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gint +compare_with (GDataComparable *self, GDataComparable *other) +{ + GDataGDWhoPrivate *a = ((GDataGDWho*) self)->priv, *b = ((GDataGDWho*) other)->priv; + + if (g_strcmp0 (a->value_string, b->value_string) == 0 && g_strcmp0 (a->email_address, b->email_address) == 0) + return 0; + return 1; +} + +static void +gdata_gd_who_comparable_init (GDataComparableIface *iface) +{ + iface->compare_with = compare_with; +} + +static void +gdata_gd_who_init (GDataGDWho *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GD_WHO, GDataGDWhoPrivate); +} + +static void +gdata_gd_who_finalize (GObject *object) +{ + GDataGDWhoPrivate *priv = GDATA_GD_WHO (object)->priv; + + g_free (priv->relation_type); + g_free (priv->value_string); + g_free (priv->email_address); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_gd_who_parent_class)->finalize (object); +} + +static void +gdata_gd_who_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataGDWhoPrivate *priv = GDATA_GD_WHO (object)->priv; + + switch (property_id) { + case PROP_RELATION_TYPE: + g_value_set_string (value, priv->relation_type); + break; + case PROP_VALUE_STRING: + g_value_set_string (value, priv->value_string); + break; + case PROP_EMAIL_ADDRESS: + g_value_set_string (value, priv->email_address); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_gd_who_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataGDWho *self = GDATA_GD_WHO (object); + + switch (property_id) { + case PROP_RELATION_TYPE: + gdata_gd_who_set_relation_type (self, g_value_get_string (value)); + break; + case PROP_VALUE_STRING: + gdata_gd_who_set_value_string (self, g_value_get_string (value)); + break; + case PROP_EMAIL_ADDRESS: + gdata_gd_who_set_email_address (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *rel, *email; + GDataGDWhoPrivate *priv = GDATA_GD_WHO (parsable)->priv; + + rel = xmlGetProp (root_node, (xmlChar*) "rel"); + if (rel != NULL && *rel == '\0') { + xmlFree (rel); + return gdata_parser_error_required_property_missing (root_node, "rel", error); + } + + email = xmlGetProp (root_node, (xmlChar*) "email"); + if (email != NULL && *email == '\0') { + xmlFree (rel); + xmlFree (email); + return gdata_parser_error_required_property_missing (root_node, "email", error); + } + + priv->relation_type = (gchar*) rel; + priv->value_string = (gchar*) xmlGetProp (root_node, (xmlChar*) "valueString"); + priv->email_address = (gchar*) email; + + return TRUE; +} + +/*static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + GDataGDWhoPrivate *priv = GDATA_GD_WHO (parsable)->priv; + + TODO: deal with the attendeeType, attendeeStatus and entryLink + + return TRUE; +}*/ + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDWhoPrivate *priv = GDATA_GD_WHO (parsable)->priv; + + if (priv->email_address != NULL) + gdata_parser_string_append_escaped (xml_string, " email='", priv->email_address, "'"); + if (priv->relation_type != NULL) + gdata_parser_string_append_escaped (xml_string, " rel='", priv->relation_type, "'"); + if (priv->value_string != NULL) + gdata_parser_string_append_escaped (xml_string, " valueString='", priv->value_string, "'"); +} + +/*static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGDWhoPrivate *priv = GDATA_GD_WHO (parsable)->priv; + + TODO: deal with the attendeeType, attendeeStatus and entryLink +}*/ + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); +} + +/** + * gdata_gd_who_new: + * @relation_type: (allow-none): the relationship between the item and this person, or %NULL + * @value_string: (allow-none): a string to represent the person, or %NULL + * @email_address: (allow-none): the person's e-mail address, or %NULL + * + * Creates a new #GDataGDWho. More information is available in the GData specification. + * + * Currently, entryLink functionality is not implemented in #GDataGDWho. + * + * Return value: a new #GDataGDWho; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataGDWho * +gdata_gd_who_new (const gchar *relation_type, const gchar *value_string, const gchar *email_address) +{ + g_return_val_if_fail (relation_type == NULL || *relation_type != '\0', NULL); + g_return_val_if_fail (email_address == NULL || *email_address != '\0', NULL); + return g_object_new (GDATA_TYPE_GD_WHO, "relation-type", relation_type, "value-string", value_string, "email-address", email_address, NULL); +} + +/** + * gdata_gd_who_get_relation_type: + * @self: a #GDataGDWho + * + * Gets the #GDataGDWho:relation-type property. + * + * Return value: the relation type, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_who_get_relation_type (GDataGDWho *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHO (self), NULL); + return self->priv->relation_type; +} + +/** + * gdata_gd_who_set_relation_type: + * @self: a #GDataGDWho + * @relation_type: (allow-none): the new relation type, or %NULL + * + * Sets the #GDataGDWho:relation-type property to @relation_type. + * + * Set @relation_type to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_who_set_relation_type (GDataGDWho *self, const gchar *relation_type) +{ + g_return_if_fail (GDATA_IS_GD_WHO (self)); + g_return_if_fail (relation_type == NULL || *relation_type != '\0'); + + g_free (self->priv->relation_type); + self->priv->relation_type = g_strdup (relation_type); + g_object_notify (G_OBJECT (self), "relation-type"); +} + +/** + * gdata_gd_who_get_value_string: + * @self: a #GDataGDWho + * + * Gets the #GDataGDWho:value-string property. + * + * Return value: the value string, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_who_get_value_string (GDataGDWho *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHO (self), NULL); + return self->priv->value_string; +} + +/** + * gdata_gd_who_set_value_string: + * @self: a #GDataGDWho + * @value_string: (allow-none): the new value string, or %NULL + * + * Sets the #GDataGDWho:value-string property to @value_string. + * + * Set @value_string to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_who_set_value_string (GDataGDWho *self, const gchar *value_string) +{ + g_return_if_fail (GDATA_IS_GD_WHO (self)); + + g_free (self->priv->value_string); + self->priv->value_string = g_strdup (value_string); + g_object_notify (G_OBJECT (self), "value-string"); +} + +/** + * gdata_gd_who_get_email_address: + * @self: a #GDataGDWho + * + * Gets the #GDataGDWho:email-address property. + * + * Return value: the e-mail address, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_gd_who_get_email_address (GDataGDWho *self) +{ + g_return_val_if_fail (GDATA_IS_GD_WHO (self), NULL); + return self->priv->email_address; +} + +/** + * gdata_gd_who_set_email_address: + * @self: a #GDataGDWho + * @email_address: (allow-none): the new e-mail address, or %NULL + * + * Sets the #GDataGDWho:email-address property to @email_address. + * + * Set @email_address to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_gd_who_set_email_address (GDataGDWho *self, const gchar *email_address) +{ + g_return_if_fail (GDATA_IS_GD_WHO (self)); + g_return_if_fail (email_address == NULL || *email_address != '\0'); + + g_free (self->priv->email_address); + self->priv->email_address = g_strdup (email_address); + g_object_notify (G_OBJECT (self), "email-address"); +} diff --git a/gdata/gd/gdata-gd-who.h b/gdata/gd/gdata-gd-who.h new file mode 100644 index 0000000..00a5cc6 --- /dev/null +++ b/gdata/gd/gdata-gd-who.h @@ -0,0 +1,122 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GD_WHO_H +#define GDATA_GD_WHO_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_GD_WHO_EVENT_ATTENDEE: + * + * The relation type URI for a general meeting or event attendee. + * + * Since: 0.7.0 + */ +#define GDATA_GD_WHO_EVENT_ATTENDEE "http://schemas.google.com/g/2005#event.attendee" + +/** + * GDATA_GD_WHO_EVENT_ORGANIZER: + * + * The relation type URI for an event organizer (not necessarily an attendee). + * + * Since: 0.7.0 + */ +#define GDATA_GD_WHO_EVENT_ORGANIZER "http://schemas.google.com/g/2005#event.organizer" + +/** + * GDATA_GD_WHO_EVENT_PERFORMER: + * + * The relation type URI for an event performer, which is similar to %GDATA_GD_WHO_EVENT_SPEAKER, but with more emphasis on art rather than speaking. + * + * Since: 0.7.0 + */ +#define GDATA_GD_WHO_EVENT_PERFORMER "http://schemas.google.com/g/2005#event.performer" + +/** + * GDATA_GD_WHO_EVENT_SPEAKER: + * + * The relation type URI for a speaker at an event. + * + * Since: 0.7.0 + */ +#define GDATA_GD_WHO_EVENT_SPEAKER "http://schemas.google.com/g/2005#event.speaker" + +/* TODO: Message kind relation types (http://code.google.com/apis/gdata/docs/2.0/elements.html#gdWho) */ + +#define GDATA_TYPE_GD_WHO (gdata_gd_who_get_type ()) +#define GDATA_GD_WHO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GD_WHO, GDataGDWho)) +#define GDATA_GD_WHO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GD_WHO, GDataGDWhoClass)) +#define GDATA_IS_GD_WHO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GD_WHO)) +#define GDATA_IS_GD_WHO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GD_WHO)) +#define GDATA_GD_WHO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GD_WHO, GDataGDWhoClass)) + +typedef struct _GDataGDWhoPrivate GDataGDWhoPrivate; + +/** + * GDataGDWho: + * + * All the fields in the #GDataGDWho structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataParsable parent; + GDataGDWhoPrivate *priv; +} GDataGDWho; + +/** + * GDataGDWhoClass: + * + * All the fields in the #GDataGDWhoClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGDWhoClass; + +GType gdata_gd_who_get_type (void) G_GNUC_CONST; + +GDataGDWho *gdata_gd_who_new (const gchar *relation_type, const gchar *value_string, + const gchar *email_address) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_gd_who_get_relation_type (GDataGDWho *self) G_GNUC_PURE; +void gdata_gd_who_set_relation_type (GDataGDWho *self, const gchar *relation_type); + +const gchar *gdata_gd_who_get_value_string (GDataGDWho *self) G_GNUC_PURE; +void gdata_gd_who_set_value_string (GDataGDWho *self, const gchar *value_string); + +const gchar *gdata_gd_who_get_email_address (GDataGDWho *self) G_GNUC_PURE; +void gdata_gd_who_set_email_address (GDataGDWho *self, const gchar *email_address); + +G_END_DECLS + +#endif /* !GDATA_GD_WHO_H */ diff --git a/gdata/gdata-access-handler.c b/gdata/gdata-access-handler.c new file mode 100644 index 0000000..0f228f2 --- /dev/null +++ b/gdata/gdata-access-handler.c @@ -0,0 +1,251 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010, 2015 + * Copyright (C) Red Hat, Inc. 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-access-handler + * @short_description: GData access handler interface + * @stability: Stable + * @include: gdata/gdata-access-handler.h + * + * #GDataAccessHandler is an interface which can be implemented by #GDataEntrys which can have their permissions controlled by an + * access control list (ACL). It has a set of methods which allow the #GDataAccessRules for the access handler/entry to be retrieved, + * added, modified and deleted, with immediate effect. + * + * For an example of inserting an access rule into an ACL, see the documentation for #GDataAccessRule. + * + * When implementing the interface, classes must implement an is_owner_rule function. It's optional to implement a + * get_authorization_domain function, but if it's not implemented, any operations on the access handler's + * #GDataAccessRules will be performed unauthorized (i.e. as if by a non-logged-in user). This will not usually work. + * + * Since: 0.3.0 + */ + +#include +#include +#include +#include + +#include "gdata-access-handler.h" +#include "gdata-private.h" +#include "gdata-access-rule.h" + +static GDataFeed * +gdata_access_handler_real_get_rules (GDataAccessHandler *self, + GDataService *service, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, + GError **error); + +typedef GDataAccessHandlerIface GDataAccessHandlerInterface; +G_DEFINE_INTERFACE (GDataAccessHandler, gdata_access_handler, + GDATA_TYPE_ENTRY); + +static void +gdata_access_handler_default_init (GDataAccessHandlerInterface *iface) +{ + iface->get_rules = gdata_access_handler_real_get_rules; +} + +typedef struct { + GDataService *service; + GDataQueryProgressCallback progress_callback; + gpointer progress_user_data; + GDestroyNotify destroy_progress_user_data; +} GetRulesAsyncData; + +static void +get_rules_async_data_free (GetRulesAsyncData *self) +{ + if (self->service != NULL) + g_object_unref (self->service); + + g_slice_free (GetRulesAsyncData, self); +} + +static GDataFeed * +gdata_access_handler_real_get_rules (GDataAccessHandler *self, + GDataService *service, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, + GError **error) +{ + GDataAccessHandlerIface *iface; + GDataAuthorizationDomain *domain = NULL; + GDataFeed *feed; + GDataLink *_link; + SoupMessage *message; + SoupMessageHeaders *headers; + const gchar *content_type; + + _link = gdata_entry_look_up_link (GDATA_ENTRY (self), GDATA_LINK_ACCESS_CONTROL_LIST); + g_assert (_link != NULL); + + iface = GDATA_ACCESS_HANDLER_GET_IFACE (self); + if (iface->get_authorization_domain != NULL) { + domain = iface->get_authorization_domain (self); + } + + message = _gdata_service_query (service, domain, gdata_link_get_uri (_link), NULL, cancellable, error); + if (message == NULL) { + return NULL; + } + + g_assert (message->response_body->data != NULL); + + headers = message->response_headers; + content_type = soup_message_headers_get_content_type (headers, NULL); + + if (g_strcmp0 (content_type, "application/json") == 0) { + /* Definitely JSON. */ + g_debug("JSON content type detected."); + feed = _gdata_feed_new_from_json (GDATA_TYPE_FEED, message->response_body->data, message->response_body->length, GDATA_TYPE_ACCESS_RULE, + progress_callback, progress_user_data, error); + } else { + /* Potentially XML. Don't bother checking the Content-Type, since the parser + * will fail gracefully if the response body is not valid XML. */ + g_debug("XML content type detected."); + feed = _gdata_feed_new_from_xml (GDATA_TYPE_FEED, message->response_body->data, message->response_body->length, GDATA_TYPE_ACCESS_RULE, + progress_callback, progress_user_data, error); + } + + g_object_unref (message); + + return feed; +} + +static void +get_rules_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataAccessHandler *access_handler = GDATA_ACCESS_HANDLER (source_object); + GDataAccessHandlerIface *iface; + g_autoptr(GError) error = NULL; + g_autoptr(GDataFeed) feed = NULL; + GetRulesAsyncData *data = task_data; + + /* Execute the query and return */ + iface = GDATA_ACCESS_HANDLER_GET_IFACE (access_handler); + g_assert (iface->get_rules != NULL); + + feed = iface->get_rules (access_handler, data->service, + cancellable, data->progress_callback, + data->progress_user_data, &error); + + if (feed == NULL && error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&feed), g_object_unref); + + if (data->destroy_progress_user_data != NULL) { + data->destroy_progress_user_data (data->progress_user_data); + } +} + +/** + * gdata_access_handler_get_rules_async: + * @self: a #GDataAccessHandler + * @service: a #GDataService + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when a rule is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Retrieves a #GDataFeed containing all the access rules which apply to the given #GDataAccessHandler. Only the owner of a #GDataAccessHandler may + * view its rule feed. @self and @service are both reffed when this function is called, so can safely be unreffed after this function returns. + * + * For more details, see gdata_access_handler_get_rules(), which is the synchronous version of this function, and gdata_service_query_async(), which + * is the base asynchronous query function. + * + * When the operation is finished, @callback will be called. You can then call gdata_service_query_finish() + * to get the results of the operation. + * + * Since: 0.9.1 + */ +void +gdata_access_handler_get_rules_async (GDataAccessHandler *self, GDataService *service, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + GetRulesAsyncData *data; + + g_return_if_fail (GDATA_IS_ACCESS_HANDLER (self)); + g_return_if_fail (GDATA_IS_SERVICE (service)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + data = g_slice_new (GetRulesAsyncData); + data->service = g_object_ref (service); + data->progress_callback = progress_callback; + data->progress_user_data = progress_user_data; + data->destroy_progress_user_data = destroy_progress_user_data; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) get_rules_async_data_free); + g_task_run_in_thread (task, get_rules_thread); +} + +/** + * gdata_access_handler_get_rules: + * @self: a #GDataAccessHandler + * @service: a #GDataService + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when a rule is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Retrieves a #GDataFeed containing all the access rules which apply to the given #GDataAccessHandler. Only the owner of a #GDataAccessHandler may + * view its rule feed. + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. + * + * A %GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be returned if the server indicates there is a problem with the query. + * + * For each rule in the response feed, @progress_callback will be called in the main thread. If there was an error parsing the XML response, + * a #GDataParserError will be returned. + * + * Return value: (transfer full): a #GDataFeed of access control rules, or %NULL; unref with g_object_unref() + * + * Since: 0.3.0 + */ +GDataFeed * +gdata_access_handler_get_rules (GDataAccessHandler *self, GDataService *service, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + GDataAccessHandlerIface *iface; + + g_return_val_if_fail (GDATA_IS_ACCESS_HANDLER (self), NULL); + g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + iface = GDATA_ACCESS_HANDLER_GET_IFACE (self); + g_assert (iface->get_rules != NULL); + + return iface->get_rules (self, service, cancellable, progress_callback, + progress_user_data, error); +} diff --git a/gdata/gdata-access-handler.h b/gdata/gdata-access-handler.h new file mode 100644 index 0000000..eff96c3 --- /dev/null +++ b/gdata/gdata-access-handler.h @@ -0,0 +1,109 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_ACCESS_HANDLER_H +#define GDATA_ACCESS_HANDLER_H + +#include +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_LINK_ACCESS_CONTROL_LIST: + * + * The relation type URI of the access control list location for this resource. + * + * For more information, see the + * ACL specification. + * + * Since: 0.7.0 + */ +#define GDATA_LINK_ACCESS_CONTROL_LIST "http://schemas.google.com/acl/2007#accessControlList" + +#define GDATA_TYPE_ACCESS_HANDLER (gdata_access_handler_get_type ()) +#define GDATA_ACCESS_HANDLER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_ACCESS_HANDLER, GDataAccessHandler)) +#define GDATA_ACCESS_HANDLER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_ACCESS_HANDLER, GDataAccessHandlerIface)) +#define GDATA_IS_ACCESS_HANDLER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_ACCESS_HANDLER)) +#define GDATA_ACCESS_HANDLER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GDATA_TYPE_ACCESS_HANDLER, GDataAccessHandlerIface)) + +/** + * GDataAccessHandler: + * + * All the fields in the #GDataAccessHandler structure are private and should never be accessed directly. + * + * Since: 0.3.0 + */ +typedef struct _GDataAccessHandler GDataAccessHandler; /* dummy typedef */ + +/** + * GDataAccessHandlerIface: + * @parent: the parent type + * @is_owner_rule: a function to return whether the given #GDataAccessRule has the role of an owner (of a #GDataAccessHandler). + * @get_authorization_domain: (allow-none): a function to return the #GDataAuthorizationDomain to be used for all operations on the access rules + * belonging to this access handler; not implementing this function is equivalent to returning %NULL from it, which signifies that operations on the + * access rules don't require authorization; new in version 0.9.0 + * @get_rules: (nullable): a function to query, parse and return a #GDataFeed of + * #GDataAccessRules for a given entry — the virtual function for + * gdata_access_handler_get_rules(); new in version 0.17.2 + * + * The class structure for the #GDataAccessHandler interface. + * + * Since: 0.9.0 + */ +typedef struct { + GTypeInterface parent; + + gboolean (*is_owner_rule) (GDataAccessRule *rule); + GDataAuthorizationDomain *(*get_authorization_domain) (GDataAccessHandler *self); + + GDataFeed *(*get_rules) (GDataAccessHandler *self, + GDataService *service, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, + GError **error); + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataAccessHandlerIface; + +GType gdata_access_handler_get_type (void) G_GNUC_CONST; + +GDataFeed *gdata_access_handler_get_rules (GDataAccessHandler *self, GDataService *service, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_access_handler_get_rules_async (GDataAccessHandler *self, GDataService *service, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); + +G_END_DECLS + +#endif /* !GDATA_ACCESS_HANDLER_H */ diff --git a/gdata/gdata-access-rule.c b/gdata/gdata-access-rule.c new file mode 100644 index 0000000..ae501ec --- /dev/null +++ b/gdata/gdata-access-rule.c @@ -0,0 +1,661 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2009–2010, 2014 + * Copyright (C) Red Hat, Inc. 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-access-rule + * @short_description: GData access rule object + * @stability: Stable + * @include: gdata/gdata-access-rule.h + * + * #GDataAccessRule is a subclass of #GDataEntry to represent a generic access rule from an access control list (ACL). + * It is returned by the ACL methods implemented in the #GDataAccessHandler interface. + * + * Access rules should be inserted to the %GDATA_LINK_ACCESS_CONTROL_LIST URI of the feed or entry they should be applied to. This will return a + * %GDATA_SERVICE_ERROR_CONFLICT error if a rule already exists on that feed or entry for that scope type and value. + * + * + * Adding a Rule to the Access Control List for an Entry + * + * GDataAuthorizationDomain *domain; + * GDataService *service; + * GDataEntry *entry; + * GDataFeed *acl_feed; + * GDataAccessRule *rule, *new_rule; + * GError *error = NULL; + * + * domain = gdata_documents_service_get_primary_authorization_domain (); + * + * /* Retrieve a GDataEntry which will have a new rule inserted into its ACL. */ + * service = build_my_service (); + * entry = get_the_entry (service); + * + * /* Create and insert a new access rule for example@gmail.com which grants them _no_ permissions on the entry. + * * In a real application, the GDataEntry subclass would define its own access roles which are more useful. For example, + * * GDataDocumentsEntry defines access roles for users who can read (but not write) a Google Document, and users who + * * can also write to the document. */ + * rule = gdata_access_rule_new (NULL); + * gdata_access_rule_set_role (rule, GDATA_ACCESS_ROLE_NONE); /* or, for example, GDATA_DOCUMENTS_ACCESS_ROLE_READER */ + * gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_USER, "example@gmail.com"); /* e-mail address of the user the ACL applies to */ + * + * acl_link = gdata_entry_look_up_link (entry, GDATA_LINK_ACCESS_CONTROL_LIST); + * new_rule = GDATA_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), domain, gdata_link_get_uri (acl_link), + * GDATA_ENTRY (rule), NULL, &error)); + * + * g_object_unref (rule); + * g_object_unref (entry); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error inserting access rule: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Potentially do something with the new_rule here, such as store its ID for later use. */ + * + * g_object_unref (new_rule); + * + * + * + * Since: 0.3.0 + */ + +#include +#include +#include +#include + +#include "gdata-access-rule.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-private.h" + +static GObject *gdata_access_rule_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); +static void gdata_access_rule_finalize (GObject *object); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void gdata_access_rule_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void gdata_access_rule_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static gboolean post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error); + +struct _GDataAccessRulePrivate { + gchar *role; + gchar *scope_type; + gchar *scope_value; + gint64 edited; + gchar *key; +}; + +enum { + PROP_ROLE = 1, + PROP_SCOPE_TYPE, + PROP_SCOPE_VALUE, + PROP_EDITED, + PROP_ETAG, + PROP_KEY, +}; + +G_DEFINE_TYPE (GDataAccessRule, gdata_access_rule, GDATA_TYPE_ENTRY) + +static void +gdata_access_rule_class_init (GDataAccessRuleClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataAccessRulePrivate)); + + gobject_class->constructor = gdata_access_rule_constructor; + gobject_class->finalize = gdata_access_rule_finalize; + gobject_class->get_property = gdata_access_rule_get_property; + gobject_class->set_property = gdata_access_rule_set_property; + + parsable_class->parse_xml = parse_xml; + parsable_class->post_parse_xml = post_parse_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + + entry_class->kind_term = "http://schemas.google.com/acl/2007#accessRule"; + + /** + * GDataAccessRule:role: + * + * The role of the person concerned by this ACL. By default, this can only be %GDATA_ACCESS_ROLE_NONE. Services may extend it with + * their own namespaced roles. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_ROLE, + g_param_spec_string ("role", + "Role", "The role of the person concerned by this ACL.", + GDATA_ACCESS_ROLE_NONE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataAccessRule:scope-type: + * + * Specifies to whom this access rule applies. For example, %GDATA_ACCESS_SCOPE_USER or %GDATA_ACCESS_SCOPE_DEFAULT. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_SCOPE_TYPE, + g_param_spec_string ("scope-type", + "Scope type", "Specifies to whom this access rule applies.", + GDATA_ACCESS_SCOPE_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataAccessRule:scope-value: + * + * A value representing the user who is represented by the access rule, such as an + * e-mail address for users, or a domain name for domains. + * + * This must be %NULL if and only if #GDataAccessRule:scope-type is %GDATA_ACCESS_SCOPE_DEFAULT. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_SCOPE_VALUE, + g_param_spec_string ("scope-value", + "Scope value", "The scope value for this access rule.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataAccessRule:edited: + * + * The last time the access rule was edited. If the rule has not been edited yet, the content indicates the time it was created. + * + * For more information, see the + * Atom Publishing Protocol specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_EDITED, + g_param_spec_int64 ("edited", + "Edited", "The last time the access rule was edited.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataAccessRule:key: + * + * An optional authorisation key required to access this item with the given scope. If set, this restricts + * access to those principals who have a copy of the key. The key is generated server-side and cannot be + * modified by the client. If no authorisation key is set (and hence none is needed for access to the item), + * this will be %NULL. + * + * Since: 0.16.0 + */ + g_object_class_install_property (gobject_class, PROP_KEY, + g_param_spec_string ("key", + "Key", "An optional authorisation key required to access this item.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /* Override the ETag property since ETags don't seem to be supported for ACL entries. TODO: Investigate this further (might only be + * unsupported for Google Calendar). */ + g_object_class_override_property (gobject_class, PROP_ETAG, "etag"); +} + +static void notify_role_cb (GDataAccessRule *self, GParamSpec *pspec, gpointer user_data); + +static void +notify_title_cb (GDataAccessRule *self, GParamSpec *pspec, gpointer user_data) +{ + /* Update GDataAccessRule:role */ + g_signal_handlers_block_by_func (self, notify_role_cb, self); + gdata_access_rule_set_role (self, gdata_entry_get_title (GDATA_ENTRY (self))); + g_signal_handlers_unblock_by_func (self, notify_role_cb, self); +} + +static void +notify_role_cb (GDataAccessRule *self, GParamSpec *pspec, gpointer user_data) +{ + /* Update GDataEntry:title */ + g_signal_handlers_block_by_func (self, notify_title_cb, self); + gdata_entry_set_title (GDATA_ENTRY (self), gdata_access_rule_get_role (self)); + g_signal_handlers_unblock_by_func (self, notify_title_cb, self); +} + +static void +gdata_access_rule_init (GDataAccessRule *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_ACCESS_RULE, GDataAccessRulePrivate); + self->priv->edited = -1; + + /* Listen to change notifications for the entry's title, since it's linked to GDataAccessRule:role */ + g_signal_connect (self, "notify::title", (GCallback) notify_title_cb, self); + g_signal_connect (self, "notify::role", (GCallback) notify_role_cb, self); +} + +static GObject * +gdata_access_rule_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) +{ + GObject *object; + + /* Chain up to the parent class */ + object = G_OBJECT_CLASS (gdata_access_rule_parent_class)->constructor (type, n_construct_params, construct_params); + + /* We can't create these in init, or they would collide with the group and control created when parsing the XML */ + if (_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object)) == FALSE) { + GDataAccessRulePrivate *priv = GDATA_ACCESS_RULE (object)->priv; + GTimeVal time_val; + + /* Set the edited property to the current time (creation time). We don't do this in *_init() since that would cause + * setting it from parse_xml() to fail (duplicate element). */ + g_get_current_time (&time_val); + priv->edited = time_val.tv_sec; + + /* Set up the role and scope type */ + priv->role = g_strdup (GDATA_ACCESS_ROLE_NONE); + priv->scope_type = g_strdup (GDATA_ACCESS_SCOPE_DEFAULT); + } + + return object; +} + +static void +gdata_access_rule_finalize (GObject *object) +{ + GDataAccessRulePrivate *priv = GDATA_ACCESS_RULE (object)->priv; + + g_free (priv->role); + g_free (priv->scope_type); + g_free (priv->scope_value); + g_free (priv->key); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_access_rule_parent_class)->finalize (object); +} + +static void +gdata_access_rule_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataAccessRulePrivate *priv = GDATA_ACCESS_RULE (object)->priv; + + switch (property_id) { + case PROP_ROLE: + g_value_set_string (value, priv->role); + break; + case PROP_SCOPE_TYPE: + g_value_set_string (value, priv->scope_type); + break; + case PROP_SCOPE_VALUE: + g_value_set_string (value, priv->scope_value); + break; + case PROP_EDITED: + g_value_set_int64 (value, priv->edited); + break; + case PROP_ETAG: + /* Never return an ETag */ + g_value_set_string (value, NULL); + break; + case PROP_KEY: + g_value_set_string (value, priv->key); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_access_rule_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataAccessRule *self = GDATA_ACCESS_RULE (object); + + switch (property_id) { + case PROP_ROLE: + gdata_access_rule_set_role (self, g_value_get_string (value)); + break; + case PROP_SCOPE_TYPE: + g_free (self->priv->scope_type); + self->priv->scope_type = g_value_dup_string (value); + g_object_notify (object, "scope-type"); + break; + case PROP_SCOPE_VALUE: + g_free (self->priv->scope_value); + self->priv->scope_value = g_value_dup_string (value); + g_object_notify (object, "scope-value"); + break; + case PROP_ETAG: + /* Never set an ETag (note that this doesn't stop it being set in GDataEntry due to XML parsing) */ + break; + case PROP_KEY: + /* Read only; fall through */ + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataAccessRule *self = GDATA_ACCESS_RULE (parsable); + + if (gdata_parser_is_namespace (node, "http://www.w3.org/2007/app") == TRUE && + gdata_parser_int64_time_from_element (node, "edited", P_REQUIRED | P_NO_DUPES, &(self->priv->edited), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/acl/2007") == TRUE) { + if (xmlStrcmp (node->name, (xmlChar*) "role") == 0) { + /* gAcl:role */ + xmlChar *role = xmlGetProp (node, (xmlChar*) "value"); + if (role == NULL || *role == '\0') { + xmlFree (role); + return gdata_parser_error_required_property_missing (node, "value", error); + } + self->priv->role = (gchar*) role; + } else if (xmlStrcmp (node->name, (xmlChar*) "scope") == 0) { + /* gAcl:scope */ + xmlChar *scope_type, *scope_value; + + scope_type = xmlGetProp (node, (xmlChar*) "type"); + if (scope_type == NULL || *scope_type == '\0') { + xmlFree (scope_type); + return gdata_parser_error_required_property_missing (node, "type", error); + } + + scope_value = xmlGetProp (node, (xmlChar*) "value"); + + /* The @value property is required for all scope types except "default". + * See: https://developers.google.com/google-apps/calendar/v2/reference#gacl_reference */ + if (xmlStrcmp (scope_type, (xmlChar*) GDATA_ACCESS_SCOPE_DEFAULT) != 0 && scope_value == NULL) { + xmlFree (scope_type); + return gdata_parser_error_required_property_missing (node, "value", error); + } + + self->priv->scope_type = (gchar*) scope_type; + self->priv->scope_value = (gchar*) scope_value; + } else if (xmlStrcmp (node->name, (xmlChar*) "withKey") == 0) { + /* gAcl:withKey */ + gboolean found_role = FALSE; + xmlNode *child; + xmlChar *key; + + /* Extract the key. */ + key = xmlGetProp (node, (xmlChar *) "key"); + if (key == NULL) { + return gdata_parser_error_required_property_missing (node, "key", error); + } + + self->priv->key = (gchar *) key; + + /* Look for a gAcl:role child element. */ + for (child = node->children; child != NULL; child = child->next) { + if (xmlStrcmp (child->name, (xmlChar*) "role") == 0) { + xmlChar *role = xmlGetProp (child, (xmlChar *) "value"); + if (role == NULL) { + return gdata_parser_error_required_property_missing (child, "value", error); + } + + self->priv->role = (gchar *) role; + found_role = TRUE; + } else { + /* TODO: this logic copied from gdata-parsable.c. Re-evaluate this at some point in the future. + * If GeoRSS and GML support were to be used more widely, it might due to implement GML objects. */ + xmlBuffer *buffer; + + /* Unhandled XML */ + buffer = xmlBufferCreate (); + xmlNodeDump (buffer, doc, child, 0, 0); + g_debug ("Unhandled XML in : %s", (gchar *) xmlBufferContent (buffer)); + xmlBufferFree (buffer); + } + } + + if (!found_role) { + return gdata_parser_error_required_element_missing ("role", "gAcl:withKey", error); + } + } else { + return GDATA_PARSABLE_CLASS (gdata_access_rule_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else { + return GDATA_PARSABLE_CLASS (gdata_access_rule_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static gboolean +post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataAccessRulePrivate *priv = GDATA_ACCESS_RULE (parsable)->priv; + + /* Check for missing required elements */ + if (gdata_entry_get_title (GDATA_ENTRY (parsable)) == NULL || *gdata_entry_get_title (GDATA_ENTRY (parsable)) == '\0') + return gdata_parser_error_required_element_missing ("role", "entry", error); + if (priv->scope_type == NULL) + return gdata_parser_error_required_element_missing ("scope", "entry", error); + + return TRUE; +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataAccessRulePrivate *priv = GDATA_ACCESS_RULE (parsable)->priv; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_access_rule_parent_class)->get_xml (parsable, xml_string); + + if (priv->key != NULL) { + /* gAcl:withKey; has to wrap gAcl:role */ + gdata_parser_string_append_escaped (xml_string, ""); + } + + if (priv->role != NULL) { + /* gAcl:role */ + gdata_parser_string_append_escaped (xml_string, ""); + } + + if (priv->key != NULL) { + g_string_append (xml_string, ""); + } + + if (priv->scope_value != NULL) { + /* gAcl:scope */ + if (priv->scope_type != NULL) { + gdata_parser_string_append_escaped (xml_string, ""); + } else { + gdata_parser_string_append_escaped (xml_string, ""); + } + } else { + /* gAcl:scope of type GDATA_ACCESS_SCOPE_DEFAULT. */ + g_assert (priv->scope_type != NULL && strcmp (priv->scope_type, GDATA_ACCESS_SCOPE_DEFAULT) == 0); + g_string_append (xml_string, ""); + } +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_access_rule_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "gAcl", (gchar*) "http://schemas.google.com/acl/2007"); +} + +/** + * gdata_access_rule_new: + * @id: the access rule's ID, or %NULL + * + * Creates a new #GDataAccessRule with the given ID and default properties. + * + * Return value: a new #GDataAccessRule; unref with g_object_unref() + * + * Since: 0.3.0 + */ +GDataAccessRule * +gdata_access_rule_new (const gchar *id) +{ + return GDATA_ACCESS_RULE (g_object_new (GDATA_TYPE_ACCESS_RULE, "id", id, NULL)); +} + +/** + * gdata_access_rule_set_role: + * @self: a #GDataAccessRule + * @role: a new role, or %NULL + * + * Sets the #GDataAccessRule:role property to @role. @role must be a non-empty string, such as %GDATA_ACCESS_ROLE_NONE. + * + * Set @role to %NULL to unset the property in the access rule. + * + * Since: 0.3.0 + */ +void +gdata_access_rule_set_role (GDataAccessRule *self, const gchar *role) +{ + g_return_if_fail (GDATA_IS_ACCESS_RULE (self)); + g_return_if_fail (role == NULL || *role != '\0'); + + g_free (self->priv->role); + self->priv->role = g_strdup (role); + g_object_notify (G_OBJECT (self), "role"); +} + +/** + * gdata_access_rule_get_role: + * @self: a #GDataAccessRule + * + * Gets the #GDataAccessRule:role property. + * + * Return value: the access rule's role, or %NULL + * + * Since: 0.3.0 + */ +const gchar * +gdata_access_rule_get_role (GDataAccessRule *self) +{ + g_return_val_if_fail (GDATA_IS_ACCESS_RULE (self), NULL); + return self->priv->role; +} + + +/** + * gdata_access_rule_set_scope: + * @self: a #GDataAccessRule + * @type: a new scope type + * @value: (allow-none): a new scope value, or %NULL + * + * Sets the #GDataAccessRule:scope-type property to @type and the #GDataAccessRule:scope-value property to @value. + * + * Set @scope_value to %NULL to unset the #GDataAccessRule:scope-value property in the access rule. @type cannot + * be %NULL. @scope_value must be %NULL if @type is default, and non-%NULL otherwise. + * + * See the + * online + * documentation for more information. + * + * Since: 0.3.0 + */ +void +gdata_access_rule_set_scope (GDataAccessRule *self, const gchar *type, const gchar *value) +{ + g_return_if_fail (GDATA_IS_ACCESS_RULE (self)); + g_return_if_fail (type != NULL && *type != '\0'); + g_return_if_fail ((strcmp (type, GDATA_ACCESS_SCOPE_DEFAULT) == 0 && value == NULL) || value != NULL); + + g_free (self->priv->scope_type); + self->priv->scope_type = g_strdup (type); + + g_free (self->priv->scope_value); + self->priv->scope_value = g_strdup (value); + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "scope-type"); + g_object_notify (G_OBJECT (self), "scope-value"); + g_object_thaw_notify (G_OBJECT (self)); +} + +/** + * gdata_access_rule_get_scope: + * @self: a #GDataAccessRule + * @type: (out callee-allocates) (transfer none) (allow-none): return location for the scope type, or %NULL + * @value: (out callee-allocates) (transfer none) (allow-none): return location for the scope value, or %NULL + * + * Gets the #GDataAccessRule:scope-type and #GDataAccessRule:scope-value properties. + * + * Since: 0.3.0 + */ +void +gdata_access_rule_get_scope (GDataAccessRule *self, const gchar **type, const gchar **value) +{ + g_return_if_fail (GDATA_IS_ACCESS_RULE (self)); + if (type != NULL) + *type = self->priv->scope_type; + if (value != NULL) + *value = self->priv->scope_value; +} + +/** + * gdata_access_rule_get_edited: + * @self: a #GDataAccessRule + * + * Gets the #GDataAccessRule:edited property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the access rule was last edited, or -1 + * + * Since: 0.7.0 + */ +gint64 +gdata_access_rule_get_edited (GDataAccessRule *self) +{ + g_return_val_if_fail (GDATA_IS_ACCESS_RULE (self), -1); + return self->priv->edited; +} + +void +_gdata_access_rule_set_key (GDataAccessRule *self, const gchar *key) +{ + g_return_if_fail (GDATA_IS_ACCESS_RULE (self)); + + if (g_strcmp0 (key, self->priv->key) == 0) + return; + + g_free (self->priv->key); + self->priv->key = g_strdup (key); + + g_object_notify (G_OBJECT (self), "key"); +} + +/** + * gdata_access_rule_get_key: + * @self: a #GDataAccessRule + * + * Gets the #GDataAccessRule:key property. + * + * Return value: the access rule's authorisation key, or %NULL + * + * Since: 0.16.0 + */ +const gchar * +gdata_access_rule_get_key (GDataAccessRule *self) +{ + g_return_val_if_fail (GDATA_IS_ACCESS_RULE (self), NULL); + return self->priv->key; +} diff --git a/gdata/gdata-access-rule.h b/gdata/gdata-access-rule.h new file mode 100644 index 0000000..34db2c8 --- /dev/null +++ b/gdata/gdata-access-rule.h @@ -0,0 +1,118 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_ACCESS_RULE_H +#define GDATA_ACCESS_RULE_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_ACCESS_SCOPE_USER: + * + * The #GDataAccessRule applies to a single individual, whose e-mail address is given in #GDataAccessRule:scope-value. + * + * Since: 0.7.0 + */ +#define GDATA_ACCESS_SCOPE_USER "user" + +/** + * GDATA_ACCESS_SCOPE_DOMAIN: + * + * The #GDataAccessRule applies to all users in a Google Apps For Your Domain domain, given in #GDataAccessRule:scope-value. + * + * Since: 0.7.0 + */ +#define GDATA_ACCESS_SCOPE_DOMAIN "domain" + +/** + * GDATA_ACCESS_SCOPE_DEFAULT: + * + * The #GDataAccessRule applies to all users. + * + * Since: 0.7.0 + */ +#define GDATA_ACCESS_SCOPE_DEFAULT "default" + +/** + * GDATA_ACCESS_ROLE_NONE: + * + * The users specified by the #GDataAccessRule have no rights. + * + * Since: 0.7.0 + */ +#define GDATA_ACCESS_ROLE_NONE "none" + +#define GDATA_TYPE_ACCESS_RULE (gdata_access_rule_get_type ()) +#define GDATA_ACCESS_RULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_ACCESS_RULE, GDataAccessRule)) +#define GDATA_ACCESS_RULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_ACCESS_RULE, GDataAccessRuleClass)) +#define GDATA_IS_ACCESS_RULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_ACCESS_RULE)) +#define GDATA_IS_ACCESS_RULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_ACCESS_RULE)) +#define GDATA_ACCESS_RULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_ACCESS_RULE, GDataAccessRuleClass)) + +typedef struct _GDataAccessRulePrivate GDataAccessRulePrivate; + +/** + * GDataAccessRule: + * + * All the fields in the #GDataAccessRule structure are private and should never be accessed directly. + * + * Since: 0.3.0 + */ +typedef struct { + GDataEntry parent; + GDataAccessRulePrivate *priv; +} GDataAccessRule; + +/** + * GDataAccessRuleClass: + * + * All the fields in the #GDataAccessRuleClass structure are private and should never be accessed directly. + * + * Since: 0.3.0 + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataAccessRuleClass; + +GType gdata_access_rule_get_type (void) G_GNUC_CONST; + +GDataAccessRule *gdata_access_rule_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_access_rule_get_role (GDataAccessRule *self) G_GNUC_PURE; +void gdata_access_rule_set_role (GDataAccessRule *self, const gchar *role); +void gdata_access_rule_get_scope (GDataAccessRule *self, const gchar **type, const gchar **value); +void gdata_access_rule_set_scope (GDataAccessRule *self, const gchar *type, const gchar *value); +gint64 gdata_access_rule_get_edited (GDataAccessRule *self); +const gchar *gdata_access_rule_get_key (GDataAccessRule *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_ACCESS_RULE_H */ diff --git a/gdata/gdata-authorization-domain.c b/gdata/gdata-authorization-domain.c new file mode 100644 index 0000000..a0c640d --- /dev/null +++ b/gdata/gdata-authorization-domain.c @@ -0,0 +1,197 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-authorization-domain + * @short_description: GData authorization domain + * @stability: Stable + * @include: gdata/gdata-authorization-domain.h + * + * A #GDataAuthorizationDomain represents a single data domain which a user can authorize libgdata to access. This might be a domain covering the + * whole of the user's Google Contacts account, for example. Typically, #GDataServices map to #GDataAuthorizationDomains in a one-to-one + * fashion, though some services (such as #GDataDocumentsService) use multiple authorization domains. + * + * The #GDataAuthorizationDomainss used by a service can be retrieved using gdata_service_get_authorization_domains(). The set of domains + * used by a given service is static and will never change at runtime. + * + * #GDataAuthorizationDomains are used by a #GDataAuthorizer instance to request authorization to interact with data in those domains when + * first authenticating and authorizing with the online service. Typically, a given #GDataAuthorizer will be passed a set of domains (or a service + * type, from which it can retrieve the service's set of domains) at construction time, and will use those domains when initially asking the user for + * authorization and whenever the authorization is refreshed afterwards. It's not expected that the set of domains used by a #GDataAuthorizer will + * change after construction time. + * + * Note that it's not expected that #GDataAuthorizationDomains will have to be constructed manually. All #GDataServices should provide + * accessor functions to return instances of all the authorization domains they support. + * + * Since: 0.9.0 + */ + +#include + +#include "gdata-authorization-domain.h" + +static void finalize (GObject *object); +static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); + +struct _GDataAuthorizationDomainPrivate { + gchar *service_name; + gchar *scope; +}; + +enum { + PROP_SERVICE_NAME = 1, + PROP_SCOPE, +}; + +G_DEFINE_TYPE (GDataAuthorizationDomain, gdata_authorization_domain, G_TYPE_OBJECT) + +static void +gdata_authorization_domain_class_init (GDataAuthorizationDomainClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataAuthorizationDomainPrivate)); + + gobject_class->get_property = get_property; + gobject_class->set_property = set_property; + gobject_class->finalize = finalize; + + /** + * GDataAuthorizationDomain:service-name: + * + * The name of the service which contains the authorization domain, as enumerated in the + * online documentation. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_SERVICE_NAME, + g_param_spec_string ("service-name", + "Service name", "The name of the service which contains the authorization domain.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataAuthorizationDomain:scope: + * + * A URI detailing the scope of the authorization domain, as enumerated in the + * online documentation. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_SCOPE, + g_param_spec_string ("scope", + "Scope", "A URI detailing the scope of the authorization domain.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_authorization_domain_init (GDataAuthorizationDomain *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_AUTHORIZATION_DOMAIN, GDataAuthorizationDomainPrivate); +} + +static void +finalize (GObject *object) +{ + GDataAuthorizationDomainPrivate *priv = GDATA_AUTHORIZATION_DOMAIN (object)->priv; + + g_free (priv->service_name); + g_free (priv->scope); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_authorization_domain_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataAuthorizationDomainPrivate *priv = GDATA_AUTHORIZATION_DOMAIN (object)->priv; + + switch (property_id) { + case PROP_SERVICE_NAME: + g_value_set_string (value, priv->service_name); + break; + case PROP_SCOPE: + g_value_set_string (value, priv->scope); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataAuthorizationDomainPrivate *priv = GDATA_AUTHORIZATION_DOMAIN (object)->priv; + + switch (property_id) { + /* Construct only */ + case PROP_SERVICE_NAME: + priv->service_name = g_value_dup_string (value); + break; + /* Construct only */ + case PROP_SCOPE: + priv->scope = g_value_dup_string (value); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/** + * gdata_authorization_domain_get_service_name: + * @self: a #GDataAuthorizationDomain + * + * Returns the name of the service containing the authorization domain. See #GDataAuthorizationDomain:service-name for more details. + * + * Return value: name of the service containing the authorization domain + * + * Since: 0.9.0 + */ +const gchar * +gdata_authorization_domain_get_service_name (GDataAuthorizationDomain *self) +{ + g_return_val_if_fail (GDATA_IS_AUTHORIZATION_DOMAIN (self), NULL); + + return self->priv->service_name; +} + +/** + * gdata_authorization_domain_get_scope: + * @self: a #GDataAuthorizationDomain + * + * Returns a URI detailing the scope of the authorization domain. See #GDataAuthorizationDomain:scope for more details. + * + * Return value: URI detailing the scope of the authorization domain + * + * Since: 0.9.0 + */ +const gchar * +gdata_authorization_domain_get_scope (GDataAuthorizationDomain *self) +{ + g_return_val_if_fail (GDATA_IS_AUTHORIZATION_DOMAIN (self), NULL); + + return self->priv->scope; +} diff --git a/gdata/gdata-authorization-domain.h b/gdata/gdata-authorization-domain.h new file mode 100644 index 0000000..a4f8419 --- /dev/null +++ b/gdata/gdata-authorization-domain.h @@ -0,0 +1,78 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_AUTHORIZATION_DOMAIN_H +#define GDATA_AUTHORIZATION_DOMAIN_H + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_AUTHORIZATION_DOMAIN (gdata_authorization_domain_get_type ()) +#define GDATA_AUTHORIZATION_DOMAIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_AUTHORIZATION_DOMAIN, GDataAuthorizationDomain)) +#define GDATA_AUTHORIZATION_DOMAIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_AUTHORIZATION_DOMAIN, GDataAuthorizationDomainClass)) +#define GDATA_IS_AUTHORIZATION_DOMAIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_AUTHORIZATION_DOMAIN)) +#define GDATA_IS_AUTHORIZATION_DOMAIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_AUTHORIZATION_DOMAIN)) +#define GDATA_AUTHORIZATION_DOMAIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_AUTHORIZATION_DOMAIN, GDataAuthorizationDomainClass)) + +typedef struct _GDataAuthorizationDomainPrivate GDataAuthorizationDomainPrivate; + +/** + * GDataAuthorizationDomain: + * + * All the fields in the #GDataAuthorizationDomain structure are private and should never be accessed directly. + * + * Since: 0.9.0 + */ +typedef struct { + /*< private >*/ + GObject parent; + GDataAuthorizationDomainPrivate *priv; +} GDataAuthorizationDomain; + +/** + * GDataAuthorizationDomainClass: + * + * All the fields in the #GDataAuthorizationDomainClass structure are private and should never be accessed directly. + * + * Since: 0.9.0 + */ +typedef struct { + /*< private >*/ + GObjectClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataAuthorizationDomainClass; + +GType gdata_authorization_domain_get_type (void) G_GNUC_CONST; + +const gchar *gdata_authorization_domain_get_service_name (GDataAuthorizationDomain *self) G_GNUC_PURE; +const gchar *gdata_authorization_domain_get_scope (GDataAuthorizationDomain *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_AUTHORIZATION_DOMAIN_H */ diff --git a/gdata/gdata-authorizer.c b/gdata/gdata-authorizer.c new file mode 100644 index 0000000..933e425 --- /dev/null +++ b/gdata/gdata-authorizer.c @@ -0,0 +1,312 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011, 2014 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-authorizer + * @short_description: GData authorization interface + * @stability: Stable + * @include: gdata/gdata-authorizer.h + * + * The #GDataAuthorizer interface provides a uniform way to implement authentication and authorization processes for use by #GDataServices. + * Client code will construct a new #GDataAuthorizer instance of their choosing, such as #GDataClientLoginAuthorizer or #GDataOAuth2Authorizer, for + * the #GDataServices which will be used by the client, then authenticates and authorizes with the #GDataAuthorizer instead of the + * #GDataService. The #GDataService then uses the #GDataAuthorizer to authorize individual network requests using whatever authorization token was + * returned to the #GDataAuthorizer by the Google Accounts service. + * + * All #GDataAuthorizer implementations are expected to operate against a set of #GDataAuthorizationDomains which are provided to the + * authorizer at construction time. These domains specify which data domains the client expects to access using the #GDataServices they + * have using the #GDataAuthorizer instance. Following the principle of least privilege, the set of domains should be the minimum such set of domains + * which still allows the client to operate normally. Note that implementations of #GDataAuthorizationDomain may display the list of requested + * authorization domains to the user for verification before authorization is granted. + * + * #GDataAuthorizer implementations are provided for some of the standard authorization processes supported by Google for installed applications, as + * listed in their online documentation: + * + * #GDataClientLoginAuthorizer for + * ClientLogin (deprecated) + * #GDataOAuth1Authorizer for + * OAuth 1.0 (deprecated) + * #GDataOAuth2Authorizer for + * OAuth 2.0 (preferred) + * + * + * It is quite possible for clients to write their own #GDataAuthorizer implementation. For example, if a client already uses OAuth 2.0 and handles + * authentication itself, it may want to use its own #GDataAuthorizer implementation which simply exposes the client's existing access token to + * libgdata and does nothing more. + * + * It must be noted that all #GDataAuthorizer implementations must be thread safe, as methods such as gdata_authorizer_refresh_authorization() may be + * called from any thread (such as the thread performing an asynchronous query operation) at any time. + * + * Examples of code using #GDataAuthorizer can be found in the documentation for the various implementations of the #GDataAuthorizer interface. + * + * Since: 0.9.0 + */ + +#include + +#include "gdata-authorizer.h" + +G_DEFINE_INTERFACE (GDataAuthorizer, gdata_authorizer, G_TYPE_OBJECT) + +static void +gdata_authorizer_default_init (GDataAuthorizerInterface *iface) +{ + /* Nothing to see here */ +} + +/** + * gdata_authorizer_process_request: + * @self: a #GDataAuthorizer + * @domain: (allow-none): the #GDataAuthorizationDomain the query falls under, or %NULL + * @message: the query to process + * + * Processes @message, adding all the necessary extra headers and parameters to ensure that it's correctly authenticated and authorized under the + * given @domain for the online service. Basically, if a query is not processed by calling this method on it, it will be sent to the online service as + * if it's a query from a non-logged-in user. Similarly, if the #GDataAuthorizer isn't authenticated or authorized (for @domain), no changes will + * be made to the @message. + * + * @domain may be %NULL if the request doesn't require authorization. + * + * This modifies @message in place. + * + * This method is thread safe. + * + * Since: 0.9.0 + */ +void +gdata_authorizer_process_request (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message) +{ + GDataAuthorizerInterface *iface; + + g_return_if_fail (GDATA_IS_AUTHORIZER (self)); + g_return_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain)); + g_return_if_fail (SOUP_IS_MESSAGE (message)); + + iface = GDATA_AUTHORIZER_GET_IFACE (self); + g_assert (iface->process_request != NULL); + + iface->process_request (self, domain, message); +} + +/** + * gdata_authorizer_is_authorized_for_domain: + * @self: (allow-none): a #GDataAuthorizer, or %NULL + * @domain: the #GDataAuthorizationDomain to check against + * + * Returns whether the #GDataAuthorizer instance believes it's currently authorized to access the given @domain. Note that this will not perform any + * network requests, and will just look up the result in the #GDataAuthorizer's local cache of authorizations. This means that the result may be out + * of date, as the server may have since invalidated the authorization. If the #GDataAuthorizer class supports timeouts and TTLs on authorizations, + * they will not be taken into account; this method effectively returns whether the last successful authorization operation performed on the + * #GDataAuthorizer included @domain in the list of requested authorization domains. + * + * Note that %NULL may be passed as the #GDataAuthorizer, in which case %FALSE will always be returned, regardless of the @domain. This is for + * convenience of checking whether a domain is authorized by the #GDataAuthorizer returned by gdata_service_get_authorizer(), which may be %NULL. + * For example: + * |[ + * if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (my_service), my_domain) == TRUE) { + * /* Code to execute only if we're authorized for the given domain */ + * } + * ]| + * + * This method is thread safe. + * + * Return value: %TRUE if the #GDataAuthorizer has been authorized to access @domain, %FALSE otherwise + * + * Since: 0.9.0 + */ +gboolean +gdata_authorizer_is_authorized_for_domain (GDataAuthorizer *self, GDataAuthorizationDomain *domain) +{ + GDataAuthorizerInterface *iface; + + g_return_val_if_fail (self == NULL || GDATA_IS_AUTHORIZER (self), FALSE); + g_return_val_if_fail (GDATA_IS_AUTHORIZATION_DOMAIN (domain), FALSE); + + if (self == NULL) { + return FALSE; + } + + iface = GDATA_AUTHORIZER_GET_IFACE (self); + g_assert (iface->is_authorized_for_domain != NULL); + + return iface->is_authorized_for_domain (self, domain); +} + +/** + * gdata_authorizer_refresh_authorization: + * @self: a #GDataAuthorizer + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Forces the #GDataAuthorizer to refresh any authorization tokens it holds with the online service. This should typically be called when a + * #GDataService query returns %GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, and is already called transparently by methods such as + * gdata_service_query() and gdata_service_insert_entry() (see their documentation for more details). + * + * If re-authorization is successful, it's guaranteed that by the time this method returns, the properties containing the relevant authorization + * tokens on the #GDataAuthorizer instance will have been updated. + * + * If %FALSE is returned, @error will be set if (and only if) it's due to a refresh being attempted and failing. If a refresh is not attempted, %FALSE + * will be returned but @error will not be set. + * + * If the #GDataAuthorizer has not been previously authenticated or authorized (using the class' specific methods), no authorization will be + * attempted, %FALSE will be returned immediately and @error will not be set. + * + * Some #GDataAuthorizer implementations may not support refreshing authorization tokens at all; for example if doing so requires user interaction. + * %FALSE will be returned immediately in that case and @error will not be set. + * + * This method is thread safe. + * + * Return value: %TRUE if an authorization refresh was attempted and was successful, %FALSE if a refresh wasn't attempted or was unsuccessful + * + * Since: 0.9.0 + */ +gboolean +gdata_authorizer_refresh_authorization (GDataAuthorizer *self, GCancellable *cancellable, GError **error) +{ + GDataAuthorizerInterface *iface; + + g_return_val_if_fail (GDATA_IS_AUTHORIZER (self), FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + iface = GDATA_AUTHORIZER_GET_IFACE (self); + + /* Return FALSE with no error if the method isn't implemented */ + if (iface->refresh_authorization == NULL) { + return FALSE; + } + + return iface->refresh_authorization (self, cancellable, error); +} + +static void +refresh_authorization_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataAuthorizer *authorizer = GDATA_AUTHORIZER (source_object); + g_autoptr(GError) error = NULL; + + /* Refresh the authorisation and return */ + gdata_authorizer_refresh_authorization (authorizer, cancellable, &error); + + if (error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_boolean (task, TRUE); +} + +/** + * gdata_authorizer_refresh_authorization_async: + * @self: a #GDataAuthorizer + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: (allow-none) (scope async): a #GAsyncReadyCallback to call when the authorization refresh operation is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Forces the #GDataAuthorizer to refresh any authorization tokens it holds with the online service. @self and @cancellable are reffed when this + * method is called, so can safely be freed after this method returns. + * + * For more details, see gdata_authorizer_refresh_authorization(), which is the synchronous version of this method. If the #GDataAuthorizer class + * doesn't implement #GDataAuthorizerInterface.refresh_authorization_async but does implement #GDataAuthorizerInterface.refresh_authorization, the + * latter will be called from a new thread to make it asynchronous. + * + * When the authorization refresh operation is finished, @callback will be called. You can then call gdata_authorizer_refresh_authorization_finish() + * to get the results of the operation. + * + * This method is thread safe. + * + * Since: 0.9.0 + */ +void +gdata_authorizer_refresh_authorization_async (GDataAuthorizer *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + GDataAuthorizerInterface *iface; + + g_return_if_fail (GDATA_IS_AUTHORIZER (self)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + iface = GDATA_AUTHORIZER_GET_IFACE (self); + + /* Either both _async() and _finish() must be defined, or they must both be undefined. */ + g_assert ((iface->refresh_authorization_async == NULL && iface->refresh_authorization_finish == NULL) || + (iface->refresh_authorization_async != NULL && iface->refresh_authorization_finish != NULL)); + + if (iface->refresh_authorization_async != NULL) { + /* Call the method */ + iface->refresh_authorization_async (self, cancellable, callback, user_data); + } else { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_authorizer_refresh_authorization_async); + + + if (iface->refresh_authorization != NULL) { + /* If the _async() method isn't implemented, fall back to running the sync method in a thread */ + g_task_run_in_thread (task, refresh_authorization_thread); + } else { + /* If neither are implemented, immediately return FALSE with no error in a callback */ + g_task_return_boolean (task, FALSE); + } + + return; + } +} + +/** + * gdata_authorizer_refresh_authorization_finish: + * @self: a #GDataAuthorizer + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous authorization refresh operation for the #GDataAuthorizer, as started with gdata_authorizer_refresh_authorization_async(). + * + * This method is thread safe. + * + * Return value: %TRUE if an authorization refresh was attempted and was successful, %FALSE if a refresh wasn't attempted or was unsuccessful + * + * Since: 0.9.0 + */ +gboolean +gdata_authorizer_refresh_authorization_finish (GDataAuthorizer *self, GAsyncResult *async_result, GError **error) +{ + GDataAuthorizerInterface *iface; + + g_return_val_if_fail (GDATA_IS_AUTHORIZER (self), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + iface = GDATA_AUTHORIZER_GET_IFACE (self); + + /* Either both _async() and _finish() must be defined, or they must both be undefined. */ + g_assert ((iface->refresh_authorization_async == NULL && iface->refresh_authorization_finish == NULL) || + (iface->refresh_authorization_async != NULL && iface->refresh_authorization_finish != NULL)); + + if (iface->refresh_authorization_finish != NULL) { + /* Call the method */ + return iface->refresh_authorization_finish (self, async_result, error); + } else if (iface->refresh_authorization != NULL) { + /* If the _async() method isn't implemented, fall back to finishing off running the sync method in a thread */ + g_return_val_if_fail (g_task_is_valid (async_result, self), FALSE); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_authorizer_refresh_authorization_async), FALSE); + + return g_task_propagate_boolean (G_TASK (async_result), error); + } + + /* Fall back to just returning FALSE if none of the methods are implemented */ + return FALSE; +} diff --git a/gdata/gdata-authorizer.h b/gdata/gdata-authorizer.h new file mode 100644 index 0000000..4913c50 --- /dev/null +++ b/gdata/gdata-authorizer.h @@ -0,0 +1,91 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_AUTHORIZER_H +#define GDATA_AUTHORIZER_H + +#include +#include +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_AUTHORIZER (gdata_authorizer_get_type ()) +#define GDATA_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_AUTHORIZER, GDataAuthorizer)) +#define GDATA_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_AUTHORIZER, GDataAuthorizerInterface)) +#define GDATA_IS_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_AUTHORIZER)) +#define GDATA_AUTHORIZER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GDATA_TYPE_AUTHORIZER, GDataAuthorizerInterface)) + +/** + * GDataAuthorizer: + * + * All the fields in the #GDataAuthorizer structure are private and should never be accessed directly. + * + * Since: 0.9.0 + */ +typedef struct _GDataAuthorizer GDataAuthorizer; /* dummy typedef */ + +/** + * GDataAuthorizerInterface: + * @parent: the parent type + * @process_request: a function to append authorization headers to queries before they are submitted to the online service under the given + * authorization domain (which may be %NULL); this must be implemented and must be thread safe, and must also handle being called multiple times on + * the same #SoupMessage instance (so must be careful to replace headers rather than append them, for example) + * @is_authorized_for_domain: a function to check whether the authorizer is authorized against the given domain; this must be implemented and must + * be thread safe + * @refresh_authorization: (allow-none): a function to force a refresh of any authorization tokens the authorizer holds, returning %TRUE if a refresh + * was attempted and was successful, or %FALSE if a refresh wasn't attempted or was unsuccessful; if this isn't implemented it's assumed %FALSE + * would've been returned, if it is implemented it must be thread safe + * @refresh_authorization_async: (allow-none): an asynchronous version of @refresh_authorization; if this isn't implemented and @refresh_authorization + * is, @refresh_authorization will be called in a thread to simulate this function, whereas if this is implemented @refresh_authorization_finish must + * also be implemented and both functions must be thread safe + * @refresh_authorization_finish: (allow-none): a finish function for the asynchronous version of @refresh_authorization; this must be implemented + * exactly if @refresh_authorization_async is implemented, and must be thread safe if it is implemented + * + * The class structure for the #GDataAuthorizer interface. + * + * Since: 0.9.0 + */ +typedef struct { + GTypeInterface parent; + + void (*process_request) (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message); + gboolean (*is_authorized_for_domain) (GDataAuthorizer *self, GDataAuthorizationDomain *domain); + gboolean (*refresh_authorization) (GDataAuthorizer *self, GCancellable *cancellable, GError **error); + void (*refresh_authorization_async) (GDataAuthorizer *self, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); + gboolean (*refresh_authorization_finish) (GDataAuthorizer *self, GAsyncResult *async_result, GError **error); +} GDataAuthorizerInterface; + +GType gdata_authorizer_get_type (void) G_GNUC_CONST; + +void gdata_authorizer_process_request (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message); +gboolean gdata_authorizer_is_authorized_for_domain (GDataAuthorizer *self, GDataAuthorizationDomain *domain); + +gboolean gdata_authorizer_refresh_authorization (GDataAuthorizer *self, GCancellable *cancellable, GError **error); +void gdata_authorizer_refresh_authorization_async (GDataAuthorizer *self, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +gboolean gdata_authorizer_refresh_authorization_finish (GDataAuthorizer *self, GAsyncResult *async_result, GError **error); + +G_END_DECLS + +#endif /* !GDATA_AUTHORIZER_H */ diff --git a/gdata/gdata-batch-feed.c b/gdata/gdata-batch-feed.c new file mode 100644 index 0000000..103ec9c --- /dev/null +++ b/gdata/gdata-batch-feed.c @@ -0,0 +1,170 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/* + * SECTION:gdata-batch-feed + * @short_description: GData batch feed helper object + * @stability: Stable + * @include: gdata/gdata-batch-feed.h + * + * Helper class to parse the feed returned from a batch operation and instantiate different types of #GDataEntry according to the batch operation + * associated with each one. It's tightly coupled with #GDataBatchOperation, and isn't exposed publicly. + * + * For more information, see the online documentation. + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-batch-feed.h" +#include "gdata-private.h" +#include "gdata-batch-private.h" + +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); + +G_DEFINE_TYPE (GDataBatchFeed, gdata_batch_feed, GDATA_TYPE_FEED) + +static void +gdata_batch_feed_class_init (GDataBatchFeedClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + parsable_class->parse_xml = parse_xml; +} + +static void +gdata_batch_feed_init (GDataBatchFeed *self) +{ + /* Nothing to see here */ +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + GDataBatchOperation *operation = GDATA_BATCH_OPERATION (user_data); + + if (xmlStrcmp (node->name, (xmlChar*) "entry") == 0) { + GDataEntry *entry = NULL; + xmlBuffer *status_response = NULL; + gchar *status_reason = NULL; + guint id = 0, status_code = 0; + xmlNode *entry_node; + BatchOperation *op; + + status_response = xmlBufferCreate (); + + /* Parse the child nodes of the to get the batch namespace elements containing information about this operation */ + for (entry_node = node->children; entry_node != NULL; entry_node = entry_node->next) { + /* We have to be careful about namespaces here, and we can skip text nodes (since none of the nodes we're looking for + * are text nodes) */ + if (entry_node->type == XML_TEXT_NODE || + gdata_parser_is_namespace (entry_node, "http://schemas.google.com/gdata/batch") == FALSE) + continue; + + if (xmlStrcmp (entry_node->name, (xmlChar*) "id") == 0) { + /* batch:id */ + xmlChar *id_string = xmlNodeListGetString (doc, entry_node->children, TRUE); + id = g_ascii_strtoull ((char*) id_string, NULL, 10); + xmlFree (id_string); + } else if (xmlStrcmp (entry_node->name, (xmlChar*) "status") == 0) { + /* batch:status */ + xmlChar *status_code_string; + xmlNode *child_node; + + status_code_string = xmlGetProp (entry_node, (xmlChar*) "code"); + status_code = g_ascii_strtoull ((char*) status_code_string, NULL, 10); + xmlFree (status_code_string); + + status_reason = (gchar*) xmlGetProp (entry_node, (xmlChar*) "reason"); + + /* Dump the content of the status node, since it's service-specific, and could be anything from plain text to XML */ + for (child_node = entry_node->children; child_node != NULL; child_node = child_node->next) + xmlNodeDump (status_response, doc, child_node, 0, 0); + } + + if (id != 0 && status_code != 0) + break; + } + + /* Check we've got all the required data */ + if (id == 0) { + gdata_parser_error_required_element_missing ("batch:id", "entry", error); + goto error; + } else if (status_code == 0) { + gdata_parser_error_required_element_missing ("batch:status", "entry", error); + goto error; + } + + op = _gdata_batch_operation_get_operation (operation, id); + + /* Check for errors */ + if (SOUP_STATUS_IS_SUCCESSFUL (status_code) == FALSE) { + /* Handle the error */ + GDataService *service = gdata_batch_operation_get_service (operation); + GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (service); + GError *child_error = NULL; + + /* Parse the error (it's returned in a service-specific format */ + g_assert (klass->parse_error_response != NULL); + klass->parse_error_response (service, (GDataOperationType) op->type, status_code, + status_reason, (gchar*) xmlBufferContent (status_response), + xmlBufferLength (status_response), &child_error); + + /* Run the operation's callback. This takes ownership of @child_error. */ + _gdata_batch_operation_run_callback (operation, op, NULL, child_error); + + g_free (status_reason); + xmlBufferFree (status_response); + + /* We return TRUE because we parsed the XML successfully; despite it being an error that we parsed */ + return TRUE; + } + + /* If there wasn't an error, parse the resulting GDataEntry and run the operation's callback */ + if (op->type == GDATA_BATCH_OPERATION_QUERY) + entry = GDATA_ENTRY (_gdata_parsable_new_from_xml_node (op->entry_type, doc, node, NULL, error)); + else if (op->type != GDATA_BATCH_OPERATION_DELETION) + entry = GDATA_ENTRY (_gdata_parsable_new_from_xml_node (G_OBJECT_TYPE (op->entry), doc, node, NULL, error)); + + if (op->type != GDATA_BATCH_OPERATION_DELETION && entry == NULL) + goto error; + + _gdata_batch_operation_run_callback (operation, op, entry, NULL); + + if (entry != NULL) + g_object_unref (entry); + + g_free (status_reason); + xmlBufferFree (status_response); + + return TRUE; + +error: + g_free (status_reason); + xmlBufferFree (status_response); + + return FALSE; + } else if (GDATA_PARSABLE_CLASS (gdata_batch_feed_parent_class)->parse_xml (parsable, doc, node, user_data, error) == FALSE) { + /* Error! */ + return FALSE; + } + + return TRUE; +} diff --git a/gdata/gdata-batch-feed.h b/gdata/gdata-batch-feed.h new file mode 100644 index 0000000..3e50d65 --- /dev/null +++ b/gdata/gdata-batch-feed.h @@ -0,0 +1,73 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_BATCH_FEED_H +#define GDATA_BATCH_FEED_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_BATCH_FEED (gdata_batch_feed_get_type ()) +#define GDATA_BATCH_FEED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_BATCH_FEED, GDataBatchFeed)) +#define GDATA_BATCH_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_BATCH_FEED, GDataBatchFeedClass)) +#define GDATA_IS_BATCH_FEED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_BATCH_FEED)) +#define GDATA_IS_BATCH_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_BATCH_FEED)) +#define GDATA_BATCH_FEED_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_BATCH_FEED, GDataBatchFeedClass)) + +typedef struct _GDataBatchFeedPrivate GDataBatchFeedPrivate; + +/** + * GDataBatchFeed: + * + * All the fields in the #GDataBatchFeed structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataFeed parent; + GDataBatchFeedPrivate *priv; +} GDataBatchFeed; + +/** + * GDataBatchFeedClass: + * + * All the fields in the #GDataBatchFeedClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataFeedClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataBatchFeedClass; + +GType gdata_batch_feed_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* !GDATA_BATCH_FEED_H */ diff --git a/gdata/gdata-batch-operation.c b/gdata/gdata-batch-operation.c new file mode 100644 index 0000000..adac8b5 --- /dev/null +++ b/gdata/gdata-batch-operation.c @@ -0,0 +1,825 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-batch-operation + * @short_description: GData batch operation object + * @stability: Stable + * @include: gdata/gdata-batch-operation.h + * + * #GDataBatchOperation is a transient standalone class which represents and handles a single batch operation request to a service. To make a batch + * operation request: create a new #GDataBatchOperation; add the required queries, insertions, updates and deletions to the operation using + * gdata_batch_operation_add_query(), gdata_batch_operation_add_insertion(), gdata_batch_operation_add_update() and + * gdata_batch_operation_add_deletion(), respectively; run the request with gdata_batch_operation_run() or gdata_batch_operation_run_async(); and + * handle the results in the callback functions which are invoked by the operation as the results are received and parsed. + * + * If authorization is required for any of the requests in the batch operation, the #GDataService set in #GDataBatchOperation:service must have + * a #GDataAuthorizer set as its #GDataService:authorizer property, and that authorizer must be authorized for the #GDataAuthorizationDomain set + * in #GDataBatchOperation:authorization-domain. It's not possible for requests in a single batch operation to be authorized under multiple domains; + * in that case, the requests must be split up across several batch operations using different authorization domains. + * + * If all of the requests in the batch operation don't require authorization (i.e. they all operate on public data; see the documentation for the + * #GDataService subclass in question's operations for details of which require authorization), #GDataBatchOperation:authorization-domain can be set + * to %NULL to save the overhead of sending authorization data to the online service. + * + * + * Running a Synchronous Operation + * + * guint op_id, op_id2; + * GDataBatchOperation *operation; + * GDataContactsContact *contact; + * GDataService *service; + * GDataAuthorizationDomain *domain; + * + * service = create_contacts_service (); + * domain = get_authorization_domain_from_service (service); + * contact = create_new_contact (); + * batch_link = gdata_feed_look_up_link (contacts_feed, GDATA_LINK_BATCH); + * + * operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), domain, gdata_link_get_uri (batch_link)); + * + * /* Add to the operation to insert a new contact and query for another one */ + * op_id = gdata_batch_operation_add_insertion (operation, GDATA_ENTRY (contact), insertion_cb, user_data); + * op_id2 = gdata_batch_operation_add_query (operation, gdata_entry_get_id (other_contact), GDATA_TYPE_CONTACTS_CONTACT, query_cb, user_data); + * + * g_object_unref (contact); + * g_object_unref (domain); + * g_object_unref (service); + * + * /* Run the operations in a blocking fashion. Ideally, check and free the error as appropriate after running the operation. */ + * gdata_batch_operation_run (operation, NULL, &error); + * + * g_object_unref (operation); + * + * static void + * insertion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_id == op_id, operation_type == GDATA_BATCH_OPERATION_INSERTION */ + * + * /* Process the new inserted entry, ideally after checking for errors. Note that the entry should be reffed if it needs to stay + * * alive after execution of the callback finishes. */ + * process_inserted_entry (entry, user_data); + * } + * + * static void + * query_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_id == op_id2, operation_type == GDATA_BATCH_OPERATION_QUERY */ + * + * /* Process the results of the query, ideally after checking for errors. Note that the entry should be reffed if it needs to + * * stay alive after execution of the callback finishes. */ + * process_queried_entry (entry, user_data); + * } + * + * + * + * Since: 0.7.0 + */ + +#include +#include +#include +#include + +#include "gdata-batch-operation.h" +#include "gdata-batch-feed.h" +#include "gdata-batchable.h" +#include "gdata-private.h" +#include "gdata-batch-private.h" + +static void operation_free (BatchOperation *op); + +static void gdata_batch_operation_dispose (GObject *object); +static void gdata_batch_operation_finalize (GObject *object); +static void gdata_batch_operation_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_batch_operation_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); + +struct _GDataBatchOperationPrivate { + GDataService *service; + GDataAuthorizationDomain *authorization_domain; + gchar *feed_uri; + GHashTable *operations; + guint next_id; /* next available operation ID */ + gboolean has_run; /* TRUE if the operation has been run already (though it does not necessarily have to have finished running) */ + gboolean is_async; /* TRUE if the operation was run with *_run_async(); FALSE if run with *_run() */ +}; + +enum { + PROP_SERVICE = 1, + PROP_FEED_URI, + PROP_AUTHORIZATION_DOMAIN, +}; + +G_DEFINE_TYPE (GDataBatchOperation, gdata_batch_operation, G_TYPE_OBJECT) +#define GDATA_BATCH_OPERATION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDATA_TYPE_BATCH_OPERATION, GDataBatchOperationPrivate)) + +static void +gdata_batch_operation_class_init (GDataBatchOperationClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataBatchOperationPrivate)); + + gobject_class->dispose = gdata_batch_operation_dispose; + gobject_class->finalize = gdata_batch_operation_finalize; + gobject_class->get_property = gdata_batch_operation_get_property; + gobject_class->set_property = gdata_batch_operation_set_property; + + /** + * GDataBatchOperation:service: + * + * The service this batch operation is attached to. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_SERVICE, + g_param_spec_object ("service", + "Service", "The service this batch operation is attached to.", + GDATA_TYPE_SERVICE, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataBatchOperation:authorization-domain: + * + * The authorization domain for the batch operation, against which the #GDataService:authorizer for the #GDataBatchOperation:service should be + * authorized. This may be %NULL if authorization is not needed for any of the requests in the batch operation. + * + * All requests in the batch operation must be authorizable under this single authorization domain. If requests need different authorization + * domains, they must be performed in different batch operations. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_AUTHORIZATION_DOMAIN, + g_param_spec_object ("authorization-domain", + "Authorization domain", "The authorization domain for the batch operation.", + GDATA_TYPE_AUTHORIZATION_DOMAIN, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataBatchOperation:feed-uri: + * + * The feed URI that this batch operation will be sent to. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_FEED_URI, + g_param_spec_string ("feed-uri", + "Feed URI", "The feed URI that this batch operation will be sent to.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_batch_operation_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataBatchOperationPrivate *priv = GDATA_BATCH_OPERATION_GET_PRIVATE (object); + + switch (property_id) { + case PROP_SERVICE: + g_value_set_object (value, priv->service); + break; + case PROP_AUTHORIZATION_DOMAIN: + g_value_set_object (value, priv->authorization_domain); + break; + case PROP_FEED_URI: + g_value_set_string (value, priv->feed_uri); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_batch_operation_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataBatchOperationPrivate *priv = GDATA_BATCH_OPERATION_GET_PRIVATE (object); + + switch (property_id) { + case PROP_SERVICE: + priv->service = g_value_dup_object (value); + break; + /* Construct only */ + case PROP_AUTHORIZATION_DOMAIN: + priv->authorization_domain = g_value_dup_object (value); + break; + case PROP_FEED_URI: + priv->feed_uri = g_value_dup_string (value); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_batch_operation_init (GDataBatchOperation *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_BATCH_OPERATION, GDataBatchOperationPrivate); + self->priv->next_id = 1; /* reserve ID 0 for error conditions */ + self->priv->operations = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) operation_free); +} + +static void +gdata_batch_operation_dispose (GObject *object) +{ + GDataBatchOperationPrivate *priv = GDATA_BATCH_OPERATION_GET_PRIVATE (object); + + if (priv->authorization_domain != NULL) + g_object_unref (priv->authorization_domain); + priv->authorization_domain = NULL; + + if (priv->service != NULL) + g_object_unref (priv->service); + priv->service = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_batch_operation_parent_class)->dispose (object); +} + +static void +gdata_batch_operation_finalize (GObject *object) +{ + GDataBatchOperationPrivate *priv = GDATA_BATCH_OPERATION_GET_PRIVATE (object); + + g_free (priv->feed_uri); + g_hash_table_destroy (priv->operations); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_batch_operation_parent_class)->finalize (object); +} + +/** + * gdata_batch_operation_get_service: + * @self: a #GDataBatchOperation + * + * Gets the #GDataBatchOperation:service property. + * + * Return value: (transfer none): the batch operation's attached service + * + * Since: 0.7.0 + */ +GDataService * +gdata_batch_operation_get_service (GDataBatchOperation *self) +{ + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), NULL); + return self->priv->service; +} + +/** + * gdata_batch_operation_get_authorization_domain: + * @self: a #GDataBatchOperation + * + * Gets the #GDataBatchOperation:authorization-domain property. + * + * Return value: (transfer none) (allow-none): the #GDataAuthorizationDomain used to authorize the batch operation, or %NULL + * + * Since: 0.9.0 + */ +GDataAuthorizationDomain * +gdata_batch_operation_get_authorization_domain (GDataBatchOperation *self) +{ + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), NULL); + + return self->priv->authorization_domain; +} + +/** + * gdata_batch_operation_get_feed_uri: + * @self: a #GDataBatchOperation + * + * Gets the #GDataBatchOperation:feed-uri property. + * + * Return value: the batch operation's feed URI + * + * Since: 0.7.0 + */ +const gchar * +gdata_batch_operation_get_feed_uri (GDataBatchOperation *self) +{ + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), NULL); + return self->priv->feed_uri; +} + +/* Add an operation to the list of operations to be executed when the #GDataBatchOperation is run, and return its operation ID */ +static guint +add_operation (GDataBatchOperation *self, GDataBatchOperationType type, GDataEntry *entry, GDataBatchOperationCallback callback, gpointer user_data) +{ + BatchOperation *op; + + /* Create the operation */ + op = g_slice_new0 (BatchOperation); + op->id = (self->priv->next_id++); + op->type = type; + op->callback = callback; + op->user_data = user_data; + op->entry = g_object_ref (entry); + + /* Add the operation to the table */ + g_hash_table_insert (self->priv->operations, GUINT_TO_POINTER (op->id), op); + + return op->id; +} + +/** + * _gdata_batch_operation_get_operation: + * @self: a #GDataBatchOperation + * @id: the operation ID + * + * Return the #BatchOperation for the given operation ID. + * + * Return value: the relevant #BatchOperation, or %NULL + * + * Since: 0.7.0 + */ +BatchOperation * +_gdata_batch_operation_get_operation (GDataBatchOperation *self, guint id) +{ + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), NULL); + g_return_val_if_fail (id > 0, NULL); + + return g_hash_table_lookup (self->priv->operations, GUINT_TO_POINTER (id)); +} + +/* Run a user-supplied callback for a #BatchOperation whose return value we've just processed. This is designed to be used in an idle handler, so + * that the callback is run in the main thread. It can be called if the user-supplied callback is %NULL (e.g. in the case that the callback's been + * called before). */ +static gboolean +run_callback_cb (BatchOperation *op) +{ + if (op->callback != NULL) + op->callback (op->id, op->type, op->entry, op->error, op->user_data); + + /* Unset the callback so that it can't be called again */ + op->callback = NULL; + + return FALSE; +} + +/** + * _gdata_batch_operation_run_callback: + * @self: a #GDataBatchOperation + * @op: the #BatchOperation which has been finished + * @entry: (allow-none): the entry representing the operation's result, or %NULL + * @error: the error from the operation, or %NULL + * + * Run the callback for @op to notify the user code that the operation's result has been received and processed. Either @entry or @error should be + * set (and the other should be %NULL), signifying a successful operation or a failed operation, respectively. + * + * The function will call @op's user-supplied callback, if available, in either the current or the main thread, depending on whether the + * #GDataBatchOperation was run with gdata_batch_operation_run() or gdata_batch_operation_run_async(). + * + * Since: 0.7.0 + */ +void +_gdata_batch_operation_run_callback (GDataBatchOperation *self, BatchOperation *op, GDataEntry *entry, GError *error) +{ + g_return_if_fail (GDATA_IS_BATCH_OPERATION (self)); + g_return_if_fail (op != NULL); + g_return_if_fail (entry == NULL || GDATA_IS_ENTRY (entry)); + g_return_if_fail (entry == NULL || error == NULL); + + /* We can free the request data, and replace it with the response data */ + g_free (op->query_id); + op->query_id = NULL; + if (op->entry != NULL) + g_object_unref (op->entry); + if (entry != NULL) + g_object_ref (entry); + op->entry = entry; + op->error = error; + + /* Don't bother scheduling run_callback_cb() if there is no callback to run */ + if (op->callback == NULL) + return; + + /* Only dispatch it in the main thread if the request was run with *_run_async(). This allows applications to run batch operations entirely in + * application-owned threads if desired. */ + if (self->priv->is_async == TRUE) { + /* Send the callback; use G_PRIORITY_DEFAULT rather than G_PRIORITY_DEFAULT_IDLE + * to contend with the priorities used by the callback functions in GAsyncResult */ + g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc) run_callback_cb, op, NULL); + } else { + run_callback_cb (op); + } +} + +/* Free a #BatchOperation */ +static void +operation_free (BatchOperation *op) +{ + g_free (op->query_id); + if (op->entry != NULL) + g_object_unref (op->entry); + if (op->error != NULL) + g_error_free (op->error); + + g_slice_free (BatchOperation, op); +} + +/** + * gdata_batch_operation_add_query: + * @self: a #GDataBatchOperation + * @id: the ID of the entry being queried for + * @entry_type: the type of the entry which will be returned + * @callback: (scope async): a #GDataBatchOperationCallback to call when the query is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Add a query to the #GDataBatchOperation, to be executed when the operation is run. The query will return a #GDataEntry (of subclass type + * @entry_type) representing the given entry @id. The ID is of the same format as that returned by gdata_entry_get_id(). + * + * Note that a single batch operation should not operate on a given #GDataEntry more than once, as there's no guarantee about the order in which the + * batch operation's operations will be performed. + * + * @callback will be called when the #GDataBatchOperation is run with gdata_batch_operation_run() (in which case it will be called in the thread which + * ran the batch operation), or with gdata_batch_operation_run_async() (in which case it will be called in an idle handler in the main thread). The + * @operation_id passed to the callback will match the return value of gdata_batch_operation_add_query(), and the @operation_type will be + * %GDATA_BATCH_OPERATION_QUERY. If the query was successful, the resulting entry will be passed to the callback function as @entry, and @error will + * be %NULL. If, however, the query was unsuccessful, @entry will be %NULL and @error will contain a #GError detailing what went wrong. + * + * Return value: operation ID for the added query, or 0 + * + * Since: 0.7.0 + */ +guint +gdata_batch_operation_add_query (GDataBatchOperation *self, const gchar *id, GType entry_type, + GDataBatchOperationCallback callback, gpointer user_data) +{ + BatchOperation *op; + + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), 0); + g_return_val_if_fail (id != NULL, 0); + g_return_val_if_fail (g_type_is_a (entry_type, GDATA_TYPE_ENTRY), 0); + g_return_val_if_fail (self->priv->has_run == FALSE, 0); + + /* Create the operation manually, since it would be messy to special-case add_operation() to do this */ + op = g_slice_new0 (BatchOperation); + op->id = (self->priv->next_id++); + op->type = GDATA_BATCH_OPERATION_QUERY; + op->callback = callback; + op->user_data = user_data; + op->query_id = g_strdup (id); + op->entry_type = entry_type; + + /* Add the operation to the table */ + g_hash_table_insert (self->priv->operations, GUINT_TO_POINTER (op->id), op); + + return op->id; +} + +/** + * gdata_batch_operation_add_insertion: + * @self: a #GDataBatchOperation + * @entry: the #GDataEntry to insert + * @callback: (scope async): a #GDataBatchOperationCallback to call when the insertion is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Add an entry to the #GDataBatchOperation, to be inserted on the server when the operation is run. The insertion will return the inserted version + * of @entry. @entry is reffed by the function, so may be freed after it returns. + * + * @callback will be called as specified in the documentation for gdata_batch_operation_add_query(), with an @operation_type of + * %GDATA_BATCH_OPERATION_INSERTION. + * + * Return value: operation ID for the added insertion, or 0 + * + * Since: 0.7.0 + */ +guint +gdata_batch_operation_add_insertion (GDataBatchOperation *self, GDataEntry *entry, GDataBatchOperationCallback callback, gpointer user_data) +{ + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), 0); + g_return_val_if_fail (GDATA_IS_ENTRY (entry), 0); + g_return_val_if_fail (self->priv->has_run == FALSE, 0); + + return add_operation (self, GDATA_BATCH_OPERATION_INSERTION, entry, callback, user_data); +} + +/** + * gdata_batch_operation_add_update: + * @self: a #GDataBatchOperation + * @entry: the #GDataEntry to update + * @callback: (scope async): a #GDataBatchOperationCallback to call when the update is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Add an entry to the #GDataBatchOperation, to be updated on the server when the operation is run. The update will return the updated version of + * @entry. @entry is reffed by the function, so may be freed after it returns. + * + * Note that a single batch operation should not operate on a given #GDataEntry more than once, as there's no guarantee about the order in which the + * batch operation's operations will be performed. + * + * @callback will be called as specified in the documentation for gdata_batch_operation_add_query(), with an @operation_type of + * %GDATA_BATCH_OPERATION_UPDATE. + * + * Return value: operation ID for the added update, or 0 + * + * Since: 0.7.0 + */ +guint +gdata_batch_operation_add_update (GDataBatchOperation *self, GDataEntry *entry, GDataBatchOperationCallback callback, gpointer user_data) +{ + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), 0); + g_return_val_if_fail (GDATA_IS_ENTRY (entry), 0); + g_return_val_if_fail (self->priv->has_run == FALSE, 0); + + return add_operation (self, GDATA_BATCH_OPERATION_UPDATE, entry, callback, user_data); +} + +/** + * gdata_batch_operation_add_deletion: + * @self: a #GDataBatchOperation + * @entry: the #GDataEntry to delete + * @callback: (scope async): a #GDataBatchOperationCallback to call when the deletion is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Add an entry to the #GDataBatchOperation, to be deleted on the server when the operation is run. @entry is reffed by the function, so may be freed + * after it returns. + * + * Note that a single batch operation should not operate on a given #GDataEntry more than once, as there's no guarantee about the order in which the + * batch operation's operations will be performed. + * + * @callback will be called as specified in the documentation for gdata_batch_operation_add_query(), with an @operation_type of + * %GDATA_BATCH_OPERATION_DELETION. + * + * Return value: operation ID for the added deletion, or 0 + * + * Since: 0.7.0 + */ +guint +gdata_batch_operation_add_deletion (GDataBatchOperation *self, GDataEntry *entry, GDataBatchOperationCallback callback, gpointer user_data) +{ + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), 0); + g_return_val_if_fail (GDATA_IS_ENTRY (entry), 0); + g_return_val_if_fail (self->priv->has_run == FALSE, 0); + + return add_operation (self, GDATA_BATCH_OPERATION_DELETION, entry, callback, user_data); +} + +/** + * gdata_batch_operation_run: + * @self: a #GDataBatchOperation + * @cancellable: (allow-none): a #GCancellable, or %NULL + * @error: a #GError, or %NULL + * + * Run the #GDataBatchOperation synchronously. This will send all the operations in the batch operation to the server, and call their respective + * callbacks synchronously (i.e. before gdata_batch_operation_run() returns, and in the same thread that called gdata_batch_operation_run()) as the + * server returns results for each operation. + * + * The callbacks for all of the operations in the batch operation are always guaranteed to be called, even if the batch operation as a whole fails. + * Each callback will be called exactly once for each time gdata_batch_operation_run() is called. + * + * The return value of the function indicates whether the overall batch operation was successful, and doesn't indicate the status of any of the + * operations it comprises. gdata_batch_operation_run() could return %TRUE even if all of its operations failed. + * + * @cancellable can be used to cancel the entire batch operation any time before or during the network activity. If @cancellable is cancelled + * after network activity has finished, gdata_batch_operation_run() will continue and finish as normal. + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_batch_operation_run (GDataBatchOperation *self, GCancellable *cancellable, GError **error) +{ + GDataBatchOperationPrivate *priv = self->priv; + SoupMessage *message; + GDataFeed *feed; + GTimeVal updated; + gchar *upload_data; + guint status; + GHashTableIter iter; + gpointer op_id; + BatchOperation *op; + GError *child_error = NULL; + + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_return_val_if_fail (priv->has_run == FALSE, FALSE); + + /* Check for early cancellation. */ + if (g_cancellable_set_error_if_cancelled (cancellable, error)) { + return FALSE; + } + + /* Check whether the service actually supports these kinds of + * operations. */ + g_hash_table_iter_init (&iter, priv->operations); + while (g_hash_table_iter_next (&iter, &op_id, (gpointer*) &op) == TRUE) { + GDataBatchable *batchable = GDATA_BATCHABLE (priv->service); + GDataBatchableIface *batchable_iface; + + batchable_iface = GDATA_BATCHABLE_GET_IFACE (batchable); + + if (batchable_iface->is_supported != NULL && + !batchable_iface->is_supported (op->type)) { + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION, + _("Batch operations are unsupported by " + "this service.")); + return FALSE; + } + } + + message = _gdata_service_build_message (priv->service, priv->authorization_domain, SOUP_METHOD_POST, priv->feed_uri, NULL, TRUE); + + /* Build the request */ + g_get_current_time (&updated); + feed = _gdata_feed_new (GDATA_TYPE_FEED, "Batch operation feed", + "batch1", updated.tv_sec); + + g_hash_table_iter_init (&iter, priv->operations); + while (g_hash_table_iter_next (&iter, &op_id, (gpointer*) &op) == TRUE) { + if (op->type == GDATA_BATCH_OPERATION_QUERY) { + /* Queries are weird; build a new throwaway entry, and add it to the feed */ + GDataEntry *entry; + GDataEntryClass *klass; + gchar *entry_uri; + + klass = g_type_class_ref (op->entry_type); + g_assert (klass->get_entry_uri != NULL); + + entry_uri = klass->get_entry_uri (op->query_id); + entry = gdata_entry_new (entry_uri); + g_free (entry_uri); + + gdata_entry_set_title (entry, "Batch operation query"); + _gdata_entry_set_updated (entry, updated.tv_sec); + + _gdata_entry_set_batch_data (entry, op->id, op->type); + _gdata_feed_add_entry (feed, entry); + + g_type_class_unref (klass); + g_object_unref (entry); + } else { + /* Everything else just dumps the entry's XML in the request */ + _gdata_entry_set_batch_data (op->entry, op->id, op->type); + _gdata_feed_add_entry (feed, op->entry); + } + } + + upload_data = gdata_parsable_get_xml (GDATA_PARSABLE (feed)); + soup_message_set_request (message, "application/atom+xml", SOUP_MEMORY_TAKE, upload_data, strlen (upload_data)); + + g_object_unref (feed); + + /* Ensure that this GDataBatchOperation can't be run again */ + priv->has_run = TRUE; + + /* Send the message */ + status = _gdata_service_send_message (priv->service, message, cancellable, &child_error); + + if (status != SOUP_STATUS_OK) { + /* Iff status is SOUP_STATUS_NONE or SOUP_STATUS_CANCELLED, child_error has already been set */ + if (status != SOUP_STATUS_NONE && status != SOUP_STATUS_CANCELLED) { + /* Error */ + GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (priv->service); + g_assert (klass->parse_error_response != NULL); + klass->parse_error_response (priv->service, GDATA_OPERATION_BATCH, status, message->reason_phrase, message->response_body->data, + message->response_body->length, &child_error); + } + g_object_unref (message); + + goto error; + } + + /* Parse the XML; GDataBatchFeed will fire off the relevant callbacks */ + g_assert (message->response_body->data != NULL); + feed = GDATA_FEED (_gdata_parsable_new_from_xml (GDATA_TYPE_BATCH_FEED, message->response_body->data, message->response_body->length, + self, &child_error)); + g_object_unref (message); + + if (feed == NULL) + goto error; + g_object_unref (feed); + + return TRUE; + +error: + /* Call the callbacks for each of our operations to notify them of the error */ + g_hash_table_iter_init (&iter, priv->operations); + while (g_hash_table_iter_next (&iter, &op_id, (gpointer*) &op) == TRUE) + _gdata_batch_operation_run_callback (self, op, NULL, g_error_copy (child_error)); + + g_propagate_error (error, child_error); + + return FALSE; +} + +static void +run_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataBatchOperation *operation = GDATA_BATCH_OPERATION (source_object); + g_autoptr(GError) error = NULL; + + /* Run the batch operation and return */ + if (!gdata_batch_operation_run (operation, cancellable, &error)) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_boolean (task, TRUE); +} + +/** + * gdata_batch_operation_run_async: + * @self: a #GDataBatchOperation + * @cancellable: (allow-none): a #GCancellable, or %NULL + * @callback: a #GAsyncReadyCallback to call when the batch operation is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Run the #GDataBatchOperation asynchronously. This will send all the operations in the batch operation to the server, and call their respective + * callbacks asynchronously (i.e. in idle functions in the main thread, usually after gdata_batch_operation_run_async() has returned) as the + * server returns results for each operation. @self is reffed when this function is called, so can safely be unreffed after this function returns. + * + * For more details, see gdata_batch_operation_run(), which is the synchronous version of this function. + * + * When the entire batch operation is finished, @callback will be called. You can then call gdata_batch_operation_run_finish() to get the results of + * the batch operation. + * + * Since: 0.7.0 + */ +void +gdata_batch_operation_run_async (GDataBatchOperation *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + + g_return_if_fail (GDATA_IS_BATCH_OPERATION (self)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (self->priv->has_run == FALSE); + + /* Mark the operation as async for the purposes of deciding where to call the callbacks */ + self->priv->is_async = TRUE; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_batch_operation_run_async); + g_task_run_in_thread (task, run_thread); +} + +/** + * gdata_batch_operation_run_finish: + * @self: a #GDataBatchOperation + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous batch operation run with gdata_batch_operation_run_async(). + * + * Return values are as for gdata_batch_operation_run(). + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_batch_operation_run_finish (GDataBatchOperation *self, GAsyncResult *async_result, GError **error) +{ + GDataBatchOperationPrivate *priv = self->priv; + g_autoptr(GError) child_error = NULL; + + g_return_val_if_fail (GDATA_IS_BATCH_OPERATION (self), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_return_val_if_fail (g_task_is_valid (async_result, self), FALSE); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_batch_operation_run_async), FALSE); + + if (!g_task_propagate_boolean (G_TASK (async_result), &child_error)) { + if (priv->has_run == FALSE) { + GHashTableIter iter; + gpointer op_id; + BatchOperation *op; + + /* Temporarily mark the operation as synchronous so that the callbacks get dispatched in this thread */ + priv->is_async = FALSE; + + /* If has_run hasn't been set, the call to gdata_batch_operation_run() was never made in the thread, and so none of the + * operations' callbacks have been called. Call the callbacks for each of our operations to notify them of the error. + * If has_run has been set, gdata_batch_operation_run() has already done this for us. */ + g_hash_table_iter_init (&iter, priv->operations); + while (g_hash_table_iter_next (&iter, &op_id, (gpointer*) &op) == TRUE) + _gdata_batch_operation_run_callback (self, op, NULL, g_error_copy (child_error)); + + priv->is_async = TRUE; + } + + g_propagate_error (error, g_steal_pointer (&child_error)); + + return FALSE; + } + + return TRUE; +} diff --git a/gdata/gdata-batch-operation.h b/gdata/gdata-batch-operation.h new file mode 100644 index 0000000..1626a28 --- /dev/null +++ b/gdata/gdata-batch-operation.h @@ -0,0 +1,150 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_BATCH_OPERATION_H +#define GDATA_BATCH_OPERATION_H + +#include +#include + +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_LINK_BATCH: + * + * The relation type URI for the batch operation URI for a given #GDataFeed. + * + * For more information, see the GData specification. + * + * Since: 0.7.0 + */ +#define GDATA_LINK_BATCH "http://schemas.google.com/g/2005#batch" + +/** + * GDataBatchOperationType: + * @GDATA_BATCH_OPERATION_QUERY: a query operation + * @GDATA_BATCH_OPERATION_INSERTION: an insertion operation + * @GDATA_BATCH_OPERATION_UPDATE: an update operation + * @GDATA_BATCH_OPERATION_DELETION: a deletion operation + * + * Indicates which type of batch operation caused the current #GDataBatchOperationCallback to be called. + * + * Since: 0.7.0 + */ +typedef enum { + GDATA_BATCH_OPERATION_QUERY = 0, + GDATA_BATCH_OPERATION_INSERTION, + GDATA_BATCH_OPERATION_UPDATE, + GDATA_BATCH_OPERATION_DELETION +} GDataBatchOperationType; + +/** + * GDataBatchOperationCallback: + * @operation_id: the operation ID returned from gdata_batch_operation_add_*() + * @operation_type: the type of operation which was requested + * @entry: the result of the operation, or %NULL + * @error: a #GError describing any error which occurred, or %NULL + * @user_data: user data passed to the callback + * + * Callback function called once for each operation in a batch operation run. The operation is identified by @operation_id and @operation_type (where + * @operation_id is the ID returned by the relevant call to gdata_batch_operation_add_query(), gdata_batch_operation_add_insertion(), + * gdata_batch_operation_add_update() or gdata_batch_operation_add_deletion(), and @operation_type shows which one of the above was called). + * + * If the operation was successful, the resulting #GDataEntry will be passed in as @entry, and @error will be %NULL. Otherwise, @entry will be %NULL + * and a descriptive error will be in @error. If @operation_type is %GDATA_BATCH_OPERATION_DELETION, @entry will always be %NULL, and @error will be + * %NULL or non-%NULL as appropriate. + * + * If the callback code needs to retain a copy of @entry, it must be referenced (with g_object_ref()). Similarly, @error is owned by the calling code, + * and must not be freed. + * + * The callback is called in the main thread, and there is no guarantee on the order in which the callbacks for the operations in a run are executed, + * or whether they will be called in a timely manner. It is, however, guaranteed that they will all be called before the #GAsyncReadyCallback which + * signals the completion of the run (if initiated with gdata_batch_operation_run_async()) is called; or gdata_batch_operation_run() returns (if + * initiated synchronously). + * + * Since: 0.7.0 + */ +typedef void (*GDataBatchOperationCallback) (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, + GError *error, gpointer user_data); + +#define GDATA_TYPE_BATCH_OPERATION (gdata_batch_operation_get_type ()) +#define GDATA_BATCH_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_BATCH_OPERATION, GDataBatchOperation)) +#define GDATA_BATCH_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_BATCH_OPERATION, GDataBatchOperationClass)) +#define GDATA_IS_BATCH_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_BATCH_OPERATION)) +#define GDATA_IS_BATCH_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_BATCH_OPERATION)) +#define GDATA_BATCH_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_BATCH_OPERATION, GDataBatchOperationClass)) + +typedef struct _GDataBatchOperationPrivate GDataBatchOperationPrivate; + +/** + * GDataBatchOperation: + * + * All the fields in the #GDataBatchOperation structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GObject parent; + GDataBatchOperationPrivate *priv; +} GDataBatchOperation; + +/** + * GDataBatchOperationClass: + * + * All the fields in the #GDataBatchOperationClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GObjectClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataBatchOperationClass; + +GType gdata_batch_operation_get_type (void) G_GNUC_CONST; + +GDataService *gdata_batch_operation_get_service (GDataBatchOperation *self) G_GNUC_PURE; +GDataAuthorizationDomain *gdata_batch_operation_get_authorization_domain (GDataBatchOperation *self) G_GNUC_PURE; +const gchar *gdata_batch_operation_get_feed_uri (GDataBatchOperation *self) G_GNUC_PURE; + +guint gdata_batch_operation_add_query (GDataBatchOperation *self, const gchar *id, GType entry_type, + GDataBatchOperationCallback callback, gpointer user_data); +guint gdata_batch_operation_add_insertion (GDataBatchOperation *self, GDataEntry *entry, GDataBatchOperationCallback callback, gpointer user_data); +guint gdata_batch_operation_add_update (GDataBatchOperation *self, GDataEntry *entry, GDataBatchOperationCallback callback, gpointer user_data); +guint gdata_batch_operation_add_deletion (GDataBatchOperation *self, GDataEntry *entry, GDataBatchOperationCallback callback, gpointer user_data); + +gboolean gdata_batch_operation_run (GDataBatchOperation *self, GCancellable *cancellable, GError **error); +void gdata_batch_operation_run_async (GDataBatchOperation *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +gboolean gdata_batch_operation_run_finish (GDataBatchOperation *self, GAsyncResult *async_result, GError **error); + +G_END_DECLS + +#endif /* !GDATA_BATCH_OPERATION_H */ diff --git a/gdata/gdata-batch-private.h b/gdata/gdata-batch-private.h new file mode 100644 index 0000000..8c682f0 --- /dev/null +++ b/gdata/gdata-batch-private.h @@ -0,0 +1,44 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_BATCH_PRIVATE_H +#define GDATA_BATCH_PRIVATE_H + +#include +#include + +G_BEGIN_DECLS + +typedef struct { + guint id; + GDataBatchOperationType type; + GDataBatchOperationCallback callback; + gpointer user_data; + gchar *query_id; /* only used for queries */ + GType entry_type; /* only used for queries */ + GError *error; + GDataEntry *entry; /* used for anything except queries, and to store the results of all operations */ +} BatchOperation; + +G_GNUC_INTERNAL BatchOperation *_gdata_batch_operation_get_operation (GDataBatchOperation *self, guint id) G_GNUC_PURE; +G_GNUC_INTERNAL void _gdata_batch_operation_run_callback (GDataBatchOperation *self, BatchOperation *op, GDataEntry *entry, GError *error); + +G_END_DECLS + +#endif /* !GDATA_BATCH_PRIVATE_H */ diff --git a/gdata/gdata-batchable.c b/gdata/gdata-batchable.c new file mode 100644 index 0000000..763909e --- /dev/null +++ b/gdata/gdata-batchable.c @@ -0,0 +1,81 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-batchable + * @short_description: GData batch service interface + * @stability: Stable + * @include: gdata/gdata-batchable.h + * + * #GDataBatchable is an interface which can be implemented by #GDataServices which support batch operations on their entries. It allows the + * creation of a #GDataBatchOperation for the service, which allows a set of batch operations to be run. + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-batchable.h" +#include "gdata-service.h" +#include "gdata-batch-operation.h" + +GType +gdata_batchable_get_type (void) +{ + static GType batchable_type = 0; + + if (!batchable_type) { + batchable_type = g_type_register_static_simple (G_TYPE_INTERFACE, "GDataBatchable", + sizeof (GDataBatchableIface), + NULL, 0, NULL, 0); + g_type_interface_add_prerequisite (batchable_type, GDATA_TYPE_SERVICE); + } + + return batchable_type; +} + +/** + * gdata_batchable_create_operation: + * @self: a #GDataBatchable + * @domain: (allow-none): the #GDataAuthorizationDomain to authorize the operation, or %NULL + * @feed_uri: the URI to send the batch operation request to + * + * Creates a new #GDataBatchOperation for the given #GDataBatchable service, and with the given @feed_uri. @feed_uri is normally the %GDATA_LINK_BATCH + * link URI in the appropriate #GDataFeed from the service. If authorization will be required to perform any of the requests in the batch operation, + * @domain must be non-%NULL, and must be an authorization domain which covers all of the requests. Otherwise, @domain may be %NULL if authorization + * is not required. + * + * Return value: (transfer full): a new #GDataBatchOperation; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataBatchOperation * +gdata_batchable_create_operation (GDataBatchable *self, GDataAuthorizationDomain *domain, const gchar *feed_uri) +{ + g_return_val_if_fail (GDATA_IS_BATCHABLE (self), NULL); + g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), NULL); + g_return_val_if_fail (feed_uri != NULL, NULL); + + return g_object_new (GDATA_TYPE_BATCH_OPERATION, + "service", self, + "authorization-domain", domain, + "feed-uri", feed_uri, + NULL); +} diff --git a/gdata/gdata-batchable.h b/gdata/gdata-batchable.h new file mode 100644 index 0000000..5dce9a1 --- /dev/null +++ b/gdata/gdata-batchable.h @@ -0,0 +1,76 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_BATCHABLE_H +#define GDATA_BATCHABLE_H + +#include +#include + +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_BATCHABLE (gdata_batchable_get_type ()) +#define GDATA_BATCHABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_BATCHABLE, GDataBatchable)) +#define GDATA_BATCHABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_BATCHABLE, GDataBatchableIface)) +#define GDATA_IS_BATCHABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_BATCHABLE)) +#define GDATA_BATCHABLE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GDATA_TYPE_BATCHABLE, GDataBatchableIface)) + +/** + * GDataBatchable: + * + * All the fields in the #GDataBatchable structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct _GDataBatchable GDataBatchable; /* dummy typedef */ + +/** + * GDataBatchableIface: + * @is_supported: Determines whether the given #GDataBatchOperationType is + * supported by this #GDataBatchable; if not, operations using it will return + * %GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION. It is valid for a + * #GDataBatchable to return %FALSE for all #GDataBatchOperationTypes if the + * server no longer supports batch operations. If this method is not + * implemented, it is assumed that all #GDataBatchOperationTypes are + * supported. Since: 0.17.2. + * + * All the fields in the #GDataBatchableIface structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GTypeInterface parent; + + /*< public >*/ + gboolean (*is_supported) (GDataBatchOperationType operation_type); +} GDataBatchableIface; + +GType gdata_batchable_get_type (void) G_GNUC_CONST; + +GDataBatchOperation *gdata_batchable_create_operation (GDataBatchable *self, GDataAuthorizationDomain *domain, + const gchar *feed_uri) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_BATCHABLE_H */ diff --git a/gdata/gdata-buffer.c b/gdata/gdata-buffer.c new file mode 100644 index 0000000..ac42636 --- /dev/null +++ b/gdata/gdata-buffer.c @@ -0,0 +1,351 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/* + * SECTION:gdata-buffer + * @short_description: GData buffer to allow threadsafe buffering + * @stability: Stable + * @include: gdata/gdata-buffer.h + * + * #GDataBuffer is a simple object which allows threadsafe buffering of data meaning, for example, data can be received from + * the network in a "push" fashion, buffered, then sent out to an output stream in a "pull" fashion. + */ + +#include +#include +#include + +#include "gdata-buffer.h" + +struct _GDataBufferChunk { + /*< private >*/ + guint8 *data; + gsize length; + GDataBufferChunk *next; + /* Note: the data is actually allocated in the same memory block, so it's inside this comment right now. + * We simply set chunk->data to point to chunk + sizeof (GDataBufferChunk). */ +}; + +/** + * gdata_buffer_new: + * + * Creates a new empty #GDataBuffer. + * + * Return value: a new #GDataBuffer; free with gdata_buffer_free() + * + * Since: 0.5.0 + */ +GDataBuffer * +gdata_buffer_new (void) +{ + GDataBuffer *buffer = g_slice_new0 (GDataBuffer); + + g_mutex_init (&(buffer->mutex)); + g_cond_init (&(buffer->cond)); + + return buffer; +} + +/** + * gdata_buffer_free: + * + * Frees a #GDataBuffer. The function isn't threadsafe, so should only be called once + * use of the buffer has been reduced to only one thread (the reading thread, after + * the EOF has been reached). + * + * Since: 0.5.0 + */ +void +gdata_buffer_free (GDataBuffer *self) +{ + GDataBufferChunk *chunk, *next_chunk; + + g_return_if_fail (self != NULL); + + for (chunk = self->head; chunk != NULL; chunk = next_chunk) { + next_chunk = chunk->next; + g_free (chunk); + } + + g_cond_clear (&(self->cond)); + g_mutex_clear (&(self->mutex)); + + g_slice_free (GDataBuffer, self); +} + +/** + * gdata_buffer_push_data: + * @self: a #GDataBuffer + * @data: the data to push onto the buffer + * @length: the length of @data + * + * Pushes @length bytes of @data onto the buffer, taking a copy of the data. If @data is %NULL and @length is 0, + * the buffer will be marked as having reached the EOF, and subsequent calls to gdata_buffer_push_data() + * will fail and return %FALSE. + * + * Assuming the buffer hasn't reached EOF, this operation is guaranteed to succeed (unless memory allocation fails). + * + * This function holds the lock on the #GDataBuffer, and signals any waiting calls to gdata_buffer_pop_data() once + * the new data has been pushed onto the buffer. This function is threadsafe. + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.5.0 + */ +gboolean +gdata_buffer_push_data (GDataBuffer *self, const guint8 *data, gsize length) +{ + GDataBufferChunk *chunk; + + g_return_val_if_fail (self != NULL, 0); + + g_mutex_lock (&(self->mutex)); + + if (G_UNLIKELY (self->reached_eof == TRUE)) { + /* If we're marked as having reached EOF, don't accept any more data */ + g_mutex_unlock (&(self->mutex)); + return FALSE; + } else if (G_UNLIKELY (data == NULL && length == 0)) { + /* If @data is NULL and @length is 0, mark the buffer as having reached EOF, + * and signal any waiting threads. */ + self->reached_eof = TRUE; + g_cond_signal (&(self->cond)); + g_mutex_unlock (&(self->mutex)); + return FALSE; + } + + /* Create the chunk */ + chunk = g_malloc (sizeof (GDataBufferChunk) + length); + chunk->data = (guint8*) ((guint8*) chunk + sizeof (GDataBufferChunk)); /* pointer arithmetic in terms of bytes here */ + chunk->length = length; + chunk->next = NULL; + + /* Copy the data to the chunk */ + if (G_LIKELY (data != NULL)) + memcpy (chunk->data, data, length); + + /* Add it to the buffer's tail */ + if (self->tail != NULL) + *(self->tail) = chunk; + else + self->head = chunk; + self->tail = &(chunk->next); + self->total_length += length; + + /* Signal any threads waiting to pop that data is available */ + g_cond_signal (&(self->cond)); + + g_mutex_unlock (&(self->mutex)); + + return TRUE; +} + +typedef struct { + GDataBuffer *buffer; + gboolean *cancelled; +} CancelledData; + +static void +pop_cancelled_cb (GCancellable *cancellable, CancelledData *data) +{ + /* Signal the pop_data function that it should stop blocking and cancel */ + g_mutex_lock (&(data->buffer->mutex)); + *(data->cancelled) = TRUE; + g_cond_signal (&(data->buffer->cond)); + g_mutex_unlock (&(data->buffer->mutex)); +} + +/** + * gdata_buffer_pop_data: + * @self: a #GDataBuffer + * @data: (allow-none): return location for the popped data, or %NULL to just drop the data + * @length_requested: the number of bytes of data requested + * @reached_eof: return location for a value which is %TRUE when we've reached EOF, %FALSE otherwise, or %NULL + * @cancellable: (allow-none): a #GCancellable, or %NULL + * + * Pops up to @length_requested bytes off the head of the buffer and copies them to @data, which must be allocated by + * the caller and have enough space to store at most @length_requested bytes of output. + * + * If the buffer contains enough data to satisfy @length_requested, this function returns immediately. + * Otherwise, this function blocks until data is pushed onto the head of the buffer with gdata_buffer_pop_data(). If + * the buffer is marked as having reached the EOF, this function will not block, and will instead return the + * remaining data in the buffer. + * + * This function holds the lock on the #GDataBuffer, and will automatically be signalled of new data pushed onto the + * buffer if it's blocking. + * + * If @cancellable is provided, calling g_cancellable_cancel() on it from another thread will cause the call to + * gdata_buffer_pop_data() to return immediately with whatever data it can find. + * + * Return value: the number of bytes returned in @data + * + * Since: 0.5.0 + */ +gsize +gdata_buffer_pop_data (GDataBuffer *self, guint8 *data, gsize length_requested, gboolean *reached_eof, GCancellable *cancellable) +{ + GDataBufferChunk *chunk; + gsize return_length = 0, length_remaining; + gulong cancelled_signal = 0; + gboolean cancelled = FALSE; + + g_return_val_if_fail (self != NULL, 0); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), 0); + + /* In the case: + * - length_requested < amount available: return length_requested + * - length_requested > amount available: block until more is available, return length_requested + * - length_requested > amount available and we've reached EOF: don't block, return all remaining data + * - length_requested is a whole number of chunks: remove those chunks, return length_requested + * - length_requested is less than one chunk: remove no chunks, return length_requested, set head_read_offset + * - length_requested is a fraction of multiple chunks: remove whole chunks, return length_requested, set head_read_offset + * for remaining fraction */ + + /* Set up a handler so we can stop if we're cancelled. This must be done before we lock @self->mutex, or deadlock could occur if the + * cancellable has already been cancelled — g_cancellable_connect() would call pop_cancelled_cb() directly, and it would attempt to lock + * @self->mutex again. */ + if (cancellable != NULL) { + CancelledData cancelled_data; + + cancelled_data.buffer = self; + cancelled_data.cancelled = &cancelled; + + cancelled_signal = g_cancellable_connect (cancellable, (GCallback) pop_cancelled_cb, &cancelled_data, NULL); + } + + g_mutex_lock (&(self->mutex)); + + if (self->reached_eof == TRUE && length_requested > self->total_length) { + /* Return data up to the EOF */ + return_length = self->total_length; + } else if (length_requested > self->total_length) { + /* Block until more data is available */ + while (length_requested > self->total_length) { + /* If we've already been cancelled, don't wait on @self->cond, since it'll never be signalled again. */ + if (cancelled == FALSE) { + g_cond_wait (&(self->cond), &(self->mutex)); + } + + /* If the g_cond_wait() returned because it was signalled from the GCancellable callback (rather than from + * data being pushed into the buffer), stop blocking for data and make do with what we have so far. */ + if (cancelled == TRUE || self->reached_eof == TRUE) { + return_length = MIN (length_requested, self->total_length); + break; + } else { + return_length = length_requested; + } + } + } else { + return_length = length_requested; + } + + /* Set reached_eof */ + if (reached_eof != NULL) + *reached_eof = self->reached_eof && length_requested >= self->total_length; + + /* Return if we haven't got any data to pop (i.e. if we were cancelled before even one chunk arrived) */ + if (return_length == 0) + goto done; + + /* Otherwise, get on with things */ + length_remaining = return_length; + + /* We can't assume we'll have enough data, since we may have reached EOF */ + chunk = self->head; + while (chunk != NULL && self->head_read_offset + length_remaining >= chunk->length) { + GDataBufferChunk *next_chunk; + gsize chunk_length = chunk->length - self->head_read_offset; + + /* Copy the data to the output */ + length_remaining -= chunk_length; + if (data != NULL) { + memcpy (data, chunk->data + self->head_read_offset, chunk_length); + data += chunk_length; + } + + /* Free the chunk and move on */ + next_chunk = chunk->next; + g_free (chunk); + chunk = next_chunk; + + /* Reset the head read offset, since we've processed at least the first chunk now */ + self->head_read_offset = 0; + } + + /* If the requested length is still > 0, it must be < chunk->length, and chunk must != NULL (if it does, the cached total_length has + * been corrupted somewhere). */ + if (G_LIKELY (length_remaining > 0)) { + g_assert (chunk != NULL); + g_assert_cmpuint (length_remaining, <=, chunk->length); + + /* Copy the requested data to the output */ + if (data != NULL) { + memcpy (data, chunk->data + self->head_read_offset, length_remaining); + } + self->head_read_offset += length_remaining; + } + + self->head = chunk; + if (self->head == NULL) + self->tail = NULL; + self->total_length -= return_length; + +done: + g_mutex_unlock (&(self->mutex)); + + /* Disconnect from the cancelled signal. Note that this has to be done without @self->mutex held, or deadlock can occur. + * (g_cancellable_disconnect() waits for any in-progress signal handler call to finish, which can't happen until the mutex is released.) */ + if (cancelled_signal != 0) + g_cancellable_disconnect (cancellable, cancelled_signal); + + return return_length; +} + +/** + * gdata_buffer_pop_all_data: + * @self: a #GDataBuffer + * @data: return location for the popped data + * @maximum_length: the maximum number of bytes to return + * @reached_eof: return location for a value which is %TRUE when we've reached EOF, %FALSE otherwise, or %NULL + * + * Pops as much data as possible off the #GDataBuffer, up to a limit of @maximum_length bytes. If fewer bytes exist + * in the buffer, fewer bytes will be returned. If more bytes exist in the buffer, @maximum_length bytes will be returned. + * + * If 0 bytes exist in the buffer, this function will block until data is available. Otherwise, it will never block. + * + * Return value: the number of bytes returned in @data (guaranteed to be more than 0 and at most @maximum_length) + * + * Since: 0.5.0 + */ +gsize +gdata_buffer_pop_data_limited (GDataBuffer *self, guint8 *data, gsize maximum_length, gboolean *reached_eof) +{ + g_return_val_if_fail (self != NULL, 0); + g_return_val_if_fail (data != NULL, 0); + g_return_val_if_fail (maximum_length > 0, 0); + + /* If there's no data in the buffer, block until some is available */ + g_mutex_lock (&(self->mutex)); + if (self->total_length == 0 && self->reached_eof == FALSE) { + g_cond_wait (&(self->cond), &(self->mutex)); + } + g_mutex_unlock (&(self->mutex)); + + return gdata_buffer_pop_data (self, data, MIN (maximum_length, self->total_length), reached_eof, NULL); +} diff --git a/gdata/gdata-buffer.h b/gdata/gdata-buffer.h new file mode 100644 index 0000000..0fbd14b --- /dev/null +++ b/gdata/gdata-buffer.h @@ -0,0 +1,59 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_BUFFER_H +#define GDATA_BUFFER_H + +#include +#include +#include + +G_BEGIN_DECLS + +typedef struct _GDataBufferChunk GDataBufferChunk; + +/** + * GDataBuffer: + * + * All the fields in the #GDataBuffer structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + /*< private >*/ + GDataBufferChunk *head; + gsize head_read_offset; /* number of bytes which have already been popped from the head chunk */ + gsize total_length; /* total length of all the chunks available to read (i.e. head_read_offset is already subtracted) */ + gboolean reached_eof; /* set to TRUE only once we've reached EOF */ + GDataBufferChunk **tail; /* pointer to the GDataBufferChunk->next field of the current tail chunk */ + + GMutex mutex; /* mutex protecting the entire structure on push and pop */ + GCond cond; /* a GCond to allow a popping thread to block on data being pushed into the buffer */ +} GDataBuffer; + +GDataBuffer *gdata_buffer_new (void) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_buffer_free (GDataBuffer *self); + +gboolean gdata_buffer_push_data (GDataBuffer *self, const guint8 *data, gsize length); +gsize gdata_buffer_pop_data (GDataBuffer *self, guint8 *data, gsize length_requested, gboolean *reached_eof, GCancellable *cancellable); +gsize gdata_buffer_pop_data_limited (GDataBuffer *self, guint8 *data, gsize maximum_length, gboolean *reached_eof); + +G_END_DECLS + +#endif /* !GDATA_BUFFER_H */ diff --git a/gdata/gdata-client-login-authorizer.c b/gdata/gdata-client-login-authorizer.c new file mode 100644 index 0000000..9edb789 --- /dev/null +++ b/gdata/gdata-client-login-authorizer.c @@ -0,0 +1,1344 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-client-login-authorizer + * @short_description: GData ClientLogin authorization interface + * @stability: Stable + * @include: gdata/gdata-client-login-authorizer.h + * + * #GDataClientLoginAuthorizer provides an implementation of the #GDataAuthorizer interface for authentication and authorization using the deprecated + * ClientLogin process. + * + * As noted, the ClientLogin process is being deprecated in favour of OAuth 2.0. This API is not (yet) deprecated, however. One of the main reasons + * for ClientLogin being deprecated is that it cannot support two-factor authentication as now available to Google Accounts. Any account which has + * two-factor authentication enabled has to use a service-specific one-time password instead if a client is authenticating with + * #GDataClientLoginAuthorizer. More documentation about this is + * available online. + * Note that newer services cannot be authenticated against using ClientLogin, + * and a #GDataOAuth2Authorizer must be used instead. + * + * The ClientLogin process is a simple one whereby the user's Google Account username and password are sent over an HTTPS connection to the Google + * Account servers (when gdata_client_login_authorizer_authenticate() is called), which return an authorization token. This token is then attached to + * all future requests to the online service. A slight complication is that the Google Accounts service may return a CAPTCHA challenge instead of + * immediately returning an authorization token. In this case, the #GDataClientLoginAuthorizer::captcha-challenge signal will be emitted, and the + * user's response to the CAPTCHA should be returned by the handler. + * + * ClientLogin does not natively support authorization against multiple authorization domains concurrently with a single authorization token, so it + * has to be simulated by maintaining multiple authorization tokens if multiple authorization domains are used. This means that proportionally more + * network requests are made when gdata_client_login_authorizer_authenticate() is called, which will be proportionally slower. Handling of the + * multiple authorization tokens is otherwise transparent to the client. + * + * Each authorization token is long lived, so reauthorization is rarely necessary with #GDataClientLoginAuthorizer. Consequently, refreshing + * authorization using gdata_authorizer_refresh_authorization() is not supported by #GDataClientLoginAuthorizer, and will immediately return %FALSE + * with no error set. + * + * + * Authenticating Asynchronously Using ClientLogin + * + * GDataSomeService *service; + * GDataClientLoginAuthorizer *authorizer; + * + * /* Create an authorizer and authenticate and authorize the service we're using, asynchronously. */ + * authorizer = gdata_client_login_authorizer_new ("companyName-applicationName-versionID", GDATA_TYPE_SOME_SERVICE); + * gdata_client_login_authorizer_authenticate_async (authorizer, username, password, cancellable, + * (GAsyncReadyCallback) authenticate_cb, user_data); + * + * /* Create a service object and link it with the authorizer */ + * service = gdata_some_service_new (GDATA_AUTHORIZER (authorizer)); + * + * static void + * authenticate_cb (GDataClientLoginAuthorizer *authorizer, GAsyncResult *async_result, gpointer user_data) + * { + * GError *error = NULL; + * + * if (gdata_client_login_authorizer_authenticate_finish (authorizer, async_result, &error) == FALSE) { + * /* Notify the user of all errors except cancellation errors */ + * if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + * g_error ("Authentication failed: %s", error->message); + * } + * g_error_free (error); + * return; + * } + * + * /* (The client is now authenticated and authorized against the service. + * * It can now proceed to execute queries on the service object which require the user to be authenticated.) */ + * } + * + * g_object_unref (service); + * g_object_unref (authorizer); + * + * + * + * Since: 0.9.0 + */ + +#include +#include +#include +#include + +#include "gdata-service.h" +#include "gdata-private.h" +#include "gdata-marshal.h" +#include "gdata-client-login-authorizer.h" + +/* The default e-mail domain to use for usernames */ +#define EMAIL_DOMAIN "gmail.com" + +GQuark +gdata_client_login_authorizer_error_quark (void) +{ + return g_quark_from_static_string ("gdata-client-login-authorizer-error-quark"); +} + +static void authorizer_init (GDataAuthorizerInterface *iface); +static void dispose (GObject *object); +static void finalize (GObject *object); +static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); + +static void process_request (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message); +static gboolean is_authorized_for_domain (GDataAuthorizer *self, GDataAuthorizationDomain *domain); + +static void notify_proxy_uri_cb (GObject *gobject, GParamSpec *pspec, GDataClientLoginAuthorizer *self); +static void notify_timeout_cb (GObject *gobject, GParamSpec *pspec, GObject *self); + +static SoupURI *_get_proxy_uri (GDataClientLoginAuthorizer *self); +static void _set_proxy_uri (GDataClientLoginAuthorizer *self, SoupURI *proxy_uri); + +struct _GDataClientLoginAuthorizerPrivate { + SoupSession *session; + SoupURI *proxy_uri; /* cached version only set if gdata_client_login_authorizer_get_proxy_uri() is called */ + GProxyResolver *proxy_resolver; + + gchar *client_id; + + /* Mutex for username, password and auth_tokens. It has to be recursive as the top-level authentication functions need to hold a lock on + * auth_tokens while looping over it, but lower-level functions also need to modify auth_tokens to add the auth_tokens themselves once they're + * returned by the online service. */ + GRecMutex mutex; + + gchar *username; + GDataSecureString password; /* must be allocated by _gdata_service_secure_strdup() */ + + /* Mapping from GDataAuthorizationDomain to string? auth_token; auth_token is NULL for domains which aren't authorised at the moment */ + GHashTable *auth_tokens; +}; + +enum { + PROP_CLIENT_ID = 1, + PROP_USERNAME, + PROP_PASSWORD, + PROP_PROXY_URI, + PROP_TIMEOUT, + PROP_PROXY_RESOLVER, +}; + +enum { + SIGNAL_CAPTCHA_CHALLENGE, + LAST_SIGNAL +}; + +static guint authorizer_signals[LAST_SIGNAL] = { 0, }; + +G_DEFINE_TYPE_WITH_CODE (GDataClientLoginAuthorizer, gdata_client_login_authorizer, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_AUTHORIZER, authorizer_init)) + +static void +gdata_client_login_authorizer_class_init (GDataClientLoginAuthorizerClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataClientLoginAuthorizerPrivate)); + + gobject_class->get_property = get_property; + gobject_class->set_property = set_property; + gobject_class->dispose = dispose; + gobject_class->finalize = finalize; + + /** + * GDataClientLoginAuthorizer:client-id: + * + * A client ID for your application (see the + * reference documentation). + * + * It is recommended that the ID is of the form company name-application name- + * version ID. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_CLIENT_ID, + g_param_spec_string ("client-id", + "Client ID", "A client ID for your application.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataClientLoginAuthorizer:username: + * + * The user's Google username for authentication. This will always be a full e-mail address. + * + * This will only be set after authentication using gdata_client_login_authorizer_authenticate() is completed successfully. It will + * then be set to the username passed to gdata_client_login_authorizer_authenticate(), and a #GObject::notify signal will be emitted. If + * authentication fails, it will be set to %NULL. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_USERNAME, + g_param_spec_string ("username", + "Username", "The user's Google username for authentication.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataClientLoginAuthorizer:password: + * + * The user's account password for authentication. + * + * This will only be set after authentication using gdata_client_login_authorizer_authenticate() is completed successfully. It will + * then be set to the password passed to gdata_client_login_authorizer_authenticate(), and a #GObject::notify signal will be emitted. If + * authentication fails, it will be set to %NULL. + * + * If libgdata is compiled with libgcr support, the password will be stored in non-pageable memory. However, if it is retrieved + * using g_object_get() (or related functions) it will be copied to non-pageable memory and could end up being written to disk. Accessing + * the password using gdata_client_login_authorizer_get_password() will not perform any copies, and so maintains privacy. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_PASSWORD, + g_param_spec_string ("password", + "Password", "The user's account password for authentication.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataClientLoginAuthorizer:proxy-uri: + * + * The proxy URI used internally for all network requests. + * + * Since: 0.9.0 + * Deprecated: 0.15.0: Use #GDataClientLoginAuthorizer:proxy-resolver instead, which gives more flexibility over the proxy used. + */ + g_object_class_install_property (gobject_class, PROP_PROXY_URI, + g_param_spec_boxed ("proxy-uri", + "Proxy URI", "The proxy URI used internally for all network requests.", + SOUP_TYPE_URI, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataClientLoginAuthorizer:timeout: + * + * A timeout, in seconds, for network operations. If the timeout is exceeded, the operation will be cancelled and + * %GDATA_SERVICE_ERROR_NETWORK_ERROR will be returned. + * + * If the timeout is 0, operations will never time out. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_TIMEOUT, + g_param_spec_uint ("timeout", + "Timeout", "A timeout, in seconds, for network operations.", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataClientLoginAuthorizer:proxy-resolver: + * + * The #GProxyResolver used to determine a proxy URI. Setting this will clear the #GDataClientLoginAuthorizer:proxy-uri property. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_PROXY_RESOLVER, + g_param_spec_object ("proxy-resolver", + "Proxy Resolver", "A GProxyResolver used to determine a proxy URI.", + G_TYPE_PROXY_RESOLVER, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataClientLoginAuthorizer::captcha-challenge: + * @authorizer: the #GDataClientLoginAuthorizer which received the challenge + * @uri: the URI of the CAPTCHA image to be used + * + * The #GDataClientLoginAuthorizer::captcha-challenge signal is emitted during the authentication process if the authorizer requires a CAPTCHA + * to be completed. The URI of a CAPTCHA image is given, and the program should display this to the user, and return their response (the text + * displayed in the image). There is no timeout imposed by the library for the response. + * + * Return value: a newly allocated string containing the text in the CAPTCHA image + * + * Since: 0.9.0 + */ + authorizer_signals[SIGNAL_CAPTCHA_CHALLENGE] = g_signal_new ("captcha-challenge", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + gdata_marshal_STRING__OBJECT_STRING, + G_TYPE_STRING, 1, G_TYPE_STRING); +} + +static void +authorizer_init (GDataAuthorizerInterface *iface) +{ + iface->process_request = process_request; + iface->is_authorized_for_domain = is_authorized_for_domain; +} + +static void +gdata_client_login_authorizer_init (GDataClientLoginAuthorizer *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_CLIENT_LOGIN_AUTHORIZER, GDataClientLoginAuthorizerPrivate); + + /* Set up the authentication mutex */ + g_rec_mutex_init (&(self->priv->mutex)); + self->priv->auth_tokens = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, (GDestroyNotify) _gdata_service_secure_strfree); + + /* Set up the session */ + self->priv->session = _gdata_service_build_session (); + + /* Proxy the SoupSession's proxy-uri and timeout properties */ + g_signal_connect (self->priv->session, "notify::proxy-uri", (GCallback) notify_proxy_uri_cb, self); + g_signal_connect (self->priv->session, "notify::timeout", (GCallback) notify_timeout_cb, self); + + /* Keep our GProxyResolver synchronized with SoupSession's. */ + g_object_bind_property (self->priv->session, "proxy-resolver", self, "proxy-resolver", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); +} + +static void +dispose (GObject *object) +{ + GDataClientLoginAuthorizerPrivate *priv = GDATA_CLIENT_LOGIN_AUTHORIZER (object)->priv; + + if (priv->session != NULL) { + g_object_unref (priv->session); + } + priv->session = NULL; + + g_clear_object (&priv->proxy_resolver); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_client_login_authorizer_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + GDataClientLoginAuthorizerPrivate *priv = GDATA_CLIENT_LOGIN_AUTHORIZER (object)->priv; + + g_free (priv->username); + _gdata_service_secure_strfree (priv->password); + g_free (priv->client_id); + g_hash_table_destroy (priv->auth_tokens); + g_rec_mutex_clear (&(priv->mutex)); + + if (priv->proxy_uri != NULL) { + soup_uri_free (priv->proxy_uri); + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_client_login_authorizer_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataClientLoginAuthorizerPrivate *priv = GDATA_CLIENT_LOGIN_AUTHORIZER (object)->priv; + + switch (property_id) { + case PROP_CLIENT_ID: + g_value_set_string (value, priv->client_id); + break; + case PROP_USERNAME: + g_rec_mutex_lock (&(priv->mutex)); + g_value_set_string (value, priv->username); + g_rec_mutex_unlock (&(priv->mutex)); + break; + case PROP_PASSWORD: + /* NOTE: This takes a pageable copy of non-pageable memory and thus could result in the password hitting disk. */ + g_rec_mutex_lock (&(priv->mutex)); + g_value_set_string (value, priv->password); + g_rec_mutex_unlock (&(priv->mutex)); + break; + case PROP_PROXY_URI: + g_value_set_boxed (value, _get_proxy_uri (GDATA_CLIENT_LOGIN_AUTHORIZER (object))); + break; + case PROP_TIMEOUT: + g_value_set_uint (value, gdata_client_login_authorizer_get_timeout (GDATA_CLIENT_LOGIN_AUTHORIZER (object))); + break; + case PROP_PROXY_RESOLVER: + g_value_set_object (value, gdata_client_login_authorizer_get_proxy_resolver (GDATA_CLIENT_LOGIN_AUTHORIZER (object))); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataClientLoginAuthorizerPrivate *priv = GDATA_CLIENT_LOGIN_AUTHORIZER (object)->priv; + + switch (property_id) { + case PROP_CLIENT_ID: + priv->client_id = g_value_dup_string (value); + break; + case PROP_PROXY_URI: + _set_proxy_uri (GDATA_CLIENT_LOGIN_AUTHORIZER (object), g_value_get_boxed (value)); + break; + case PROP_TIMEOUT: + gdata_client_login_authorizer_set_timeout (GDATA_CLIENT_LOGIN_AUTHORIZER (object), g_value_get_uint (value)); + break; + case PROP_PROXY_RESOLVER: + gdata_client_login_authorizer_set_proxy_resolver (GDATA_CLIENT_LOGIN_AUTHORIZER (object), g_value_get_object (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +process_request (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message) +{ + GDataConstSecureString auth_token; /* privacy sensitive */ + GDataClientLoginAuthorizerPrivate *priv = GDATA_CLIENT_LOGIN_AUTHORIZER (self)->priv; + + /* If the domain's NULL, return immediately */ + if (domain == NULL) { + return; + } + + /* Set the authorisation header */ + g_rec_mutex_lock (&(priv->mutex)); + + auth_token = (GDataConstSecureString) g_hash_table_lookup (priv->auth_tokens, domain); + + if (auth_token != NULL) { + /* Ensure that we're using HTTPS: if not, we shouldn't set the Authorization header or we could be revealing the auth token to + * anyone snooping the connection, which would give them the same rights as us on the user's data. Generally a bad thing to happen. */ + if (soup_message_get_uri (message)->scheme != SOUP_URI_SCHEME_HTTPS) { + g_warning ("Not authorizing a non-HTTPS message with the user's ClientLogin auth token as the connection isn't secure."); + } else { + /* Ideally, authorisation_header would be allocated in non-pageable memory. However, it's copied by + * soup_message_headers_replace() immediately anyway, so there's not much point. However, we do ensure we zero it out before + * freeing. */ + gchar *authorisation_header = g_strdup_printf ("GoogleLogin auth=%s", auth_token); + soup_message_headers_replace (message->request_headers, "Authorization", authorisation_header); + memset (authorisation_header, 0, strlen (authorisation_header)); + g_free (authorisation_header); + } + } + + g_rec_mutex_unlock (&(priv->mutex)); +} + +static gboolean +is_authorized_for_domain (GDataAuthorizer *self, GDataAuthorizationDomain *domain) +{ + GDataClientLoginAuthorizerPrivate *priv = GDATA_CLIENT_LOGIN_AUTHORIZER (self)->priv; + gpointer result; + + g_rec_mutex_lock (&(priv->mutex)); + result = g_hash_table_lookup (priv->auth_tokens, domain); + g_rec_mutex_unlock (&(priv->mutex)); + + return (result != NULL) ? TRUE : FALSE; +} + +/** + * gdata_client_login_authorizer_new: + * @client_id: your application's client ID + * @service_type: the #GType of a #GDataService subclass which the #GDataClientLoginAuthorizer will be used with + * + * Creates a new #GDataClientLoginAuthorizer. The @client_id must be unique for your application, and as registered with Google. + * + * The #GDataAuthorizationDomains for the given @service_type (i.e. as returned by gdata_service_get_authorization_domains()) are the ones the + * user will be logged in to using the provided username and password when gdata_client_login_authorizer_authenticate() is called. Note that the same + * username and password will be used for all domains. + * + * Return value: (transfer full): a new #GDataClientLoginAuthorizer, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataClientLoginAuthorizer * +gdata_client_login_authorizer_new (const gchar *client_id, GType service_type) +{ + g_return_val_if_fail (client_id != NULL && *client_id != '\0', NULL); + g_return_val_if_fail (g_type_is_a (service_type, GDATA_TYPE_SERVICE), NULL); + + return gdata_client_login_authorizer_new_for_authorization_domains (client_id, + gdata_service_get_authorization_domains (service_type)); +} + +/** + * gdata_client_login_authorizer_new_for_authorization_domains: + * @client_id: your application's client ID + * @authorization_domains: (element-type GDataAuthorizationDomain) (transfer none): a non-empty list of #GDataAuthorizationDomains to be + * authorized against by the #GDataClientLoginAuthorizer + * + * Creates a new #GDataClientLoginAuthorizer. The @client_id must be unique for your application, and as registered with Google. This function is + * intended to be used only when the default authorization domain list for a single #GDataService, as used by gdata_client_login_authorizer_new(), + * isn't suitable. For example, this could be because the #GDataClientLoginAuthorizer will be used with multiple #GDataService subclasses, or because + * the client requires a specific set of authorization domains. + * + * The specified #GDataAuthorizationDomains are the ones the user will be logged in to using the provided username and password when + * gdata_client_login_authorizer_authenticate() is called. Note that the same username and password will be used for all domains. + * + * Return value: (transfer full): a new #GDataClientLoginAuthorizer, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataClientLoginAuthorizer * +gdata_client_login_authorizer_new_for_authorization_domains (const gchar *client_id, GList *authorization_domains) +{ + GList *i; + GDataClientLoginAuthorizer *authorizer; + + g_return_val_if_fail (client_id != NULL && *client_id != '\0', NULL); + g_return_val_if_fail (authorization_domains != NULL, NULL); + + authorizer = GDATA_CLIENT_LOGIN_AUTHORIZER (g_object_new (GDATA_TYPE_CLIENT_LOGIN_AUTHORIZER, + "client-id", client_id, + NULL)); + + /* Register all the domains with the authorizer */ + for (i = authorization_domains; i != NULL; i = i->next) { + g_return_val_if_fail (GDATA_IS_AUTHORIZATION_DOMAIN (i->data), NULL); + + /* We don't have to lock the authoriser's mutex here as no other code has seen the authoriser yet */ + g_hash_table_insert (authorizer->priv->auth_tokens, g_object_ref (GDATA_AUTHORIZATION_DOMAIN (i->data)), NULL); + } + + return authorizer; +} + +/* Called in the main thread to notify of changes to the username and password properties from the authentication thread. It swallows a reference + * the authoriser. */ +static gboolean +notify_authentication_details_cb (GDataClientLoginAuthorizer *self) +{ + GObject *authorizer = G_OBJECT (self); + + g_object_freeze_notify (authorizer); + g_object_notify (authorizer, "username"); + g_object_notify (authorizer, "password"); + g_object_thaw_notify (authorizer); + + g_object_unref (self); + + /* Only execute once */ + return FALSE; +} + +static void +set_authentication_details (GDataClientLoginAuthorizer *self, const gchar *username, const gchar *password, GHashTable *new_auth_tokens, + gboolean is_async) +{ + GDataClientLoginAuthorizerPrivate *priv = self->priv; + GHashTableIter iter; + + g_rec_mutex_lock (&(priv->mutex)); + + /* Ensure the username is always a full e-mail address */ + g_free (priv->username); + if (username != NULL && strchr (username, '@') == NULL) { + priv->username = g_strdup_printf ("%s@" EMAIL_DOMAIN, username); + } else { + priv->username = g_strdup (username); + } + + _gdata_service_secure_strfree (priv->password); + priv->password = _gdata_service_secure_strdup (password); + + /* Transfer all successful auth. tokens to the object-wide auth. token store. */ + if (new_auth_tokens == NULL) { + /* Reset ->auth_tokens to contain no auth. tokens, just the domains. */ + g_hash_table_iter_init (&iter, priv->auth_tokens); + + while (g_hash_table_iter_next (&iter, NULL, NULL) == TRUE) { + g_hash_table_iter_replace (&iter, NULL); + } + } else { + /* Replace the existing ->auth_tokens with the new one, which contains all the shiny new auth. tokens. */ + g_hash_table_ref (new_auth_tokens); + g_hash_table_unref (priv->auth_tokens); + priv->auth_tokens = new_auth_tokens; + } + + g_rec_mutex_unlock (&(priv->mutex)); + + /* Notify of the property changes in the main thread; i.e. if we're running an async operation, schedule the notification in an idle + * callback; but if we're running a sync operation, emit them immediately. + * This guarantees that: + * • notifications will always be emitted before gdata_client_login_authorizer_authenticate() returns; and + * • notifications will always be emitted in the main thread for calls to gdata_client_login_authorizer_authenticate_async(). */ + if (is_async == TRUE) { + g_idle_add ((GSourceFunc) notify_authentication_details_cb, g_object_ref (self)); + } else { + notify_authentication_details_cb (g_object_ref (self)); + } +} + +static GDataSecureString +parse_authentication_response (GDataClientLoginAuthorizer *self, GDataAuthorizationDomain *domain, guint status, + const gchar *response_body, gint length, GError **error) +{ + gchar *auth_start, *auth_end; + GDataSecureString auth_token; /* NOTE: auth_token must be allocated using _gdata_service_secure_strdup() and friends */ + + /* Parse the response */ + auth_start = strstr (response_body, "Auth="); + if (auth_start == NULL) { + goto protocol_error; + } + auth_start += strlen ("Auth="); + + auth_end = strstr (auth_start, "\n"); + if (auth_end == NULL) { + goto protocol_error; + } + + auth_token = _gdata_service_secure_strndup (auth_start, auth_end - auth_start); + if (auth_token == NULL || strlen (auth_token) == 0) { + _gdata_service_secure_strfree (auth_token); + goto protocol_error; + } + + return auth_token; + +protocol_error: + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + return NULL; +} + +static void +parse_error_response (GDataClientLoginAuthorizer *self, guint status, const gchar *reason_phrase, const gchar *response_body, gint length, + GError **error) +{ + /* We prefer to include the @response_body in the error message, but if it's empty, fall back to the @reason_phrase */ + if (response_body == NULL || *response_body == '\0') { + response_body = reason_phrase; + } + + /* See: http://code.google.com/apis/gdata/docs/2.0/reference.html#HTTPStatusCodes */ + switch (status) { + case SOUP_STATUS_CANT_RESOLVE: + case SOUP_STATUS_CANT_CONNECT: + case SOUP_STATUS_SSL_FAILED: + case SOUP_STATUS_IO_ERROR: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NETWORK_ERROR, + _("Cannot connect to the service’s server.")); + return; + case SOUP_STATUS_CANT_RESOLVE_PROXY: + case SOUP_STATUS_CANT_CONNECT_PROXY: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROXY_ERROR, + _("Cannot connect to the proxy server.")); + return; + case SOUP_STATUS_MALFORMED: + case SOUP_STATUS_BAD_REQUEST: /* 400 */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message returned by the server. */ + _("Invalid request URI or header, or unsupported nonstandard parameter: %s"), response_body); + return; + case SOUP_STATUS_UNAUTHORIZED: /* 401 */ + case SOUP_STATUS_FORBIDDEN: /* 403 */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + /* Translators: the parameter is an error message returned by the server. */ + _("Authentication required: %s"), response_body); + return; + case SOUP_STATUS_NOT_FOUND: /* 404 */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NOT_FOUND, + /* Translators: the parameter is an error message returned by the server. */ + _("The requested resource was not found: %s"), response_body); + return; + case SOUP_STATUS_CONFLICT: /* 409 */ + case SOUP_STATUS_PRECONDITION_FAILED: /* 412 */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_CONFLICT, + /* Translators: the parameter is an error message returned by the server. */ + _("The entry has been modified since it was downloaded: %s"), response_body); + return; + case SOUP_STATUS_INTERNAL_SERVER_ERROR: /* 500 */ + default: + /* We'll fall back to a generic error, below */ + break; + } + + /* If the error hasn't been handled already, throw a generic error */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is an HTTP status, + * and the second is an error message returned by the server. */ + _("Error code %u when authenticating: %s"), status, response_body); +} + +static GDataSecureString +authenticate (GDataClientLoginAuthorizer *self, GDataAuthorizationDomain *domain, const gchar *username, const gchar *password, + gchar *captcha_token, gchar *captcha_answer, GCancellable *cancellable, GError **error) +{ + GDataClientLoginAuthorizerPrivate *priv = self->priv; + SoupMessage *message; + gchar *request_body; + const gchar *service_name; + guint status; + GDataSecureString auth_token; + SoupURI *_uri; + + /* Prepare the request. + * NOTE: At this point, our non-pageable password is copied into a pageable HTTP request structure. We can't do much about this + * except note that the request is transient and so the chance of it getting paged out is low (but still positive). */ + service_name = gdata_authorization_domain_get_service_name (domain); + request_body = soup_form_encode ("accountType", "HOSTED_OR_GOOGLE", + "Email", username, + "Passwd", password, + "service", service_name, + "source", priv->client_id, + (captcha_token == NULL) ? NULL : "logintoken", captcha_token, + "loginanswer", captcha_answer, + NULL); + + /* Free the CAPTCHA token and answer if necessary */ + g_free (captcha_token); + g_free (captcha_answer); + + /* Build the message */ + _uri = soup_uri_new ("https://www.google.com/accounts/ClientLogin"); + soup_uri_set_port (_uri, _gdata_service_get_https_port ()); + message = soup_message_new_from_uri (SOUP_METHOD_POST, _uri); + soup_uri_free (_uri); + soup_message_set_request (message, "application/x-www-form-urlencoded", SOUP_MEMORY_TAKE, request_body, strlen (request_body)); + + /* Send the message */ + _gdata_service_actually_send_message (priv->session, message, cancellable, error); + status = message->status_code; + + if (status == SOUP_STATUS_CANCELLED) { + /* Cancelled (the error has already been set) */ + g_object_unref (message); + return NULL; + } else if (status != SOUP_STATUS_OK) { + const gchar *response_body = message->response_body->data; + gchar *error_start, *error_end, *uri_start, *uri_end, *uri = NULL; + + /* Parse the error response; see: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Errors */ + if (response_body == NULL) { + goto protocol_error; + } + + /* Error */ + error_start = strstr (response_body, "Error="); + if (error_start == NULL) { + goto protocol_error; + } + error_start += strlen ("Error="); + + error_end = strstr (error_start, "\n"); + if (error_end == NULL) { + goto protocol_error; + } + + if (strncmp (error_start, "CaptchaRequired", error_end - error_start) == 0) { + const gchar *captcha_base_uri = "http://www.google.com/accounts/"; + gchar *captcha_start, *captcha_end, *captcha_uri, *new_captcha_answer; + guint captcha_base_uri_length; + + /* CAPTCHA required to log in */ + captcha_start = strstr (response_body, "CaptchaUrl="); + if (captcha_start == NULL) { + goto protocol_error; + } + captcha_start += strlen ("CaptchaUrl="); + + captcha_end = strstr (captcha_start, "\n"); + if (captcha_end == NULL) { + goto protocol_error; + } + + /* Do some fancy memory stuff to save ourselves another alloc */ + captcha_base_uri_length = strlen (captcha_base_uri); + captcha_uri = g_malloc (captcha_base_uri_length + (captcha_end - captcha_start) + 1); + memcpy (captcha_uri, captcha_base_uri, captcha_base_uri_length); + memcpy (captcha_uri + captcha_base_uri_length, captcha_start, (captcha_end - captcha_start)); + captcha_uri[captcha_base_uri_length + (captcha_end - captcha_start)] = '\0'; + + /* Request a CAPTCHA answer from the application */ + g_signal_emit (self, authorizer_signals[SIGNAL_CAPTCHA_CHALLENGE], 0, captcha_uri, &new_captcha_answer); + g_free (captcha_uri); + + if (new_captcha_answer == NULL || *new_captcha_answer == '\0') { + g_set_error_literal (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_CAPTCHA_REQUIRED, + /* Translators: see http://en.wikipedia.org/wiki/CAPTCHA for information about CAPTCHAs */ + _("A CAPTCHA must be filled out to log in.")); + goto login_error; + } + + /* Get the CAPTCHA token */ + captcha_start = strstr (response_body, "CaptchaToken="); + if (captcha_start == NULL) { + goto protocol_error; + } + captcha_start += strlen ("CaptchaToken="); + + captcha_end = strstr (captcha_start, "\n"); + if (captcha_end == NULL) { + goto protocol_error; + } + + /* Save the CAPTCHA token and answer, and attempt to log in with them */ + g_object_unref (message); + + return authenticate (self, domain, username, password, + g_strndup (captcha_start, captcha_end - captcha_start), new_captcha_answer, + cancellable, error); + } else if (strncmp (error_start, "Unknown", error_end - error_start) == 0) { + goto protocol_error; + } else if (strncmp (error_start, "BadAuthentication", error_end - error_start) == 0) { + /* Looks like Error=BadAuthentication errors don't return a URI */ + gchar *info_start, *info_end; + + info_start = strstr (response_body, "Info="); + if (info_start != NULL) { + info_start += strlen ("Info="); + info_end = strstr (info_start, "\n"); + } + + /* If Info=InvalidSecondFactor, the user needs to generate an application-specific password and use that instead */ + if (info_start != NULL && info_end != NULL && strncmp (info_start, "InvalidSecondFactor", info_end - info_start) == 0) { + g_set_error (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_INVALID_SECOND_FACTOR, + /* Translators: the parameter is a URI for further information. */ + _("This account requires an application-specific password. (%s)"), + "http://www.google.com/support/accounts/bin/static.py?page=guide.cs&guide=1056283&topic=1056286"); + goto login_error; + } + + /* Fall back to a generic "bad authentication details" message */ + g_set_error_literal (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_BAD_AUTHENTICATION, + _("Your username or password were incorrect.")); + goto login_error; + } + + /* Get the information URI */ + uri_start = strstr (response_body, "Url="); + if (uri_start == NULL) { + goto protocol_error; + } + uri_start += strlen ("Url="); + + uri_end = strstr (uri_start, "\n"); + if (uri_end == NULL) { + goto protocol_error; + } + + uri = g_strndup (uri_start, uri_end - uri_start); + + if (strncmp (error_start, "NotVerified", error_end - error_start) == 0) { + g_set_error (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_NOT_VERIFIED, + /* Translators: the parameter is a URI for further information. */ + _("Your account’s e-mail address has not been verified. (%s)"), uri); + goto login_error; + } else if (strncmp (error_start, "TermsNotAgreed", error_end - error_start) == 0) { + g_set_error (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_TERMS_NOT_AGREED, + /* Translators: the parameter is a URI for further information. */ + _("You have not agreed to the service’s terms and conditions. (%s)"), uri); + goto login_error; + } else if (strncmp (error_start, "AccountMigrated", error_end - error_start) == 0) { + /* This is non-standard, and used by YouTube since it's got messed-up accounts */ + g_set_error (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_MIGRATED, + /* Translators: the parameter is a URI for further information. */ + _("This account has been migrated. Please log in online to receive your new username and password. (%s)"), uri); + goto login_error; + } else if (strncmp (error_start, "AccountDeleted", error_end - error_start) == 0) { + g_set_error (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DELETED, + /* Translators: the parameter is a URI for further information. */ + _("This account has been deleted. (%s)"), uri); + goto login_error; + } else if (strncmp (error_start, "AccountDisabled", error_end - error_start) == 0) { + g_set_error (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DISABLED, + /* Translators: the parameter is a URI for further information. */ + _("This account has been disabled. (%s)"), uri); + goto login_error; + } else if (strncmp (error_start, "ServiceDisabled", error_end - error_start) == 0) { + g_set_error (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_SERVICE_DISABLED, + /* Translators: the parameter is a URI for further information. */ + _("This account’s access to this service has been disabled. (%s)"), uri); + goto login_error; + } else if (strncmp (error_start, "ServiceUnavailable", error_end - error_start) == 0) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_UNAVAILABLE, + /* Translators: the parameter is a URI for further information. */ + _("This service is not available at the moment. (%s)"), uri); + goto login_error; + } + + /* Unknown error type! */ + goto protocol_error; + +login_error: + g_free (uri); + g_object_unref (message); + + return NULL; + } + + g_assert (message->response_body->data != NULL); + + auth_token = parse_authentication_response (self, domain, status, message->response_body->data, message->response_body->length, error); + + /* Zero out the response body to lower the chance of it (with all the juicy passwords and auth. tokens it contains) hitting disk or getting + * leaked in free memory. */ + memset ((void*) message->response_body->data, 0, message->response_body->length); + + g_object_unref (message); + + return auth_token; + +protocol_error: + parse_error_response (self, status, message->reason_phrase, message->response_body->data, message->response_body->length, error); + + g_object_unref (message); + + return NULL; +} + +static gboolean +authenticate_loop (GDataClientLoginAuthorizer *authorizer, gboolean is_async, const gchar *username, const gchar *password, GCancellable *cancellable, + GError **error) +{ + GDataClientLoginAuthorizerPrivate *priv = authorizer->priv; + gboolean cumulative_success = TRUE; + GHashTable *new_auth_tokens; + GHashTableIter iter; + GDataAuthorizationDomain *domain; + GDataSecureString auth_token; + + g_rec_mutex_lock (&(priv->mutex)); + + /* Authenticate and authorize against each of the services registered with the authorizer */ + new_auth_tokens = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, (GDestroyNotify) _gdata_service_secure_strfree); + g_hash_table_iter_init (&iter, priv->auth_tokens); + + while (g_hash_table_iter_next (&iter, (gpointer*) &domain, NULL) == TRUE) { + GError *authenticate_error = NULL; + + auth_token = authenticate (authorizer, domain, username, password, NULL, NULL, cancellable, &authenticate_error); + + if (auth_token == NULL && cumulative_success == TRUE) { + /* Only propagate the first error which occurs. */ + g_propagate_error (error, authenticate_error); + authenticate_error = NULL; + } + + cumulative_success = (auth_token != NULL) && cumulative_success; + + /* Store the auth. token (or lack thereof if authentication failed). */ + g_hash_table_insert (new_auth_tokens, g_object_ref (domain), auth_token); + + g_clear_error (&authenticate_error); + } + + g_rec_mutex_unlock (&(priv->mutex)); + + /* Set or clear the authentication details and return now that we're done */ + if (cumulative_success == TRUE) { + set_authentication_details (authorizer, username, password, new_auth_tokens, is_async); + } else { + set_authentication_details (authorizer, NULL, NULL, NULL, is_async); + } + + g_hash_table_unref (new_auth_tokens); + + return cumulative_success; +} + +typedef struct { + gchar *username; + GDataSecureString password; /* NOTE: This must be allocated in non-pageable memory using _gdata_service_secure_strdup(). */ +} AuthenticateAsyncData; + +static void +authenticate_async_data_free (AuthenticateAsyncData *self) +{ + g_free (self->username); + _gdata_service_secure_strfree (self->password); + + g_slice_free (AuthenticateAsyncData, self); +} + +static void +authenticate_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataClientLoginAuthorizer *authorizer = GDATA_CLIENT_LOGIN_AUTHORIZER (source_object); + g_autoptr(GError) error = NULL; + AuthenticateAsyncData *data = task_data; + + if (!authenticate_loop (authorizer, TRUE, data->username, data->password, cancellable, &error)) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_boolean (task, TRUE); +} + +/** + * gdata_client_login_authorizer_authenticate_async: + * @self: a #GDataClientLoginAuthorizer + * @username: the user's username + * @password: the user's password + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Authenticates the #GDataClientLoginAuthorizer with the Google accounts service using the given @username and @password. @self, @username and + * @password are all reffed/copied when this function is called, so can safely be freed after this function returns. + * + * For more details, see gdata_client_login_authorizer_authenticate(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_client_login_authorizer_authenticate_finish() + * to get the results of the operation. + * + * Since: 0.9.0 + */ +void +gdata_client_login_authorizer_authenticate_async (GDataClientLoginAuthorizer *self, const gchar *username, const gchar *password, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + AuthenticateAsyncData *data; + + g_return_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self)); + g_return_if_fail (username != NULL); + g_return_if_fail (password != NULL); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + data = g_slice_new (AuthenticateAsyncData); + data->username = g_strdup (username); + data->password = _gdata_service_secure_strdup (password); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_client_login_authorizer_authenticate_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) authenticate_async_data_free); + g_task_run_in_thread (task, authenticate_thread); +} + +/** + * gdata_client_login_authorizer_authenticate_finish: + * @self: a #GDataClientLoginAuthorizer + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous authentication operation started with gdata_client_login_authorizer_authenticate_async(). + * + * Return value: %TRUE if authentication was successful, %FALSE otherwise + * + * Since: 0.9.0 + */ +gboolean +gdata_client_login_authorizer_authenticate_finish (GDataClientLoginAuthorizer *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_return_val_if_fail (g_task_is_valid (async_result, self), FALSE); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_client_login_authorizer_authenticate_async), FALSE); + + return g_task_propagate_boolean (G_TASK (async_result), error); +} + +/** + * gdata_client_login_authorizer_authenticate: + * @self: a #GDataClientLoginAuthorizer + * @username: the user's username + * @password: the user's password + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Authenticates the #GDataClientLoginAuthorizer with the Google Accounts service using @username and @password and authorizes it against all the + * service types passed to gdata_client_login_authorizer_new(); i.e. logs into the service with the given user account. @username should be a full + * e-mail address (e.g. john.smith\@gmail.com). If a full e-mail address is not given, @username will have + * \@gmail.com appended to create an e-mail address + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. + * + * If the operation errors or is cancelled part-way through, gdata_authorizer_is_authorized_for_domain() is guaranteed to return %FALSE + * for all #GDataAuthorizationDomains, even if authentication has succeeded for some of them already. + * + * A %GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_BAD_AUTHENTICATION will be returned if authentication failed due to an incorrect username or password. + * Other #GDataClientLoginAuthorizerError errors can be returned for other conditions. + * + * If the service requires a CAPTCHA to be completed, the #GDataClientLoginAuthorizer::captcha-challenge signal will be emitted. + * The return value from a signal handler for the signal should be a newly allocated string containing the text from the image. If the text is %NULL + * or empty, authentication will fail with a %GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_CAPTCHA_REQUIRED error. Otherwise, authentication will be + * automatically and transparently restarted with the new CAPTCHA details. + * + * A %GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be returned if the server's responses were invalid. + * + * Return value: %TRUE if authentication and authorization was successful against all the services, %FALSE otherwise + * + * Since: 0.9.0 + */ +gboolean +gdata_client_login_authorizer_authenticate (GDataClientLoginAuthorizer *self, const gchar *username, const gchar *password, + GCancellable *cancellable, GError **error) +{ + g_return_val_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self), FALSE); + g_return_val_if_fail (username != NULL, FALSE); + g_return_val_if_fail (password != NULL, FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + return authenticate_loop (self, FALSE, username, password, cancellable, error); +} + +static void +notify_proxy_uri_cb (GObject *object, GParamSpec *pspec, GDataClientLoginAuthorizer *self) +{ + /* Flush our cached version */ + if (self->priv->proxy_uri != NULL) { + soup_uri_free (self->priv->proxy_uri); + self->priv->proxy_uri = NULL; + } + + g_object_notify (G_OBJECT (self), "proxy-uri"); +} + +/* Static function which isn't deprecated so we can continue using it internally. */ +static SoupURI * +_get_proxy_uri (GDataClientLoginAuthorizer *self) +{ + SoupURI *proxy_uri; + + g_return_val_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self), NULL); + + /* If we have a cached version, return that */ + if (self->priv->proxy_uri != NULL) { + return self->priv->proxy_uri; + } + + g_object_get (self->priv->session, SOUP_SESSION_PROXY_URI, &proxy_uri, NULL); + + /* Update the cache; it takes ownership of the URI */ + self->priv->proxy_uri = proxy_uri; + + return proxy_uri; +} + +/** + * gdata_client_login_authorizer_get_proxy_uri: + * @self: a #GDataClientLoginAuthorizer + * + * Gets the proxy URI on the #GDataClientLoginAuthorizer's #SoupSession. + * + * Return value: (transfer full): the proxy URI, or %NULL; free with soup_uri_free() + * + * Since: 0.9.0 + * Deprecated: 0.15.0: Use gdata_client_login_authorizer_get_proxy_resolver() instead, which gives more flexibility over the proxy used. + */ +SoupURI * +gdata_client_login_authorizer_get_proxy_uri (GDataClientLoginAuthorizer *self) +{ + return _get_proxy_uri (self); +} + +/* Static function which isn't deprecated so we can continue using it internally. */ +static void +_set_proxy_uri (GDataClientLoginAuthorizer *self, SoupURI *proxy_uri) +{ + g_return_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self)); + + g_object_set (self->priv->session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL); + + /* Notification is handled in notify_proxy_uri_cb() which is called as a result of setting the property on the session */ +} + +/** + * gdata_client_login_authorizer_set_proxy_uri: + * @self: a #GDataClientLoginAuthorizer + * @proxy_uri: (allow-none): the proxy URI, or %NULL + * + * Sets the proxy URI on the #SoupSession used internally by the #GDataClientLoginAuthorizer. This forces all requests through the given proxy. + * + * If @proxy_uri is %NULL, no proxy will be used. + * + * Since: 0.9.0 + * Deprecated: 0.15.0: Use gdata_client_login_authorizer_set_proxy_resolver() instead, which gives more flexibility over the proxy used. + */ +void +gdata_client_login_authorizer_set_proxy_uri (GDataClientLoginAuthorizer *self, SoupURI *proxy_uri) +{ + _set_proxy_uri (self, proxy_uri); +} + +/** + * gdata_client_login_authorizer_get_proxy_resolver: + * @self: a #GDataClientLoginAuthorizer + * + * Gets the #GProxyResolver on the #GDataClientLoginAuthorizer's #SoupSession. + * + * Return value: (transfer none) (allow-none): a #GProxyResolver, or %NULL + * + * Since: 0.15.0 + */ +GProxyResolver * +gdata_client_login_authorizer_get_proxy_resolver (GDataClientLoginAuthorizer *self) +{ + g_return_val_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self), NULL); + + return self->priv->proxy_resolver; +} + +/** + * gdata_client_login_authorizer_set_proxy_resolver: + * @self: a #GDataClientLoginAuthorizer + * @proxy_resolver: (allow-none): a #GProxyResolver, or %NULL + * + * Sets the #GProxyResolver on the #SoupSession used internally by the given #GDataClientLoginAuthorizer. + * + * Setting this will clear the #GDataClientLoginAuthorizer:proxy-uri property. + * + * Since: 0.15.0 + */ +void +gdata_client_login_authorizer_set_proxy_resolver (GDataClientLoginAuthorizer *self, GProxyResolver *proxy_resolver) +{ + g_return_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self)); + g_return_if_fail (proxy_resolver == NULL || G_IS_PROXY_RESOLVER (proxy_resolver)); + + if (proxy_resolver != NULL) { + g_object_ref (proxy_resolver); + } + + g_clear_object (&self->priv->proxy_resolver); + self->priv->proxy_resolver = proxy_resolver; + + g_object_notify (G_OBJECT (self), "proxy-resolver"); +} + +static void +notify_timeout_cb (GObject *gobject, GParamSpec *pspec, GObject *self) +{ + g_object_notify (self, "timeout"); +} + +/** + * gdata_client_login_authorizer_get_timeout: + * @self: a #GDataClientLoginAuthorizer + * + * Gets the #GDataClientLoginAuthorizer:timeout property; the network timeout, in seconds. + * + * Return value: the timeout, or 0 + * + * Since: 0.9.0 + */ +guint +gdata_client_login_authorizer_get_timeout (GDataClientLoginAuthorizer *self) +{ + guint timeout; + + g_return_val_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self), 0); + + g_object_get (self->priv->session, SOUP_SESSION_TIMEOUT, &timeout, NULL); + + return timeout; +} + +/** + * gdata_client_login_authorizer_set_timeout: + * @self: a #GDataClientLoginAuthorizer + * @timeout: the timeout, or 0 + * + * Sets the #GDataClientLoginAuthorizer:timeout property; the network timeout, in seconds. + * + * If @timeout is 0, network operations will never time out. + * + * Since: 0.9.0 + */ +void +gdata_client_login_authorizer_set_timeout (GDataClientLoginAuthorizer *self, guint timeout) +{ + g_return_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self)); + + g_object_set (self->priv->session, SOUP_SESSION_TIMEOUT, timeout, NULL); + + /* Notification is handled in notify_proxy_uri_cb() which is called as a result of setting the property on the session */ +} + +/** + * gdata_client_login_authorizer_get_client_id: + * @self: a #GDataClientLoginAuthorizer + * + * Returns the authorizer's client ID, as specified on constructing the #GDataClientLoginAuthorizer. + * + * Return value: the authorizer's client ID + * + * Since: 0.9.0 + */ +const gchar * +gdata_client_login_authorizer_get_client_id (GDataClientLoginAuthorizer *self) +{ + g_return_val_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self), NULL); + + return self->priv->client_id; +} + +/** + * gdata_client_login_authorizer_get_username: + * @self: a #GDataClientLoginAuthorizer + * + * Returns the username of the currently authenticated user, or %NULL if nobody is authenticated. + * + * It is not safe to call this while an authentication operation is ongoing. + * + * Return value: the username of the currently authenticated user, or %NULL + * + * Since: 0.9.0 + */ +const gchar * +gdata_client_login_authorizer_get_username (GDataClientLoginAuthorizer *self) +{ + g_return_val_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self), NULL); + + /* There's little point protecting this with ->mutex, as the data's meaningless if accessed during an authentication operation, + * and not being accessed concurrently otherwise. */ + return self->priv->username; +} + +/** + * gdata_client_login_authorizer_get_password: + * @self: a #GDataClientLoginAuthorizer + * + * Returns the password of the currently authenticated user, or %NULL if nobody is authenticated. + * + * It is not safe to call this while an authentication operation is ongoing. + * + * If libgdata is compiled with libgcr support, the password will be stored in non-pageable memory. Since this function doesn't return + * a copy of the password, the returned value is guaranteed to not hit disk. It's advised that any copies of the password made in client programs + * also use non-pageable memory. + * + * Return value: the password of the currently authenticated user, or %NULL + * + * Since: 0.9.0 + */ +const gchar * +gdata_client_login_authorizer_get_password (GDataClientLoginAuthorizer *self) +{ + g_return_val_if_fail (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (self), NULL); + + /* There's little point protecting this with ->mutex, as the data's meaningless if accessed during an authentication operation, + * and not being accessed concurrently otherwise. */ + return self->priv->password; +} diff --git a/gdata/gdata-client-login-authorizer.h b/gdata/gdata-client-login-authorizer.h new file mode 100644 index 0000000..3db4c5c --- /dev/null +++ b/gdata/gdata-client-login-authorizer.h @@ -0,0 +1,140 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CLIENT_LOGIN_AUTHORIZER_H +#define GDATA_CLIENT_LOGIN_AUTHORIZER_H + +#include +#include + +#include "gdata-authorizer.h" + +G_BEGIN_DECLS + +/** + * GDataClientLoginAuthorizerError: + * @GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_BAD_AUTHENTICATION: The login request used a username or password that is not recognized. + * @GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_NOT_VERIFIED: The account email address has not been verified. The user will need to access their Google + * account directly to resolve the issue before logging in using a non-Google application. + * @GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_TERMS_NOT_AGREED: The user has not agreed to terms. The user will need to access their Google account directly + * to resolve the issue before logging in using a non-Google application. + * @GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_CAPTCHA_REQUIRED: A CAPTCHA is required. (A response with this error code will also contain an image URI and a + * CAPTCHA token.) + * @GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DELETED: The user account has been deleted. + * @GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DISABLED: The user account has been disabled. + * @GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_SERVICE_DISABLED: The user's access to the specified service has been disabled. (The user account may still be + * valid.) + * @GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_MIGRATED: The user's account login details have been migrated to a new system. (This is used for the + * transition from the old YouTube login details to the new ones.) + * @GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_INVALID_SECOND_FACTOR: The user's account requires an application-specific password to be used. + * + * Error codes for authentication and authorization operations on #GDataClientLoginAuthorizer. See the + * online ClientLogin documentation for + * more information. + * + * Since: 0.9.0 + */ +typedef enum { + GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_BAD_AUTHENTICATION = 1, + GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_NOT_VERIFIED, + GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_TERMS_NOT_AGREED, + GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_CAPTCHA_REQUIRED, + GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DELETED, + GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DISABLED, + GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_SERVICE_DISABLED, + GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_MIGRATED, + GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_INVALID_SECOND_FACTOR +} GDataClientLoginAuthorizerError; + +GQuark gdata_client_login_authorizer_error_quark (void) G_GNUC_CONST; + +#define GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR gdata_client_login_authorizer_error_quark () + +#define GDATA_TYPE_CLIENT_LOGIN_AUTHORIZER (gdata_client_login_authorizer_get_type ()) +#define GDATA_CLIENT_LOGIN_AUTHORIZER(o) \ + (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CLIENT_LOGIN_AUTHORIZER, GDataClientLoginAuthorizer)) +#define GDATA_CLIENT_LOGIN_AUTHORIZER_CLASS(k) \ + (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CLIENT_LOGIN_AUTHORIZER, GDataClientLoginAuthorizerClass)) +#define GDATA_IS_CLIENT_LOGIN_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CLIENT_LOGIN_AUTHORIZER)) +#define GDATA_IS_CLIENT_LOGIN_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CLIENT_LOGIN_AUTHORIZER)) +#define GDATA_CLIENT_LOGIN_AUTHORIZER_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CLIENT_LOGIN_AUTHORIZER, GDataClientLoginAuthorizerClass)) + +typedef struct _GDataClientLoginAuthorizerPrivate GDataClientLoginAuthorizerPrivate; + +/** + * GDataClientLoginAuthorizer: + * + * All the fields in the #GDataClientLoginAuthorizer structure are private and should never be accessed directly. + * + * Since: 0.9.0 + */ +typedef struct { + /*< private >*/ + GObject parent; + GDataClientLoginAuthorizerPrivate *priv; +} GDataClientLoginAuthorizer; + +/** + * GDataClientLoginAuthorizerClass: + * + * All the fields in the #GDataClientLoginAuthorizerClass structure are private and should never be accessed directly. + * + * Since: 0.9.0 + */ +typedef struct { + /*< private >*/ + GObjectClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataClientLoginAuthorizerClass; + +GType gdata_client_login_authorizer_get_type (void) G_GNUC_CONST; + +GDataClientLoginAuthorizer *gdata_client_login_authorizer_new (const gchar *client_id, GType service_type) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataClientLoginAuthorizer *gdata_client_login_authorizer_new_for_authorization_domains (const gchar *client_id, GList *authorization_domains) + G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gboolean gdata_client_login_authorizer_authenticate (GDataClientLoginAuthorizer *self, const gchar *username, const gchar *password, + GCancellable *cancellable, GError **error); +void gdata_client_login_authorizer_authenticate_async (GDataClientLoginAuthorizer *self, const gchar *username, const gchar *password, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +gboolean gdata_client_login_authorizer_authenticate_finish (GDataClientLoginAuthorizer *self, GAsyncResult *async_result, GError **error); + +const gchar *gdata_client_login_authorizer_get_client_id (GDataClientLoginAuthorizer *self) G_GNUC_PURE; +const gchar *gdata_client_login_authorizer_get_username (GDataClientLoginAuthorizer *self) G_GNUC_PURE; +const gchar *gdata_client_login_authorizer_get_password (GDataClientLoginAuthorizer *self) G_GNUC_PURE; + +#ifndef LIBGDATA_DISABLE_DEPRECATED +SoupURI *gdata_client_login_authorizer_get_proxy_uri (GDataClientLoginAuthorizer *self) G_GNUC_PURE G_GNUC_DEPRECATED_FOR (gdata_client_login_authorizer_get_proxy_resolver); +void gdata_client_login_authorizer_set_proxy_uri (GDataClientLoginAuthorizer *self, SoupURI *proxy_uri) G_GNUC_DEPRECATED_FOR (gdata_client_login_authorizer_set_proxy_resolver); +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +GProxyResolver *gdata_client_login_authorizer_get_proxy_resolver (GDataClientLoginAuthorizer *self) G_GNUC_PURE; +void gdata_client_login_authorizer_set_proxy_resolver (GDataClientLoginAuthorizer *self, GProxyResolver *proxy_resolver); + +guint gdata_client_login_authorizer_get_timeout (GDataClientLoginAuthorizer *self) G_GNUC_PURE; +void gdata_client_login_authorizer_set_timeout (GDataClientLoginAuthorizer *self, guint timeout); + +G_END_DECLS + +#endif /* !GDATA_CLIENT_LOGIN_AUTHORIZER_H */ diff --git a/gdata/gdata-comment.c b/gdata/gdata-comment.c new file mode 100644 index 0000000..c5bcc10 --- /dev/null +++ b/gdata/gdata-comment.c @@ -0,0 +1,54 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-comment + * @short_description: GData comment object + * @stability: Stable + * @include: gdata/gdata-comment.h + * + * #GDataComment is a subclass of #GDataEntry to represent a generic comment on an entry. It is returned by the methods implemented in the + * #GDataCommentable interface. + * + * Any class which implements #GDataCommentable should have its own concrete subclass of #GDataComment which provides service-specific functionality. + * + * All subclasses of #GDataComment should ensure that the body of a comment is accessible using gdata_entry_get_content(), and that each comment has + * at least one #GDataAuthor object representing the person who wrote the comment, accessible using gdata_entry_get_authors(). + * + * Since: 0.10.0 + */ + +#include +#include + +#include "gdata-comment.h" + +G_DEFINE_ABSTRACT_TYPE (GDataComment, gdata_comment, GDATA_TYPE_ENTRY) + +static void +gdata_comment_class_init (GDataCommentClass *klass) +{ + /* Nothing to see here */ +} + +static void +gdata_comment_init (GDataComment *self) +{ + /* Nothing to see here */ +} diff --git a/gdata/gdata-comment.h b/gdata/gdata-comment.h new file mode 100644 index 0000000..973ac1e --- /dev/null +++ b/gdata/gdata-comment.h @@ -0,0 +1,72 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_COMMENT_H +#define GDATA_COMMENT_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_COMMENT (gdata_comment_get_type ()) +#define GDATA_COMMENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_COMMENT, GDataComment)) +#define GDATA_COMMENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_COMMENT, GDataCommentClass)) +#define GDATA_IS_COMMENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_COMMENT)) +#define GDATA_IS_COMMENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_COMMENT)) +#define GDATA_COMMENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_COMMENT, GDataCommentClass)) + +typedef struct _GDataCommentPrivate GDataCommentPrivate; + +/** + * GDataComment: + * + * All the fields in the #GDataComment structure are private and should never be accessed directly. + * + * Since: 0.10.0 + */ +typedef struct { + GDataEntry parent; + GDataCommentPrivate *priv; +} GDataComment; + +/** + * GDataCommentClass: + * + * All the fields in the #GDataCommentClass structure are private and should never be accessed directly. + * + * Since: 0.10.0 + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataCommentClass; + +GType gdata_comment_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* !GDATA_COMMENT_H */ diff --git a/gdata/gdata-commentable.c b/gdata/gdata-commentable.c new file mode 100644 index 0000000..e46630f --- /dev/null +++ b/gdata/gdata-commentable.c @@ -0,0 +1,598 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008–2010 + * Copyright (C) Richard Schwarting 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-commentable + * @short_description: GData commentable interface + * @stability: Stable + * @include: gdata/gdata-commentable.h + * + * #GDataCommentable is an interface which can be implemented by commentable objects: objects which support having comments added to them by users, + * such as videos and photos. + * + * Comments may be queried, added and deleted. Note that they may not be edited. + * + * #GDataCommentable objects may not support all operations on comments, on an instance-by-instance basis (i.e. it's an invalid assumption that if, + * for example, one #GDataYouTubeVideo doesn't support adding comments all other #GDataYouTubeVideos don't support adding comments either). + * Specific documentation for a particular type of #GDataCommentable may state otherwise, though. + * + * + * Querying for Comments + * + * GDataService *service; + * GDataCommentable *commentable; + * + * /* Create a service */ + * service = create_service (); + * + * /* Retrieve the GDataCommentable which is going to be queried. This may be, for example, a GDataYouTubeVideo. */ + * commentable = get_commentable (); + * + * /* Start the async. query for the comments. */ + * gdata_commentable_query_comments_async (commentable, service, NULL, NULL, NULL, NULL, NULL, (GAsyncReadyCallback) query_comments_cb, NULL); + * + * g_object_unref (service); + * g_object_unref (commentable); + * + * static void + * query_comments_cb (GDataCommentable *commentable, GAsyncResult *result, gpointer user_data) + * { + * GDataFeed *comment_feed; + * GList *comments, *i; + * GError *error = NULL; + * + * comment_feed = gdata_commentable_query_comments_finish (commentable, result, &error); + * + * if (error != NULL) { + * /* Error! */ + * g_error ("Error querying comments: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Examine the comments. */ + * comments = gdata_feed_get_entries (comment_feed); + * for (i = comments; i != NULL; i = i->next) { + * /* Note that this will actually be a subclass of GDataComment, + * * such as GDataYouTubeComment or GDataPicasaWebComment. */ + * GDataComment *comment = GDATA_COMMENT (i->data); + * GDataAuthor *author; + * + * /* Note that in practice it might not always be safe to assume that a comment always has an author. */ + * author = GDATA_AUTHOR (gdata_entry_get_authors (GDATA_ENTRY (comment))->data); + * + * g_message ("Comment by %s (%s): %s", + * gdata_author_get_name (author), + * gdata_author_get_uri (author), + * gdata_entry_get_content (GDATA_ENTRY (comment))); + * } + * + * g_object_unref (comment_feed); + * } + * + * + * + * Since: 0.10.0 + */ + +#include +#include +#include +#include + +#include "gdata-commentable.h" +#include "gdata-service.h" + +G_DEFINE_INTERFACE (GDataCommentable, gdata_commentable, GDATA_TYPE_ENTRY) + +static void +gdata_commentable_default_init (GDataCommentableInterface *iface) +{ + iface->comment_type = G_TYPE_INVALID; + iface->get_authorization_domain = NULL; + iface->get_query_comments_uri = NULL; + iface->get_insert_comment_uri = NULL; + iface->is_comment_deletable = NULL; +} + +static GType +get_comment_type (GDataCommentableInterface *iface) +{ + GType comment_type; + + comment_type = iface->comment_type; + g_assert (g_type_is_a (comment_type, GDATA_TYPE_COMMENT) == TRUE); + + return comment_type; +} + +/** + * gdata_commentable_query_comments: + * @self: a #GDataCommentable + * @service: a #GDataService representing the service with which the object's comments will be manipulated + * @query: (allow-none): a #GDataQuery with query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when a comment is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Retrieves a #GDataFeed containing the #GDataComments representing the comments on the #GDataCommentable which match the given @query. + * + * If the #GDataCommentable doesn't support commenting, %NULL will be returned and @error will be set to %GDATA_SERVICE_ERROR_FORBIDDEN. This is in + * contrast to if it does support commenting but hasn't had any comments added yet, in which case an empty #GDataFeed will be returned and no error + * will be set. + * + * Return value: (transfer full) (allow-none): a #GDataFeed of #GDataComments, or %NULL; unref with g_object_unref() + * + * Since: 0.10.0 + */ +GDataFeed * +gdata_commentable_query_comments (GDataCommentable *self, GDataService *service, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, GError **error) +{ + GDataCommentableInterface *iface; + gchar *uri; + GDataFeed *feed; + GDataAuthorizationDomain *domain = NULL; + + g_return_val_if_fail (GDATA_IS_COMMENTABLE (self), NULL); + g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + iface = GDATA_COMMENTABLE_GET_IFACE (self); + + /* Get the comment feed URI. */ + g_assert (iface->get_query_comments_uri != NULL); + uri = iface->get_query_comments_uri (self); + + /* The URI can be NULL when no comments and thus no feedLink is present in a GDataCommentable */ + if (uri == NULL) { + /* Translators: This is an error message for if a user attempts to retrieve comments from an entry (such as a video) which doesn't + * support comments. */ + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_FORBIDDEN, _("This entry does not support comments.")); + return NULL; + } + + /* Get the authorisation domain. */ + if (iface->get_authorization_domain != NULL) { + domain = iface->get_authorization_domain (self); + } + + /* Get the comment feed. */ + feed = gdata_service_query (service, domain, uri, query, get_comment_type (iface), cancellable, progress_callback, progress_user_data, error); + g_free (uri); + + return feed; +} + +static void +query_comments_async_cb (GDataService *service, GAsyncResult *service_result, gpointer user_data) +{ + g_autoptr(GTask) commentable_task = G_TASK (user_data); + g_autoptr(GDataFeed) feed = NULL; + g_autoptr(GError) error = NULL; + + feed = gdata_service_query_finish (service, service_result, &error); + + if (error != NULL) + g_task_return_error (commentable_task, g_steal_pointer (&error)); + else + g_task_return_pointer (commentable_task, g_steal_pointer (&feed), g_object_unref); +} + +/** + * gdata_commentable_query_comments_async: + * @self: a #GDataCommentable + * @service: a #GDataService representing the service with which the object's comments will be manipulated + * @query: (allow-none): a #GDataQuery with query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope notified) (closure progress_user_data): a #GDataQueryProgressCallback to call when a comment is loaded, + * or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): a function to call when @progress_callback will not be called any more, or %NULL; this function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Retrieves a #GDataFeed containing the #GDataComments representing the comments on the #GDataCommentable which match the given @query. + * @self, @service and @query are all reffed when this method is called, so can safely be freed after this method returns. + * + * For more details, see gdata_commentable_query_comments(), which is the synchronous version of this method. + * + * When the operation is finished, @callback will be called. You can then call gdata_commentable_query_comments_finish() to get the results of the + * operation. + * + * Since: 0.10.0 + */ +void +gdata_commentable_query_comments_async (GDataCommentable *self, GDataService *service, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data) +{ + GDataCommentableInterface *iface; + gchar *uri; + g_autoptr(GTask) task = NULL; + GDataAuthorizationDomain *domain = NULL; + + g_return_if_fail (GDATA_IS_COMMENTABLE (self)); + g_return_if_fail (GDATA_IS_SERVICE (service)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + iface = GDATA_COMMENTABLE_GET_IFACE (self); + + /* Get the comment feed URI. */ + g_assert (iface->get_query_comments_uri != NULL); + uri = iface->get_query_comments_uri (self); + + /* Build the async result. */ + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_commentable_query_comments_async); + + /* The URI can be NULL when no comments and thus no feedLink is present in a GDataCommentable */ + if (uri == NULL) { + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_FORBIDDEN, + /* Translators: This is an error message for if a user attempts to retrieve comments from an entry + * (such as a video) which doesn't support comments. */ + _("This entry does not support comments.")); + return; + } + + /* Get the authorisation domain. */ + if (iface->get_authorization_domain != NULL) { + domain = iface->get_authorization_domain (self); + } + + /* Get the comment feed. */ + gdata_service_query_async (service, domain, uri, query, get_comment_type (iface), cancellable, progress_callback, progress_user_data, + destroy_progress_user_data, (GAsyncReadyCallback) query_comments_async_cb, g_object_ref (task)); + g_free (uri); +} + +/** + * gdata_commentable_query_comments_finish: + * @self: a #GDataCommentable + * @result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous comment query operation started with gdata_commentable_query_comments_async(). + * + * Return value: (transfer full) (allow-none): a #GDataFeed of #GDataComments, or %NULL; unref with g_object_unref() + * + * Since: 0.10.0 + */ +GDataFeed * +gdata_commentable_query_comments_finish (GDataCommentable *self, GAsyncResult *result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_COMMENTABLE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (result, gdata_commentable_query_comments_async), NULL); + + return g_task_propagate_pointer (G_TASK (result), error); +} + +/** + * gdata_commentable_insert_comment: + * @self: a #GDataCommentable + * @service: a #GDataService with which the comment will be added + * @comment_: a new comment to be added to the #GDataCommentable + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Adds @comment to the #GDataCommentable. + * + * If the #GDataCommentable doesn't support commenting, %NULL will be returned and @error will be set to %GDATA_SERVICE_ERROR_FORBIDDEN. + * + * Return value: (transfer full) (allow-none): the added #GDataComment, or %NULL; unref with g_object_unref() + * + * Since: 0.10.0 + */ +GDataComment * +gdata_commentable_insert_comment (GDataCommentable *self, GDataService *service, GDataComment *comment_, GCancellable *cancellable, GError **error) +{ + GDataCommentableInterface *iface; + gchar *uri; + GDataComment *new_comment; + GDataAuthorizationDomain *domain = NULL; + + g_return_val_if_fail (GDATA_IS_COMMENTABLE (self), NULL); + g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL); + g_return_val_if_fail (GDATA_IS_COMMENT (comment_), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + iface = GDATA_COMMENTABLE_GET_IFACE (self); + + g_return_val_if_fail (g_type_is_a (G_OBJECT_TYPE (comment_), get_comment_type (iface)) == TRUE, NULL); + + /* Get the upload URI. */ + g_assert (iface->get_insert_comment_uri != NULL); + uri = iface->get_insert_comment_uri (self, comment_); + + if (uri == NULL) { + /* Translators: This is an error message for if a user attempts to add a comment to an entry (such as a video) which doesn't support + * comments. */ + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_FORBIDDEN, _("Comments may not be added to this entry.")); + return NULL; + } + + /* Get the authorisation domain. */ + if (iface->get_authorization_domain != NULL) { + domain = iface->get_authorization_domain (self); + } + + /* Add the comment. */ + new_comment = GDATA_COMMENT (gdata_service_insert_entry (service, domain, uri, GDATA_ENTRY (comment_), cancellable, error)); + + g_free (uri); + + return new_comment; +} + +static void +insert_comment_async_cb (GDataService *service, GAsyncResult *service_result, gpointer user_data) +{ + g_autoptr(GTask) commentable_task = G_TASK (user_data); + g_autoptr(GDataEntry) new_comment = NULL; + g_autoptr(GError) error = NULL; + + new_comment = gdata_service_insert_entry_finish (service, service_result, &error); + + if (error != NULL) + g_task_return_error (commentable_task, g_steal_pointer (&error)); + else + g_task_return_pointer (commentable_task, g_steal_pointer (&new_comment), g_object_unref); +} + +/** + * gdata_commentable_insert_comment_async: + * @self: a #GDataCommentable + * @service: a #GDataService with which the comment will be added + * @comment_: a new comment to be added to the #GDataCommentable + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the operation is finished + * @user_data: (closure): data to pass to the @callback function + * + * Adds @comment to the #GDataCommentable. @self, @service and @comment_ are all reffed when this method is called, so can safely be freed after this + * method returns. + * + * For more details, see gdata_commentable_insert_comment(), which is the synchronous version of this method. + * + * When the operation is finished, @callback will be called. You can then call gdata_commentable_insert_comment_finish() to get the results of the + * operation. + * + * Since: 0.10.0 + */ +void +gdata_commentable_insert_comment_async (GDataCommentable *self, GDataService *service, GDataComment *comment_, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + GDataCommentableInterface *iface; + g_autofree gchar *uri = NULL; + g_autoptr(GTask) task = NULL; + GDataAuthorizationDomain *domain = NULL; + + g_return_if_fail (GDATA_IS_COMMENTABLE (self)); + g_return_if_fail (GDATA_IS_SERVICE (service)); + g_return_if_fail (GDATA_IS_COMMENT (comment_)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + iface = GDATA_COMMENTABLE_GET_IFACE (self); + + g_return_if_fail (g_type_is_a (G_OBJECT_TYPE (comment_), get_comment_type (iface)) == TRUE); + + /* Get the upload URI. */ + g_assert (iface->get_insert_comment_uri != NULL); + uri = iface->get_insert_comment_uri (self, comment_); + + /* Build the async result. */ + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_commentable_insert_comment_async); + + /* The URI can be NULL when no comments and thus no feedLink is present in a GDataCommentable */ + if (uri == NULL) { + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_FORBIDDEN, + /* Translators: This is an error message for if a user attempts to add a comment to an entry + * (such as a video) which doesn't support comments. */ + _("Comments may not be added to this entry.")); + return; + } + + /* Get the authorisation domain. */ + if (iface->get_authorization_domain != NULL) { + domain = iface->get_authorization_domain (self); + } + + /* Add the comment. */ + gdata_service_insert_entry_async (service, domain, uri, GDATA_ENTRY (comment_), cancellable, (GAsyncReadyCallback) insert_comment_async_cb, + g_object_ref (task)); +} + +/** + * gdata_commentable_insert_comment_finish: + * @self: a #GDataCommentable + * @result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous comment insertion operation started with gdata_commentable_insert_comment_async(). + * + * Return value: (transfer full) (allow-none): the added #GDataComment, or %NULL; unref with g_object_unref() + * + * Since: 0.10.0 + */ +GDataComment * +gdata_commentable_insert_comment_finish (GDataCommentable *self, GAsyncResult *result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_COMMENTABLE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (result, gdata_commentable_insert_comment_async), NULL); + + return g_task_propagate_pointer (G_TASK (result), error); +} + +/** + * gdata_commentable_delete_comment: + * @self: a #GDataCommentable + * @service: a #GDataService with which the comment will be deleted + * @comment_: a comment to be deleted + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Deletes @comment from the #GDataCommentable. + * + * If the given @comment isn't deletable (either because the service doesn't support deleting comments at all, or because this particular comment + * is not deletable due to having insufficient permissions), %GDATA_SERVICE_ERROR_FORBIDDEN will be set in @error and %FALSE will be returned. + * + * Return value: %TRUE if the comment was successfully deleted, %FALSE otherwise + * + * Since: 0.10.0 + */ +gboolean +gdata_commentable_delete_comment (GDataCommentable *self, GDataService *service, GDataComment *comment_, GCancellable *cancellable, GError **error) +{ + GDataCommentableInterface *iface; + GDataAuthorizationDomain *domain = NULL; + + g_return_val_if_fail (GDATA_IS_COMMENTABLE (self), FALSE); + g_return_val_if_fail (GDATA_IS_SERVICE (service), FALSE); + g_return_val_if_fail (GDATA_IS_COMMENT (comment_), FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + iface = GDATA_COMMENTABLE_GET_IFACE (self); + + g_return_val_if_fail (g_type_is_a (G_OBJECT_TYPE (comment_), get_comment_type (iface)) == TRUE, FALSE); + + g_assert (iface->is_comment_deletable != NULL); + if (iface->is_comment_deletable (self, comment_) == FALSE) { + /* Translators: This is an error message for if a user attempts to delete a comment they're not allowed to delete. */ + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_FORBIDDEN, _("This comment may not be deleted.")); + return FALSE; + } + + /* Get the authorisation domain. */ + if (iface->get_authorization_domain != NULL) { + domain = iface->get_authorization_domain (self); + } + + /* Delete the comment. */ + return gdata_service_delete_entry (service, domain, GDATA_ENTRY (comment_), cancellable, error); +} + +static void +delete_comment_async_cb (GDataService *service, GAsyncResult *service_result, gpointer user_data) +{ + g_autoptr(GTask) commentable_task = G_TASK (user_data); + g_autoptr(GError) error = NULL; + + if (!gdata_service_delete_entry_finish (service, service_result, &error)) + g_task_return_error (commentable_task, g_steal_pointer (&error)); + else + g_task_return_boolean (commentable_task, TRUE); +} + +/** + * gdata_commentable_delete_comment_async: + * @self: a #GDataCommentable + * @service: a #GDataService with which the comment will be deleted + * @comment_: a comment to be deleted + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the operation is finished + * @user_data: (closure): data to pass to the @callback function + * + * Deletes @comment from the #GDataCommentable. @self, @service and @comment_ are all reffed when this method is called, so can safely be freed after + * this method returns. + * + * For more details, see gdata_commentable_delete_comment(), which is the synchronous version of this method. + * + * When the operation is finished, @callback will be called. You can then call gdata_commentable_delete_comment_finish() to get the results of the + * operation. + * + * Since: 0.10.0 + */ +void +gdata_commentable_delete_comment_async (GDataCommentable *self, GDataService *service, GDataComment *comment_, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + GDataCommentableInterface *iface; + g_autoptr(GTask) task = NULL; + GDataAuthorizationDomain *domain = NULL; + + g_return_if_fail (GDATA_IS_COMMENTABLE (self)); + g_return_if_fail (GDATA_IS_SERVICE (service)); + g_return_if_fail (GDATA_IS_COMMENT (comment_)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + iface = GDATA_COMMENTABLE_GET_IFACE (self); + + g_return_if_fail (g_type_is_a (G_OBJECT_TYPE (comment_), get_comment_type (iface)) == TRUE); + + /* Build the async result. */ + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_commentable_delete_comment_async); + + g_assert (iface->is_comment_deletable != NULL); + if (iface->is_comment_deletable (self, comment_) == FALSE) { + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_FORBIDDEN, + /* Translators: This is an error message for if a user attempts to delete a comment they're not allowed to delete. */ + _("This comment may not be deleted.")); + return; + } + + /* Get the authorisation domain. */ + if (iface->get_authorization_domain != NULL) { + domain = iface->get_authorization_domain (self); + } + + /* Delete the comment. */ + gdata_service_delete_entry_async (service, domain, GDATA_ENTRY (comment_), cancellable, (GAsyncReadyCallback) delete_comment_async_cb, g_object_ref (task)); +} + +/** + * gdata_commentable_delete_comment_finish: + * @self: a #GDataCommentable + * @result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous comment deletion operation started with gdata_commentable_delete_comment_async(). + * + * Return value: %TRUE if the comment was successfully deleted, %FALSE otherwise + * + * Since: 0.10.0 + */ +gboolean +gdata_commentable_delete_comment_finish (GDataCommentable *self, GAsyncResult *result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_COMMENTABLE (self), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_return_val_if_fail (g_task_is_valid (result, self), FALSE); + g_return_val_if_fail (g_async_result_is_tagged (result, gdata_commentable_delete_comment_async), FALSE); + + return g_task_propagate_boolean (G_TASK (result), error); +} diff --git a/gdata/gdata-commentable.h b/gdata/gdata-commentable.h new file mode 100644 index 0000000..0810b19 --- /dev/null +++ b/gdata/gdata-commentable.h @@ -0,0 +1,103 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * Copyright (C) Richard Schwarting 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_COMMENTABLE_H +#define GDATA_COMMENTABLE_H + +#include +#include + +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_COMMENTABLE (gdata_commentable_get_type ()) +#define GDATA_COMMENTABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_COMMENTABLE, GDataCommentable)) +#define GDATA_COMMENTABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_COMMENTABLE, GDataCommentableInterface)) +#define GDATA_IS_COMMENTABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_COMMENTABLE)) +#define GDATA_COMMENTABLE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GDATA_TYPE_COMMENTABLE, GDataCommentableInterface)) + +/** + * GDataCommentable: + * + * All the fields in the #GDataCommentable structure are private and should never be accessed directly + * + * Since: 0.10.0 + */ +typedef struct _GDataCommentable GDataCommentable; /* dummy typedef */ + +/** + * GDataCommentableInterface: + * @parent: the parent type + * @comment_type: the #GType of the comment class (subclass of #GDataComment) to use for query results from this commentable object + * @get_authorization_domain: (allow-none): a function to return the #GDataAuthorizationDomain to be used for all operations on the comments + * belonging to this commentable object; not implementing this function is equivalent to returning %NULL from it, which signifies that operations on the + * comments don't require authorization + * @get_query_comments_uri: a function that returns the URI of a #GDataFeed of comments from a commentable object, or %NULL if the given commentable + * object doesn't support commenting; free with g_free() + * @get_insert_comment_uri: a function that returns the URI to add new comments to the commentable object, or %NULL if the given commentable object + * doesn't support adding comments; free with g_free() + * @is_comment_deletable: a function that returns %TRUE if the given comment may be deleted, %FALSE otherwise + * + * The interface structure for the #GDataCommentable interface. + * + * Since: 0.10.0 + */ +typedef struct { + GTypeInterface parent; + + GType comment_type; + + GDataAuthorizationDomain *(*get_authorization_domain) (GDataCommentable *self); + + gchar *(*get_query_comments_uri) (GDataCommentable *self); + gchar *(*get_insert_comment_uri) (GDataCommentable *self, GDataComment *comment); + gboolean (*is_comment_deletable) (GDataCommentable *self, GDataComment *comment); +} GDataCommentableInterface; + +GType gdata_commentable_get_type (void) G_GNUC_CONST; + +GDataFeed *gdata_commentable_query_comments (GDataCommentable *self, GDataService *service, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_commentable_query_comments_async (GDataCommentable *self, GDataService *service, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data); +GDataFeed *gdata_commentable_query_comments_finish (GDataCommentable *self, GAsyncResult *result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataComment *gdata_commentable_insert_comment (GDataCommentable *self, GDataService *service, GDataComment *comment_, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_commentable_insert_comment_async (GDataCommentable *self, GDataService *service, GDataComment *comment_, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +GDataComment *gdata_commentable_insert_comment_finish (GDataCommentable *self, GAsyncResult *result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gboolean gdata_commentable_delete_comment (GDataCommentable *self, GDataService *service, GDataComment *comment_, GCancellable *cancellable, + GError **error); +void gdata_commentable_delete_comment_async (GDataCommentable *self, GDataService *service, GDataComment *comment_, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +gboolean gdata_commentable_delete_comment_finish (GDataCommentable *self, GAsyncResult *result, GError **error); + +G_END_DECLS + +#endif /* !GDATA_COMMENTABLE_H */ diff --git a/gdata/gdata-comparable.c b/gdata/gdata-comparable.c new file mode 100644 index 0000000..d4c5d18 --- /dev/null +++ b/gdata/gdata-comparable.c @@ -0,0 +1,95 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-comparable + * @short_description: GData comparable interface + * @stability: Stable + * @include: gdata/gdata-comparable.h + * + * #GDataComparable is an interface which can be implemented by any object which needs to be compared to another object of the same type or of a + * derived type. + * + * When implementing the interface, classes must implement the compare_with function, and the implementation must be + * pure + * . + * + * Since: 0.7.0 + */ + +#include +#include + +#include "gdata-comparable.h" + +GType +gdata_comparable_get_type (void) +{ + static GType comparable_type = 0; + + if (!comparable_type) { + comparable_type = g_type_register_static_simple (G_TYPE_INTERFACE, "GDataComparable", + sizeof (GDataComparableIface), + NULL, 0, NULL, 0); + } + + return comparable_type; +} + +/** + * gdata_comparable_compare: + * @self: (allow-none): a #GDataComparable, or %NULL + * @other: (allow-none): another #GDataComparable of the same type, or %NULL + * + * Compares the two objects, returning -1 if @self is "less than" @other by some metric, 0 + * if they're equal, or 1 if @self is "greater than" @other. + * + * %NULL values are handled gracefully, with 0 returned if both @self and @other are %NULL, + * -1 if @self is %NULL and 1 if @other is %NULL. + * + * The @other object must be of the same type as @self, or of a type derived from @self's type. + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.7.0 + */ +gint +gdata_comparable_compare (GDataComparable *self, GDataComparable *other) +{ + GDataComparableIface *iface; + + g_return_val_if_fail (self == NULL || GDATA_IS_COMPARABLE (self), 0); + g_return_val_if_fail (other == NULL || GDATA_IS_COMPARABLE (other), 0); + g_return_val_if_fail (self == NULL || other == NULL || g_type_is_a (G_OBJECT_TYPE (other), G_OBJECT_TYPE (self)), 0); + + /* Deal with NULL values */ + if (self == NULL && other != NULL) + return -1; + else if (self != NULL && other == NULL) + return 1; + + if (self == other) + return 0; + + /* Use the comparator method for non-NULL values */ + iface = GDATA_COMPARABLE_GET_IFACE (self); + g_assert (iface->compare_with != NULL); + + return iface->compare_with (self, other); +} diff --git a/gdata/gdata-comparable.h b/gdata/gdata-comparable.h new file mode 100644 index 0000000..7843afe --- /dev/null +++ b/gdata/gdata-comparable.h @@ -0,0 +1,66 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_COMPARABLE_H +#define GDATA_COMPARABLE_H + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_COMPARABLE (gdata_comparable_get_type ()) +#define GDATA_COMPARABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_COMPARABLE, GDataComparable)) +#define GDATA_COMPARABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_COMPARABLE, GDataComparableIface)) +#define GDATA_IS_COMPARABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_COMPARABLE)) +#define GDATA_COMPARABLE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GDATA_TYPE_COMPARABLE, GDataComparableIface)) + +/** + * GDataComparable: + * + * All the fields in the #GDataComparable structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct _GDataComparable GDataComparable; /* dummy typedef */ + +/** + * GDataComparableIface: + * @parent: the parent type + * @compare_with: compares the object with an @other object of the same type, returning -1 if the object is "less than" + * the other object, 0 if they're equal, or 1 if the object is "greater than" the other. The + * function can assume that neither @self or @other will be %NULL, and that both have correct types. The function must be pure. + * + * The class structure for the #GDataComparable interface. + * + * Since: 0.7.0 + */ +typedef struct { + GTypeInterface parent; + + gint (*compare_with) (GDataComparable *self, GDataComparable *other); +} GDataComparableIface; + +GType gdata_comparable_get_type (void) G_GNUC_CONST; + +gint gdata_comparable_compare (GDataComparable *self, GDataComparable *other) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_COMPARABLE_H */ diff --git a/gdata/gdata-core.symbols b/gdata/gdata-core.symbols new file mode 100644 index 0000000..fd7c7df --- /dev/null +++ b/gdata/gdata-core.symbols @@ -0,0 +1,1126 @@ +gdata_color_get_type +gdata_color_from_hexadecimal +gdata_color_to_hexadecimal +gdata_entry_get_type +gdata_entry_new +gdata_entry_get_title +gdata_entry_set_title +gdata_entry_get_summary +gdata_entry_set_summary +gdata_entry_get_id +gdata_entry_get_etag +gdata_entry_get_updated +gdata_entry_get_published +gdata_entry_add_category +gdata_entry_get_categories +gdata_entry_get_content +gdata_entry_set_content +gdata_entry_get_content_uri +gdata_entry_set_content_uri +gdata_entry_add_link +gdata_entry_remove_link +gdata_entry_look_up_link +gdata_entry_look_up_links +gdata_entry_add_author +gdata_entry_get_authors +gdata_entry_is_inserted +gdata_entry_get_rights +gdata_entry_set_rights +gdata_feed_get_type +gdata_feed_get_entries +gdata_feed_look_up_entry +gdata_feed_get_categories +gdata_feed_get_links +gdata_feed_look_up_link +gdata_feed_get_authors +gdata_feed_get_title +gdata_feed_get_subtitle +gdata_feed_get_id +gdata_feed_get_etag +gdata_feed_get_updated +gdata_feed_get_logo +gdata_feed_get_icon +gdata_feed_get_generator +gdata_feed_get_rights +gdata_feed_get_items_per_page +gdata_feed_get_start_index +gdata_feed_get_total_results +gdata_feed_get_next_page_token +gdata_service_get_type +gdata_service_error_quark +gdata_service_query +gdata_service_query_async +gdata_service_query_finish +gdata_service_query_single_entry +gdata_service_query_single_entry_async +gdata_service_query_single_entry_finish +gdata_service_insert_entry +gdata_service_insert_entry_async +gdata_service_insert_entry_finish +gdata_service_update_entry +gdata_service_update_entry_async +gdata_service_update_entry_finish +gdata_service_delete_entry +gdata_service_delete_entry_async +gdata_service_delete_entry_finish +gdata_service_get_proxy_uri +gdata_service_set_proxy_uri +gdata_service_get_proxy_resolver +gdata_service_set_proxy_resolver +gdata_query_get_type +gdata_query_new +gdata_query_new_with_limits +gdata_query_get_query_uri +gdata_query_next_page +gdata_query_previous_page +gdata_query_get_q +gdata_query_set_q +gdata_query_get_categories +gdata_query_set_categories +gdata_query_get_author +gdata_query_set_author +gdata_query_get_updated_min +gdata_query_set_updated_min +gdata_query_get_updated_max +gdata_query_set_updated_max +gdata_query_get_published_min +gdata_query_set_published_min +gdata_query_get_published_max +gdata_query_set_published_max +gdata_query_get_start_index +gdata_query_set_start_index +gdata_query_is_strict +gdata_query_set_is_strict +gdata_query_get_max_results +gdata_query_set_max_results +gdata_query_get_etag +gdata_query_set_etag +gdata_youtube_standard_feed_type_get_type +gdata_youtube_feed_get_type +gdata_youtube_service_error_get_type +gdata_youtube_service_error_quark +gdata_youtube_service_get_type +gdata_youtube_service_new +gdata_youtube_service_query_standard_feed +gdata_youtube_service_query_standard_feed_async +gdata_youtube_service_query_videos +gdata_youtube_service_query_videos_async +gdata_youtube_service_query_related +gdata_youtube_service_query_related_async +gdata_youtube_service_get_developer_key +gdata_youtube_video_get_type +gdata_youtube_video_new +gdata_youtube_video_get_view_count +gdata_youtube_video_get_favorite_count +gdata_youtube_video_get_location +gdata_youtube_video_set_location +gdata_youtube_video_get_access_control +gdata_youtube_video_set_access_control +gdata_youtube_video_get_rating +gdata_youtube_video_get_keywords +gdata_youtube_video_set_keywords +gdata_youtube_video_get_player_uri +gdata_youtube_video_is_restricted_in_country +gdata_youtube_video_get_category +gdata_youtube_video_set_category +gdata_youtube_video_get_credit +gdata_youtube_video_get_description +gdata_youtube_video_set_description +gdata_youtube_video_look_up_content +gdata_youtube_video_get_thumbnails +gdata_youtube_video_get_duration +gdata_youtube_video_is_private +gdata_youtube_video_set_is_private +gdata_youtube_video_get_uploaded +gdata_youtube_video_get_video_id +gdata_youtube_video_is_draft +gdata_youtube_video_set_is_draft +gdata_youtube_video_get_state +gdata_youtube_video_get_recorded +gdata_youtube_video_set_recorded +gdata_youtube_video_get_video_id_from_uri +gdata_youtube_video_get_aspect_ratio +gdata_youtube_video_set_aspect_ratio +gdata_youtube_format_get_type +gdata_youtube_safe_search_get_type +gdata_youtube_sort_order_get_type +gdata_youtube_age_get_type +gdata_youtube_uploader_get_type +gdata_youtube_query_get_type +gdata_youtube_query_new +gdata_youtube_query_get_format +gdata_youtube_query_set_format +gdata_youtube_query_get_location +gdata_youtube_query_set_location +gdata_youtube_query_get_language +gdata_youtube_query_set_language +gdata_youtube_query_get_order_by +gdata_youtube_query_set_order_by +gdata_youtube_query_get_restriction +gdata_youtube_query_set_restriction +gdata_youtube_query_get_safe_search +gdata_youtube_query_set_safe_search +gdata_youtube_query_get_sort_order +gdata_youtube_query_set_sort_order +gdata_youtube_query_get_age +gdata_youtube_query_set_age +gdata_youtube_query_get_uploader +gdata_youtube_query_set_uploader +gdata_calendar_calendar_get_type +gdata_calendar_calendar_new +gdata_calendar_calendar_get_timezone +gdata_calendar_calendar_set_timezone +gdata_calendar_calendar_get_times_cleaned +gdata_calendar_calendar_is_hidden +gdata_calendar_calendar_set_is_hidden +gdata_calendar_calendar_get_color +gdata_calendar_calendar_set_color +gdata_calendar_calendar_is_selected +gdata_calendar_calendar_set_is_selected +gdata_calendar_calendar_get_access_level +gdata_calendar_calendar_get_edited +gdata_calendar_event_get_type +gdata_calendar_event_new +gdata_calendar_event_get_edited +gdata_calendar_event_get_status +gdata_calendar_event_set_status +gdata_calendar_event_get_visibility +gdata_calendar_event_set_visibility +gdata_calendar_event_get_transparency +gdata_calendar_event_set_transparency +gdata_calendar_event_get_uid +gdata_calendar_event_set_uid +gdata_calendar_event_get_sequence +gdata_calendar_event_set_sequence +gdata_calendar_event_get_guests_can_modify +gdata_calendar_event_set_guests_can_modify +gdata_calendar_event_get_guests_can_invite_others +gdata_calendar_event_set_guests_can_invite_others +gdata_calendar_event_get_guests_can_see_guests +gdata_calendar_event_set_guests_can_see_guests +gdata_calendar_event_get_anyone_can_add_self +gdata_calendar_event_set_anyone_can_add_self +gdata_calendar_event_add_person +gdata_calendar_event_get_people +gdata_calendar_event_add_place +gdata_calendar_event_get_places +gdata_calendar_event_add_time +gdata_calendar_event_get_times +gdata_calendar_event_get_primary_time +gdata_calendar_event_get_recurrence +gdata_calendar_event_set_recurrence +gdata_calendar_event_get_original_event_details +gdata_calendar_event_is_exception +gdata_calendar_query_get_type +gdata_calendar_query_new +gdata_calendar_query_new_with_limits +gdata_calendar_query_get_future_events +gdata_calendar_query_set_future_events +gdata_calendar_query_get_order_by +gdata_calendar_query_set_order_by +gdata_calendar_query_get_recurrence_expansion_start +gdata_calendar_query_set_recurrence_expansion_start +gdata_calendar_query_get_recurrence_expansion_end +gdata_calendar_query_set_recurrence_expansion_end +gdata_calendar_query_get_single_events +gdata_calendar_query_set_single_events +gdata_calendar_query_get_sort_order +gdata_calendar_query_set_sort_order +gdata_calendar_query_get_start_min +gdata_calendar_query_set_start_min +gdata_calendar_query_get_start_max +gdata_calendar_query_set_start_max +gdata_calendar_query_get_timezone +gdata_calendar_query_set_timezone +gdata_calendar_service_get_type +gdata_calendar_service_new +gdata_calendar_service_query_all_calendars +gdata_calendar_service_query_all_calendars_async +gdata_calendar_service_query_own_calendars +gdata_calendar_service_query_own_calendars_async +gdata_calendar_service_query_events +gdata_calendar_service_insert_event +gdata_calendar_service_insert_calendar_event +gdata_operation_type_get_type +gdata_service_error_get_type +gdata_media_expression_get_type +gdata_media_medium_get_type +gdata_parser_error_get_type +gdata_parser_error_quark +gdata_contacts_service_get_type +gdata_contacts_service_new +gdata_contacts_service_query_contacts +gdata_contacts_service_query_contacts_async +gdata_contacts_service_insert_contact +gdata_contacts_service_insert_contact_async +gdata_contacts_query_get_type +gdata_contacts_query_new +gdata_contacts_query_new_with_limits +gdata_contacts_query_get_order_by +gdata_contacts_query_set_order_by +gdata_contacts_query_show_deleted +gdata_contacts_query_set_show_deleted +gdata_contacts_query_get_sort_order +gdata_contacts_query_set_sort_order +gdata_contacts_query_get_group +gdata_contacts_query_set_group +gdata_contacts_contact_get_type +gdata_contacts_contact_new +gdata_contacts_contact_get_edited +gdata_contacts_contact_get_name +gdata_contacts_contact_set_name +gdata_contacts_contact_add_email_address +gdata_contacts_contact_get_email_addresses +gdata_contacts_contact_get_primary_email_address +gdata_contacts_contact_remove_all_email_addresses +gdata_contacts_contact_add_im_address +gdata_contacts_contact_get_im_addresses +gdata_contacts_contact_get_primary_im_address +gdata_contacts_contact_remove_all_im_addresses +gdata_contacts_contact_add_phone_number +gdata_contacts_contact_get_phone_numbers +gdata_contacts_contact_get_primary_phone_number +gdata_contacts_contact_remove_all_phone_numbers +gdata_contacts_contact_add_postal_address +gdata_contacts_contact_get_postal_addresses +gdata_contacts_contact_get_primary_postal_address +gdata_contacts_contact_remove_all_postal_addresses +gdata_contacts_contact_add_organization +gdata_contacts_contact_get_organizations +gdata_contacts_contact_get_primary_organization +gdata_contacts_contact_remove_all_organizations +gdata_contacts_contact_get_extended_property +gdata_contacts_contact_get_extended_properties +gdata_contacts_contact_set_extended_property +gdata_contacts_contact_add_group +gdata_contacts_contact_remove_group +gdata_contacts_contact_is_group_deleted +gdata_contacts_contact_get_groups +gdata_contacts_contact_is_deleted +gdata_contacts_contact_get_photo_etag +gdata_contacts_contact_get_photo +gdata_contacts_contact_set_photo +gdata_access_handler_get_type +gdata_access_handler_get_rules +gdata_access_handler_get_rules_async +gdata_access_rule_get_type +gdata_access_rule_new +gdata_access_rule_get_role +gdata_access_rule_set_role +gdata_access_rule_get_scope +gdata_access_rule_set_scope +gdata_access_rule_get_edited +gdata_access_rule_get_key +gdata_parsable_get_type +gdata_parsable_get_content_type +gdata_parsable_new_from_xml +gdata_parsable_get_xml +gdata_parsable_new_from_json +gdata_parsable_get_json +gdata_calendar_feed_get_type +gdata_calendar_feed_get_timezone +gdata_calendar_feed_get_times_cleaned +gdata_category_get_type +gdata_category_new +gdata_category_get_term +gdata_category_set_term +gdata_category_get_scheme +gdata_category_set_scheme +gdata_category_get_label +gdata_category_set_label +gdata_link_get_type +gdata_link_new +gdata_link_get_uri +gdata_link_set_uri +gdata_link_get_relation_type +gdata_link_set_relation_type +gdata_link_get_content_type +gdata_link_set_content_type +gdata_link_get_language +gdata_link_set_language +gdata_link_get_title +gdata_link_set_title +gdata_link_get_length +gdata_link_set_length +gdata_author_get_type +gdata_author_new +gdata_author_get_name +gdata_author_set_name +gdata_author_get_uri +gdata_author_set_uri +gdata_author_get_email_address +gdata_author_set_email_address +gdata_generator_get_type +gdata_generator_get_name +gdata_generator_get_uri +gdata_generator_get_version +gdata_gd_organization_get_type +gdata_gd_organization_new +gdata_gd_organization_get_name +gdata_gd_organization_set_name +gdata_gd_organization_get_title +gdata_gd_organization_set_title +gdata_gd_organization_get_relation_type +gdata_gd_organization_set_relation_type +gdata_gd_organization_get_label +gdata_gd_organization_set_label +gdata_gd_organization_is_primary +gdata_gd_organization_set_is_primary +gdata_gd_organization_get_department +gdata_gd_organization_set_department +gdata_gd_organization_get_job_description +gdata_gd_organization_set_job_description +gdata_gd_organization_get_symbol +gdata_gd_organization_set_symbol +gdata_gd_organization_get_location +gdata_gd_organization_set_location +gdata_gd_when_get_type +gdata_gd_when_new +gdata_gd_when_get_start_time +gdata_gd_when_set_start_time +gdata_gd_when_get_end_time +gdata_gd_when_set_end_time +gdata_gd_when_is_date +gdata_gd_when_set_is_date +gdata_gd_when_get_value_string +gdata_gd_when_set_value_string +gdata_gd_when_get_reminders +gdata_gd_when_add_reminder +gdata_gd_who_get_type +gdata_gd_who_new +gdata_gd_who_get_relation_type +gdata_gd_who_set_relation_type +gdata_gd_who_get_value_string +gdata_gd_who_set_value_string +gdata_gd_who_get_email_address +gdata_gd_who_set_email_address +gdata_gd_where_get_type +gdata_gd_where_new +gdata_gd_where_get_relation_type +gdata_gd_where_set_relation_type +gdata_gd_where_get_value_string +gdata_gd_where_set_value_string +gdata_gd_where_get_label +gdata_gd_where_set_label +gdata_gd_email_address_get_type +gdata_gd_email_address_new +gdata_gd_email_address_get_address +gdata_gd_email_address_set_address +gdata_gd_email_address_get_relation_type +gdata_gd_email_address_set_relation_type +gdata_gd_email_address_get_label +gdata_gd_email_address_set_label +gdata_gd_email_address_is_primary +gdata_gd_email_address_set_is_primary +gdata_gd_email_address_get_display_name +gdata_gd_email_address_set_display_name +gdata_gd_im_address_get_type +gdata_gd_im_address_new +gdata_gd_im_address_get_address +gdata_gd_im_address_set_address +gdata_gd_im_address_get_protocol +gdata_gd_im_address_set_protocol +gdata_gd_im_address_get_relation_type +gdata_gd_im_address_set_relation_type +gdata_gd_im_address_get_label +gdata_gd_im_address_set_label +gdata_gd_im_address_is_primary +gdata_gd_im_address_set_is_primary +gdata_gd_postal_address_get_type +gdata_gd_postal_address_new +gdata_gd_postal_address_get_address +gdata_gd_postal_address_set_address +gdata_gd_postal_address_get_relation_type +gdata_gd_postal_address_set_relation_type +gdata_gd_postal_address_get_label +gdata_gd_postal_address_set_label +gdata_gd_postal_address_is_primary +gdata_gd_postal_address_set_is_primary +gdata_gd_postal_address_get_mail_class +gdata_gd_postal_address_set_mail_class +gdata_gd_postal_address_get_usage +gdata_gd_postal_address_set_usage +gdata_gd_postal_address_get_agent +gdata_gd_postal_address_set_agent +gdata_gd_postal_address_get_house_name +gdata_gd_postal_address_set_house_name +gdata_gd_postal_address_get_street +gdata_gd_postal_address_set_street +gdata_gd_postal_address_get_po_box +gdata_gd_postal_address_set_po_box +gdata_gd_postal_address_get_neighborhood +gdata_gd_postal_address_set_neighborhood +gdata_gd_postal_address_get_city +gdata_gd_postal_address_set_city +gdata_gd_postal_address_get_subregion +gdata_gd_postal_address_set_subregion +gdata_gd_postal_address_get_region +gdata_gd_postal_address_set_region +gdata_gd_postal_address_get_postcode +gdata_gd_postal_address_set_postcode +gdata_gd_postal_address_get_country +gdata_gd_postal_address_get_country_code +gdata_gd_postal_address_set_country +gdata_gd_phone_number_get_type +gdata_gd_phone_number_new +gdata_gd_phone_number_get_number +gdata_gd_phone_number_set_number +gdata_gd_phone_number_get_uri +gdata_gd_phone_number_set_uri +gdata_gd_phone_number_get_relation_type +gdata_gd_phone_number_set_relation_type +gdata_gd_phone_number_get_label +gdata_gd_phone_number_set_label +gdata_gd_phone_number_is_primary +gdata_gd_phone_number_set_is_primary +gdata_gd_reminder_get_type +gdata_gd_reminder_new +gdata_gd_reminder_get_method +gdata_gd_reminder_set_method +gdata_gd_reminder_get_absolute_time +gdata_gd_reminder_set_absolute_time +gdata_gd_reminder_is_absolute_time +gdata_gd_reminder_get_relative_time +gdata_gd_reminder_set_relative_time +gdata_media_category_get_type +gdata_media_category_new +gdata_media_category_get_category +gdata_media_category_set_category +gdata_media_category_get_scheme +gdata_media_category_set_scheme +gdata_media_category_get_label +gdata_media_category_set_label +gdata_media_credit_get_type +gdata_media_credit_get_credit +gdata_media_credit_get_scheme +gdata_media_credit_get_role +gdata_youtube_credit_get_type +gdata_youtube_credit_get_entity_type +gdata_media_content_get_type +gdata_media_content_get_uri +gdata_media_content_get_filesize +gdata_media_content_get_content_type +gdata_media_content_get_medium +gdata_media_content_is_default +gdata_media_content_get_expression +gdata_media_content_get_duration +gdata_media_content_get_height +gdata_media_content_get_width +gdata_media_content_download +gdata_youtube_content_get_type +gdata_youtube_content_get_format +gdata_media_thumbnail_get_type +gdata_media_thumbnail_get_uri +gdata_media_thumbnail_get_height +gdata_media_thumbnail_get_width +gdata_media_thumbnail_get_time +gdata_media_thumbnail_download +gdata_youtube_state_get_type +gdata_youtube_state_get_name +gdata_youtube_state_get_reason_code +gdata_youtube_state_get_help_uri +gdata_youtube_state_get_message +gdata_picasaweb_album_get_type +gdata_picasaweb_album_new +gdata_picasaweb_album_get_id +gdata_picasaweb_album_get_user +gdata_picasaweb_album_get_nickname +gdata_picasaweb_album_get_edited +gdata_picasaweb_album_get_location +gdata_picasaweb_album_set_location +gdata_picasaweb_album_get_visibility +gdata_picasaweb_album_set_visibility +gdata_picasaweb_album_get_timestamp +gdata_picasaweb_album_set_timestamp +gdata_picasaweb_album_get_num_photos +gdata_picasaweb_album_get_num_photos_remaining +gdata_picasaweb_album_get_bytes_used +gdata_picasaweb_album_is_commenting_enabled +gdata_picasaweb_album_set_is_commenting_enabled +gdata_picasaweb_album_get_comment_count +gdata_picasaweb_album_get_tags +gdata_picasaweb_album_set_tags +gdata_picasaweb_album_get_contents +gdata_picasaweb_album_get_thumbnails +gdata_picasaweb_album_get_coordinates +gdata_picasaweb_album_set_coordinates +gdata_picasaweb_file_get_type +gdata_picasaweb_file_new +gdata_picasaweb_file_get_id +gdata_picasaweb_file_get_edited +gdata_picasaweb_file_get_version +gdata_picasaweb_file_get_album_id +gdata_picasaweb_file_set_album_id +gdata_picasaweb_file_get_width +gdata_picasaweb_file_get_height +gdata_picasaweb_file_get_size +gdata_picasaweb_file_get_checksum +gdata_picasaweb_file_set_checksum +gdata_picasaweb_file_get_timestamp +gdata_picasaweb_file_set_timestamp +gdata_picasaweb_file_is_commenting_enabled +gdata_picasaweb_file_set_is_commenting_enabled +gdata_picasaweb_file_get_comment_count +gdata_picasaweb_file_get_rotation +gdata_picasaweb_file_set_rotation +gdata_picasaweb_file_get_video_status +gdata_picasaweb_file_get_tags +gdata_picasaweb_file_set_tags +gdata_picasaweb_file_get_credit +gdata_picasaweb_file_get_caption +gdata_picasaweb_file_set_caption +gdata_picasaweb_file_get_contents +gdata_picasaweb_file_get_thumbnails +gdata_picasaweb_file_get_distance +gdata_picasaweb_file_get_exposure +gdata_picasaweb_file_get_flash +gdata_picasaweb_file_get_focal_length +gdata_picasaweb_file_get_fstop +gdata_picasaweb_file_get_image_unique_id +gdata_picasaweb_file_get_iso +gdata_picasaweb_file_get_make +gdata_picasaweb_file_get_model +gdata_picasaweb_file_get_coordinates +gdata_picasaweb_file_set_coordinates +gdata_picasaweb_service_get_type +gdata_picasaweb_service_new +gdata_picasaweb_service_get_user +gdata_picasaweb_service_query_all_albums +gdata_picasaweb_service_query_all_albums_async +gdata_picasaweb_service_query_files +gdata_picasaweb_service_insert_album +gdata_picasaweb_feed_get_type +gdata_picasaweb_user_get_type +gdata_picasaweb_user_get_user +gdata_picasaweb_user_get_nickname +gdata_picasaweb_user_get_quota_limit +gdata_picasaweb_user_get_quota_current +gdata_picasaweb_user_get_max_photos_per_album +gdata_picasaweb_user_get_thumbnail_uri +gdata_picasaweb_query_get_type +gdata_picasaweb_query_new +gdata_picasaweb_query_new_with_limits +gdata_picasaweb_query_get_visibility +gdata_picasaweb_query_set_visibility +gdata_picasaweb_query_get_thumbnail_size +gdata_picasaweb_query_set_thumbnail_size +gdata_picasaweb_query_get_image_size +gdata_picasaweb_query_set_image_size +gdata_picasaweb_query_get_tag +gdata_picasaweb_query_set_tag +gdata_picasaweb_query_get_bounding_box +gdata_picasaweb_query_set_bounding_box +gdata_picasaweb_query_get_location +gdata_picasaweb_query_set_location +gdata_picasaweb_visibility_get_type +gdata_documents_presentation_get_type +gdata_documents_presentation_new +gdata_documents_drawing_get_type +gdata_documents_drawing_new +gdata_documents_pdf_get_type +gdata_documents_pdf_new +gdata_documents_text_get_type +gdata_documents_text_new +gdata_documents_spreadsheet_get_type +gdata_documents_spreadsheet_new +gdata_documents_spreadsheet_get_download_uri +gdata_documents_folder_get_type +gdata_documents_folder_new +gdata_documents_service_get_type +gdata_documents_service_new +gdata_documents_service_get_metadata +gdata_documents_service_get_metadata_async +gdata_documents_service_get_metadata_finish +gdata_documents_service_query_documents +gdata_documents_service_query_documents_async +gdata_documents_service_upload_document +gdata_documents_service_update_document +gdata_documents_service_get_upload_uri +gdata_documents_metadata_get_type +gdata_documents_metadata_get_quota_total +gdata_documents_metadata_get_quota_used +gdata_documents_feed_get_type +gdata_documents_entry_get_type +gdata_documents_entry_get_path +gdata_documents_entry_get_document_id +gdata_documents_entry_get_edited +gdata_documents_entry_get_last_viewed +gdata_documents_entry_set_writers_can_invite +gdata_documents_entry_writers_can_invite +gdata_documents_entry_get_last_modified_by +gdata_documents_entry_is_deleted +gdata_documents_query_get_type +gdata_documents_query_new +gdata_documents_query_new_with_limits +gdata_documents_query_show_deleted +gdata_documents_query_set_show_deleted +gdata_documents_query_show_folders +gdata_documents_query_set_show_folders +gdata_documents_query_get_folder_id +gdata_documents_query_set_folder_id +gdata_documents_query_get_title +gdata_documents_query_get_exact_title +gdata_documents_query_set_title +gdata_documents_query_get_collaborator_addresses +gdata_documents_query_get_reader_addresses +gdata_documents_query_add_reader +gdata_documents_query_add_collaborator +gdata_documents_service_error_get_type +gdata_documents_service_error_quark +gdata_documents_access_rule_get_type +gdata_documents_access_rule_new +gdata_download_stream_get_type +gdata_download_stream_new +gdata_download_stream_get_service +gdata_download_stream_get_download_uri +gdata_download_stream_get_content_type +gdata_download_stream_get_content_length +gdata_upload_stream_get_type +gdata_upload_stream_new +gdata_upload_stream_get_service +gdata_upload_stream_get_upload_uri +gdata_upload_stream_get_entry +gdata_upload_stream_get_slug +gdata_upload_stream_get_content_type +gdata_gd_name_get_type +gdata_gd_name_new +gdata_gd_name_get_given_name +gdata_gd_name_set_given_name +gdata_gd_name_get_additional_name +gdata_gd_name_set_additional_name +gdata_gd_name_get_family_name +gdata_gd_name_set_family_name +gdata_gd_name_get_prefix +gdata_gd_name_set_prefix +gdata_gd_name_get_suffix +gdata_gd_name_set_suffix +gdata_gd_name_get_full_name +gdata_gd_name_set_full_name +gdata_youtube_permission_get_type +gdata_gcontact_jot_get_type +gdata_gcontact_jot_new +gdata_gcontact_jot_get_content +gdata_gcontact_jot_set_content +gdata_gcontact_jot_get_relation_type +gdata_gcontact_jot_set_relation_type +gdata_contacts_contact_add_jot +gdata_contacts_contact_get_jots +gdata_contacts_contact_remove_all_jots +gdata_contacts_contact_get_nickname +gdata_contacts_contact_set_nickname +gdata_contacts_contact_get_birthday +gdata_contacts_contact_set_birthday +gdata_gcontact_relation_get_type +gdata_gcontact_relation_new +gdata_gcontact_relation_get_name +gdata_gcontact_relation_set_name +gdata_gcontact_relation_get_relation_type +gdata_gcontact_relation_set_relation_type +gdata_gcontact_relation_get_label +gdata_gcontact_relation_set_label +gdata_contacts_contact_add_relation +gdata_contacts_contact_get_relations +gdata_contacts_contact_remove_all_relations +gdata_gcontact_website_get_type +gdata_gcontact_website_new +gdata_gcontact_website_get_uri +gdata_gcontact_website_set_uri +gdata_gcontact_website_get_relation_type +gdata_gcontact_website_set_relation_type +gdata_gcontact_website_get_label +gdata_gcontact_website_set_label +gdata_gcontact_website_is_primary +gdata_gcontact_website_set_is_primary +gdata_contacts_contact_add_website +gdata_contacts_contact_get_websites +gdata_contacts_contact_get_primary_website +gdata_contacts_contact_remove_all_websites +gdata_gcontact_event_get_type +gdata_gcontact_event_new +gdata_gcontact_event_get_date +gdata_gcontact_event_set_date +gdata_gcontact_event_get_relation_type +gdata_gcontact_event_set_relation_type +gdata_gcontact_event_get_label +gdata_gcontact_event_set_label +gdata_contacts_contact_add_event +gdata_contacts_contact_get_events +gdata_contacts_contact_remove_all_events +gdata_gcontact_calendar_get_type +gdata_gcontact_calendar_new +gdata_gcontact_calendar_get_uri +gdata_gcontact_calendar_set_uri +gdata_gcontact_calendar_get_relation_type +gdata_gcontact_calendar_set_relation_type +gdata_gcontact_calendar_get_label +gdata_gcontact_calendar_set_label +gdata_gcontact_calendar_is_primary +gdata_gcontact_calendar_set_is_primary +gdata_contacts_contact_add_calendar +gdata_contacts_contact_get_calendars +gdata_contacts_contact_get_primary_calendar +gdata_contacts_contact_remove_all_calendars +gdata_contacts_contact_get_directory_server +gdata_contacts_contact_set_directory_server +gdata_contacts_contact_get_gender +gdata_contacts_contact_set_gender +gdata_contacts_contact_get_initials +gdata_contacts_contact_set_initials +gdata_contacts_contact_get_maiden_name +gdata_contacts_contact_set_maiden_name +gdata_contacts_contact_get_mileage +gdata_contacts_contact_set_mileage +gdata_contacts_contact_get_occupation +gdata_contacts_contact_set_occupation +gdata_contacts_contact_get_priority +gdata_contacts_contact_set_priority +gdata_contacts_contact_get_sensitivity +gdata_contacts_contact_set_sensitivity +gdata_contacts_contact_get_short_name +gdata_contacts_contact_set_short_name +gdata_contacts_contact_get_subject +gdata_contacts_contact_set_subject +gdata_contacts_contact_get_billing_information +gdata_contacts_contact_set_billing_information +gdata_contacts_contact_get_user_defined_field +gdata_contacts_contact_get_user_defined_fields +gdata_contacts_contact_set_user_defined_field +gdata_gcontact_external_id_get_type +gdata_gcontact_external_id_new +gdata_gcontact_external_id_get_value +gdata_gcontact_external_id_set_value +gdata_gcontact_external_id_get_relation_type +gdata_gcontact_external_id_set_relation_type +gdata_gcontact_external_id_get_label +gdata_gcontact_external_id_set_label +gdata_contacts_contact_add_external_id +gdata_contacts_contact_get_external_ids +gdata_contacts_contact_remove_all_external_ids +gdata_contacts_contact_add_hobby +gdata_contacts_contact_get_hobbies +gdata_contacts_contact_remove_all_hobbies +gdata_gcontact_language_get_type +gdata_gcontact_language_new +gdata_gcontact_language_get_code +gdata_gcontact_language_set_code +gdata_gcontact_language_get_label +gdata_gcontact_language_set_label +gdata_contacts_contact_add_language +gdata_contacts_contact_get_languages +gdata_contacts_contact_remove_all_languages +gdata_service_get_timeout +gdata_service_set_timeout +gdata_service_get_locale +gdata_service_set_locale +gdata_youtube_service_get_categories +gdata_youtube_service_get_categories_async +gdata_youtube_service_get_categories_finish +gdata_youtube_category_get_type +gdata_youtube_category_is_assignable +gdata_youtube_category_is_browsable +gdata_youtube_category_is_deprecated +gdata_app_categories_get_type +gdata_app_categories_get_categories +gdata_app_categories_is_fixed +gdata_comparable_get_type +gdata_comparable_compare +gdata_batch_operation_get_type +gdata_batch_operation_get_service +gdata_batch_operation_get_feed_uri +gdata_batch_operation_add_query +gdata_batch_operation_add_insertion +gdata_batch_operation_add_update +gdata_batch_operation_add_deletion +gdata_batch_operation_run +gdata_batch_operation_run_async +gdata_batch_operation_run_finish +gdata_batch_operation_type_get_type +gdata_batchable_get_type +gdata_batchable_create_operation +gdata_upload_stream_get_method +gdata_documents_document_get_type +gdata_documents_document_download +gdata_documents_document_get_download_uri +gdata_contacts_group_get_type +gdata_contacts_group_new +gdata_contacts_group_get_edited +gdata_contacts_group_is_deleted +gdata_contacts_group_get_system_group_id +gdata_contacts_group_get_extended_property +gdata_contacts_group_get_extended_properties +gdata_contacts_group_set_extended_property +gdata_contacts_service_query_groups +gdata_contacts_service_query_groups_async +gdata_contacts_service_insert_group +gdata_contacts_service_insert_group_async +gdata_picasaweb_service_insert_album_async +gdata_picasaweb_service_query_files_async +gdata_documents_service_finish_upload +gdata_documents_service_add_entry_to_folder +gdata_documents_service_remove_entry_from_folder +gdata_documents_service_add_entry_to_folder_async +gdata_documents_service_add_entry_to_folder_finish +gdata_documents_service_remove_entry_from_folder_async +gdata_documents_service_remove_entry_from_folder_finish +gdata_picasaweb_service_upload_file +gdata_picasaweb_service_finish_file_upload +gdata_youtube_service_upload_video +gdata_youtube_service_finish_video_upload +gdata_calendar_service_query_events_async +gdata_calendar_service_insert_event_async +gdata_calendar_service_insert_calendar_event_async +gdata_contacts_contact_get_photo_async +gdata_contacts_contact_get_photo_finish +gdata_contacts_contact_set_photo_async +gdata_contacts_contact_set_photo_finish +gdata_youtube_video_get_coordinates +gdata_youtube_video_set_coordinates +gdata_upload_stream_get_cancellable +gdata_download_stream_get_cancellable +gdata_service_is_authorized +gdata_service_get_authorizer +gdata_service_set_authorizer +gdata_authorizer_get_type +gdata_authorizer_process_request +gdata_authorizer_is_authorized_for_domain +gdata_authorizer_refresh_authorization +gdata_authorizer_refresh_authorization_async +gdata_authorizer_refresh_authorization_finish +gdata_authorization_domain_get_type +gdata_authorization_domain_get_service_name +gdata_authorization_domain_get_scope +gdata_client_login_authorizer_get_type +gdata_client_login_authorizer_new +gdata_client_login_authorizer_new_for_authorization_domains +gdata_client_login_authorizer_authenticate +gdata_client_login_authorizer_authenticate_async +gdata_client_login_authorizer_authenticate_finish +gdata_client_login_authorizer_get_client_id +gdata_client_login_authorizer_get_username +gdata_client_login_authorizer_get_password +gdata_client_login_authorizer_get_proxy_uri +gdata_client_login_authorizer_set_proxy_uri +gdata_client_login_authorizer_get_proxy_resolver +gdata_client_login_authorizer_set_proxy_resolver +gdata_client_login_authorizer_get_timeout +gdata_client_login_authorizer_set_timeout +gdata_client_login_authorizer_error_quark +gdata_client_login_authorizer_error_get_type +gdata_download_stream_get_authorization_domain +gdata_upload_stream_get_authorization_domain +gdata_batch_operation_get_authorization_domain +gdata_contacts_service_get_primary_authorization_domain +gdata_calendar_service_get_primary_authorization_domain +gdata_documents_service_get_primary_authorization_domain +gdata_documents_service_get_spreadsheet_authorization_domain +gdata_picasaweb_service_get_primary_authorization_domain +gdata_youtube_service_get_primary_authorization_domain +gdata_service_get_authorization_domains +gdata_oauth1_authorizer_get_type +gdata_oauth1_authorizer_new +gdata_oauth1_authorizer_new_for_authorization_domains +gdata_oauth1_authorizer_request_authentication_uri +gdata_oauth1_authorizer_request_authentication_uri_async +gdata_oauth1_authorizer_request_authentication_uri_finish +gdata_oauth1_authorizer_request_authorization +gdata_oauth1_authorizer_request_authorization_async +gdata_oauth1_authorizer_request_authorization_finish +gdata_oauth1_authorizer_get_application_name +gdata_oauth1_authorizer_get_locale +gdata_oauth1_authorizer_set_locale +gdata_oauth1_authorizer_get_proxy_uri +gdata_oauth1_authorizer_set_proxy_uri +gdata_oauth1_authorizer_get_proxy_resolver +gdata_oauth1_authorizer_set_proxy_resolver +gdata_oauth1_authorizer_get_timeout +gdata_oauth1_authorizer_set_timeout +gdata_calendar_query_get_max_attendees +gdata_calendar_query_set_max_attendees +gdata_calendar_query_show_deleted +gdata_calendar_query_set_show_deleted +gdata_picasaweb_service_get_user_async +gdata_picasaweb_service_get_user_finish +gdata_commentable_get_type +gdata_commentable_query_comments +gdata_commentable_query_comments_async +gdata_commentable_query_comments_finish +gdata_commentable_insert_comment +gdata_commentable_insert_comment_async +gdata_commentable_insert_comment_finish +gdata_commentable_delete_comment +gdata_commentable_delete_comment_async +gdata_commentable_delete_comment_finish +gdata_comment_get_type +gdata_youtube_comment_get_type +gdata_youtube_comment_new +gdata_youtube_comment_get_parent_comment_uri +gdata_youtube_comment_set_parent_comment_uri +gdata_picasaweb_comment_get_type +gdata_picasaweb_comment_new +gdata_youtube_video_get_media_rating +gdata_documents_entry_get_resource_id +gdata_youtube_query_get_license +gdata_youtube_query_set_license +gdata_contacts_contact_get_file_as +gdata_contacts_contact_set_file_as +gdata_upload_stream_new_resumable +gdata_upload_stream_get_content_length +gdata_documents_service_upload_document_resumable +gdata_documents_service_update_document_resumable +gdata_documents_upload_query_get_type +gdata_documents_upload_query_new +gdata_documents_upload_query_build_uri +gdata_documents_upload_query_get_folder +gdata_documents_upload_query_set_folder +gdata_documents_document_new +gdata_documents_upload_query_get_convert +gdata_documents_upload_query_set_convert +gdata_documents_entry_get_quota_used +gdata_documents_entry_get_file_size +gdata_documents_service_copy_document +gdata_documents_service_copy_document_async +gdata_documents_service_copy_document_finish +gdata_documents_document_get_thumbnail_uri +gdata_tasks_task_get_type +gdata_tasks_task_new +gdata_tasks_task_get_parent +gdata_tasks_task_get_position +gdata_tasks_task_get_notes +gdata_tasks_task_set_notes +gdata_tasks_task_get_status +gdata_tasks_task_set_status +gdata_tasks_task_get_due +gdata_tasks_task_set_due +gdata_tasks_task_get_completed +gdata_tasks_task_set_completed +gdata_tasks_task_is_deleted +gdata_tasks_task_set_is_deleted +gdata_tasks_task_is_hidden +gdata_tasks_tasklist_get_type +gdata_tasks_tasklist_new +gdata_tasks_query_get_type +gdata_tasks_query_new +gdata_tasks_query_get_completed_max +gdata_tasks_query_set_completed_max +gdata_tasks_query_get_completed_min +gdata_tasks_query_set_completed_min +gdata_tasks_query_get_due_max +gdata_tasks_query_set_due_max +gdata_tasks_query_get_due_min +gdata_tasks_query_set_due_min +gdata_tasks_query_get_show_completed +gdata_tasks_query_set_show_completed +gdata_tasks_query_get_show_deleted +gdata_tasks_query_set_show_deleted +gdata_tasks_query_get_show_hidden +gdata_tasks_query_set_show_hidden +gdata_tasks_service_get_type +gdata_tasks_service_new +gdata_tasks_service_get_primary_authorization_domain +gdata_tasks_service_query_all_tasklists +gdata_tasks_service_query_all_tasklists_async +gdata_tasks_service_query_tasks +gdata_tasks_service_query_tasks_async +gdata_tasks_service_insert_task +gdata_tasks_service_insert_task_async +gdata_tasks_service_insert_tasklist +gdata_tasks_service_insert_tasklist_async +gdata_tasks_service_delete_task +gdata_tasks_service_delete_task_async +gdata_tasks_service_delete_tasklist +gdata_tasks_service_delete_tasklist_async +gdata_tasks_service_update_task +gdata_tasks_service_update_task_async +gdata_tasks_service_update_tasklist +gdata_tasks_service_update_tasklist_async +gdata_freebase_service_get_type +gdata_freebase_service_new +gdata_freebase_service_query +gdata_freebase_service_query_async +gdata_freebase_service_get_topic +gdata_freebase_service_get_topic_async +gdata_freebase_service_search +gdata_freebase_service_search_async +gdata_freebase_service_get_image +gdata_freebase_query_get_type +gdata_freebase_query_new +gdata_freebase_query_new_from_variant +gdata_freebase_search_filter_type_get_type +gdata_freebase_search_query_get_type +gdata_freebase_search_query_new +gdata_freebase_search_query_open_filter +gdata_freebase_search_query_close_filter +gdata_freebase_search_query_add_filter +gdata_freebase_search_query_add_location +gdata_freebase_search_query_set_language +gdata_freebase_search_query_get_language +gdata_freebase_search_query_set_stemmed +gdata_freebase_search_query_get_stemmed +gdata_freebase_search_result_get_type +gdata_freebase_search_result_new +gdata_freebase_search_result_get_num_items +gdata_freebase_search_result_get_total_hits +gdata_freebase_search_result_get_item +gdata_freebase_search_result_item_get_type +gdata_freebase_search_result_item_get_mid +gdata_freebase_search_result_item_get_id +gdata_freebase_search_result_item_get_name +gdata_freebase_search_result_item_get_language +gdata_freebase_search_result_item_get_notable_name +gdata_freebase_search_result_item_get_notable_id +gdata_freebase_search_result_item_get_score +gdata_freebase_topic_query_get_type +gdata_freebase_topic_query_new +gdata_freebase_topic_query_set_filter +gdata_freebase_topic_query_get_filter +gdata_freebase_topic_query_set_language +gdata_freebase_topic_query_get_language +gdata_freebase_topic_object_get_type +gdata_freebase_topic_object_ref +gdata_freebase_topic_object_unref +gdata_freebase_topic_object_list_properties +gdata_freebase_topic_object_get_id +gdata_freebase_topic_object_get_property_count +gdata_freebase_topic_object_get_property_hits +gdata_freebase_topic_object_get_property_value +gdata_freebase_topic_value_get_type +gdata_freebase_topic_value_ref +gdata_freebase_topic_value_unref +gdata_freebase_topic_value_get_property +gdata_freebase_topic_value_get_text +gdata_freebase_topic_value_get_language +gdata_freebase_topic_value_get_creator +gdata_freebase_topic_value_get_timestamp +gdata_freebase_topic_value_get_value_type +gdata_freebase_topic_value_copy_value +gdata_freebase_topic_value_get_int +gdata_freebase_topic_value_get_double +gdata_freebase_topic_value_get_string +gdata_freebase_topic_value_get_object +gdata_freebase_topic_value_is_image +gdata_freebase_topic_result_get_type +gdata_freebase_topic_result_new +gdata_freebase_topic_result_dup_object +gdata_freebase_result_get_type +gdata_freebase_result_new +gdata_freebase_result_dup_variant +gdata_oauth2_authorizer_get_type +gdata_oauth2_authorizer_new +gdata_oauth2_authorizer_new_for_authorization_domains +gdata_oauth2_authorizer_build_authentication_uri +gdata_oauth2_authorizer_request_authorization +gdata_oauth2_authorizer_request_authorization_async +gdata_oauth2_authorizer_request_authorization_finish +gdata_oauth2_authorizer_get_client_id +gdata_oauth2_authorizer_get_redirect_uri +gdata_oauth2_authorizer_get_client_secret +gdata_oauth2_authorizer_dup_refresh_token +gdata_oauth2_authorizer_set_refresh_token +gdata_oauth2_authorizer_get_locale +gdata_oauth2_authorizer_set_locale +gdata_oauth2_authorizer_get_timeout +gdata_oauth2_authorizer_set_timeout +gdata_oauth2_authorizer_get_proxy_resolver +gdata_oauth2_authorizer_set_proxy_resolver +gdata_calendar_access_rule_get_type +gdata_calendar_access_rule_new diff --git a/gdata/gdata-download-stream.c b/gdata/gdata-download-stream.c new file mode 100644 index 0000000..5bfd704 --- /dev/null +++ b/gdata/gdata-download-stream.c @@ -0,0 +1,1087 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-download-stream + * @short_description: GData download stream object + * @stability: Stable + * @include: gdata/gdata-download-stream.h + * + * #GDataDownloadStream is a #GInputStream subclass to allow downloading of files from GData services with authorization from a #GDataService under + * the given #GDataAuthorizationDomain. If authorization is not required to perform the download, a #GDataAuthorizationDomain doesn't have to be + * specified. + * + * Once a #GDataDownloadStream is instantiated with gdata_download_stream_new(), the standard #GInputStream API can be used on the stream to download + * the file. Network communication may not actually begin until the first call to g_input_stream_read(), so having a #GDataDownloadStream around is no + * guarantee that the file is being downloaded. + * + * The content type and length of the file being downloaded are made available through #GDataDownloadStream:content-type and + * #GDataDownloadStream:content-length as soon as the appropriate data is received from the server. Connect to the + * #GObject::notify content-type and content-length details to be notified as + * soon as the data is available. + * + * The entire download operation can be cancelled using the #GCancellable instance provided to gdata_download_stream_new(), or returned by + * gdata_download_stream_get_cancellable(). Cancelling this at any time will cause all future #GInputStream method calls to return + * %G_IO_ERROR_CANCELLED. If any #GInputStream methods are in the process of being called, they will be cancelled and return %G_IO_ERROR_CANCELLED as + * soon as possible. + * + * Note that cancelling an individual method call (such as a call to g_input_stream_read()) using the #GCancellable parameter of the method will not + * cancel the download as a whole — just that particular method call. In the case of g_input_stream_read(), this will cause it to successfully return + * any data that it has in memory at the moment (up to the requested number of bytes), or return a %G_IO_ERROR_CANCELLED if it was blocking on receiving + * data from the network. This is also the behaviour of g_input_stream_read() when the download operation as a whole is cancelled. + * + * In the case of g_input_stream_close(), the call will return immediately if network activity hasn't yet started. If it has, the network activity will + * be cancelled, regardless of whether the call to g_input_stream_close() is cancelled. Cancelling a pending call to g_input_stream_close() (either + * using the method's #GCancellable, or by cancelling the download stream as a whole) will cause it to stop waiting for the network activity to finish, + * and return %G_IO_ERROR_CANCELLED immediately. Network activity will continue to be shut down in the background. + * + * If the server returns an error message (for example, if the user is not correctly authenticated/authorized or doesn't have suitable permissions to + * download from the given URI), it will be returned as a #GDataServiceError by the first call to g_input_stream_read(). + * + * + * Downloading to a File + * + * GDataService *service; + * GDataAuthorizationDomain *domain; + * GCancellable *cancellable; + * GInputStream *download_stream; + * GOutputStream *output_stream; + * + * /* Create the download stream */ + * service = create_my_service (); + * domain = get_my_authorization_domain_from_service (service); + * cancellable = g_cancellable_new (); /* cancel this to cancel the entire download operation */ + * download_stream = gdata_download_stream_new (service, domain, download_uri, cancellable); + * output_stream = create_file_and_return_output_stream (); + * + * /* Perform the download asynchronously */ + * g_output_stream_splice_async (output_stream, download_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, + * G_PRIORITY_DEFAULT, NULL, (GAsyncReadyCallback) download_splice_cb, NULL); + * + * g_object_unref (output_stream); + * g_object_unref (download_stream); + * g_object_unref (cancellable); + * g_object_unref (domain); + * g_object_unref (service); + * + * static void + * download_splice_cb (GOutputStream *output_stream, GAsyncResult *result, gpointer user_data) + * { + * GError *error = NULL; + * + * g_output_stream_splice_finish (output_stream, result, &error); + * + * if (error != NULL && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) == FALSE)) { + * /* Error downloading the file; potentially an I/O error (GIOError), or an error response from the server + * * (GDataServiceError). You might want to delete the newly created file because of the error. */ + * g_error ("Error downloading file: %s", error->message); + * g_error_free (error); + * } + * } + * + * + * + * Since: 0.5.0 + */ + +#include +#include +#include + +#include "gdata-download-stream.h" +#include "gdata-buffer.h" +#include "gdata-private.h" + +static void gdata_download_stream_seekable_iface_init (GSeekableIface *seekable_iface); +static GObject *gdata_download_stream_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); +static void gdata_download_stream_dispose (GObject *object); +static void gdata_download_stream_finalize (GObject *object); +static void gdata_download_stream_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_download_stream_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); + +static gssize gdata_download_stream_read (GInputStream *stream, void *buffer, gsize count, GCancellable *cancellable, GError **error); +static gboolean gdata_download_stream_close (GInputStream *stream, GCancellable *cancellable, GError **error); + +static goffset gdata_download_stream_tell (GSeekable *seekable); +static gboolean gdata_download_stream_can_seek (GSeekable *seekable); +static gboolean gdata_download_stream_seek (GSeekable *seekable, goffset offset, GSeekType type, GCancellable *cancellable, GError **error); +static gboolean gdata_download_stream_can_truncate (GSeekable *seekable); +static gboolean gdata_download_stream_truncate (GSeekable *seekable, goffset offset, GCancellable *cancellable, GError **error); + +static void create_network_thread (GDataDownloadStream *self, GError **error); +static void reset_network_thread (GDataDownloadStream *self); + +/* + * The GDataDownloadStream can be in one of several states: + * 1. Pre-network activity. This is the state that the stream is created in. @network_thread and @cancellable are both %NULL, and @finished is %FALSE. + * The stream will remain in this state until gdata_download_stream_read() or gdata_download_stream_seek() are called for the first time. + * @content_type and @content_length are at their default values (NULL and -1, respectively). + * 2. Network activity. This state is entered when gdata_download_stream_read() is called for the first time. + * @network_thread, @buffer and @cancellable are created, while @finished remains %FALSE. + * As soon as the headers are downloaded, which is guaranteed to be before the first call to gdata_download_stream_read() returns, @content_type + * and @content_length are set from the headers. From this point onwards, they are immutable. + * 3. Reset network activity. This state is entered only if case 3 is encountered in a call to gdata_download_stream_seek(): a seek to an offset which + * has already been read out of the buffer. In this state, @buffer is freed and set to %NULL, @network_thread is cancelled (then set to %NULL), + * and @offset is set to the seeked-to offset. @finished remains at %FALSE. + * When the next call to gdata_download_stream_read() is made, the download stream will go back to state 2 as if this was the first call to + * gdata_download_stream_read(). + * 4. Post-network activity. This state is reached once the download thread finishes downloading, due to having downloaded everything. + * @buffer is non-%NULL, @network_thread is non-%NULL, but meaningless; @cancellable is still a valid #GCancellable instance; and @finished is set + * to %TRUE. At the same time, @finished_cond is signalled. + * This state can be exited either by making a call to gdata_download_stream_seek(), in which case the stream will go back to state 3; or by + * calling gdata_download_stream_close(), in which case the stream will return errors for all operations, as the underlying %GInputStream will be + * marked as closed. + */ +struct _GDataDownloadStreamPrivate { + gchar *download_uri; + GDataService *service; + GDataAuthorizationDomain *authorization_domain; + SoupSession *session; + SoupMessage *message; + GDataBuffer *buffer; + goffset offset; /* current position in the stream */ + + GThread *network_thread; + GCancellable *cancellable; + GCancellable *network_cancellable; /* see the comment in gdata_download_stream_constructor() about the relationship between these two */ + gulong network_cancellable_id; + + gboolean finished; + GCond finished_cond; + GMutex finished_mutex; /* mutex for ->finished, protected by ->finished_cond */ + + /* Cached data from the SoupMessage */ + gchar *content_type; + gssize content_length; + GMutex content_mutex; /* mutex to protect them */ +}; + +enum { + PROP_SERVICE = 1, + PROP_DOWNLOAD_URI, + PROP_CONTENT_TYPE, + PROP_CONTENT_LENGTH, + PROP_CANCELLABLE, + PROP_AUTHORIZATION_DOMAIN, +}; + +G_DEFINE_TYPE_WITH_CODE (GDataDownloadStream, gdata_download_stream, G_TYPE_INPUT_STREAM, + G_IMPLEMENT_INTERFACE (G_TYPE_SEEKABLE, gdata_download_stream_seekable_iface_init)) + +static void +gdata_download_stream_class_init (GDataDownloadStreamClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataDownloadStreamPrivate)); + + gobject_class->constructor = gdata_download_stream_constructor; + gobject_class->dispose = gdata_download_stream_dispose; + gobject_class->finalize = gdata_download_stream_finalize; + gobject_class->get_property = gdata_download_stream_get_property; + gobject_class->set_property = gdata_download_stream_set_property; + + /* We use the default implementations of the async functions, which just run + * our implementation of the sync function in a thread. */ + stream_class->read_fn = gdata_download_stream_read; + stream_class->close_fn = gdata_download_stream_close; + + /** + * GDataDownloadStream:service: + * + * The service which is used to authorize the download, and to which the download relates. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_SERVICE, + g_param_spec_object ("service", + "Service", "The service which is used to authorize the download.", + GDATA_TYPE_SERVICE, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDownloadStream:authorization-domain: + * + * The authorization domain for the download, against which the #GDataService:authorizer for the #GDataDownloadStream:service should be + * authorized. This may be %NULL if authorization is not needed for the download. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_AUTHORIZATION_DOMAIN, + g_param_spec_object ("authorization-domain", + "Authorization domain", "The authorization domain for the download.", + GDATA_TYPE_AUTHORIZATION_DOMAIN, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDownloadStream:download-uri: + * + * The URI of the file to download. This must be HTTPS. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_DOWNLOAD_URI, + g_param_spec_string ("download-uri", + "Download URI", "The URI of the file to download.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDownloadStream:content-type: + * + * The content type of the file being downloaded. This will initially be %NULL, and will be populated as soon as the appropriate header is + * received from the server. Its value will never change after this. + * + * Note that change notifications for this property (#GObject::notify emissions) may be emitted in threads other than the one which created + * the #GDataDownloadStream. It is the client's responsibility to ensure that any notification signal handlers are either multi-thread safe + * or marshal the notification to the thread which owns the #GDataDownloadStream as appropriate. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_CONTENT_TYPE, + g_param_spec_string ("content-type", + "Content type", "The content type of the file being downloaded.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDownloadStream:content-length: + * + * The length (in bytes) of the file being downloaded. This will initially be -1, and will be populated as soon as + * the appropriate header is received from the server. Its value will never change after this. + * + * Note that change notifications for this property (#GObject::notify emissions) may be emitted in threads other than the one which created + * the #GDataDownloadStream. It is the client's responsibility to ensure that any notification signal handlers are either multi-thread safe + * or marshal the notification to the thread which owns the #GDataDownloadStream as appropriate. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_CONTENT_LENGTH, + g_param_spec_long ("content-length", + "Content length", "The length (in bytes) of the file being downloaded.", + -1, G_MAXSSIZE, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDownloadStream:cancellable: + * + * An optional cancellable used to cancel the entire download operation. If a #GCancellable instance isn't provided for this property at + * construction time (i.e. to gdata_download_stream_new()), one will be created internally and can be retrieved using + * gdata_download_stream_get_cancellable() and used to cancel the download operation with g_cancellable_cancel() just as if it was passed to + * gdata_download_stream_new(). + * + * If the download operation is cancelled using this #GCancellable, any ongoing network activity will be stopped, and any pending or future + * calls to #GInputStream API on the #GDataDownloadStream will return %G_IO_ERROR_CANCELLED. Note that the #GCancellable objects which can be + * passed to individual #GInputStream operations will not cancel the download operation proper if cancelled — they will merely cancel that API + * call. The only way to cancel the download operation completely is using #GDataDownloadStream:cancellable. + * + * Since: 0.8.0 + */ + g_object_class_install_property (gobject_class, PROP_CANCELLABLE, + g_param_spec_object ("cancellable", + "Cancellable", "An optional cancellable used to cancel the entire download operation.", + G_TYPE_CANCELLABLE, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_download_stream_seekable_iface_init (GSeekableIface *seekable_iface) +{ + seekable_iface->tell = gdata_download_stream_tell; + seekable_iface->can_seek = gdata_download_stream_can_seek; + seekable_iface->seek = gdata_download_stream_seek; + seekable_iface->can_truncate = gdata_download_stream_can_truncate; + seekable_iface->truncate_fn = gdata_download_stream_truncate; +} + +static void +gdata_download_stream_init (GDataDownloadStream *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_DOWNLOAD_STREAM, GDataDownloadStreamPrivate); + self->priv->buffer = NULL; /* created when the network thread is started and destroyed when the stream is closed */ + + self->priv->finished = FALSE; + g_cond_init (&(self->priv->finished_cond)); + g_mutex_init (&(self->priv->finished_mutex)); + + self->priv->content_type = NULL; + self->priv->content_length = -1; + g_mutex_init (&(self->priv->content_mutex)); +} + +static void +cancellable_cancel_cb (GCancellable *cancellable, GCancellable *network_cancellable) +{ + g_cancellable_cancel (network_cancellable); +} + +static GObject * +gdata_download_stream_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) +{ + GDataDownloadStreamPrivate *priv; + GDataServiceClass *klass; + GObject *object; + SoupURI *_uri; + + /* Chain up to the parent class */ + object = G_OBJECT_CLASS (gdata_download_stream_parent_class)->constructor (type, n_construct_params, construct_params); + priv = GDATA_DOWNLOAD_STREAM (object)->priv; + + /* Create a #GCancellable for the network. Cancellation of ->cancellable is chained to this one, so that if ->cancellable is cancelled, + * ->network_cancellable is also cancelled. However, if ->network_cancellable is cancelled, the cancellation doesn't propagate back upwards + * to ->cancellable. This allows closing the stream part-way through a download to be implemented by cancelling ->network_cancellable, without + * causing ->cancellable to be unnecessarily cancelled (which would be a nasty side-effect of closing the stream early otherwise). */ + priv->network_cancellable = g_cancellable_new (); + + /* Create a #GCancellable for the entire download operation if one wasn't specified for #GDataDownloadStream:cancellable during construction */ + if (priv->cancellable == NULL) + priv->cancellable = g_cancellable_new (); + priv->network_cancellable_id = g_cancellable_connect (priv->cancellable, (GCallback) cancellable_cancel_cb, priv->network_cancellable, NULL); + + /* Build the message. The URI must be HTTPS. */ + _uri = soup_uri_new (priv->download_uri); + soup_uri_set_port (_uri, _gdata_service_get_https_port ()); + g_assert_cmpstr (soup_uri_get_scheme (_uri), ==, SOUP_URI_SCHEME_HTTPS); + priv->message = soup_message_new_from_uri (SOUP_METHOD_GET, _uri); + soup_uri_free (_uri); + + /* Make sure the headers are set */ + klass = GDATA_SERVICE_GET_CLASS (priv->service); + if (klass->append_query_headers != NULL) { + klass->append_query_headers (priv->service, priv->authorization_domain, priv->message); + } + + /* We don't want to accumulate chunks */ + soup_message_body_set_accumulate (priv->message->request_body, FALSE); + + /* Downloading doesn't actually start until the first call to read() */ + + return object; +} + +static void +gdata_download_stream_dispose (GObject *object) +{ + GDataDownloadStreamPrivate *priv = GDATA_DOWNLOAD_STREAM (object)->priv; + + /* Block on closing the stream */ + g_input_stream_close (G_INPUT_STREAM (object), NULL, NULL); + + if (priv->cancellable != NULL) { + if (priv->network_cancellable_id != 0) { + g_cancellable_disconnect (priv->cancellable, priv->network_cancellable_id); + } + + g_object_unref (priv->cancellable); + } + + priv->network_cancellable_id = 0; + priv->cancellable = NULL; + + if (priv->network_cancellable != NULL) + g_object_unref (priv->network_cancellable); + priv->network_cancellable = NULL; + + if (priv->authorization_domain != NULL) + g_object_unref (priv->authorization_domain); + priv->authorization_domain = NULL; + + if (priv->service != NULL) + g_object_unref (priv->service); + priv->service = NULL; + + if (priv->message != NULL) + g_object_unref (priv->message); + priv->message = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_download_stream_parent_class)->dispose (object); +} + +static void +gdata_download_stream_finalize (GObject *object) +{ + GDataDownloadStreamPrivate *priv = GDATA_DOWNLOAD_STREAM (object)->priv; + + reset_network_thread (GDATA_DOWNLOAD_STREAM (object)); + + g_cond_clear (&(priv->finished_cond)); + g_mutex_clear (&(priv->finished_mutex)); + + g_mutex_clear (&(priv->content_mutex)); + + g_free (priv->download_uri); + g_free (priv->content_type); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_download_stream_parent_class)->finalize (object); +} + +static void +gdata_download_stream_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataDownloadStreamPrivate *priv = GDATA_DOWNLOAD_STREAM (object)->priv; + + switch (property_id) { + case PROP_SERVICE: + g_value_set_object (value, priv->service); + break; + case PROP_AUTHORIZATION_DOMAIN: + g_value_set_object (value, priv->authorization_domain); + break; + case PROP_DOWNLOAD_URI: + g_value_set_string (value, priv->download_uri); + break; + case PROP_CONTENT_TYPE: + g_mutex_lock (&(priv->content_mutex)); + g_value_set_string (value, priv->content_type); + g_mutex_unlock (&(priv->content_mutex)); + break; + case PROP_CONTENT_LENGTH: + g_mutex_lock (&(priv->content_mutex)); + g_value_set_long (value, priv->content_length); + g_mutex_unlock (&(priv->content_mutex)); + break; + case PROP_CANCELLABLE: + g_value_set_object (value, priv->cancellable); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_download_stream_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataDownloadStreamPrivate *priv = GDATA_DOWNLOAD_STREAM (object)->priv; + + switch (property_id) { + case PROP_SERVICE: + priv->service = g_value_dup_object (value); + priv->session = _gdata_service_get_session (priv->service); + break; + case PROP_AUTHORIZATION_DOMAIN: + priv->authorization_domain = g_value_dup_object (value); + break; + case PROP_DOWNLOAD_URI: + priv->download_uri = g_value_dup_string (value); + break; + case PROP_CANCELLABLE: + /* Construction only */ + priv->cancellable = g_value_dup_object (value); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +read_cancelled_cb (GCancellable *cancellable, GCancellable *child_cancellable) +{ + g_cancellable_cancel (child_cancellable); +} + +static gssize +gdata_download_stream_read (GInputStream *stream, void *buffer, gsize count, GCancellable *cancellable, GError **error) +{ + GDataDownloadStreamPrivate *priv = GDATA_DOWNLOAD_STREAM (stream)->priv; + gssize length_read = -1; + gboolean reached_eof = FALSE; + gulong cancelled_signal = 0, global_cancelled_signal = 0; + GCancellable *child_cancellable; + GError *child_error = NULL; + + /* Listen for cancellation from either @cancellable or @priv->cancellable. We have to multiplex cancellation signals from the two sources + * into a single #GCancellabel, @child_cancellable. */ + child_cancellable = g_cancellable_new (); + + global_cancelled_signal = g_cancellable_connect (priv->cancellable, (GCallback) read_cancelled_cb, child_cancellable, NULL); + + if (cancellable != NULL) + cancelled_signal = g_cancellable_connect (cancellable, (GCallback) read_cancelled_cb, child_cancellable, NULL); + + /* We're lazy about starting the network operation so we don't end up with a massive buffer */ + if (priv->network_thread == NULL) { + /* Handle early cancellation so that we don't create the network thread unnecessarily */ + if (g_cancellable_set_error_if_cancelled (child_cancellable, &child_error) == TRUE) { + length_read = -1; + goto done; + } + + /* Create the network thread */ + create_network_thread (GDATA_DOWNLOAD_STREAM (stream), &child_error); + if (priv->network_thread == NULL) { + length_read = -1; + goto done; + } + } + + /* Read the data off the buffer. If the operation is cancelled, it'll probably still return a positive number of bytes read — if it does, we + * can return without error. Iff it returns a non-positive number of bytes should we return an error. */ + g_assert (priv->buffer != NULL); + length_read = (gssize) gdata_buffer_pop_data (priv->buffer, buffer, count, &reached_eof, child_cancellable); + + if (length_read < 1 && g_cancellable_set_error_if_cancelled (child_cancellable, &child_error) == TRUE) { + /* Handle cancellation */ + length_read = -1; + + goto done; + } else if (SOUP_STATUS_IS_SUCCESSFUL (priv->message->status_code) == FALSE) { + GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (priv->service); + + /* Set an appropriate error */ + g_assert (klass->parse_error_response != NULL); + klass->parse_error_response (priv->service, GDATA_OPERATION_DOWNLOAD, priv->message->status_code, priv->message->reason_phrase, + NULL, 0, &child_error); + length_read = -1; + + goto done; + } + +done: + /* Disconnect from the cancelled signals. */ + if (cancelled_signal != 0) + g_cancellable_disconnect (cancellable, cancelled_signal); + if (global_cancelled_signal != 0) + g_cancellable_disconnect (priv->cancellable, global_cancelled_signal); + + g_object_unref (child_cancellable); + + g_assert ((reached_eof == FALSE && length_read > 0 && length_read <= (gssize) count && child_error == NULL) || + (reached_eof == TRUE && length_read >= 0 && length_read <= (gssize) count && child_error == NULL) || + (length_read == -1 && child_error != NULL)); + + if (child_error != NULL) + g_propagate_error (error, child_error); + + /* Update our internal offset */ + if (length_read > 0) { + priv->offset += length_read; + } + + return length_read; +} + +typedef struct { + GDataDownloadStream *download_stream; + gboolean *cancelled; +} CancelledData; + +static void +close_cancelled_cb (GCancellable *cancellable, CancelledData *data) +{ + GDataDownloadStreamPrivate *priv = data->download_stream->priv; + + g_mutex_lock (&(priv->finished_mutex)); + *(data->cancelled) = TRUE; + g_cond_signal (&(priv->finished_cond)); + g_mutex_unlock (&(priv->finished_mutex)); +} + +/* Even though calling g_input_stream_close() multiple times on this stream is guaranteed to call gdata_download_stream_close() at most once, other + * GIO methods (notably g_output_stream_splice()) can call gdata_download_stream_close() directly. Consequently, we need to be careful to be idempotent + * after the first call. + * + * If the network thread hasn't yet been started (i.e. gdata_download_stream_read() hasn't been called at all yet), %TRUE will be returned immediately. + * + * If the global cancellable, ->cancellable, or @cancellable are cancelled before the call to gdata_download_stream_close(), + * gdata_download_stream_close() should return immediately with %G_IO_ERROR_CANCELLED. If they're cancelled during the call, + * gdata_download_stream_close() should stop waiting for any outstanding network activity to finish and return %G_IO_ERROR_CANCELLED (though the + * operation to finish off network activity and close the stream will still continue). + * + * If the call to gdata_download_stream_close() is not cancelled by any #GCancellable, it will cancel the ongoing network activity, and wait until + * the operation has been cleaned up before returning success. */ +static gboolean +gdata_download_stream_close (GInputStream *stream, GCancellable *cancellable, GError **error) +{ + GDataDownloadStreamPrivate *priv = GDATA_DOWNLOAD_STREAM (stream)->priv; + gulong cancelled_signal = 0, global_cancelled_signal = 0; + gboolean cancelled = FALSE; /* must only be touched with ->finished_mutex held */ + gboolean success = TRUE; + CancelledData data; + GError *child_error = NULL; + + /* If the operation was never started, return successfully immediately */ + if (priv->network_thread == NULL) { + goto done; + } + + /* Allow cancellation */ + data.download_stream = GDATA_DOWNLOAD_STREAM (stream); + data.cancelled = &cancelled; + + global_cancelled_signal = g_cancellable_connect (priv->cancellable, (GCallback) close_cancelled_cb, &data, NULL); + + if (cancellable != NULL) + cancelled_signal = g_cancellable_connect (cancellable, (GCallback) close_cancelled_cb, &data, NULL); + + g_mutex_lock (&(priv->finished_mutex)); + + /* If the operation has started but hasn't already finished, cancel the network thread and wait for it to finish before returning */ + if (priv->finished == FALSE) { + g_cancellable_cancel (priv->network_cancellable); + + /* Allow the close() call to be cancelled by cancelling either @cancellable or ->cancellable. Note that this won't prevent the stream + * from continuing to be closed in the background — it'll just stop waiting on the operation to finish being cancelled. */ + if (cancelled == FALSE) { + g_cond_wait (&(priv->finished_cond), &(priv->finished_mutex)); + } + } + + /* Error handling */ + if (priv->finished == FALSE && cancelled == TRUE) { + /* Cancelled? If ->finished is TRUE, the network activity finished before the gdata_download_stream_close() operation was cancelled, + * so we don't need to return an error. */ + g_assert (g_cancellable_set_error_if_cancelled (cancellable, &child_error) == TRUE || + g_cancellable_set_error_if_cancelled (priv->cancellable, &child_error) == TRUE); + success = FALSE; + } + + g_mutex_unlock (&(priv->finished_mutex)); + + /* Disconnect from the signal handlers. Note that we have to do this without @finished_mutex held, as g_cancellable_disconnect() blocks + * until any outstanding cancellation callbacks return, and they will block on @finished_mutex. */ + if (cancelled_signal != 0) + g_cancellable_disconnect (cancellable, cancelled_signal); + if (global_cancelled_signal != 0) + g_cancellable_disconnect (priv->cancellable, global_cancelled_signal); + +done: + /* If we were successful, tidy up various bits of state */ + g_mutex_lock (&(priv->finished_mutex)); + + if (success == TRUE && priv->finished == TRUE) { + reset_network_thread (GDATA_DOWNLOAD_STREAM (stream)); + } + + g_mutex_unlock (&(priv->finished_mutex)); + + g_assert ((success == TRUE && child_error == NULL) || (success == FALSE && child_error != NULL)); + + if (child_error != NULL) + g_propagate_error (error, child_error); + + return success; +} + +static goffset +gdata_download_stream_tell (GSeekable *seekable) +{ + return GDATA_DOWNLOAD_STREAM (seekable)->priv->offset; +} + +static gboolean +gdata_download_stream_can_seek (GSeekable *seekable) +{ + return TRUE; +} + +static gboolean +gdata_download_stream_seek (GSeekable *seekable, goffset offset, GSeekType type, GCancellable *cancellable, GError **error) +{ + GDataDownloadStreamPrivate *priv = GDATA_DOWNLOAD_STREAM (seekable)->priv; + GError *child_error = NULL; + + if (type == G_SEEK_END && priv->content_length == -1) { + /* If we don't have the Content-Length, we can't calculate the offset from the start of the stream properly, so just give up. + * We could technically use a HEAD request to get the Content-Length, but this hasn't been tried yet (FIXME). */ + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "G_SEEK_END not currently supported"); + return FALSE; + } + + if (g_input_stream_set_pending (G_INPUT_STREAM (seekable), error) == FALSE) { + return FALSE; + } + + /* Ensure that offset is relative to the start of the stream. */ + switch (type) { + case G_SEEK_CUR: + offset += priv->offset; + break; + case G_SEEK_SET: + /* Nothing needs doing */ + break; + case G_SEEK_END: + offset += priv->content_length; + break; + default: + g_assert_not_reached (); + } + + /* There are three cases to consider: + * 1. The network thread hasn't been started. In this case, we need to set the offset and do nothing. When the network thread is started + * (in the next read() call), a Range header will be set on it which will give the correct seek. + * 2. The network thread has been started and the seek is to a position greater than our current position (i.e. one which already does, or + * will soon, exist in the buffer). In this case, we need to pop the intervening bytes off the buffer (which may block) and update the + * offset. + * 3. The network thread has been started and the seek is to a position which has already been popped off the buffer. In this case, we need + * to set the offset and cancel the network thread. When the network thread is restarted (in the next read() call), a Range header will + * be set on it which will give the correct seek. + */ + + if (priv->network_thread == NULL) { + /* Case 1. Set the offset and we're done. */ + priv->offset = offset; + + goto done; + } + + /* Cases 2 and 3. The network thread has already been started. */ + if (offset >= priv->offset) { + goffset num_intervening_bytes; + gssize length_read; + + /* Case 2. Pop off the intervening bytes and update the offset. If we can't pop enough bytes off, we throw an error. */ + num_intervening_bytes = offset - priv->offset; + g_assert (priv->buffer != NULL); + length_read = (gssize) gdata_buffer_pop_data (priv->buffer, NULL, num_intervening_bytes, NULL, cancellable); + + if (length_read != num_intervening_bytes) { + if (g_cancellable_set_error_if_cancelled (cancellable, &child_error) == FALSE) { + /* Tried to seek too far */ + g_set_error_literal (&child_error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, _("Invalid seek request")); + } + + goto done; + } + + /* Update the offset */ + priv->offset = offset; + + goto done; + } else { + /* Case 3. Cancel the current network thread. Note that we don't allow cancellation of this call, as we depend on it waiting for + * the network thread to join. */ + if (gdata_download_stream_close (G_INPUT_STREAM (seekable), NULL, &child_error) == FALSE) { + goto done; + } + + /* Update the offset */ + priv->offset = offset; + + /* Mark the thread as unfinished */ + g_mutex_lock (&(priv->finished_mutex)); + priv->finished = FALSE; + g_mutex_unlock (&(priv->finished_mutex)); + + goto done; + } + +done: + g_input_stream_clear_pending (G_INPUT_STREAM (seekable)); + + if (child_error != NULL) { + g_propagate_error (error, child_error); + return FALSE; + } + + return TRUE; +} + +static gboolean +gdata_download_stream_can_truncate (GSeekable *seekable) +{ + return FALSE; +} + +static gboolean +gdata_download_stream_truncate (GSeekable *seekable, goffset offset, GCancellable *cancellable, GError **error) +{ + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Truncate not allowed on input stream"); + return FALSE; +} + +static void +got_headers_cb (SoupMessage *message, GDataDownloadStream *self) +{ + goffset end; + goffset start; + goffset total_length; + + /* Don't get the client's hopes up by setting the Content-Type or -Length if the response + * is actually unsuccessful. */ + if (SOUP_STATUS_IS_SUCCESSFUL (message->status_code) == FALSE) + return; + + g_mutex_lock (&(self->priv->content_mutex)); + self->priv->content_type = g_strdup (soup_message_headers_get_content_type (message->response_headers, NULL)); + self->priv->content_length = soup_message_headers_get_content_length (message->response_headers); + if (soup_message_headers_get_content_range (message->response_headers, &start, &end, &total_length)) { + self->priv->content_length = (gssize) total_length; + } + g_mutex_unlock (&(self->priv->content_mutex)); + + /* Emit the notifications for the Content-Length and -Type properties */ + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "content-length"); + g_object_notify (G_OBJECT (self), "content-type"); + g_object_thaw_notify (G_OBJECT (self)); +} + +static void +got_chunk_cb (SoupMessage *message, SoupBuffer *buffer, GDataDownloadStream *self) +{ + /* Ignore the chunk if the response is unsuccessful or it has zero length */ + if (SOUP_STATUS_IS_SUCCESSFUL (message->status_code) == FALSE || buffer->length == 0) + return; + + /* Push the data onto the buffer immediately */ + g_assert (self->priv->buffer != NULL); + gdata_buffer_push_data (self->priv->buffer, (const guint8*) buffer->data, buffer->length); +} + +static gpointer +download_thread (GDataDownloadStream *self) +{ + GDataDownloadStreamPrivate *priv = self->priv; + + g_object_ref (self); + + g_assert (priv->network_cancellable != NULL); + + /* Connect to the got-headers signal so we can notify clients of the values of content-type and content-length */ + g_signal_connect (priv->message, "got-headers", (GCallback) got_headers_cb, self); + g_signal_connect (priv->message, "got-chunk", (GCallback) got_chunk_cb, self); + + /* Set a Range header if our starting offset is non-zero */ + if (priv->offset > 0) { + soup_message_headers_set_range (priv->message->request_headers, priv->offset, -1); + } else { + soup_message_headers_remove (priv->message->request_headers, "Range"); + } + + _gdata_service_actually_send_message (priv->session, priv->message, priv->network_cancellable, NULL); + + /* Mark the buffer as having reached EOF */ + g_assert (priv->buffer != NULL); + gdata_buffer_push_data (priv->buffer, NULL, 0); + + /* Mark the download as finished */ + g_mutex_lock (&(priv->finished_mutex)); + priv->finished = TRUE; + g_cond_signal (&(priv->finished_cond)); + g_mutex_unlock (&(priv->finished_mutex)); + + g_object_unref (self); + + return NULL; +} + +static void +create_network_thread (GDataDownloadStream *self, GError **error) +{ + GDataDownloadStreamPrivate *priv = self->priv; + + g_assert (priv->buffer == NULL); + priv->buffer = gdata_buffer_new (); + + g_assert (priv->network_thread == NULL); + priv->network_thread = g_thread_try_new ("download-thread", (GThreadFunc) download_thread, self, error); +} + +static void +reset_network_thread (GDataDownloadStream *self) +{ + GDataDownloadStreamPrivate *priv = self->priv; + + priv->network_thread = NULL; + + if (priv->buffer != NULL) { + gdata_buffer_free (priv->buffer); + priv->buffer = NULL; + } + + if (priv->message != NULL) { + soup_session_cancel_message (priv->session, priv->message, SOUP_STATUS_CANCELLED); + g_signal_handlers_disconnect_by_func (priv->message, got_headers_cb, self); + g_signal_handlers_disconnect_by_func (priv->message, got_chunk_cb, self); + } + + priv->offset = 0; + + if (priv->network_cancellable != NULL) { + g_cancellable_reset (priv->network_cancellable); + } +} + +/** + * gdata_download_stream_new: + * @service: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain to authorize the download, or %NULL + * @download_uri: the URI to download; this must be HTTPS + * @cancellable: (allow-none): a #GCancellable for the entire download stream, or %NULL + * + * Creates a new #GDataDownloadStream, allowing a file to be downloaded from a GData service using standard #GInputStream API. + * + * As well as the standard GIO errors, calls to the #GInputStream API on a #GDataDownloadStream can also return any relevant specific error from + * #GDataServiceError, or %GDATA_SERVICE_ERROR_PROTOCOL_ERROR in the general case. + * + * If a #GCancellable is provided in @cancellable, the download operation may be cancelled at any time from another thread using g_cancellable_cancel(). + * In this case, any ongoing network activity will be stopped, and any pending or future calls to #GInputStream API on the #GDataDownloadStream will + * return %G_IO_ERROR_CANCELLED. Note that the #GCancellable objects which can be passed to individual #GInputStream operations will not cancel the + * download operation proper if cancelled — they will merely cancel that API call. The only way to cancel the download operation completely is using + * this @cancellable. + * + * Return value: a new #GInputStream, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GInputStream * +gdata_download_stream_new (GDataService *service, GDataAuthorizationDomain *domain, const gchar *download_uri, GCancellable *cancellable) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL); + g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), NULL); + g_return_val_if_fail (download_uri != NULL, NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + + return G_INPUT_STREAM (g_object_new (GDATA_TYPE_DOWNLOAD_STREAM, + "download-uri", download_uri, + "service", service, + "authorization-domain", domain, + "cancellable", cancellable, + NULL)); +} + +/** + * gdata_download_stream_get_service: + * @self: a #GDataDownloadStream + * + * Gets the service used to authorize the download, as passed to gdata_download_stream_new(). + * + * Return value: (transfer none): the #GDataService used to authorize the download + * + * Since: 0.5.0 + */ +GDataService * +gdata_download_stream_get_service (GDataDownloadStream *self) +{ + g_return_val_if_fail (GDATA_IS_DOWNLOAD_STREAM (self), NULL); + return self->priv->service; +} + +/** + * gdata_download_stream_get_authorization_domain: + * @self: a #GDataDownloadStream + * + * Gets the authorization domain used to authorize the download, as passed to gdata_download_stream_new(). It may be %NULL if authorization is not + * needed for the download. + * + * Return value: (transfer none) (allow-none): the #GDataAuthorizationDomain used to authorize the download, or %NULL + * + * Since: 0.9.0 + */ +GDataAuthorizationDomain * +gdata_download_stream_get_authorization_domain (GDataDownloadStream *self) +{ + g_return_val_if_fail (GDATA_IS_DOWNLOAD_STREAM (self), NULL); + return self->priv->authorization_domain; +} + +/** + * gdata_download_stream_get_download_uri: + * @self: a #GDataDownloadStream + * + * Gets the URI of the file being downloaded, as passed to gdata_download_stream_new(). + * + * Return value: the URI of the file being downloaded + * + * Since: 0.5.0 + */ +const gchar * +gdata_download_stream_get_download_uri (GDataDownloadStream *self) +{ + g_return_val_if_fail (GDATA_IS_DOWNLOAD_STREAM (self), NULL); + return self->priv->download_uri; +} + +/** + * gdata_download_stream_get_content_type: + * @self: a #GDataDownloadStream + * + * Gets the content type of the file being downloaded. If the Content-Type header has not yet + * been received, %NULL will be returned. + * + * Return value: the content type of the file being downloaded, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_download_stream_get_content_type (GDataDownloadStream *self) +{ + const gchar *content_type; + + g_return_val_if_fail (GDATA_IS_DOWNLOAD_STREAM (self), NULL); + + g_mutex_lock (&(self->priv->content_mutex)); + content_type = self->priv->content_type; + g_mutex_unlock (&(self->priv->content_mutex)); + + /* It's safe to return this, even though we're not taking a copy of it, as it's immutable once set. */ + return content_type; +} + +/** + * gdata_download_stream_get_content_length: + * @self: a #GDataDownloadStream + * + * Gets the length (in bytes) of the file being downloaded. If the Content-Length header has not yet + * been received from the server, -1 will be returned. + * + * Return value: the content length of the file being downloaded, or -1 + * + * Since: 0.5.0 + */ +gssize +gdata_download_stream_get_content_length (GDataDownloadStream *self) +{ + gssize content_length; + + g_return_val_if_fail (GDATA_IS_DOWNLOAD_STREAM (self), -1); + + g_mutex_lock (&(self->priv->content_mutex)); + content_length = self->priv->content_length; + g_mutex_unlock (&(self->priv->content_mutex)); + + g_assert (content_length >= -1); + + return content_length; +} + +/** + * gdata_download_stream_get_cancellable: + * @self: a #GDataDownloadStream + * + * Gets the #GCancellable for the entire download operation, #GDataDownloadStream:cancellable. + * + * Return value: (transfer none): the #GCancellable for the entire download operation + * + * Since: 0.8.0 + */ +GCancellable * +gdata_download_stream_get_cancellable (GDataDownloadStream *self) +{ + g_return_val_if_fail (GDATA_IS_DOWNLOAD_STREAM (self), NULL); + g_assert (self->priv->cancellable != NULL); + return self->priv->cancellable; +} diff --git a/gdata/gdata-download-stream.h b/gdata/gdata-download-stream.h new file mode 100644 index 0000000..9086f2a --- /dev/null +++ b/gdata/gdata-download-stream.h @@ -0,0 +1,87 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOWNLOAD_STREAM_H +#define GDATA_DOWNLOAD_STREAM_H + +#include +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_DOWNLOAD_STREAM (gdata_download_stream_get_type ()) +#define GDATA_DOWNLOAD_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOWNLOAD_STREAM, GDataDownloadStream)) +#define GDATA_DOWNLOAD_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOWNLOAD_STREAM, GDataDownloadStreamClass)) +#define GDATA_IS_DOWNLOAD_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOWNLOAD_STREAM)) +#define GDATA_IS_DOWNLOAD_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOWNLOAD_STREAM)) +#define GDATA_DOWNLOAD_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOWNLOAD_STREAM, GDataDownloadStreamClass)) + +typedef struct _GDataDownloadStreamPrivate GDataDownloadStreamPrivate; + +/** + * GDataDownloadStream: + * + * All the fields in the #GDataDownloadStream structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + GInputStream parent; + GDataDownloadStreamPrivate *priv; +} GDataDownloadStream; + +/** + * GDataDownloadStreamClass: + * + * All the fields in the #GDataDownloadStreamClass structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + /*< private >*/ + GInputStreamClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataDownloadStreamClass; + +GType gdata_download_stream_get_type (void) G_GNUC_CONST; + +GInputStream *gdata_download_stream_new (GDataService *service, GDataAuthorizationDomain *domain, const gchar *download_uri, + GCancellable *cancellable) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataService *gdata_download_stream_get_service (GDataDownloadStream *self) G_GNUC_PURE; +GDataAuthorizationDomain *gdata_download_stream_get_authorization_domain (GDataDownloadStream *self) G_GNUC_PURE; +const gchar *gdata_download_stream_get_download_uri (GDataDownloadStream *self) G_GNUC_PURE; +const gchar *gdata_download_stream_get_content_type (GDataDownloadStream *self) G_GNUC_PURE; +gssize gdata_download_stream_get_content_length (GDataDownloadStream *self) G_GNUC_PURE; +GCancellable *gdata_download_stream_get_cancellable (GDataDownloadStream *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_DOWNLOAD_STREAM_H */ diff --git a/gdata/gdata-entry.c b/gdata/gdata-entry.c new file mode 100644 index 0000000..1833e3d --- /dev/null +++ b/gdata/gdata-entry.c @@ -0,0 +1,1306 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-entry + * @short_description: GData entry object + * @stability: Stable + * @include: gdata/gdata-entry.h + * + * #GDataEntry represents a single object on the online service, such as a playlist, video or calendar event. It is a snapshot of the + * state of that object at the time of querying the service, so modifications made to a #GDataEntry will not be automatically or + * magically propagated to the server. + */ + +#include +#include +#include +#include +#include +#include + +#include "gdata-entry.h" +#include "gdata-types.h" +#include "gdata-service.h" +#include "gdata-private.h" +#include "gdata-comparable.h" +#include "atom/gdata-category.h" +#include "atom/gdata-link.h" +#include "atom/gdata-author.h" + +static void gdata_entry_constructed (GObject *object); +static void gdata_entry_dispose (GObject *object); +static void gdata_entry_finalize (GObject *object); +static void gdata_entry_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_entry_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static gboolean post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); +static gchar *get_entry_uri (const gchar *id) G_GNUC_WARN_UNUSED_RESULT; +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static void get_json (GDataParsable *parsable, JsonBuilder *builder); + +struct _GDataEntryPrivate { + gchar *title; + gchar *summary; + gchar *id; + gchar *etag; + gint64 updated; + gint64 published; + GList *categories; /* GDataCategory */ + gchar *content; + gboolean content_is_uri; + GList *links; /* GDataLink */ + GList *authors; /* GDataAuthor */ + gchar *rights; + + /* Batch processing data */ + GDataBatchOperationType batch_operation_type; + guint batch_id; +}; + +enum { + PROP_TITLE = 1, + PROP_SUMMARY, + PROP_ETAG, + PROP_ID, + PROP_UPDATED, + PROP_PUBLISHED, + PROP_CONTENT, + PROP_IS_INSERTED, + PROP_RIGHTS, + PROP_CONTENT_URI +}; + +G_DEFINE_TYPE (GDataEntry, gdata_entry, GDATA_TYPE_PARSABLE) + +static void +gdata_entry_class_init (GDataEntryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataEntryPrivate)); + + gobject_class->constructed = gdata_entry_constructed; + gobject_class->get_property = gdata_entry_get_property; + gobject_class->set_property = gdata_entry_set_property; + gobject_class->dispose = gdata_entry_dispose; + gobject_class->finalize = gdata_entry_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->post_parse_xml = post_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "entry"; + + parsable_class->parse_json = parse_json; + parsable_class->get_json = get_json; + + klass->get_entry_uri = get_entry_uri; + + /** + * GDataEntry:title: + * + * A human-readable title for the entry. + * + * For more information, see the Atom specification. + */ + g_object_class_install_property (gobject_class, PROP_TITLE, + g_param_spec_string ("title", + "Title", "A human-readable title for the entry.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataEntry:summary: + * + * A short summary, abstract, or excerpt of the entry. + * + * For more information, see the Atom specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_SUMMARY, + g_param_spec_string ("summary", + "Summary", "A short summary, abstract, or excerpt of the entry.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataEntry:id: + * + * A permanent, universally unique identifier for the entry, in IRI form. This is %NULL for new entries (i.e. ones which haven't yet been + * inserted on the server, created with gdata_entry_new()), and a non-empty IRI string for all other entries. + * + * For more information, see the + * Atom specification. + */ + g_object_class_install_property (gobject_class, PROP_ID, + g_param_spec_string ("id", + "ID", "A permanent, universally unique identifier for the entry, in IRI form.", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + + /** + * GDataEntry:etag: + * + * An identifier for a particular version of the entry. This changes every time the entry on the server changes, and can be used + * for conditional retrieval and locking. + * + * For more information, see the + * GData specification. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_ETAG, + g_param_spec_string ("etag", + "ETag", "An identifier for a particular version of the entry.", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + + /** + * GDataEntry:updated: + * + * The date and time when the entry was most recently updated significantly. + * + * For more information, see the Atom specification. + */ + g_object_class_install_property (gobject_class, PROP_UPDATED, + g_param_spec_int64 ("updated", + "Updated", "The date and time when the entry was most recently updated significantly.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataEntry:published: + * + * The date and time the entry was first published or made available. + * + * For more information, see the Atom specification. + */ + g_object_class_install_property (gobject_class, PROP_PUBLISHED, + g_param_spec_int64 ("published", + "Published", "The date and time the entry was first published or made available.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataEntry:content: + * + * The content of the entry. This is mutually exclusive with #GDataEntry:content. + * + * For more information, see the Atom specification. + */ + g_object_class_install_property (gobject_class, PROP_CONTENT, + g_param_spec_string ("content", + "Content", "The content of the entry.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataEntry:content-uri: + * + * A URI pointing to the location of the content of the entry. This is mutually exclusive with #GDataEntry:content. + * + * For more information, see the + * Atom specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_CONTENT_URI, + g_param_spec_string ("content-uri", + "Content URI", "A URI pointing to the location of the content of the entry.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataEntry:is-inserted: + * + * Whether the entry has been inserted on the server. This is %FALSE for entries which have just been created using gdata_entry_new() and + * %TRUE for entries returned from the server by queries. It is set to %TRUE when an entry is inserted using gdata_service_insert_entry(). + */ + g_object_class_install_property (gobject_class, PROP_IS_INSERTED, + g_param_spec_boolean ("is-inserted", + "Inserted?", "Whether the entry has been inserted on the server.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataEntry:rights: + * + * The ownership rights pertaining to the entry. + * + * For more information, see the Atom specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_RIGHTS, + g_param_spec_string ("rights", + "Rights", "The ownership rights pertaining to the entry.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_entry_init (GDataEntry *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_ENTRY, GDataEntryPrivate); + self->priv->updated = -1; + self->priv->published = -1; +} + +static void +gdata_entry_constructed (GObject *object) +{ + GDataEntryClass *klass = GDATA_ENTRY_GET_CLASS (object); + GObjectClass *parent_class = G_OBJECT_CLASS (gdata_entry_parent_class); + + /* This can't be done in *_init() because the class properties haven't been properly set then */ + if (klass->kind_term != NULL) { + /* Ensure we have the correct category/kind */ + GDataCategory *category = gdata_category_new (klass->kind_term, "http://schemas.google.com/g/2005#kind", NULL); + gdata_entry_add_category (GDATA_ENTRY (object), category); + g_object_unref (category); + } + + /* Chain up to the parent class */ + if (parent_class->constructed != NULL) + parent_class->constructed (object); +} + +static void +gdata_entry_dispose (GObject *object) +{ + GDataEntryPrivate *priv = GDATA_ENTRY (object)->priv; + + if (priv->categories != NULL) { + g_list_foreach (priv->categories, (GFunc) g_object_unref, NULL); + g_list_free (priv->categories); + } + priv->categories = NULL; + + if (priv->links != NULL) { + g_list_foreach (priv->links, (GFunc) g_object_unref, NULL); + g_list_free (priv->links); + } + priv->links = NULL; + + if (priv->authors != NULL) { + g_list_foreach (priv->authors, (GFunc) g_object_unref, NULL); + g_list_free (priv->authors); + } + priv->authors = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_entry_parent_class)->dispose (object); +} + +static void +gdata_entry_finalize (GObject *object) +{ + GDataEntryPrivate *priv = GDATA_ENTRY (object)->priv; + + g_free (priv->title); + g_free (priv->summary); + g_free (priv->id); + g_free (priv->etag); + g_free (priv->rights); + g_free (priv->content); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_entry_parent_class)->finalize (object); +} + +static void +gdata_entry_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataEntryPrivate *priv = GDATA_ENTRY (object)->priv; + + switch (property_id) { + case PROP_TITLE: + g_value_set_string (value, priv->title); + break; + case PROP_SUMMARY: + g_value_set_string (value, priv->summary); + break; + case PROP_ID: + g_value_set_string (value, priv->id); + break; + case PROP_ETAG: + g_value_set_string (value, priv->etag); + break; + case PROP_UPDATED: + g_value_set_int64 (value, priv->updated); + break; + case PROP_PUBLISHED: + g_value_set_int64 (value, priv->published); + break; + case PROP_CONTENT: + g_value_set_string (value, (priv->content_is_uri == FALSE) ? priv->content : NULL); + break; + case PROP_CONTENT_URI: + g_value_set_string (value, (priv->content_is_uri == TRUE) ? priv->content : NULL); + break; + case PROP_IS_INSERTED: + g_value_set_boolean (value, gdata_entry_is_inserted (GDATA_ENTRY (object))); + break; + case PROP_RIGHTS: + g_value_set_string (value, priv->rights); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_entry_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataEntry *self = GDATA_ENTRY (object); + + switch (property_id) { + case PROP_ID: + /* Construct only */ + self->priv->id = g_value_dup_string (value); + break; + case PROP_ETAG: + /* Construct only */ + self->priv->etag = g_value_dup_string (value); + break; + case PROP_TITLE: + gdata_entry_set_title (self, g_value_get_string (value)); + break; + case PROP_SUMMARY: + gdata_entry_set_summary (self, g_value_get_string (value)); + break; + case PROP_CONTENT: + gdata_entry_set_content (self, g_value_get_string (value)); + break; + case PROP_CONTENT_URI: + gdata_entry_set_content_uri (self, g_value_get_string (value)); + break; + case PROP_RIGHTS: + gdata_entry_set_rights (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + /* Extract the ETag */ + GDATA_ENTRY (parsable)->priv->etag = (gchar*) xmlGetProp (root_node, (xmlChar*) "etag"); + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataEntryPrivate *priv = GDATA_ENTRY (parsable)->priv; + + if (gdata_parser_is_namespace (node, "http://www.w3.org/2005/Atom") == TRUE) { + if (gdata_parser_string_from_element (node, "title", P_DEFAULT | P_NO_DUPES, &(priv->title), &success, error) == TRUE || + gdata_parser_string_from_element (node, "id", P_REQUIRED | P_NON_EMPTY | P_NO_DUPES, &(priv->id), &success, error) == TRUE || + gdata_parser_string_from_element (node, "summary", P_NONE, &(priv->summary), &success, error) == TRUE || + gdata_parser_string_from_element (node, "rights", P_NONE, &(priv->rights), &success, error) == TRUE || + gdata_parser_int64_time_from_element (node, "updated", P_REQUIRED | P_NO_DUPES, &(priv->updated), &success, error) == TRUE || + gdata_parser_int64_time_from_element (node, "published", P_REQUIRED | P_NO_DUPES, &(priv->published), &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "category", P_REQUIRED, GDATA_TYPE_CATEGORY, + gdata_entry_add_category, parsable, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "link", P_REQUIRED, GDATA_TYPE_LINK, + gdata_entry_add_link, parsable, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "author", P_REQUIRED, GDATA_TYPE_AUTHOR, + gdata_entry_add_author, parsable, &success, error) == TRUE) { + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "content") == 0) { + /* atom:content */ + priv->content = (gchar*) xmlGetProp (node, (xmlChar*) "src"); + priv->content_is_uri = TRUE; + + if (priv->content == NULL) { + priv->content = (gchar*) xmlNodeListGetString (doc, node->children, TRUE); + priv->content_is_uri = FALSE; + } + + return TRUE; + } + } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/gdata/batch") == TRUE) { + if (xmlStrcmp (node->name, (xmlChar*) "id") == 0 || + xmlStrcmp (node->name, (xmlChar*) "status") == 0 || + xmlStrcmp (node->name, (xmlChar*) "operation") == 0) { + /* Ignore batch operation elements; they're handled in GDataBatchFeed */ + return TRUE; + } + } + + return GDATA_PARSABLE_CLASS (gdata_entry_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +static gboolean +post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataEntryPrivate *priv = GDATA_ENTRY (parsable)->priv; + + /* Check for missing required elements */ + /* Can't uncomment it, as things like access rules break the Atom standard */ + /*if (priv->title == NULL) + return gdata_parser_error_required_element_missing ("title", "entry", error); + if (priv->id == NULL) + return gdata_parser_error_required_element_missing ("id", "entry", error); + if (priv->updated.tv_sec == 0 && priv->updated.tv_usec == 0) + return gdata_parser_error_required_element_missing ("updated", "entry", error);*/ + + /* Reverse our lists of stuff */ + priv->categories = g_list_reverse (priv->categories); + priv->links = g_list_reverse (priv->links); + priv->authors = g_list_reverse (priv->authors); + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataEntryPrivate *priv = GDATA_ENTRY (parsable)->priv; + + /* Add the entry's ETag, if available */ + if (gdata_entry_get_etag (GDATA_ENTRY (parsable)) != NULL) + gdata_parser_string_append_escaped (xml_string, " gd:etag='", priv->etag, "'"); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataEntryPrivate *priv = GDATA_ENTRY (parsable)->priv; + GList *categories, *links, *authors; + + gdata_parser_string_append_escaped (xml_string, "", priv->title, ""); + + if (priv->id != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->id, ""); + + if (priv->updated != -1) { + gchar *updated = gdata_parser_int64_to_iso8601 (priv->updated); + g_string_append_printf (xml_string, "%s", updated); + g_free (updated); + } + + if (priv->published != -1) { + gchar *published = gdata_parser_int64_to_iso8601 (priv->published); + g_string_append_printf (xml_string, "%s", published); + g_free (published); + } + + if (priv->summary != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->summary, ""); + + if (priv->rights != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->rights, ""); + + if (priv->content != NULL) { + if (priv->content_is_uri == TRUE) + gdata_parser_string_append_escaped (xml_string, ""); + else + gdata_parser_string_append_escaped (xml_string, "", priv->content, ""); + } + + for (categories = priv->categories; categories != NULL; categories = categories->next) + _gdata_parsable_get_xml (GDATA_PARSABLE (categories->data), xml_string, FALSE); + + for (links = priv->links; links != NULL; links = links->next) + _gdata_parsable_get_xml (GDATA_PARSABLE (links->data), xml_string, FALSE); + + for (authors = priv->authors; authors != NULL; authors = authors->next) + _gdata_parsable_get_xml (GDATA_PARSABLE (authors->data), xml_string, FALSE); + + /* Batch operation data */ + if (priv->batch_id != 0) { + const gchar *batch_op; + + switch (priv->batch_operation_type) { + case GDATA_BATCH_OPERATION_QUERY: + batch_op = "query"; + break; + case GDATA_BATCH_OPERATION_INSERTION: + batch_op = "insert"; + break; + case GDATA_BATCH_OPERATION_UPDATE: + batch_op = "update"; + break; + case GDATA_BATCH_OPERATION_DELETION: + batch_op = "delete"; + break; + default: + g_assert_not_reached (); + break; + } + + g_string_append_printf (xml_string, "%u", priv->batch_id, batch_op); + } +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); + + if (GDATA_ENTRY (parsable)->priv->batch_id != 0) + g_hash_table_insert (namespaces, (gchar*) "batch", (gchar*) "http://schemas.google.com/gdata/batch"); +} + +static gchar * +get_entry_uri (const gchar *id) +{ + /* We assume the entry ID is also its entry URI; subclasses can override this + * if the service they implement has a convoluted API */ + return g_strdup (id); +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + gboolean success; + GDataEntryPrivate *priv = GDATA_ENTRY (parsable)->priv; + + if (gdata_parser_string_from_json_member (reader, "title", P_DEFAULT | P_NO_DUPES, &(priv->title), &success, error) == TRUE || + gdata_parser_string_from_json_member (reader, "id", P_NON_EMPTY | P_NO_DUPES, &(priv->id), &success, error) == TRUE || + gdata_parser_string_from_json_member (reader, "description", P_NONE, &(priv->summary), &success, error) == TRUE || + gdata_parser_int64_time_from_json_member (reader, "updated", P_REQUIRED | P_NO_DUPES, &(priv->updated), &success, error) == TRUE || + gdata_parser_string_from_json_member (reader, "etag", P_NON_EMPTY | P_NO_DUPES, &(priv->etag), &success, error) == TRUE) { + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "selfLink") == 0) { + GDataLink *_link; + const gchar *uri; + + /* Empty URI? */ + uri = json_reader_get_string_value (reader); + if (uri == NULL || *uri == '\0') { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + _link = gdata_link_new (uri, GDATA_LINK_SELF); + gdata_entry_add_link (GDATA_ENTRY (parsable), _link); + g_object_unref (_link); + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "kind") == 0) { + GDataCategory *category; + const gchar *kind; + + /* Empty kind? */ + kind = json_reader_get_string_value (reader); + if (kind == NULL || *kind == '\0') { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + category = gdata_category_new (kind, "http://schemas.google.com/g/2005#kind", NULL); + gdata_entry_add_category (GDATA_ENTRY (parsable), category); + g_object_unref (category); + + return TRUE; + } + + return GDATA_PARSABLE_CLASS (gdata_entry_parent_class)->parse_json (parsable, reader, user_data, error); +} + +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + GDataEntryPrivate *priv = GDATA_ENTRY (parsable)->priv; + GList *i; + GDataLink *_link; + + json_builder_set_member_name (builder, "title"); + json_builder_add_string_value (builder, priv->title); + + if (priv->id != NULL) { + json_builder_set_member_name (builder, "id"); + json_builder_add_string_value (builder, priv->id); + } + + if (priv->summary != NULL) { + json_builder_set_member_name (builder, "description"); + json_builder_add_string_value (builder, priv->summary); + } + + if (priv->updated != -1) { + gchar *updated = gdata_parser_int64_to_iso8601 (priv->updated); + json_builder_set_member_name (builder, "updated"); + json_builder_add_string_value (builder, updated); + g_free (updated); + } + + /* If we have a "kind" category, add that. */ + for (i = priv->categories; i != NULL; i = i->next) { + GDataCategory *category = GDATA_CATEGORY (i->data); + + if (g_strcmp0 (gdata_category_get_scheme (category), "http://schemas.google.com/g/2005#kind") == 0) { + json_builder_set_member_name (builder, "kind"); + json_builder_add_string_value (builder, gdata_category_get_term (category)); + } + } + + /* Add the ETag, if available. */ + if (gdata_entry_get_etag (GDATA_ENTRY (parsable)) != NULL) { + json_builder_set_member_name (builder, "etag"); + json_builder_add_string_value (builder, priv->etag); + } + + /* Add the self-link. */ + _link = gdata_entry_look_up_link (GDATA_ENTRY (parsable), GDATA_LINK_SELF); + if (_link != NULL) { + json_builder_set_member_name (builder, "selfLink"); + json_builder_add_string_value (builder, gdata_link_get_uri (_link)); + } +} + +/** + * gdata_entry_new: + * @id: (allow-none): the entry's ID, or %NULL + * + * Creates a new #GDataEntry with the given ID and default properties. + * + * Return value: a new #GDataEntry; unref with g_object_unref() + */ +GDataEntry * +gdata_entry_new (const gchar *id) +{ + GDataEntry *entry = GDATA_ENTRY (g_object_new (GDATA_TYPE_ENTRY, "id", id, NULL)); + + /* Set this here, as it interferes with P_NO_DUPES when parsing */ + entry->priv->title = g_strdup (""); /* title can't be NULL */ + + return entry; +} + +/** + * gdata_entry_get_title: + * @self: a #GDataEntry + * + * Returns the title of the entry. This will never be %NULL, but may be an empty string. + * + * Return value: the entry's title + */ +const gchar * +gdata_entry_get_title (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + return self->priv->title; +} + +/** + * gdata_entry_set_title: + * @self: a #GDataEntry + * @title: (allow-none): the new entry title, or %NULL + * + * Sets the title of the entry. + */ +void +gdata_entry_set_title (GDataEntry *self, const gchar *title) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + + g_free (self->priv->title); + self->priv->title = g_strdup (title); + g_object_notify (G_OBJECT (self), "title"); +} + +/** + * gdata_entry_get_summary: + * @self: a #GDataEntry + * + * Returns the summary of the entry. + * + * Return value: the entry's summary, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_entry_get_summary (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + return self->priv->summary; +} + +/** + * gdata_entry_set_summary: + * @self: a #GDataEntry + * @summary: (allow-none): the new entry summary, or %NULL + * + * Sets the summary of the entry. + * + * Since: 0.4.0 + */ +void +gdata_entry_set_summary (GDataEntry *self, const gchar *summary) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + + g_free (self->priv->summary); + self->priv->summary = g_strdup (summary); + g_object_notify (G_OBJECT (self), "summary"); +} + +/** + * gdata_entry_get_id: + * @self: a #GDataEntry + * + * Returns the URN ID of the entry; a unique and permanent identifier for the object the entry represents. + * + * The ID may be %NULL if and only if the #GDataEntry has been newly created, and hasn't yet been inserted on the server. + * + * Return value: (nullable): the entry's ID, or %NULL + */ +const gchar * +gdata_entry_get_id (GDataEntry *self) +{ + gchar *id; + + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + + /* We have to get the actual property since GDataDocumentsEntry overrides it. We then store it in our own ID field so that we can + * free it later on. */ + g_object_get (G_OBJECT (self), "id", &id, NULL); + + g_free (self->priv->id); + self->priv->id = id; + + return id; +} + +/** + * gdata_entry_get_etag: + * @self: a #GDataEntry + * + * Returns the ETag of the entry; a unique identifier for each version of the entry. For more information, see the + * online documentation. + * + * The ETag will never be empty; it's either %NULL or a valid ETag. + * + * Return value: (nullable): the entry's ETag, or %NULL + * + * Since: 0.2.0 + */ +const gchar * +gdata_entry_get_etag (GDataEntry *self) +{ + gchar *etag; + + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + + /* We have to check if the property's set since GDataAccessRule overrides it and sets it to always be NULL (since ACL entries don't support + * ETags, for some reason). */ + g_object_get (G_OBJECT (self), "etag", &etag, NULL); + if (etag != NULL) { + g_free (etag); + return self->priv->etag; + } + + return NULL; +} + +/* + * _gdata_entry_set_etag: + * @self: a #GDataEntry + * @etag: the new ETag value + * + * Sets the value of the #GDataEntry:etag property to @etag. + * + * Since: 0.17.2 + */ +void +_gdata_entry_set_etag (GDataEntry *self, const gchar *etag) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + + g_free (self->priv->etag); + self->priv->etag = g_strdup (etag); +} + +/** + * gdata_entry_get_updated: + * @self: a #GDataEntry + * + * Gets the time the entry was last updated. + * + * Return value: the UNIX timestamp for the last update of the entry + */ +gint64 +gdata_entry_get_updated (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), -1); + return self->priv->updated; +} + +/* + * _gdata_entry_set_updated: + * @self: a #GDataEntry + * @updated: the new updated value + * + * Sets the value of the #GDataEntry:updated property to @updated. + * + * Since: 0.6.0 + */ +void +_gdata_entry_set_updated (GDataEntry *self, gint64 updated) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + self->priv->updated = updated; +} + +/* + * _gdata_entry_set_published: + * @self: a #GDataEntry + * @updated: the new published value + * + * Sets the value of the #GDataEntry:published property to @published. + * + * Since: 0.17.0 + */ +void +_gdata_entry_set_published (GDataEntry *self, gint64 published) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + self->priv->published = published; +} + +/* + * _gdata_entry_set_id: + * @self: a #GDataEntry + * @id: (nullable): the new ID + * + * Sets the value of the #GDataEntry:id property to @id. + * + * Since: 0.17.0 + */ +void +_gdata_entry_set_id (GDataEntry *self, const gchar *id) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + + g_free (self->priv->id); + self->priv->id = g_strdup (id); +} + +/** + * gdata_entry_get_published: + * @self: a #GDataEntry + * + * Gets the time the entry was originally published. + * + * Return value: the UNIX timestamp for the original publish time of the entry + */ +gint64 +gdata_entry_get_published (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), -1); + return self->priv->published; +} + +/** + * gdata_entry_add_category: + * @self: a #GDataEntry + * @category: a #GDataCategory to add + * + * Adds @category to the list of categories in the given #GDataEntry, and increments its reference count. + * + * Duplicate categories will not be added to the list. + */ +void +gdata_entry_add_category (GDataEntry *self, GDataCategory *category) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + g_return_if_fail (GDATA_IS_CATEGORY (category)); + + /* Check to see if it's a kind category and if it matches the entry's predetermined kind */ + if (g_strcmp0 (gdata_category_get_scheme (category), "http://schemas.google.com/g/2005#kind") == 0) { + GDataEntryClass *klass = GDATA_ENTRY_GET_CLASS (self); + GList *element; + + if (klass->kind_term != NULL && g_strcmp0 (gdata_category_get_term (category), klass->kind_term) != 0) { + /* This used to make sense as a warning, but the new + * JSON APIs use a lot of different kinds for very + * highly related JSON schemas, which libgdata uses a + * single class for…so it makes less sense now. */ + g_debug ("Adding a kind category term, '%s', to an entry of kind '%s'.", + gdata_category_get_term (category), klass->kind_term); + } + + /* If it is a kind category, remove the entry’s existing kind category to allow the new one + * to be added. This is necessary because the existing category was set in + * gdata_entry_constructed() and might not contain all the attributes of the actual XML + * category. + * + * See: https://bugzilla.gnome.org/show_bug.cgi?id=707477 */ + element = g_list_find_custom (self->priv->categories, category, (GCompareFunc) gdata_comparable_compare); + if (element != NULL) { + g_assert (GDATA_IS_CATEGORY (element->data)); + g_object_unref (element->data); + self->priv->categories = g_list_delete_link (self->priv->categories, element); + } + } + + /* Add the category if we don't already have it */ + if (g_list_find_custom (self->priv->categories, category, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->categories = g_list_prepend (self->priv->categories, g_object_ref (category)); +} + +/** + * gdata_entry_get_categories: + * @self: a #GDataEntry + * + * Gets a list of the #GDataCategorys containing this entry. + * + * Return value: (element-type GData.Category) (transfer none): a #GList of #GDataCategorys + * + * Since: 0.2.0 + */ +GList * +gdata_entry_get_categories (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + return self->priv->categories; +} + +/** + * gdata_entry_get_authors: + * @self: a #GDataEntry + * + * Gets a list of the #GDataAuthors for this entry. + * + * Return value: (element-type GData.Author) (transfer none): a #GList of #GDataAuthors + * + * Since: 0.7.0 + */ +GList * +gdata_entry_get_authors (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + return self->priv->authors; +} + +/** + * gdata_entry_get_content: + * @self: a #GDataEntry + * + * Returns the textual content in this entry. If the content in this entry is pointed to by a URI, %NULL will be returned; the content URI will be + * returned by gdata_entry_get_content_uri(). + * + * Return value: the entry's content, or %NULL + */ +const gchar * +gdata_entry_get_content (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + return (self->priv->content_is_uri == FALSE) ? self->priv->content : NULL; +} + +/** + * gdata_entry_set_content: + * @self: a #GDataEntry + * @content: (allow-none): the new content for the entry, or %NULL + * + * Sets the entry's content to @content. This unsets #GDataEntry:content-uri. + */ +void +gdata_entry_set_content (GDataEntry *self, const gchar *content) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + + g_free (self->priv->content); + self->priv->content = g_strdup (content); + self->priv->content_is_uri = FALSE; + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "content"); + g_object_notify (G_OBJECT (self), "content-uri"); + g_object_thaw_notify (G_OBJECT (self)); +} + +/** + * gdata_entry_get_content_uri: + * @self: a #GDataEntry + * + * Returns a URI pointing to the content of this entry. If the content in this entry is stored directly, %NULL will be returned; the content will be + * returned by gdata_entry_get_content(). + * + * Return value: a URI pointing to the entry's content, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_entry_get_content_uri (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + return (self->priv->content_is_uri == TRUE) ? self->priv->content : NULL; +} + +/** + * gdata_entry_set_content_uri: + * @self: a #GDataEntry + * @content_uri: (allow-none): the new URI pointing to the content for the entry, or %NULL + * + * Sets the URI pointing to the entry's content to @content. This unsets #GDataEntry:content. + * + * Since: 0.7.0 + */ +void +gdata_entry_set_content_uri (GDataEntry *self, const gchar *content_uri) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + + g_free (self->priv->content); + self->priv->content = g_strdup (content_uri); + self->priv->content_is_uri = TRUE; + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "content"); + g_object_notify (G_OBJECT (self), "content-uri"); + g_object_thaw_notify (G_OBJECT (self)); +} + +/** + * gdata_entry_add_link: + * @self: a #GDataEntry + * @_link: a #GDataLink to add + * + * Adds @_link to the list of links in the given #GDataEntry and increments its reference count. + * + * Duplicate links will not be added to the list. + */ +void +gdata_entry_add_link (GDataEntry *self, GDataLink *_link) +{ + /* TODO: More link API */ + g_return_if_fail (GDATA_IS_ENTRY (self)); + g_return_if_fail (GDATA_IS_LINK (_link)); + + if (g_list_find_custom (self->priv->links, _link, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->links = g_list_prepend (self->priv->links, g_object_ref (_link)); +} + +/** + * gdata_entry_remove_link: + * @self: a #GDataEntry + * @_link: a #GDataLink to remove + * + * Removes @_link from the list of links in the given #GDataEntry and decrements its reference count (since the #GDataEntry held a reference to it + * while it was in the list). + * + * Return value: %TRUE if @_link was found in the #GDataEntry and removed, %FALSE if it was not found + * + * Since: 0.10.0 + */ +gboolean +gdata_entry_remove_link (GDataEntry *self, GDataLink *_link) +{ + GList *i; + + g_return_val_if_fail (GDATA_IS_ENTRY (self), FALSE); + g_return_val_if_fail (GDATA_IS_LINK (_link), FALSE); + + i = g_list_find_custom (self->priv->links, _link, (GCompareFunc) gdata_comparable_compare); + + if (i == NULL) { + return FALSE; + } + + self->priv->links = g_list_delete_link (self->priv->links, i); + g_object_unref (_link); + + return TRUE; +} + +static gint +link_compare_cb (const GDataLink *_link, const gchar *rel) +{ + return strcmp (gdata_link_get_relation_type ((GDataLink*) _link), rel); +} + +/** + * gdata_entry_look_up_link: + * @self: a #GDataEntry + * @rel: the value of the rel attribute of the desired link + * + * Looks up a link by relation type from the list of links in the entry. If the link has one of the standard Atom relation types, + * use one of the defined @rel values, instead of a static string. e.g. %GDATA_LINK_EDIT or %GDATA_LINK_SELF. + * + * In the rare event of requiring a list of links with the same @rel value, use gdata_entry_look_up_links(). + * + * Return value: (transfer none): a #GDataLink, or %NULL if one was not found + * + * Since: 0.1.1 + */ +GDataLink * +gdata_entry_look_up_link (GDataEntry *self, const gchar *rel) +{ + GList *element; + + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + g_return_val_if_fail (rel != NULL, NULL); + + element = g_list_find_custom (self->priv->links, rel, (GCompareFunc) link_compare_cb); + if (element == NULL) + return NULL; + return GDATA_LINK (element->data); +} + +/** + * gdata_entry_look_up_links: + * @self: a #GDataEntry + * @rel: the value of the rel attribute of the desired links + * + * Looks up a list of links by relation type from the list of links in the entry. If the links have one of the standard Atom + * relation types, use one of the defined @rel values, instead of a static string. e.g. %GDATA_LINK_EDIT or %GDATA_LINK_SELF. + * + * If you will only use the first link found, consider calling gdata_entry_look_up_link() instead. + * + * Return value: (element-type GData.Link) (transfer container): a #GList of #GDataLinks, or %NULL if none were found; free the list with + * g_list_free() + * + * Since: 0.4.0 + */ +GList * +gdata_entry_look_up_links (GDataEntry *self, const gchar *rel) +{ + GList *i, *results = NULL; + + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + g_return_val_if_fail (rel != NULL, NULL); + + for (i = self->priv->links; i != NULL; i = i->next) { + const gchar *relation_type = gdata_link_get_relation_type (((GDataLink*) i->data)); + if (strcmp (relation_type, rel) == 0) + results = g_list_prepend (results, i->data); + } + + return g_list_reverse (results); +} + +/** + * gdata_entry_add_author: + * @self: a #GDataEntry + * @author: a #GDataAuthor to add + * + * Adds @author to the list of authors in the given #GDataEntry and increments its reference count. + * + * Duplicate authors will not be added to the list. + */ +void +gdata_entry_add_author (GDataEntry *self, GDataAuthor *author) +{ + /* TODO: More author API */ + g_return_if_fail (GDATA_IS_ENTRY (self)); + g_return_if_fail (GDATA_IS_AUTHOR (author)); + + if (g_list_find_custom (self->priv->authors, author, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->authors = g_list_prepend (self->priv->authors, g_object_ref (author)); +} + +/** + * gdata_entry_is_inserted: + * @self: a #GDataEntry + * + * Returns whether the entry is marked as having been inserted on (uploaded to) the server already. + * + * Return value: %TRUE if the entry has been inserted already, %FALSE otherwise + */ +gboolean +gdata_entry_is_inserted (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), FALSE); + + if (self->priv->id != NULL || self->priv->updated != -1) + return TRUE; + return FALSE; +} + +/** + * gdata_entry_get_rights: + * @self: a #GDataEntry + * + * Returns the rights pertaining to the entry, or %NULL if not set. + * + * Return value: the entry's rights information + * + * Since: 0.5.0 + */ +const gchar * +gdata_entry_get_rights (GDataEntry *self) +{ + g_return_val_if_fail (GDATA_IS_ENTRY (self), NULL); + return self->priv->rights; +} + +/** + * gdata_entry_set_rights: + * @self: a #GDataEntry + * @rights: (allow-none): the new rights, or %NULL + * + * Sets the rights for this entry. + * + * Since: 0.5.0 + */ +void +gdata_entry_set_rights (GDataEntry *self, const gchar *rights) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + + g_free (self->priv->rights); + self->priv->rights = g_strdup (rights); + g_object_notify (G_OBJECT (self), "rights"); +} + +/* + * _gdata_entry_set_batch_data: + * @self: a #GDataEntry + * @id: the batch operation ID + * @type: the type of batch operation being performed on the #GDataEntry + * + * Sets the batch operation data needed when outputting the XML for a #GDataEntry to be put into a batch operation feed. + * + * Since: 0.6.0 + */ +void +_gdata_entry_set_batch_data (GDataEntry *self, guint id, GDataBatchOperationType type) +{ + g_return_if_fail (GDATA_IS_ENTRY (self)); + + self->priv->batch_id = id; + self->priv->batch_operation_type = type; +} diff --git a/gdata/gdata-entry.h b/gdata/gdata-entry.h new file mode 100644 index 0000000..5d878c9 --- /dev/null +++ b/gdata/gdata-entry.h @@ -0,0 +1,111 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_ENTRY_H +#define GDATA_ENTRY_H + +#include +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_ENTRY (gdata_entry_get_type ()) +#define GDATA_ENTRY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_ENTRY, GDataEntry)) +#define GDATA_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_ENTRY, GDataEntryClass)) +#define GDATA_IS_ENTRY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_ENTRY)) +#define GDATA_IS_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_ENTRY)) +#define GDATA_ENTRY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_ENTRY, GDataEntryClass)) + +typedef struct _GDataEntryPrivate GDataEntryPrivate; + +/** + * GDataEntry: + * + * All the fields in the #GDataEntry structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataEntryPrivate *priv; +} GDataEntry; + +/** + * GDataEntryClass: + * @parent: the parent class + * @get_entry_uri: a function to build the entry URI for the entry, given its entry ID; free the URI with g_free() + * @kind_term: the term for this entry's kind category (see the + * documentation on kinds) + * + * The class structure for the #GDataEntry type. + */ +typedef struct { + GDataParsableClass parent; + + gchar *(*get_entry_uri) (const gchar *id); /* G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC */ + const gchar *kind_term; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); + void (*_g_reserved6) (void); + void (*_g_reserved7) (void); +} GDataEntryClass; + +GType gdata_entry_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataEntry, g_object_unref) + +GDataEntry *gdata_entry_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_entry_get_title (GDataEntry *self) G_GNUC_PURE; +void gdata_entry_set_title (GDataEntry *self, const gchar *title); +const gchar *gdata_entry_get_summary (GDataEntry *self) G_GNUC_PURE; +void gdata_entry_set_summary (GDataEntry *self, const gchar *summary); +const gchar *gdata_entry_get_id (GDataEntry *self) G_GNUC_PURE; +const gchar *gdata_entry_get_etag (GDataEntry *self) G_GNUC_PURE; +gint64 gdata_entry_get_updated (GDataEntry *self); +gint64 gdata_entry_get_published (GDataEntry *self); +void gdata_entry_add_category (GDataEntry *self, GDataCategory *category); +GList *gdata_entry_get_categories (GDataEntry *self) G_GNUC_PURE; +const gchar *gdata_entry_get_content (GDataEntry *self) G_GNUC_PURE; +void gdata_entry_set_content (GDataEntry *self, const gchar *content); +const gchar *gdata_entry_get_content_uri (GDataEntry *self) G_GNUC_PURE; +void gdata_entry_set_content_uri (GDataEntry *self, const gchar *content_uri); +void gdata_entry_add_link (GDataEntry *self, GDataLink *_link); +gboolean gdata_entry_remove_link (GDataEntry *self, GDataLink *_link); +GDataLink *gdata_entry_look_up_link (GDataEntry *self, const gchar *rel) G_GNUC_PURE; +GList *gdata_entry_look_up_links (GDataEntry *self, const gchar *rel) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_entry_add_author (GDataEntry *self, GDataAuthor *author); +GList *gdata_entry_get_authors (GDataEntry *self) G_GNUC_PURE; +const gchar *gdata_entry_get_rights (GDataEntry *self) G_GNUC_PURE; +void gdata_entry_set_rights (GDataEntry *self, const gchar *rights); + +gboolean gdata_entry_is_inserted (GDataEntry *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_ENTRY_H */ diff --git a/gdata/gdata-enums.c b/gdata/gdata-enums.c new file mode 100644 index 0000000..fe2a643 --- /dev/null +++ b/gdata/gdata-enums.c @@ -0,0 +1,114 @@ + + + +#include "gdata-service.h" +#include "gdata-parsable.h" +#include "gdata-batch-operation.h" +#include "gdata-enums.h" +#include "gdata-client-login-authorizer.h" + +/* enumerations from "/opt/gnome/source/libgdata/gdata/gdata-batch-operation.h" */ +GType +gdata_batch_operation_type_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_BATCH_OPERATION_QUERY, "GDATA_BATCH_OPERATION_QUERY", "query" }, + { GDATA_BATCH_OPERATION_INSERTION, "GDATA_BATCH_OPERATION_INSERTION", "insertion" }, + { GDATA_BATCH_OPERATION_UPDATE, "GDATA_BATCH_OPERATION_UPDATE", "update" }, + { GDATA_BATCH_OPERATION_DELETION, "GDATA_BATCH_OPERATION_DELETION", "deletion" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataBatchOperationType", values); + } + return etype; +} + +/* enumerations from "/opt/gnome/source/libgdata/gdata/gdata-client-login-authorizer.h" */ +GType +gdata_client_login_authorizer_error_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_BAD_AUTHENTICATION, "GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_BAD_AUTHENTICATION", "bad-authentication" }, + { GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_NOT_VERIFIED, "GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_NOT_VERIFIED", "not-verified" }, + { GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_TERMS_NOT_AGREED, "GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_TERMS_NOT_AGREED", "terms-not-agreed" }, + { GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_CAPTCHA_REQUIRED, "GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_CAPTCHA_REQUIRED", "captcha-required" }, + { GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DELETED, "GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DELETED", "account-deleted" }, + { GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DISABLED, "GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_DISABLED", "account-disabled" }, + { GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_SERVICE_DISABLED, "GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_SERVICE_DISABLED", "service-disabled" }, + { GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_MIGRATED, "GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_ACCOUNT_MIGRATED", "account-migrated" }, + { GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_INVALID_SECOND_FACTOR, "GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_INVALID_SECOND_FACTOR", "invalid-second-factor" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataClientLoginAuthorizerError", values); + } + return etype; +} + +/* enumerations from "/opt/gnome/source/libgdata/gdata/gdata-parsable.h" */ +GType +gdata_parser_error_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_PARSER_ERROR_PARSING_STRING, "GDATA_PARSER_ERROR_PARSING_STRING", "parsing-string" }, + { GDATA_PARSER_ERROR_EMPTY_DOCUMENT, "GDATA_PARSER_ERROR_EMPTY_DOCUMENT", "empty-document" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataParserError", values); + } + return etype; +} + +/* enumerations from "/opt/gnome/source/libgdata/gdata/gdata-service.h" */ +GType +gdata_operation_type_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_OPERATION_QUERY, "GDATA_OPERATION_QUERY", "query" }, + { GDATA_OPERATION_INSERTION, "GDATA_OPERATION_INSERTION", "insertion" }, + { GDATA_OPERATION_UPDATE, "GDATA_OPERATION_UPDATE", "update" }, + { GDATA_OPERATION_DELETION, "GDATA_OPERATION_DELETION", "deletion" }, + { GDATA_OPERATION_DOWNLOAD, "GDATA_OPERATION_DOWNLOAD", "download" }, + { GDATA_OPERATION_UPLOAD, "GDATA_OPERATION_UPLOAD", "upload" }, + { GDATA_OPERATION_AUTHENTICATION, "GDATA_OPERATION_AUTHENTICATION", "authentication" }, + { GDATA_OPERATION_BATCH, "GDATA_OPERATION_BATCH", "batch" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataOperationType", values); + } + return etype; +} +GType +gdata_service_error_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_SERVICE_ERROR_UNAVAILABLE, "GDATA_SERVICE_ERROR_UNAVAILABLE", "unavailable" }, + { GDATA_SERVICE_ERROR_PROTOCOL_ERROR, "GDATA_SERVICE_ERROR_PROTOCOL_ERROR", "protocol-error" }, + { GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED, "GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED", "entry-already-inserted" }, + { GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED", "authentication-required" }, + { GDATA_SERVICE_ERROR_NOT_FOUND, "GDATA_SERVICE_ERROR_NOT_FOUND", "not-found" }, + { GDATA_SERVICE_ERROR_CONFLICT, "GDATA_SERVICE_ERROR_CONFLICT", "conflict" }, + { GDATA_SERVICE_ERROR_FORBIDDEN, "GDATA_SERVICE_ERROR_FORBIDDEN", "forbidden" }, + { GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER, "GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER", "bad-query-parameter" }, + { GDATA_SERVICE_ERROR_NETWORK_ERROR, "GDATA_SERVICE_ERROR_NETWORK_ERROR", "network-error" }, + { GDATA_SERVICE_ERROR_PROXY_ERROR, "GDATA_SERVICE_ERROR_PROXY_ERROR", "proxy-error" }, + { GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION, "GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION", "with-batch-operation" }, + { GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED, "GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED", "api-quota-exceeded" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataServiceError", values); + } + return etype; +} + + + diff --git a/gdata/gdata-enums.h b/gdata/gdata-enums.h new file mode 100644 index 0000000..739d530 --- /dev/null +++ b/gdata/gdata-enums.h @@ -0,0 +1,29 @@ + + + +#ifndef GDATA_ENUMS_H +#define GDATA_ENUMS_H + +#include + +G_BEGIN_DECLS +/* enumerations from "/opt/gnome/source/libgdata/gdata/gdata-batch-operation.h" */ +GType gdata_batch_operation_type_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_DATA_BATCH_OPERATION_TYPE (gdata_batch_operation_type_get_type()) +/* enumerations from "/opt/gnome/source/libgdata/gdata/gdata-client-login-authorizer.h" */ +GType gdata_client_login_authorizer_error_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_DATA_CLIENT_LOGIN_AUTHORIZER_ERROR (gdata_client_login_authorizer_error_get_type()) +/* enumerations from "/opt/gnome/source/libgdata/gdata/gdata-parsable.h" */ +GType gdata_parser_error_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_DATA_PARSER_ERROR (gdata_parser_error_get_type()) +/* enumerations from "/opt/gnome/source/libgdata/gdata/gdata-service.h" */ +GType gdata_operation_type_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_DATA_OPERATION_TYPE (gdata_operation_type_get_type()) +GType gdata_service_error_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_DATA_SERVICE_ERROR (gdata_service_error_get_type()) +G_END_DECLS + +#endif /* !GDATA_ENUMS_H */ + + + diff --git a/gdata/gdata-feed.c b/gdata/gdata-feed.c new file mode 100644 index 0000000..8db1f7d --- /dev/null +++ b/gdata/gdata-feed.c @@ -0,0 +1,1187 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008–2010 + * Copyright (C) Red Hat, Inc. 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-feed + * @short_description: GData feed object + * @stability: Stable + * @include: gdata/gdata-feed.h + * + * #GDataFeed is a list of entries (#GDataEntry) returned as the result of a query to a #GDataService, or given as the input to another + * operation on the online service. It also has pieces of data associated with the query on the #GDataService, such as the query title + * or timestamp when it was last updated. + * + * Each #GDataEntry represents a single object on the online service, such as a playlist, video or calendar entry, and the #GDataFeed + * represents a collection of similar objects. + */ + +#include +#include +#include +#include +#include +#include + +#include "gdata-feed.h" +#include "gdata-entry.h" +#include "gdata-types.h" +#include "gdata-private.h" +#include "gdata-service.h" +#include "gdata-parsable.h" + +static void gdata_feed_dispose (GObject *object); +static void gdata_feed_finalize (GObject *object); +static void gdata_feed_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static gboolean post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +static void _gdata_feed_add_category (GDataFeed *self, GDataCategory *category); +static void _gdata_feed_add_author (GDataFeed *self, GDataAuthor *author); + +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static gboolean post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error); + +struct _GDataFeedPrivate { + GList *entries; + gchar *title; + gchar *subtitle; + gchar *id; + gchar *etag; + gint64 updated; + GList *categories; /* GDataCategory */ + gchar *logo; + gchar *icon; + GList *links; /* GDataLink */ + GList *authors; /* GDataAuthor */ + GDataGenerator *generator; + guint items_per_page; + guint start_index; + guint total_results; + gchar *rights; + gchar *next_page_token; +}; + +enum { + PROP_ID = 1, + PROP_ETAG, + PROP_UPDATED, + PROP_TITLE, + PROP_SUBTITLE, + PROP_LOGO, + PROP_ICON, + PROP_GENERATOR, + PROP_ITEMS_PER_PAGE, + PROP_START_INDEX, + PROP_TOTAL_RESULTS, + PROP_RIGHTS, + PROP_NEXT_PAGE_TOKEN, +}; + +G_DEFINE_TYPE (GDataFeed, gdata_feed, GDATA_TYPE_PARSABLE) + +static void +gdata_feed_class_init (GDataFeedClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataFeedPrivate)); + + gobject_class->get_property = gdata_feed_get_property; + gobject_class->dispose = gdata_feed_dispose; + gobject_class->finalize = gdata_feed_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->post_parse_xml = post_parse_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "feed"; + + parsable_class->parse_json = parse_json; + parsable_class->post_parse_json = post_parse_json; + + /** + * GDataFeed:title: + * + * The title of the feed. + * + * API reference: + * atom:title + */ + g_object_class_install_property (gobject_class, PROP_TITLE, + g_param_spec_string ("title", + "Title", "The title of the feed.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:subtitle: + * + * The subtitle of the feed. + * + * API reference: atom:subtitle + */ + g_object_class_install_property (gobject_class, PROP_SUBTITLE, + g_param_spec_string ("subtitle", + "Subtitle", "The subtitle of the feed.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:id: + * + * The unique and permanent URN ID for the feed. + * + * API reference: atom:id + */ + g_object_class_install_property (gobject_class, PROP_ID, + g_param_spec_string ("id", + "ID", "The unique and permanent URN ID for the feed.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:etag: + * + * The unique ETag for this version of the feed. See the + * online documentation for + * more information. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_ETAG, + g_param_spec_string ("etag", + "ETag", "The unique ETag for this version of the feed.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:updated: + * + * The time the feed was last updated. + * + * API reference: + * atom:updated + */ + g_object_class_install_property (gobject_class, PROP_UPDATED, + g_param_spec_int64 ("updated", + "Updated", "The time the feed was last updated.", + 0, G_MAXINT64, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:logo: + * + * The URI of a logo for the feed. + * + * API reference: atom:logo + */ + g_object_class_install_property (gobject_class, PROP_LOGO, + g_param_spec_string ("logo", + "Logo", "The URI of a logo for the feed.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:icon: + * + * The URI of an icon for the feed. + * + * API reference: + * atom:icon + * + * Since: 0.6.0 + */ + g_object_class_install_property (gobject_class, PROP_ICON, + g_param_spec_string ("icon", + "Icon", "The URI of an icon for the feed.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:generator: + * + * Details of the software used to generate the feed. + * + * API reference: + * atom:generator + */ + g_object_class_install_property (gobject_class, PROP_GENERATOR, + g_param_spec_object ("generator", + "Generator", "Details of the software used to generate the feed.", + GDATA_TYPE_GENERATOR, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:rights: + * + * The ownership rights pertaining to the entire feed. + * + * For more information, see the Atom specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_RIGHTS, + g_param_spec_string ("rights", + "Rights", "The ownership rights pertaining to the entire feed.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:items-per-page: + * + * The number of items per results page feed. + * + * API reference: + * + * openSearch:itemsPerPage + */ + g_object_class_install_property (gobject_class, PROP_ITEMS_PER_PAGE, + g_param_spec_uint ("items-per-page", + "Items per page", "The number of items per results page feed.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:start-index: + * + * The one-based index of the first item in the results feed. + * + * This should not be used manually for pagination. Instead, use a #GDataQuery and call its gdata_query_next_page() + * or gdata_query_previous_page() functions before making the query to the service. + * + * API reference: + * openSearch:startIndex + */ + g_object_class_install_property (gobject_class, PROP_START_INDEX, + g_param_spec_uint ("start-index", + "Start index", "The one-based index of the first item in the results feed.", + 1, G_MAXUINT, 1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:total-results: + * + * The number of items in the result set for the feed, including those on other pages. If this is zero, the total number is unknown. + * + * This should not be used manually for pagination. Instead, use a #GDataQuery and call its gdata_query_next_page() + * or gdata_query_previous_page() functions before making the query to the service. + * + * API reference: + * + * openSearch:totalResults + */ + g_object_class_install_property (gobject_class, PROP_TOTAL_RESULTS, + g_param_spec_uint ("total-results", + "Total results", "The total number of results in the feed.", + 0, 1000000, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataFeed:next-page-token: + * + * The next page token for feeds. Pass this to + * gdata_query_set_page_token() to advance to the next page when + * querying APIs which use page tokens rather than page numbers or + * offsets. + * + * Since: 0.17.7 + */ + g_object_class_install_property (gobject_class, PROP_NEXT_PAGE_TOKEN, + g_param_spec_string ("next-page-token", + "Next page token", "The next page token for feeds.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_feed_init (GDataFeed *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_FEED, GDataFeedPrivate); + self->priv->updated = -1; +} + +static void +gdata_feed_dispose (GObject *object) +{ + GDataFeedPrivate *priv = GDATA_FEED (object)->priv; + + if (priv->entries != NULL) { + g_list_foreach (priv->entries, (GFunc) g_object_unref, NULL); + g_list_free (priv->entries); + } + priv->entries = NULL; + + if (priv->categories != NULL) { + g_list_foreach (priv->categories, (GFunc) g_object_unref, NULL); + g_list_free (priv->categories); + } + priv->categories = NULL; + + if (priv->links != NULL) { + g_list_foreach (priv->links, (GFunc) g_object_unref, NULL); + g_list_free (priv->links); + } + priv->links = NULL; + + if (priv->authors != NULL) { + g_list_foreach (priv->authors, (GFunc) g_object_unref, NULL); + g_list_free (priv->authors); + } + priv->authors = NULL; + + if (priv->generator != NULL) + g_object_unref (priv->generator); + priv->generator = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_feed_parent_class)->dispose (object); +} + +static void +gdata_feed_finalize (GObject *object) +{ + GDataFeedPrivate *priv = GDATA_FEED (object)->priv; + + g_free (priv->title); + g_free (priv->subtitle); + g_free (priv->id); + g_free (priv->etag); + g_free (priv->logo); + g_free (priv->icon); + g_free (priv->rights); + g_free (priv->next_page_token); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_feed_parent_class)->finalize (object); +} + +static void +gdata_feed_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataFeedPrivate *priv = GDATA_FEED (object)->priv; + + switch (property_id) { + case PROP_TITLE: + g_value_set_string (value, priv->title); + break; + case PROP_SUBTITLE: + g_value_set_string (value, priv->subtitle); + break; + case PROP_ID: + g_value_set_string (value, priv->id); + break; + case PROP_ETAG: + g_value_set_string (value, priv->etag); + break; + case PROP_UPDATED: + g_value_set_int64 (value, priv->updated); + break; + case PROP_LOGO: + g_value_set_string (value, priv->logo); + break; + case PROP_ICON: + g_value_set_string (value, priv->icon); + break; + case PROP_GENERATOR: + g_value_set_object (value, priv->generator); + break; + case PROP_RIGHTS: + g_value_set_string (value, priv->rights); + break; + case PROP_ITEMS_PER_PAGE: + g_value_set_uint (value, priv->items_per_page); + break; + case PROP_START_INDEX: + g_value_set_uint (value, priv->start_index); + break; + case PROP_TOTAL_RESULTS: + g_value_set_uint (value, priv->total_results); + break; + case PROP_NEXT_PAGE_TOKEN: + g_value_set_string (value, priv->next_page_token); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +typedef struct { + GType entry_type; + GDataQueryProgressCallback progress_callback; + gpointer progress_user_data; + guint entry_i; +} ParseData; + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + /* Extract the ETag */ + GDATA_FEED (parsable)->priv->etag = (gchar*) xmlGetProp (root_node, (xmlChar*) "etag"); + return TRUE; +} + +typedef struct { + GDataQueryProgressCallback progress_callback; + gpointer progress_user_data; + GDataEntry *entry; + guint entry_i; + guint total_results; +} ProgressCallbackData; + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataFeed *self = GDATA_FEED (parsable); + ParseData *data = user_data; + + if (gdata_parser_is_namespace (node, "http://www.w3.org/2005/Atom") == TRUE) { + if (xmlStrcmp (node->name, (xmlChar*) "entry") == 0) { + /* atom:entry */ + GDataEntry *entry; + GType entry_type; + + /* Allow @data to be %NULL, and assume we're parsing a vanilla feed, so that we can test #GDataFeed in tests/general.c. + * A little hacky, but not too much so, and valuable for testing. */ + entry_type = (data != NULL) ? data->entry_type : GDATA_TYPE_ENTRY; + entry = GDATA_ENTRY (_gdata_parsable_new_from_xml_node (entry_type, doc, node, NULL, error)); + if (entry == NULL) + return FALSE; + + /* Calls the callbacks in the main thread */ + if (data != NULL) + _gdata_feed_call_progress_callback (self, data, entry); + _gdata_feed_add_entry (self, entry); + g_object_unref (entry); + } else if (gdata_parser_string_from_element (node, "title", P_DEFAULT | P_NO_DUPES, &(self->priv->title), &success, error) == TRUE || + gdata_parser_string_from_element (node, "subtitle", P_NO_DUPES, &(self->priv->subtitle), &success, error) == TRUE || + gdata_parser_string_from_element (node, "id", P_REQUIRED | P_NON_EMPTY | P_NO_DUPES, + &(self->priv->id), &success, error) == TRUE || + gdata_parser_string_from_element (node, "logo", P_NO_DUPES, &(self->priv->logo), &success, error) == TRUE || + gdata_parser_string_from_element (node, "icon", P_NO_DUPES, &(self->priv->icon), &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "category", P_REQUIRED, GDATA_TYPE_CATEGORY, + _gdata_feed_add_category, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "link", P_REQUIRED, GDATA_TYPE_LINK, + _gdata_feed_add_link, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "author", P_REQUIRED, GDATA_TYPE_AUTHOR, + _gdata_feed_add_author, self, &success, error) == TRUE || + gdata_parser_object_from_element (node, "generator", P_REQUIRED | P_NO_DUPES, GDATA_TYPE_GENERATOR, + &(self->priv->generator), &success, error) == TRUE || + gdata_parser_int64_time_from_element (node, "updated", P_REQUIRED | P_NO_DUPES, + &(self->priv->updated), &success, error) == TRUE || + gdata_parser_string_from_element (node, "rights", P_NONE, &(self->priv->rights), &success, error) == TRUE) { + return success; + } else { + return GDATA_PARSABLE_CLASS (gdata_feed_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else if (gdata_parser_is_namespace (node, "http://a9.com/-/spec/opensearch/1.1/") == TRUE) { + if (xmlStrcmp (node->name, (xmlChar*) "totalResults") == 0) { + /* openSearch:totalResults */ + xmlChar *total_results_string; + + /* Duplicate checking */ + if (self->priv->total_results != 0) + return gdata_parser_error_duplicate_element (node, error); + + /* Parse the number */ + total_results_string = xmlNodeListGetString (doc, node->children, TRUE); + if (total_results_string == NULL) + return gdata_parser_error_required_content_missing (node, error); + + self->priv->total_results = g_ascii_strtoull ((gchar*) total_results_string, NULL, 10); + xmlFree (total_results_string); + } else if (xmlStrcmp (node->name, (xmlChar*) "startIndex") == 0) { + /* openSearch:startIndex */ + xmlChar *start_index_string; + + /* Duplicate checking */ + if (self->priv->start_index != 0) + return gdata_parser_error_duplicate_element (node, error); + + /* Parse the number */ + start_index_string = xmlNodeListGetString (doc, node->children, TRUE); + if (start_index_string == NULL) + return gdata_parser_error_required_content_missing (node, error); + + self->priv->start_index = g_ascii_strtoull ((gchar*) start_index_string, NULL, 10); + xmlFree (start_index_string); + } else if (xmlStrcmp (node->name, (xmlChar*) "itemsPerPage") == 0) { + /* openSearch:itemsPerPage */ + xmlChar *items_per_page_string; + + /* Duplicate checking */ + if (self->priv->items_per_page != 0) + return gdata_parser_error_duplicate_element (node, error); + + /* Parse the number */ + items_per_page_string = xmlNodeListGetString (doc, node->children, TRUE); + if (items_per_page_string == NULL) + return gdata_parser_error_required_content_missing (node, error); + + self->priv->items_per_page = g_ascii_strtoull ((gchar*) items_per_page_string, NULL, 10); + xmlFree (items_per_page_string); + } else { + return GDATA_PARSABLE_CLASS (gdata_feed_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else { + return GDATA_PARSABLE_CLASS (gdata_feed_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static gboolean +post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataFeedPrivate *priv = GDATA_FEED (parsable)->priv; + + /* Check for missing required elements */ + /* FIXME: The YouTube comments feed seems to have lost its element, making it an invalid Atom feed and meaning + * the check below has to be commented out. + * Filed as: https://code.google.com/p/gdata-issues/issues/detail?id=2908. + * Discovered in: https://bugzilla.gnome.org/show_bug.cgi?id=679072#c12. */ + /*if (priv->title == NULL) + return gdata_parser_error_required_element_missing ("title", "feed", error);*/ + if (priv->id == NULL) + return gdata_parser_error_required_element_missing ("id", "feed", error); + if (priv->updated == -1) + return gdata_parser_error_required_element_missing ("updated", "feed", error); + + /* Reverse our lists of stuff */ + priv->entries = g_list_reverse (priv->entries); + priv->categories = g_list_reverse (priv->categories); + priv->links = g_list_reverse (priv->links); + priv->authors = g_list_reverse (priv->authors); + + return TRUE; +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataFeedPrivate *priv = GDATA_FEED (parsable)->priv; + GList *entries; + gchar *updated; + + /* NOTE: Only the required elements are implemented at the moment */ + gdata_parser_string_append_escaped (xml_string, "", priv->title, ""); + gdata_parser_string_append_escaped (xml_string, "", priv->id, ""); + + updated = gdata_parser_int64_to_iso8601 (priv->updated); + g_string_append_printf (xml_string, "%s", updated); + g_free (updated); + + /* Entries */ + for (entries = priv->entries; entries != NULL; entries = entries->next) + _gdata_parsable_get_xml (GDATA_PARSABLE (entries->data), xml_string, FALSE); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + GDataFeedPrivate *priv = GDATA_FEED (parsable)->priv; + GList *i; + + /* We can't assume that all the entries in the feed have identical namespaces, so we have to call get_namespaces() for all of them. + * GDataBatchFeeds, for example, can easily contain entries with differing sets of namespaces. */ + for (i = priv->entries; i != NULL; i = i->next) + GDATA_PARSABLE_GET_CLASS (i->data)->get_namespaces (GDATA_PARSABLE (i->data), namespaces); +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataFeed *self = GDATA_FEED (parsable); + ParseData *data = user_data; + + if (g_strcmp0 (json_reader_get_member_name (reader), "items") == 0) { + gint i, elements; + + /* Loop through the elements array. */ + for (i = 0, elements = json_reader_count_elements (reader); i < elements; i++) { + GDataEntry *entry; + GType entry_type; + + json_reader_read_element (reader, i); + + /* Allow @data to be %NULL, and assume we're parsing a vanilla feed, so that we can test #GDataFeed in tests/general.c. + * A little hacky, but not too much so, and valuable for testing. */ + entry_type = (data != NULL) ? data->entry_type : GDATA_TYPE_ENTRY; + + /* Parse the node, passing it the reader cursor. */ + entry = GDATA_ENTRY (_gdata_parsable_new_from_json_node (entry_type, reader, NULL, error)); + if (entry == NULL) { + json_reader_end_element (reader); + return FALSE; + } + + /* Calls the callbacks in the main thread */ + if (data != NULL) + _gdata_feed_call_progress_callback (self, data, entry); + _gdata_feed_add_entry (self, entry); + g_object_unref (entry); + + json_reader_end_element (reader); + } + } else if (g_strcmp0 (json_reader_get_member_name (reader), "selfLink") == 0) { + GDataLink *_link; + const gchar *uri; + + /* Empty URI? */ + uri = json_reader_get_string_value (reader); + if (uri == NULL || *uri == '\0') { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + _link = gdata_link_new (uri, GDATA_LINK_SELF); + _gdata_feed_add_link (self, _link); + g_object_unref (_link); + } else if (g_strcmp0 (json_reader_get_member_name (reader), "kind") == 0) { + /* Ignore. */ + } else if (g_strcmp0 (json_reader_get_member_name (reader), "etag") == 0) { + GDATA_FEED (parsable)->priv->etag = g_strdup (json_reader_get_string_value (reader)); + } else if (g_strcmp0 (json_reader_get_member_name (reader), "nextPageToken") == 0) { + GDATA_FEED (parsable)->priv->next_page_token = g_strdup (json_reader_get_string_value (reader)); + } else { + return GDATA_PARSABLE_CLASS (gdata_feed_parent_class)->parse_json (parsable, reader, user_data, error); + } + + return TRUE; +} + +static gboolean +post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataFeedPrivate *priv = GDATA_FEED (parsable)->priv; + + /* Reverse our lists of stuff. */ + priv->entries = g_list_reverse (priv->entries); + + return TRUE; +} + +/* Internal helper method to set these properties. */ +void +_gdata_feed_set_page_info (GDataFeed *self, guint total_results, + guint items_per_page) +{ + g_return_if_fail (GDATA_IS_FEED (self)); + + self->priv->total_results = total_results; + self->priv->items_per_page = items_per_page; +} + +/* + * _gdata_feed_new: + * @feed_type: the type of #GDataFeed subclass + * @title: the feed's title + * @id: the feed's ID + * @updated: when the feed was last updated + * + * Creates a new #GDataFeed or subclass with the bare minimum of data to be + * valid. + * + * Return value: a new #GDataFeed + * + * Since: 0.17.0 + */ +GDataFeed * +_gdata_feed_new (GType feed_type, + const gchar *title, + const gchar *id, + gint64 updated) +{ + GDataFeed *feed; + + g_return_val_if_fail (g_type_is_a (feed_type, GDATA_TYPE_FEED), NULL); + g_return_val_if_fail (title != NULL, NULL); + g_return_val_if_fail (id != NULL, NULL); + g_return_val_if_fail (updated >= 0, NULL); + + feed = g_object_new (feed_type, NULL); + feed->priv->title = g_strdup (title); + feed->priv->id = g_strdup (id); + feed->priv->updated = updated; + + return feed; +} + +GDataFeed * +_gdata_feed_new_from_xml (GType feed_type, const gchar *xml, gint length, GType entry_type, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + ParseData *data; + GDataFeed *feed; + + g_return_val_if_fail (g_type_is_a (feed_type, GDATA_TYPE_FEED), NULL); + g_return_val_if_fail (xml != NULL, NULL); + g_return_val_if_fail (g_type_is_a (entry_type, GDATA_TYPE_ENTRY), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + data = _gdata_feed_parse_data_new (entry_type, progress_callback, progress_user_data); + feed = GDATA_FEED (_gdata_parsable_new_from_xml (feed_type, xml, length, data, error)); + _gdata_feed_parse_data_free (data); + + return feed; +} + +GDataFeed * +_gdata_feed_new_from_json (GType feed_type, const gchar *json, gint length, GType entry_type, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + ParseData *data; + GDataFeed *feed; + + g_return_val_if_fail (g_type_is_a (feed_type, GDATA_TYPE_FEED), NULL); + g_return_val_if_fail (json != NULL, NULL); + g_return_val_if_fail (g_type_is_a (entry_type, GDATA_TYPE_ENTRY), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + data = _gdata_feed_parse_data_new (entry_type, progress_callback, progress_user_data); + feed = GDATA_FEED (_gdata_parsable_new_from_json (feed_type, json, length, data, error)); + _gdata_feed_parse_data_free (data); + + return feed; +} + +/** + * gdata_feed_get_entries: + * @self: a #GDataFeed + * + * Returns a list of the entries contained in this feed. + * + * Return value: (element-type GData.Entry) (transfer none): a #GList of #GDataEntrys + */ +GList * +gdata_feed_get_entries (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->entries; +} + +static gint +entry_compare_cb (const GDataEntry *entry, const gchar *id) +{ + return strcmp (gdata_entry_get_id (GDATA_ENTRY (entry)), id); +} + +/** + * gdata_feed_look_up_entry: + * @self: a #GDataFeed + * @id: the entry's ID + * + * Returns the entry in the feed with the given @id, if found. + * + * Return value: (transfer none): the #GDataEntry, or %NULL + * + * Since: 0.2.0 + */ +GDataEntry * +gdata_feed_look_up_entry (GDataFeed *self, const gchar *id) +{ + GList *element; + + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + g_return_val_if_fail (id != NULL, NULL); + + element = g_list_find_custom (self->priv->entries, id, (GCompareFunc) entry_compare_cb); + if (element == NULL) + return NULL; + return GDATA_ENTRY (element->data); +} + +/** + * gdata_feed_get_categories: + * @self: a #GDataFeed + * + * Returns a list of the categories listed in this feed. + * + * Return value: (element-type GData.Category) (transfer none): a #GList of #GDataCategorys + */ +GList * +gdata_feed_get_categories (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->categories; +} + +static void +_gdata_feed_add_category (GDataFeed *self, GDataCategory *category) +{ + self->priv->categories = g_list_prepend (self->priv->categories, g_object_ref (category)); +} + +/** + * gdata_feed_get_links: + * @self: a #GDataFeed + * + * Returns a list of the links listed in this feed. + * + * Return value: (element-type GData.Link) (transfer none): a #GList of #GDataLinks + */ +GList * +gdata_feed_get_links (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->links; +} + +static gint +link_compare_cb (const GDataLink *_link, const gchar *rel) +{ + return strcmp (gdata_link_get_relation_type ((GDataLink*) _link), rel); +} + +/** + * gdata_feed_look_up_link: + * @self: a #GDataFeed + * @rel: the value of the #GDataLink:relation-type property of the desired link + * + * Looks up a link by #GDataLink:relation-type value from the list of links in the feed. + * + * Return value: (transfer none): a #GDataLink, or %NULL if one was not found + * + * Since: 0.1.1 + */ +GDataLink * +gdata_feed_look_up_link (GDataFeed *self, const gchar *rel) +{ + GList *element; + + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + g_return_val_if_fail (rel != NULL, NULL); + + element = g_list_find_custom (self->priv->links, rel, (GCompareFunc) link_compare_cb); + if (element == NULL) + return NULL; + return GDATA_LINK (element->data); +} + +void +_gdata_feed_add_link (GDataFeed *self, GDataLink *_link) +{ + self->priv->links = g_list_prepend (self->priv->links, g_object_ref (_link)); +} + +/** + * gdata_feed_get_authors: + * @self: a #GDataFeed + * + * Returns a list of the authors listed in this feed. + * + * Return value: (element-type GData.Author) (transfer none): a #GList of #GDataAuthors + */ +GList * +gdata_feed_get_authors (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->authors; +} + +static void +_gdata_feed_add_author (GDataFeed *self, GDataAuthor *author) +{ + self->priv->authors = g_list_prepend (self->priv->authors, g_object_ref (author)); +} + +/** + * gdata_feed_get_title: + * @self: a #GDataFeed + * + * Returns the title of the feed. + * + * Return value: the feed's title + */ +const gchar * +gdata_feed_get_title (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->title; +} + +/** + * gdata_feed_get_subtitle: + * @self: a #GDataFeed + * + * Returns the subtitle of the feed. + * + * Return value: the feed's subtitle, or %NULL + */ +const gchar * +gdata_feed_get_subtitle (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->subtitle; +} + +/** + * gdata_feed_get_id: + * @self: a #GDataFeed + * + * Returns the feed's unique and permanent URN ID. + * + * Return value: the feed's ID + */ +const gchar * +gdata_feed_get_id (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->id; +} + +/** + * gdata_feed_get_etag: + * @self: a #GDataFeed + * + * Returns the feed's unique ETag for this version. + * + * Return value: the feed's ETag + * + * Since: 0.2.0 + */ +const gchar * +gdata_feed_get_etag (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->etag; +} + +/** + * gdata_feed_get_updated: + * @self: a #GDataFeed + * + * Gets the time the feed was last updated. + * + * Return value: the UNIX timestamp for the time the feed was last updated + */ +gint64 +gdata_feed_get_updated (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), -1); + return self->priv->updated; +} + +/** + * gdata_feed_get_logo: + * @self: a #GDataFeed + * + * Returns the logo URI of the feed. + * + * Return value: the feed's logo URI, or %NULL + */ +const gchar * +gdata_feed_get_logo (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->logo; +} + +/** + * gdata_feed_get_icon: + * @self: a #GDataFeed + * + * Returns the icon URI of the feed. + * + * Return value: the feed's icon URI, or %NULL + * + * Since: 0.6.0 + */ +const gchar * +gdata_feed_get_icon (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->icon; +} + +/** + * gdata_feed_get_generator: + * @self: a #GDataFeed + * + * Returns details about the software which generated the feed. + * + * Return value: (transfer none): a #GDataGenerator, or %NULL + */ +GDataGenerator * +gdata_feed_get_generator (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->generator; +} + +/** + * gdata_feed_get_rights: + * @self: a #GDataFeed + * + * Returns the rights pertaining to the entire feed, or %NULL if not set. + * + * Return value: the feed's rights information + * + * Since: 0.7.0 + */ +const gchar * +gdata_feed_get_rights (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->rights; +} + +/** + * gdata_feed_get_items_per_page: + * @self: a #GDataFeed + * + * Returns the number of items per results page feed. + * + * Return value: the number of items per results page feed, or 0 + */ +guint +gdata_feed_get_items_per_page (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), 0); + return self->priv->items_per_page; +} + +/** + * gdata_feed_get_start_index: + * @self: a #GDataFeed + * + * Returns the one-based start index of the results feed in the result set. + * + * Return value: the one-based start index, or 0 + */ +guint +gdata_feed_get_start_index (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), 0); + return self->priv->start_index; +} + +/** + * gdata_feed_get_total_results: + * @self: a #GDataFeed + * + * Returns the total number of results in the result set, including results on other + * pages. If this is zero, the total number is unknown. + * + * Return value: the total number of results, or 0 + */ +guint +gdata_feed_get_total_results (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), 0); + return self->priv->total_results; +} + +/** + * gdata_feed_get_next_page_token: + * @self: a #GDataFeed + * + * Returns the next page token for a query result, or %NULL if not set. + * This is #GDataFeed:next-page-token. The page token might not be set if there + * is no next page, or if this service does not use token based paging (for + * example, if it uses page number or offset based paging instead). Most more + * recent services use token based paging. + * + * Return value: (nullable): the next page token + * + * Since: 0.17.7 + */ +const gchar * +gdata_feed_get_next_page_token (GDataFeed *self) +{ + g_return_val_if_fail (GDATA_IS_FEED (self), NULL); + return self->priv->next_page_token; +} + +void +_gdata_feed_add_entry (GDataFeed *self, GDataEntry *entry) +{ + g_return_if_fail (GDATA_IS_FEED (self)); + g_return_if_fail (GDATA_IS_ENTRY (entry)); + self->priv->entries = g_list_prepend (self->priv->entries, g_object_ref (entry)); +} + +gpointer +_gdata_feed_parse_data_new (GType entry_type, GDataQueryProgressCallback progress_callback, gpointer progress_user_data) +{ + ParseData *data; + data = g_slice_new (ParseData); + data->entry_type = entry_type; + data->progress_callback = progress_callback; + data->progress_user_data = progress_user_data; + data->entry_i = 0; + + return data; +} + +void +_gdata_feed_parse_data_free (gpointer data) +{ + g_slice_free (ParseData, data); +} + +static gboolean +progress_callback_idle (ProgressCallbackData *data) +{ + data->progress_callback (data->entry, data->entry_i, data->total_results, data->progress_user_data); + + return G_SOURCE_REMOVE; +} + +static void +progress_callback_data_free (ProgressCallbackData *data) +{ + g_object_unref (data->entry); + g_slice_free (ProgressCallbackData, data); +} + +void +_gdata_feed_call_progress_callback (GDataFeed *self, gpointer user_data, GDataEntry *entry) +{ + ParseData *data = user_data; + + if (data->progress_callback != NULL) { + ProgressCallbackData *progress_data; + + /* Build the data for the callback */ + progress_data = g_slice_new (ProgressCallbackData); + progress_data->progress_callback = data->progress_callback; + progress_data->progress_user_data = data->progress_user_data; + progress_data->entry = g_object_ref (entry); + progress_data->entry_i = data->entry_i; + progress_data->total_results = MIN (self->priv->items_per_page, self->priv->total_results); + + /* Send the callback; use G_PRIORITY_DEFAULT rather than G_PRIORITY_DEFAULT_IDLE + * to contend with the priorities used by the callback functions in GAsyncResult */ + g_main_context_invoke_full (NULL, G_PRIORITY_DEFAULT, + (GSourceFunc) progress_callback_idle, + progress_data, + (GDestroyNotify) progress_callback_data_free); + } + data->entry_i++; +} + diff --git a/gdata/gdata-feed.h b/gdata/gdata-feed.h new file mode 100644 index 0000000..4da0e87 --- /dev/null +++ b/gdata/gdata-feed.h @@ -0,0 +1,98 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008-2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_FEED_H +#define GDATA_FEED_H + +#include +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_FEED (gdata_feed_get_type ()) +#define GDATA_FEED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_FEED, GDataFeed)) +#define GDATA_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_FEED, GDataFeedClass)) +#define GDATA_IS_FEED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_FEED)) +#define GDATA_IS_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_FEED)) +#define GDATA_FEED_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_FEED, GDataFeedClass)) + +typedef struct _GDataFeedPrivate GDataFeedPrivate; + +/** + * GDataFeed: + * + * All the fields in the #GDataFeed structure are private and should never be accessed directly. + */ +typedef struct { + /*< private >*/ + GDataParsable parent; + GDataFeedPrivate *priv; +} GDataFeed; + +/** + * GDataFeedClass: + * + * All the fields in the #GDataFeedClass structure are private and should never be accessed directly. + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataFeedClass; + +GType gdata_feed_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataFeed, g_object_unref) + +GList *gdata_feed_get_entries (GDataFeed *self) G_GNUC_PURE; +GDataEntry *gdata_feed_look_up_entry (GDataFeed *self, const gchar *id) G_GNUC_PURE; +GList *gdata_feed_get_categories (GDataFeed *self) G_GNUC_PURE; +GList *gdata_feed_get_links (GDataFeed *self) G_GNUC_PURE; +GDataLink *gdata_feed_look_up_link (GDataFeed *self, const gchar *rel) G_GNUC_PURE; +GList *gdata_feed_get_authors (GDataFeed *self) G_GNUC_PURE; + +const gchar *gdata_feed_get_title (GDataFeed *self) G_GNUC_PURE; +const gchar *gdata_feed_get_subtitle (GDataFeed *self) G_GNUC_PURE; +const gchar *gdata_feed_get_id (GDataFeed *self) G_GNUC_PURE; +const gchar *gdata_feed_get_etag (GDataFeed *self) G_GNUC_PURE; +gint64 gdata_feed_get_updated (GDataFeed *self); +const gchar *gdata_feed_get_logo (GDataFeed *self) G_GNUC_PURE; +GDataGenerator *gdata_feed_get_generator (GDataFeed *self) G_GNUC_PURE; +const gchar *gdata_feed_get_rights (GDataFeed *self) G_GNUC_PURE; +guint gdata_feed_get_items_per_page (GDataFeed *self) G_GNUC_PURE; +guint gdata_feed_get_start_index (GDataFeed *self) G_GNUC_PURE; +guint gdata_feed_get_total_results (GDataFeed *self) G_GNUC_PURE; +const gchar *gdata_feed_get_icon (GDataFeed *self) G_GNUC_PURE; +const gchar *gdata_feed_get_next_page_token (GDataFeed *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_FEED_H */ diff --git a/gdata/gdata-goa-authorizer.c b/gdata/gdata-goa-authorizer.c new file mode 100644 index 0000000..ecfecae --- /dev/null +++ b/gdata/gdata-goa-authorizer.c @@ -0,0 +1,607 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Matthew Barnes 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-goa-authorizer + * @short_description: GData GOA authorization interface + * @stability: Stable + * @include: gdata/gdata-goa-authorizer.h + * + * #GDataGoaAuthorizer provides an implementation of the #GDataAuthorizer interface for authentication and authorization using GNOME Online Accounts + * (GOA) over D-Bus. This allows a single login session (managed by the GOA daemon) to be used by multiple applications simultaneously, without each + * of those applications having to go through the authentication process themselves. Applications making use of #GDataGoaAuthorizer don't get access + * to the user's password (it's handled solely by the GOA daemon). + * + * Internally, GOA authenticates with the Google servers using the + * OAuth 1.0 or + * OAuth 2.0 processes. + * + * #GDataGoaAuthorizer natively supports authorization against multiple services (unlike #GDataClientLoginAuthorizer), depending entirely on which + * services the user has enabled for their Google account in GOA. #GDataGoaAuthorizer cannot authenticate for more services than are enabled in GOA. + * + * + * Authenticating Using GOA + * + * GDataSomeService *service; + * GoaObject *goa_object; + * GDataGoaAuthorizer *authorizer; + * + * /* Create an authorizer and pass it an existing #GoaObject. */ + * goa_object = get_goa_object (); + * authorizer = gdata_goa_authorizer_new (goa_object); + * + * /* Create a service object and link it with the authorizer */ + * service = gdata_some_service_new (GDATA_AUTHORIZER (authorizer)); + * + * /* Use the service! */ + * + * g_object_unref (service); + * g_object_unref (authorizer); + * g_object_unref (goa_object); + * + * + * + * Since: 0.13.1 + */ + +#include +#include +#include +#include + +#include "gdata-goa-authorizer.h" +#include "gdata-authorizer.h" +#include "gdata-service.h" + +#include "services/calendar/gdata-calendar-service.h" +#include "services/contacts/gdata-contacts-service.h" +#include "services/documents/gdata-documents-service.h" +#include "services/picasaweb/gdata-picasaweb-service.h" + +#define HMAC_SHA1_LEN 20 /* bytes, raw */ + +static void gdata_goa_authorizer_interface_init (GDataAuthorizerInterface *interface); + +/* GDataAuthorizer methods must be thread-safe. */ +static GMutex mutex; + +struct _GDataGoaAuthorizerPrivate { + /* GoaObject is already thread-safe. */ + GoaObject *goa_object; + + /* These members are protected by the global mutex (above). */ + gchar *access_token; + gchar *access_token_secret; + GHashTable *authorization_domains; +}; + +enum { + PROP_GOA_OBJECT = 1, +}; + +G_DEFINE_TYPE_WITH_CODE (GDataGoaAuthorizer, gdata_goa_authorizer, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_AUTHORIZER, gdata_goa_authorizer_interface_init)) + +static GHashTable * +gdata_goa_authorizer_get_oauth1_parameters (SoupMessage *message, const gchar *consumer_key, const gchar *consumer_secret, const gchar *access_token, + const gchar *access_token_secret) +{ + GString *query; + GString *base_string; + GString *signing_key; + GHashTable *parameters; + GHashTableIter iter; + SoupURI *soup_uri; + GList *keys, *i; + gchar *string; + gchar *request_uri; + gpointer key; + guchar signature_buf[HMAC_SHA1_LEN]; + gsize signature_buf_len; + GHmac *signature_hmac; + + parameters = g_hash_table_new_full ((GHashFunc) g_str_hash, (GEqualFunc) g_str_equal, (GDestroyNotify) NULL, (GDestroyNotify) g_free); + + /* soup_form_decode() uses an awkward allocation style for + * its hash table entries, so it's easier to copy its content + * into our own hash table than try to use the returned hash + * table directly. */ + + soup_uri = soup_message_get_uri (message); + if (soup_uri->query != NULL) { + GHashTable *hash_table; + gpointer value; + + hash_table = soup_form_decode (soup_uri->query); + g_hash_table_iter_init (&iter, hash_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + key = (gpointer) g_intern_string (key); + value = g_strdup (value); + g_hash_table_insert (parameters, key, value); + } + g_hash_table_destroy (hash_table); + } + + /* Add OAuth parameters. */ + + key = (gpointer) "oauth_version"; + g_hash_table_insert (parameters, key, g_strdup ("1.0")); + + string = oauth_gen_nonce (); + key = (gpointer) "oauth_nonce"; + g_hash_table_insert (parameters, key, g_strdup (string)); + free (string); /* do not use g_free () */ + + key = (gpointer) "oauth_timestamp"; + string = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64) time (NULL)); + g_hash_table_insert (parameters, key, string); /* takes ownership */ + + key = (gpointer) "oauth_consumer_key"; + g_hash_table_insert (parameters, key, g_strdup (consumer_key)); + + key = (gpointer) "oauth_token"; + g_hash_table_insert (parameters, key, g_strdup (access_token)); + + key = (gpointer) "oauth_signature_method"; + g_hash_table_insert (parameters, key, g_strdup ("HMAC-SHA1")); + + /* Build the query part of the signature base string. */ + + query = g_string_sized_new (512); + keys = g_hash_table_get_keys (parameters); + keys = g_list_sort (keys, (GCompareFunc) g_strcmp0); + for (i = keys; i != NULL; i = g_list_next (i)) { + const gchar *_key = i->data; + const gchar *val; + + val = g_hash_table_lookup (parameters, _key); + + if (i != keys) { + g_string_append_c (query, '&'); + } + + g_string_append_uri_escaped (query, _key, NULL, FALSE); + g_string_append_c (query, '='); + g_string_append_uri_escaped (query, val, NULL, FALSE); + } + g_list_free (keys); + + /* Build the signature base string. */ + + soup_uri = soup_uri_copy (soup_uri); + soup_uri_set_query (soup_uri, NULL); + soup_uri_set_fragment (soup_uri, NULL); + request_uri = soup_uri_to_string (soup_uri, FALSE); + soup_uri_free (soup_uri); + + base_string = g_string_sized_new (512); + g_string_append_uri_escaped (base_string, message->method, NULL, FALSE); + g_string_append_c (base_string, '&'); + g_string_append_uri_escaped (base_string, request_uri, NULL, FALSE); + g_string_append_c (base_string, '&'); + g_string_append_uri_escaped (base_string, query->str, NULL, FALSE); + + /* Build the HMAC-SHA1 signing key. */ + + signing_key = g_string_sized_new (512); + g_string_append_uri_escaped (signing_key, consumer_secret, NULL, FALSE); + g_string_append_c (signing_key, '&'); + g_string_append_uri_escaped (signing_key, access_token_secret, NULL, FALSE); + + /* Sign the request. */ + signature_hmac = g_hmac_new (G_CHECKSUM_SHA1, (const guchar*) signing_key->str, signing_key->len); + g_hmac_update (signature_hmac, (const guchar*) base_string->str, base_string->len); + + signature_buf_len = G_N_ELEMENTS (signature_buf); + g_hmac_get_digest (signature_hmac, signature_buf, &signature_buf_len); + + g_hmac_unref (signature_hmac); + + key = (gpointer) "oauth_signature"; + string = g_base64_encode (signature_buf, signature_buf_len); + g_hash_table_insert (parameters, key, g_strdup (string)); + g_free (string); + + g_free (request_uri); + + g_string_free (query, TRUE); + g_string_free (base_string, TRUE); + g_string_free (signing_key, TRUE); + + return parameters; +} + +static void +gdata_goa_authorizer_add_oauth1_authorization (GDataAuthorizer *authorizer, SoupMessage *message) +{ + GDataGoaAuthorizerPrivate *priv; + GoaOAuthBased *goa_oauth_based; + GHashTable *parameters; + GString *authorization; + const gchar *consumer_key; + const gchar *consumer_secret; + guint ii; + + const gchar *oauth_keys[] = { + "oauth_version", + "oauth_nonce", + "oauth_timestamp", + "oauth_consumer_key", + "oauth_token", + "oauth_signature_method", + "oauth_signature" + }; + + /* This MUST be called with the mutex already locked. */ + + priv = GDATA_GOA_AUTHORIZER (authorizer)->priv; + + /* We can't add an Authorization header without an access token. + * Let the request fail. GData should refresh us if it gets back + * a "401 Authorization required" response from Google, and then + * automatically retry the request. */ + if (priv->access_token == NULL) { + return; + } + + goa_oauth_based = goa_object_get_oauth_based (priv->goa_object); + + consumer_key = goa_oauth_based_get_consumer_key (goa_oauth_based); + consumer_secret = goa_oauth_based_get_consumer_secret (goa_oauth_based); + + parameters = gdata_goa_authorizer_get_oauth1_parameters (message, consumer_key, consumer_secret, + priv->access_token, priv->access_token_secret); + + authorization = g_string_new ("OAuth "); + + for (ii = 0; ii < G_N_ELEMENTS (oauth_keys); ii++) { + const gchar *key; + const gchar *val; + + key = oauth_keys[ii]; + val = g_hash_table_lookup (parameters, key); + + if (ii > 0) { + g_string_append (authorization, ", "); + } + + g_string_append (authorization, key); + g_string_append_c (authorization, '='); + g_string_append_c (authorization, '"'); + g_string_append_uri_escaped (authorization, val, NULL, FALSE); + g_string_append_c (authorization, '"'); + } + + /* Use replace here, not append, to make sure + * there's only one "Authorization" header. */ + soup_message_headers_replace (message->request_headers, "Authorization", authorization->str); + + g_string_free (authorization, TRUE); + g_hash_table_destroy (parameters); + + g_object_unref (goa_oauth_based); +} + +static void +gdata_goa_authorizer_add_oauth2_authorization (GDataAuthorizer *authorizer, SoupMessage *message) +{ + GDataGoaAuthorizerPrivate *priv; + GString *authorization; + + /* This MUST be called with the mutex already locked. */ + + priv = GDATA_GOA_AUTHORIZER (authorizer)->priv; + + /* We can't add an Authorization header without an access token. Let the request fail. GData should refresh us if it gets back a + * "401 Authorization required" response from Google, and then automatically retry the request. */ + if (priv->access_token == NULL) { + return; + } + + authorization = g_string_new ("Bearer "); + g_string_append (authorization, priv->access_token); + + /* Use replace here, not append, to make sure there's only one "Authorization" header. */ + soup_message_headers_replace (message->request_headers, "Authorization", authorization->str); + + g_string_free (authorization, TRUE); +} + +static void +gdata_goa_authorizer_add_authorization (GDataAuthorizer *authorizer, SoupMessage *message) +{ + GDataGoaAuthorizerPrivate *priv; + + /* This MUST be called with the mutex already locked. */ + + priv = GDATA_GOA_AUTHORIZER (authorizer)->priv; + + /* Prefer OAuth 2.0 over OAuth 1.0. */ + if (goa_object_peek_oauth2_based (priv->goa_object) != NULL) { + gdata_goa_authorizer_add_oauth2_authorization (authorizer, message); + } else if (goa_object_peek_oauth_based (priv->goa_object) != NULL) { + gdata_goa_authorizer_add_oauth1_authorization (authorizer, message); + } +} + +static gboolean +gdata_goa_authorizer_is_authorized (GDataAuthorizer *authorizer, GDataAuthorizationDomain *domain) +{ + /* This MUST be called with the mutex already locked. */ + + if (domain == NULL) { + return TRUE; + } + + domain = g_hash_table_lookup (GDATA_GOA_AUTHORIZER (authorizer)->priv->authorization_domains, domain); + + return (domain != NULL); +} + +static void +add_authorization_domains (GDataGoaAuthorizer *self, GType service_type) +{ + GList/**/ *domains; + + domains = gdata_service_get_authorization_domains (service_type); + + while (domains != NULL) { + g_hash_table_insert (self->priv->authorization_domains, g_object_ref (domains->data), domains->data); + domains = g_list_delete_link (domains, domains); + } +} + +static void +gdata_goa_authorizer_set_goa_object (GDataGoaAuthorizer *self, GoaObject *goa_object) +{ + g_return_if_fail (GOA_IS_OBJECT (goa_object)); + g_return_if_fail (self->priv->goa_object == NULL); + + self->priv->goa_object = g_object_ref (goa_object); + + /* Add authorisation domains for all the services supported by our GoaObject. */ + if (goa_object_peek_calendar (goa_object) != NULL) { + add_authorization_domains (self, GDATA_TYPE_CALENDAR_SERVICE); + } + + if (goa_object_peek_contacts (goa_object) != NULL) { + add_authorization_domains (self, GDATA_TYPE_CONTACTS_SERVICE); + } + + if (goa_object_peek_documents (goa_object) != NULL || goa_object_peek_files (goa_object) != NULL) { + add_authorization_domains (self, GDATA_TYPE_DOCUMENTS_SERVICE); + } + + if (goa_object_peek_photos (goa_object) != NULL) { + add_authorization_domains (self, GDATA_TYPE_PICASAWEB_SERVICE); + } +} + +static void +gdata_goa_authorizer_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + switch (property_id) { + case PROP_GOA_OBJECT: + gdata_goa_authorizer_set_goa_object (GDATA_GOA_AUTHORIZER (object), g_value_get_object (value)); + return; + default: + g_assert_not_reached (); + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +gdata_goa_authorizer_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + switch (property_id) { + case PROP_GOA_OBJECT: + g_value_set_object (value, gdata_goa_authorizer_get_goa_object (GDATA_GOA_AUTHORIZER (object))); + return; + default: + g_assert_not_reached (); + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +gdata_goa_authorizer_dispose (GObject *object) +{ + GDataGoaAuthorizerPrivate *priv; + + priv = GDATA_GOA_AUTHORIZER (object)->priv; + + g_clear_object (&priv->goa_object); + g_hash_table_remove_all (priv->authorization_domains); + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (gdata_goa_authorizer_parent_class)->dispose (object); +} + +static void +gdata_goa_authorizer_finalize (GObject *object) +{ + GDataGoaAuthorizerPrivate *priv; + + priv = GDATA_GOA_AUTHORIZER (object)->priv; + + g_free (priv->access_token); + g_free (priv->access_token_secret); + g_hash_table_destroy (priv->authorization_domains); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (gdata_goa_authorizer_parent_class)->finalize (object); +} + +static void +gdata_goa_authorizer_process_request (GDataAuthorizer *authorizer, GDataAuthorizationDomain *domain, SoupMessage *message) +{ + g_mutex_lock (&mutex); + + if (gdata_goa_authorizer_is_authorized (authorizer, domain)) { + gdata_goa_authorizer_add_authorization (authorizer, message); + } + + g_mutex_unlock (&mutex); +} + +static gboolean +gdata_goa_authorizer_is_authorized_for_domain (GDataAuthorizer *authorizer, GDataAuthorizationDomain *domain) +{ + gboolean authorized; + + g_mutex_lock (&mutex); + + authorized = gdata_goa_authorizer_is_authorized (authorizer, domain); + + g_mutex_unlock (&mutex); + + return authorized; +} + +static gboolean +gdata_goa_authorizer_refresh_authorization (GDataAuthorizer *authorizer, GCancellable *cancellable, GError **error) +{ + GDataGoaAuthorizerPrivate *priv; + GoaOAuthBased *goa_oauth1_based; + GoaOAuth2Based *goa_oauth2_based; + GoaAccount *goa_account; + gboolean success = FALSE; + + priv = GDATA_GOA_AUTHORIZER (authorizer)->priv; + + g_mutex_lock (&mutex); + + g_free (priv->access_token); + priv->access_token = NULL; + + g_free (priv->access_token_secret); + priv->access_token_secret = NULL; + + goa_account = goa_object_get_account (priv->goa_object); + goa_oauth1_based = goa_object_get_oauth_based (priv->goa_object); + goa_oauth2_based = goa_object_get_oauth2_based (priv->goa_object); + + success = goa_account_call_ensure_credentials_sync (goa_account, NULL, cancellable, error); + + if (success == FALSE) { + goto exit; + } + + /* Prefer OAuth 2.0 over OAuth 1.0. */ + if (goa_oauth2_based != NULL) { + success = goa_oauth2_based_call_get_access_token_sync (goa_oauth2_based, &priv->access_token, NULL, cancellable, error); + } else if (goa_oauth1_based != NULL) { + success = goa_oauth_based_call_get_access_token_sync (goa_oauth1_based, &priv->access_token, &priv->access_token_secret, NULL, + cancellable, error); + } else { + g_warn_if_reached (); /* should never happen */ + } + +exit: + g_clear_object (&goa_account); + g_clear_object (&goa_oauth1_based); + g_clear_object (&goa_oauth2_based); + + g_mutex_unlock (&mutex); + + return success; +} + +static void +gdata_goa_authorizer_class_init (GDataGoaAuthorizerClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (GDataGoaAuthorizerPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = gdata_goa_authorizer_set_property; + object_class->get_property = gdata_goa_authorizer_get_property; + object_class->dispose = gdata_goa_authorizer_dispose; + object_class->finalize = gdata_goa_authorizer_finalize; + + /** + * GDataGoaAuthorizer:goa-object: + * + * The GOA account providing authentication. This should have all the necessary services enabled on it. + * + * Since: 0.13.1 + */ + g_object_class_install_property (object_class, PROP_GOA_OBJECT, + g_param_spec_object ("goa-object", "GOA object", "The GOA account providing authentication.", + GOA_TYPE_OBJECT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_goa_authorizer_interface_init (GDataAuthorizerInterface *interface) +{ + interface->process_request = gdata_goa_authorizer_process_request; + interface->is_authorized_for_domain = gdata_goa_authorizer_is_authorized_for_domain; + interface->refresh_authorization = gdata_goa_authorizer_refresh_authorization; +} + +static void +gdata_goa_authorizer_init (GDataGoaAuthorizer *authorizer) +{ + GHashTable *authorization_domains; + + authorization_domains = g_hash_table_new_full ((GHashFunc) g_direct_hash, (GEqualFunc) g_direct_equal, + (GDestroyNotify) g_object_unref, (GDestroyNotify) NULL); + + authorizer->priv = G_TYPE_INSTANCE_GET_PRIVATE (authorizer, GDATA_TYPE_GOA_AUTHORIZER, GDataGoaAuthorizerPrivate); + authorizer->priv->authorization_domains = authorization_domains; +} + +/** + * gdata_goa_authorizer_new: + * @goa_object: (transfer none): the GOA account providing authentication + * + * Create a new #GDataGoaAuthorizer using the authentication token from the given @goa_object. + * + * Return value: (transfer full): a new #GDataGoaAuthorizer; unref with g_object_unref() + * + * Since: 0.13.1 + */ +GDataGoaAuthorizer * +gdata_goa_authorizer_new (GoaObject *goa_object) +{ + g_return_val_if_fail (GOA_IS_OBJECT (goa_object), NULL); + + return g_object_new (GDATA_TYPE_GOA_AUTHORIZER, "goa-object", goa_object, NULL); +} + +/** + * gdata_goa_authorizer_get_goa_object: + * @self: a #GDataGoaAuthorizer + * + * The GOA account providing authentication. This is the same as #GDataGoaAuthorizer:goa-object. + * + * Return value: (transfer none): the GOA account providing authentication + * + * Since: 0.13.1 + */ +GoaObject * +gdata_goa_authorizer_get_goa_object (GDataGoaAuthorizer *self) +{ + g_return_val_if_fail (GDATA_IS_GOA_AUTHORIZER (self), NULL); + + return self->priv->goa_object; +} diff --git a/gdata/gdata-goa-authorizer.h b/gdata/gdata-goa-authorizer.h new file mode 100644 index 0000000..df9e7f6 --- /dev/null +++ b/gdata/gdata-goa-authorizer.h @@ -0,0 +1,77 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Matthew Barnes 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GOA_AUTHORIZER_H +#define GDATA_GOA_AUTHORIZER_H + +#include +#include + +#define GOA_API_IS_SUBJECT_TO_CHANGE +#include + +/* Standard GObject macros */ +#define GDATA_TYPE_GOA_AUTHORIZER (gdata_goa_authorizer_get_type ()) +#define GDATA_GOA_AUTHORIZER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDATA_TYPE_GOA_AUTHORIZER, GDataGoaAuthorizer)) +#define GDATA_GOA_AUTHORIZER_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST ((cls), GDATA_TYPE_GOA_AUTHORIZER, GDataGoaAuthorizerClass)) +#define GDATA_IS_GOA_AUTHORIZER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDATA_TYPE_GOA_AUTHORIZER)) +#define GDATA_IS_GOA_AUTHORIZER_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE ((cls), GDATA_TYPE_GOA_AUTHORIZER)) +#define GDATA_GOA_AUTHORIZER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDATA_TYPE_GOA_AUTHORIZER, GDataGoaAuthorizerClass)) + +G_BEGIN_DECLS + +typedef struct _GDataGoaAuthorizerPrivate GDataGoaAuthorizerPrivate; + +/** + * GDataGoaAuthorizer: + * + * All the fields in the #GDataGoaAuthorizer structure are private and should never be accessed directly. + * + * Since: 0.13.1 + */ +typedef struct { + /*< private >*/ + GObject parent; + GDataGoaAuthorizerPrivate *priv; +} GDataGoaAuthorizer; + +/** + * GDataGoaAuthorizerClass: + * + * All the fields in the #GDataGoaAuthorizerClass structure are private and should never be accessed directly. + * + * Since: 0.13.1 + */ +typedef struct { + /*< private >*/ + GObjectClass parent_class; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGoaAuthorizerClass; + +GType gdata_goa_authorizer_get_type (void) G_GNUC_CONST; +GDataGoaAuthorizer *gdata_goa_authorizer_new (GoaObject *goa_object) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GoaObject *gdata_goa_authorizer_get_goa_object (GDataGoaAuthorizer *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* GDATA_GOA_AUTHORIZER_H */ diff --git a/gdata/gdata-goa.symbols b/gdata/gdata-goa.symbols new file mode 100644 index 0000000..f870ec1 --- /dev/null +++ b/gdata/gdata-goa.symbols @@ -0,0 +1,3 @@ +gdata_goa_authorizer_get_type +gdata_goa_authorizer_new +gdata_goa_authorizer_get_goa_object diff --git a/gdata/gdata-marshal.c b/gdata/gdata-marshal.c new file mode 100644 index 0000000..a992ac4 --- /dev/null +++ b/gdata/gdata-marshal.c @@ -0,0 +1,151 @@ + +#ifndef __gdata_marshal_MARSHAL_H__ +#define __gdata_marshal_MARSHAL_H__ + +#include + +G_BEGIN_DECLS + +#ifdef G_ENABLE_DEBUG +#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) +#define g_marshal_value_peek_char(v) g_value_get_schar (v) +#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) +#define g_marshal_value_peek_int(v) g_value_get_int (v) +#define g_marshal_value_peek_uint(v) g_value_get_uint (v) +#define g_marshal_value_peek_long(v) g_value_get_long (v) +#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) +#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) +#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) +#define g_marshal_value_peek_enum(v) g_value_get_enum (v) +#define g_marshal_value_peek_flags(v) g_value_get_flags (v) +#define g_marshal_value_peek_float(v) g_value_get_float (v) +#define g_marshal_value_peek_double(v) g_value_get_double (v) +#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) +#define g_marshal_value_peek_param(v) g_value_get_param (v) +#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) +#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) +#define g_marshal_value_peek_object(v) g_value_get_object (v) +#define g_marshal_value_peek_variant(v) g_value_get_variant (v) +#else /* !G_ENABLE_DEBUG */ +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. + * Do not access GValues directly in your code. Instead, use the + * g_value_get_*() functions + */ +#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int +#define g_marshal_value_peek_char(v) (v)->data[0].v_int +#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint +#define g_marshal_value_peek_int(v) (v)->data[0].v_int +#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint +#define g_marshal_value_peek_long(v) (v)->data[0].v_long +#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 +#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 +#define g_marshal_value_peek_enum(v) (v)->data[0].v_long +#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_float(v) (v)->data[0].v_float +#define g_marshal_value_peek_double(v) (v)->data[0].v_double +#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer +#endif /* !G_ENABLE_DEBUG */ + + +/* VOID:OBJECT,OBJECT,POINTER (/opt/gnome/source/libgdata/gdata/gdata-marshal.list:1) */ +extern void gdata_marshal_VOID__OBJECT_OBJECT_POINTER (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); +void +gdata_marshal_VOID__OBJECT_OBJECT_POINTER (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT_POINTER) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer arg_3, + gpointer data2); + GMarshalFunc_VOID__OBJECT_OBJECT_POINTER callback; + GCClosure *cc = (GCClosure*) closure; + gpointer data1, data2; + + g_return_if_fail (n_param_values == 4); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__OBJECT_OBJECT_POINTER) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_object (param_values + 1), + g_marshal_value_peek_object (param_values + 2), + g_marshal_value_peek_pointer (param_values + 3), + data2); +} + +/* STRING:OBJECT,STRING (/opt/gnome/source/libgdata/gdata/gdata-marshal.list:2) */ +extern void gdata_marshal_STRING__OBJECT_STRING (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); +void +gdata_marshal_STRING__OBJECT_STRING (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gchar* (*GMarshalFunc_STRING__OBJECT_STRING) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer data2); + GMarshalFunc_STRING__OBJECT_STRING callback; + GCClosure *cc = (GCClosure*) closure; + gpointer data1, data2; + gchar* v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_STRING__OBJECT_STRING) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + g_marshal_value_peek_object (param_values + 1), + g_marshal_value_peek_string (param_values + 2), + data2); + + g_value_take_string (return_value, v_return); +} + +G_END_DECLS + +#endif /* __gdata_marshal_MARSHAL_H__ */ + diff --git a/gdata/gdata-marshal.h b/gdata/gdata-marshal.h new file mode 100644 index 0000000..6498694 --- /dev/null +++ b/gdata/gdata-marshal.h @@ -0,0 +1,28 @@ + +#ifndef __gdata_marshal_MARSHAL_H__ +#define __gdata_marshal_MARSHAL_H__ + +#include + +G_BEGIN_DECLS + +/* VOID:OBJECT,OBJECT,POINTER (/opt/gnome/source/libgdata/gdata/gdata-marshal.list:1) */ +extern void gdata_marshal_VOID__OBJECT_OBJECT_POINTER (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* STRING:OBJECT,STRING (/opt/gnome/source/libgdata/gdata/gdata-marshal.list:2) */ +extern void gdata_marshal_STRING__OBJECT_STRING (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +G_END_DECLS + +#endif /* __gdata_marshal_MARSHAL_H__ */ + diff --git a/gdata/gdata-marshal.list b/gdata/gdata-marshal.list new file mode 100644 index 0000000..a8d5b2a --- /dev/null +++ b/gdata/gdata-marshal.list @@ -0,0 +1,2 @@ +VOID:OBJECT,OBJECT,POINTER +STRING:OBJECT,STRING diff --git a/gdata/gdata-oauth1-authorizer.c b/gdata/gdata-oauth1-authorizer.c new file mode 100644 index 0000000..46c5837 --- /dev/null +++ b/gdata/gdata-oauth1-authorizer.c @@ -0,0 +1,1468 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-oauth1-authorizer + * @short_description: GData OAuth 1.0 authorization interface + * @stability: Stable + * @include: gdata/gdata-oauth1-authorizer.h + * + * #GDataOAuth1Authorizer provides an implementation of the #GDataAuthorizer interface for authentication and authorization using the + * OAuth 1.0 process, + * which was preferred by Google until OAuth 2.0 was released — it is now + * preferred to use #GDataOAuth2Authorizer. + * + * OAuth 1.0 replaces the deprecated ClientLogin process. One of the main reasons for this is to allow two-factor authentication to be supported, by + * moving the authentication interface to a web page under Google's control. + * + * The OAuth 1.0 process as implemented by Google follows the OAuth 1.0 protocol as + * specified by IETF in RFC 5849, with a few additions to support scopes (implemented in libgdata by #GDataAuthorizationDomains), + * locales and custom domains. Briefly, the process is initiated by requesting an authenticated request token from the Google accounts service + * (using gdata_oauth1_authorizer_request_authentication_uri()), going to the authentication URI for the request token, authenticating and authorizing + * access to the desired scopes, then providing the verifier returned by Google to the Google accounts service again (using + * gdata_oauth1_authorizer_request_authorization()) to authorize the token. This results in an access token which is attached to all future requests + * to the online service. + * + * While Google supports unregistered and registered modes for OAuth 1.0 authorization, it only supports unregistered mode for installed applications. + * Consequently, libgdata also only supports unregistered mode. For this purpose, the application name to be presented to the user on the + * authentication page at the URI returned by gdata_oauth1_authorizer_request_authentication_uri() can be specified when constructing the + * #GDataOAuth1Authorizer. + * + * As described, each authentication/authorization operation is in two parts: gdata_oauth1_authorizer_request_authentication_uri() and + * gdata_oauth1_authorizer_request_authorization(). #GDataOAuth1Authorizer stores no state about ongoing authentication operations (i.e. ones which + * have successfully called gdata_oauth1_authorizer_request_authentication_uri(), but are yet to successfully call + * gdata_oauth1_authorizer_request_authorization()). Consequently, operations can be abandoned before calling + * gdata_oauth1_authorizer_request_authorization() without problems. The only state necessary between the calls is the request token and request token + * secret, as returned by gdata_oauth1_authorizer_request_authentication_uri() and taken as parameters to + * gdata_oauth1_authorizer_request_authorization(). + * + * #GDataOAuth1Authorizer natively supports authorization against multiple services in a single authorization request (unlike + * #GDataClientLoginAuthorizer). + * + * Each access token is long lived, so reauthorization is rarely necessary with #GDataOAuth1Authorizer. Consequently, refreshing authorization using + * gdata_authorizer_refresh_authorization() is not supported by #GDataOAuth1Authorizer, and will immediately return %FALSE with no error set. + * + * + * Authenticating Asynchronously Using OAuth 1.0 + * + * GDataSomeService *service; + * GDataOAuth1Authorizer *authorizer; + * + * /* Create an authorizer and authenticate and authorize the service we're using, asynchronously. */ + * authorizer = gdata_oauth1_authorizer_new (_("My libgdata application"), GDATA_TYPE_SOME_SERVICE); + * gdata_oauth1_authorizer_request_authentication_uri_async (authorizer, cancellable, + * (GAsyncReadyCallback) request_authentication_uri_cb, user_data); + * + * /* Create a service object and link it with the authorizer */ + * service = gdata_some_service_new (GDATA_AUTHORIZER (authorizer)); + * + * static void + * request_authentication_uri_cb (GDataOAuth1Authorizer *authorizer, GAsyncResult *async_result, gpointer user_data) + * { + * gchar *authentication_uri, *token, *token_secret, *verifier; + * GError *error = NULL; + * + * authentication_uri = gdata_oauth1_authorizer_request_authentication_uri_finish (authorizer, async_result, &token, &token_secret, + * &error); + * + * if (error != NULL) { + * /* Notify the user of all errors except cancellation errors */ + * if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + * g_error ("Requesting a token failed: %s", error->message); + * } + * + * g_error_free (error); + * goto finish; + * } + * + * /* (Present the page at the authentication URI to the user, either in an embedded or stand-alone web browser, and + * * ask them to grant access to the application and return the verifier Google gives them.) */ + * verifier = ask_user_for_verifier (authentication_uri); + * + * gdata_oauth1_authorizer_request_authorization_async (authorizer, token, token_secret, verifier, cancellable, + * (GAsyncReadyCallback) request_authorization_cb, user_data); + * + * finish: + * g_free (verifier); + * g_free (authentication_uri); + * g_free (token); + * + * /* Zero out the secret before freeing. */ + * if (token_secret != NULL) { + * memset (token_secret, 0, strlen (token_secret)); + * } + * + * g_free (token_secret); + * } + * + * static void + * request_authorization_cb (GDataOAuth1Authorizer *authorizer, GAsyncResult *async_result, gpointer user_data) + * { + * GError *error = NULL; + * + * if (gdata_oauth1_authorizer_request_authorization_finish (authorizer, async_result, &error) == FALSE) { + * /* Notify the user of all errors except cancellation errors */ + * if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + * g_error ("Authorization failed: %s", error->message); + * } + * + * g_error_free (error); + * return; + * } + * + * /* (The client is now authenticated and authorized against the service. + * * It can now proceed to execute queries on the service object which require the user to be authenticated.) */ + * } + * + * g_object_unref (service); + * g_object_unref (authorizer); + * + * + * + * Since: 0.9.0 + */ + +#include +#include +#include +#include +#include + +#include "gdata-oauth1-authorizer.h" +#include "gdata-private.h" + +#define HMAC_SHA1_LEN 20 /* bytes, raw */ + +static void authorizer_init (GDataAuthorizerInterface *iface); +static void dispose (GObject *object); +static void finalize (GObject *object); +static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); + +static void process_request (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message); +static gboolean is_authorized_for_domain (GDataAuthorizer *self, GDataAuthorizationDomain *domain); + +static void sign_message (GDataOAuth1Authorizer *self, SoupMessage *message, const gchar *token, const gchar *token_secret, GHashTable *parameters); + +static void notify_proxy_uri_cb (GObject *object, GParamSpec *pspec, GDataOAuth1Authorizer *self); +static void notify_timeout_cb (GObject *gobject, GParamSpec *pspec, GObject *self); + +static SoupURI *_get_proxy_uri (GDataOAuth1Authorizer *self); +static void _set_proxy_uri (GDataOAuth1Authorizer *self, SoupURI *proxy_uri); + +struct _GDataOAuth1AuthorizerPrivate { + SoupSession *session; + SoupURI *proxy_uri; /* cached version only set if gdata_oauth1_authorizer_get_proxy_uri() is called */ + GProxyResolver *proxy_resolver; + + gchar *application_name; + gchar *locale; + + GMutex mutex; /* mutex for token, token_secret and authorization_domains */ + + /* Note: This is the access token, not the request token returned by gdata_oauth1_authorizer_request_authentication_uri(). + * It's NULL iff the authorizer isn't authenticated. token_secret must be NULL iff token is NULL. */ + gchar *token; + GDataSecureString token_secret; /* must be allocated by _gdata_service_secure_strdup() */ + + /* Mapping from GDataAuthorizationDomain to itself; a set of domains for which ->access_token is valid. */ + GHashTable *authorization_domains; +}; + +enum { + PROP_APPLICATION_NAME = 1, + PROP_LOCALE, + PROP_PROXY_URI, + PROP_TIMEOUT, + PROP_PROXY_RESOLVER, +}; + +G_DEFINE_TYPE_WITH_CODE (GDataOAuth1Authorizer, gdata_oauth1_authorizer, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_AUTHORIZER, authorizer_init)) + +static void +gdata_oauth1_authorizer_class_init (GDataOAuth1AuthorizerClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataOAuth1AuthorizerPrivate)); + + gobject_class->get_property = get_property; + gobject_class->set_property = set_property; + gobject_class->dispose = dispose; + gobject_class->finalize = finalize; + + /** + * GDataOAuth1Authorizer:application-name: + * + * The human-readable, translated application name for the client, to be presented to the user on the authentication page at the URI + * returned by gdata_oauth1_authorizer_request_authentication_uri(). + * + * If %NULL is provided in the constructor to #GDataOAuth1Authorizer, the value returned by g_get_application_name() will be used as a + * fallback. Note that this may also be %NULL: in this case, the authentication page will use the application name “anonymous”. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_APPLICATION_NAME, + g_param_spec_string ("application-name", + "Application name", "The human-readable, translated application name for the client.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth1Authorizer:locale: + * + * The locale to use for network requests, in Unix locale format. (e.g. "en_GB", "cs", "de_DE".) Use %NULL for the default "C" locale + * (typically "en_US"). + * + * This locale will be used by the server-side software to localise the authentication and authorization pages at the URI returned by + * gdata_oauth1_authorizer_request_authentication_uri(). + * + * The server-side behaviour is undefined if it doesn't support a given locale. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_LOCALE, + g_param_spec_string ("locale", + "Locale", "The locale to use for network requests, in Unix locale format.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth1Authorizer:proxy-uri: + * + * The proxy URI used internally for all network requests. + * + * Since: 0.9.0 + * Deprecated: 0.15.0: Use #GDataClientLoginAuthorizer:proxy-resolver instead, which gives more flexibility over the proxy used. + */ + g_object_class_install_property (gobject_class, PROP_PROXY_URI, + g_param_spec_boxed ("proxy-uri", + "Proxy URI", "The proxy URI used internally for all network requests.", + SOUP_TYPE_URI, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth1Authorizer:timeout: + * + * A timeout, in seconds, for network operations. If the timeout is exceeded, the operation will be cancelled and + * %GDATA_SERVICE_ERROR_NETWORK_ERROR will be returned. + * + * If the timeout is 0, operations will never time out. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_TIMEOUT, + g_param_spec_uint ("timeout", + "Timeout", "A timeout, in seconds, for network operations.", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth1Authorizer:proxy-resolver: + * + * The #GProxyResolver used to determine a proxy URI. Setting this will clear the #GDataOAuth1Authorizer:proxy-uri property. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_PROXY_RESOLVER, + g_param_spec_object ("proxy-resolver", + "Proxy Resolver", "A GProxyResolver used to determine a proxy URI.", + G_TYPE_PROXY_RESOLVER, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +authorizer_init (GDataAuthorizerInterface *iface) +{ + iface->process_request = process_request; + iface->is_authorized_for_domain = is_authorized_for_domain; +} + +static void +gdata_oauth1_authorizer_init (GDataOAuth1Authorizer *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_OAUTH1_AUTHORIZER, GDataOAuth1AuthorizerPrivate); + + /* Set up the authorizer's mutex */ + g_mutex_init (&(self->priv->mutex)); + self->priv->authorization_domains = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL); + + /* Set up the session */ + self->priv->session = _gdata_service_build_session (); + + /* Proxy the SoupSession's proxy-uri and timeout properties */ + g_signal_connect (self->priv->session, "notify::proxy-uri", (GCallback) notify_proxy_uri_cb, self); + g_signal_connect (self->priv->session, "notify::timeout", (GCallback) notify_timeout_cb, self); + + /* Keep our GProxyResolver synchronized with SoupSession's. */ + g_object_bind_property (self->priv->session, "proxy-resolver", self, "proxy-resolver", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); +} + +static void +dispose (GObject *object) +{ + GDataOAuth1AuthorizerPrivate *priv = GDATA_OAUTH1_AUTHORIZER (object)->priv; + + if (priv->session != NULL) + g_object_unref (priv->session); + priv->session = NULL; + + g_clear_object (&priv->proxy_resolver); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_oauth1_authorizer_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + GDataOAuth1AuthorizerPrivate *priv = GDATA_OAUTH1_AUTHORIZER (object)->priv; + + g_free (priv->application_name); + g_free (priv->locale); + + g_hash_table_destroy (priv->authorization_domains); + g_mutex_clear (&(priv->mutex)); + + if (priv->proxy_uri != NULL) { + soup_uri_free (priv->proxy_uri); + } + + g_free (priv->token); + _gdata_service_secure_strfree (priv->token_secret); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_oauth1_authorizer_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataOAuth1AuthorizerPrivate *priv = GDATA_OAUTH1_AUTHORIZER (object)->priv; + + switch (property_id) { + case PROP_APPLICATION_NAME: + g_value_set_string (value, priv->application_name); + break; + case PROP_LOCALE: + g_value_set_string (value, priv->locale); + break; + case PROP_PROXY_URI: + g_value_set_boxed (value, _get_proxy_uri (GDATA_OAUTH1_AUTHORIZER (object))); + break; + case PROP_TIMEOUT: + g_value_set_uint (value, gdata_oauth1_authorizer_get_timeout (GDATA_OAUTH1_AUTHORIZER (object))); + break; + case PROP_PROXY_RESOLVER: + g_value_set_object (value, gdata_oauth1_authorizer_get_proxy_resolver (GDATA_OAUTH1_AUTHORIZER (object))); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataOAuth1AuthorizerPrivate *priv = GDATA_OAUTH1_AUTHORIZER (object)->priv; + + switch (property_id) { + /* Construct only */ + case PROP_APPLICATION_NAME: + priv->application_name = g_value_dup_string (value); + + /* Default to the value of g_get_application_name() */ + if (priv->application_name == NULL || *(priv->application_name) == '\0') { + g_free (priv->application_name); + priv->application_name = g_strdup (g_get_application_name ()); + } + + break; + case PROP_LOCALE: + gdata_oauth1_authorizer_set_locale (GDATA_OAUTH1_AUTHORIZER (object), g_value_get_string (value)); + break; + case PROP_PROXY_URI: + _set_proxy_uri (GDATA_OAUTH1_AUTHORIZER (object), g_value_get_boxed (value)); + break; + case PROP_TIMEOUT: + gdata_oauth1_authorizer_set_timeout (GDATA_OAUTH1_AUTHORIZER (object), g_value_get_uint (value)); + break; + case PROP_PROXY_RESOLVER: + gdata_oauth1_authorizer_set_proxy_resolver (GDATA_OAUTH1_AUTHORIZER (object), g_value_get_object (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +process_request (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message) +{ + GDataOAuth1AuthorizerPrivate *priv = GDATA_OAUTH1_AUTHORIZER (self)->priv; + + /* Set the authorisation header */ + g_mutex_lock (&(priv->mutex)); + + /* Sanity check */ + g_assert ((priv->token == NULL) == (priv->token_secret == NULL)); + + if (priv->token != NULL && g_hash_table_lookup (priv->authorization_domains, domain) != NULL) { + sign_message (GDATA_OAUTH1_AUTHORIZER (self), message, priv->token, priv->token_secret, NULL); + } + + g_mutex_unlock (&(priv->mutex)); +} + +static gboolean +is_authorized_for_domain (GDataAuthorizer *self, GDataAuthorizationDomain *domain) +{ + GDataOAuth1AuthorizerPrivate *priv = GDATA_OAUTH1_AUTHORIZER (self)->priv; + gpointer result; + const gchar *token; + + g_mutex_lock (&(priv->mutex)); + token = priv->token; + result = g_hash_table_lookup (priv->authorization_domains, domain); + g_mutex_unlock (&(priv->mutex)); + + /* Sanity check */ + g_assert (result == NULL || result == domain); + + return (token != NULL && result != NULL) ? TRUE : FALSE; +} + +/* Sign the message and add the Authorization header to it containing the signature. + * NOTE: This must not lock priv->mutex, as it's called from within a critical section in process_request() and priv->mutex isn't recursive. */ +static void +sign_message (GDataOAuth1Authorizer *self, SoupMessage *message, const gchar *token, const gchar *token_secret, GHashTable *parameters) +{ + GHashTableIter iter; + const gchar *key, *value, *consumer_key, *consumer_secret, *signature_method; + gsize params_length = 0; + GList *sorted_params = NULL, *i; + GString *query_string, *signature_base_string, *secret_string, *authorization_header; + SoupURI *normalised_uri; + gchar *uri, *signature, *timestamp; + char *nonce; + gboolean is_first = TRUE; + GTimeVal time_val; + guchar signature_buf[HMAC_SHA1_LEN]; + gsize signature_buf_len; + GHmac *signature_hmac; + + g_return_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self)); + g_return_if_fail (SOUP_IS_MESSAGE (message)); + g_return_if_fail (token == NULL || *token != '\0'); + g_return_if_fail (token_secret == NULL || *token_secret != '\0'); + g_return_if_fail ((token == NULL) == (token_secret == NULL)); + + /* Build and return a HMAC-SHA1 signature for the given SoupMessage. We always use HMAC-SHA1, since installed applications have to be + * unregistered (see: http://code.google.com/apis/accounts/docs/OAuth_ref.html#SigningOAuth). + * Reference: http://tools.ietf.org/html/rfc5849#section-3.4 */ + signature_method = "HMAC-SHA1"; + + /* As described here, we use an anonymous consumer key and secret, since we're designed for installed applications: + * http://code.google.com/apis/accounts/docs/OAuth_ref.html#SigningOAuth */ + consumer_key = "anonymous"; + consumer_secret = "anonymous"; + + /* Add various standard parameters to the list (note: this modifies the hash table belonging to the caller) */ + nonce = oauth_gen_nonce (); + g_get_current_time (&time_val); + timestamp = g_strdup_printf ("%li", time_val.tv_sec); + + if (parameters == NULL) { + parameters = g_hash_table_new (g_str_hash, g_str_equal); + } else { + g_hash_table_ref (parameters); + } + + g_hash_table_insert (parameters, (gpointer) "oauth_signature_method", (gpointer) signature_method); + g_hash_table_insert (parameters, (gpointer) "oauth_consumer_key", (gpointer) consumer_key); + g_hash_table_insert (parameters, (gpointer) "oauth_nonce", nonce); + g_hash_table_insert (parameters, (gpointer) "oauth_timestamp", timestamp); + g_hash_table_insert (parameters, (gpointer) "oauth_version", (gpointer) "1.0"); + + /* Only add the token if it's been provided */ + if (token != NULL) { + g_hash_table_insert (parameters, (gpointer) "oauth_token", (gpointer) token); + } + + /* Sort the parameters and build a query string, as defined here: http://tools.ietf.org/html/rfc5849#section-3.4.1.3 */ + g_hash_table_iter_init (&iter, parameters); + + while (g_hash_table_iter_next (&iter, (gpointer*) &key, (gpointer*) &value) == TRUE) { + GString *pair = g_string_new (NULL); + + g_string_append_uri_escaped (pair, key, NULL, FALSE); + g_string_append_c (pair, '='); + g_string_append_uri_escaped (pair, value, NULL, FALSE); + + /* Append the pair to the list for sorting, and keep track of the total length of the strings in the list so far */ + params_length += pair->len + 1 /* sep */; + sorted_params = g_list_prepend (sorted_params, g_string_free (pair, FALSE)); + } + + g_hash_table_unref (parameters); + + sorted_params = g_list_sort (sorted_params, (GCompareFunc) g_strcmp0); + + /* Concatenate the parameters to give the query string */ + query_string = g_string_sized_new (params_length); + + for (i = sorted_params; i != NULL; i = i->next) { + if (is_first == FALSE) { + g_string_append_c (query_string, '&'); + } + + g_string_append (query_string, i->data); + + g_free (i->data); + is_first = FALSE; + } + + g_list_free (sorted_params); + + /* Normalise the URI as described here: http://tools.ietf.org/html/rfc5849#section-3.4.1.2 */ + normalised_uri = soup_uri_copy (soup_message_get_uri (message)); + soup_uri_set_query (normalised_uri, NULL); + soup_uri_set_fragment (normalised_uri, NULL); + + /* Append it to the signature base string */ + uri = soup_uri_to_string (normalised_uri, FALSE); + + /* Start building the signature base string as described here: http://tools.ietf.org/html/rfc5849#section-3.4.1.1 */ + signature_base_string = g_string_sized_new (4 /* method */ + 1 /* sep */ + strlen (uri) + 1 /* sep */ + params_length /* query string */); + g_string_append_uri_escaped (signature_base_string, message->method, NULL, FALSE); + g_string_append_c (signature_base_string, '&'); + g_string_append_uri_escaped (signature_base_string, uri, NULL, FALSE); + g_string_append_c (signature_base_string, '&'); + g_string_append_uri_escaped (signature_base_string, query_string->str, NULL, FALSE); + + g_free (uri); + soup_uri_free (normalised_uri); + g_string_free (query_string, TRUE); + + /* Build the secret key to use in the HMAC */ + secret_string = g_string_new (NULL); + g_string_append_uri_escaped (secret_string, consumer_secret, NULL, FALSE); + g_string_append_c (secret_string, '&'); + + /* Only add token_secret if it was provided */ + if (token_secret != NULL) { + g_string_append_uri_escaped (secret_string, token_secret, NULL, FALSE); + } + + /* Create the signature as described here: http://tools.ietf.org/html/rfc5849#section-3.4.2 */ + signature_hmac = g_hmac_new (G_CHECKSUM_SHA1, (const guchar*) secret_string->str, secret_string->len); + g_hmac_update (signature_hmac, (const guchar*) signature_base_string->str, signature_base_string->len); + + signature_buf_len = G_N_ELEMENTS (signature_buf); + g_hmac_get_digest (signature_hmac, signature_buf, &signature_buf_len); + + g_hmac_unref (signature_hmac); + + signature = g_base64_encode (signature_buf, signature_buf_len); + + /*g_debug ("Signing message using Signature Base String: “%s” and key “%s” using method “%s” to give signature: “%s”.", + signature_base_string->str, secret_string->str, signature_method, signature);*/ + + /* Zero out the secret_string before freeing it, to reduce the chance of secrets hitting disk. */ + memset (secret_string->str, 0, secret_string->allocated_len); + + g_string_free (secret_string, TRUE); + g_string_free (signature_base_string, TRUE); + + /* Build the Authorization header and append it to the message */ + authorization_header = g_string_new ("OAuth oauth_consumer_key=\""); + g_string_append_uri_escaped (authorization_header, consumer_key, NULL, FALSE); + + /* Only add the token if it's been provided */ + if (token != NULL) { + g_string_append (authorization_header, "\",oauth_token=\""); + g_string_append_uri_escaped (authorization_header, token, NULL, FALSE); + } + + g_string_append (authorization_header, "\",oauth_signature_method=\""); + g_string_append_uri_escaped (authorization_header, signature_method, NULL, FALSE); + g_string_append (authorization_header, "\",oauth_signature=\""); + g_string_append_uri_escaped (authorization_header, signature, NULL, FALSE); + g_string_append (authorization_header, "\",oauth_timestamp=\""); + g_string_append_uri_escaped (authorization_header, timestamp, NULL, FALSE); + g_string_append (authorization_header, "\",oauth_nonce=\""); + g_string_append_uri_escaped (authorization_header, nonce, NULL, FALSE); + g_string_append (authorization_header, "\",oauth_version=\"1.0\""); + + soup_message_headers_replace (message->request_headers, "Authorization", authorization_header->str); + + g_string_free (authorization_header, TRUE); + free (signature); + g_free (timestamp); + free (nonce); +} + +/** + * gdata_oauth1_authorizer_new: + * @application_name: (allow-none): a human-readable, translated application name to use on authentication pages, or %NULL + * @service_type: the #GType of a #GDataService subclass which the #GDataOAuth1Authorizer will be used with + * + * Creates a new #GDataOAuth1Authorizer. + * + * The #GDataAuthorizationDomains for the given @service_type (i.e. as returned by gdata_service_get_authorization_domains()) are the ones the + * user will be requested to authorize access to on the page at the URI returned by gdata_oauth1_authorizer_request_authentication_uri(). + * + * The given @application_name will set the value of #GDataOAuth1Authorizer:application-name and will be displayed to the user on authentication pages + * returned by Google. If %NULL is provided, the value of g_get_application_name() will be used as a fallback. + * + * Return value: (transfer full): a new #GDataOAuth1Authorizer; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataOAuth1Authorizer * +gdata_oauth1_authorizer_new (const gchar *application_name, GType service_type) +{ + g_return_val_if_fail (g_type_is_a (service_type, GDATA_TYPE_SERVICE), NULL); + + return gdata_oauth1_authorizer_new_for_authorization_domains (application_name, gdata_service_get_authorization_domains (service_type)); +} + +/** + * gdata_oauth1_authorizer_new_for_authorization_domains: + * @application_name: (allow-none): a human-readable, translated application name to use on authentication pages, or %NULL + * @authorization_domains: (element-type GDataAuthorizationDomain) (transfer none): a non-empty list of #GDataAuthorizationDomains to be + * authorized against by the #GDataOAuth1Authorizer + * + * Creates a new #GDataOAuth1Authorizer. This function is intended to be used only when the default authorization domain list for a single + * #GDataService, as used by gdata_oauth1_authorizer_new(), isn't suitable. For example, this could be because the #GDataOAuth1Authorizer will be used + * with multiple #GDataService subclasses, or because the client requires a specific set of authorization domains. + * + * The specified #GDataAuthorizationDomains are the ones the user will be requested to authorize access to on the page at the URI returned by + * gdata_oauth1_authorizer_request_authentication_uri(). + * + * The given @application_name will set the value of #GDataOAuth1Authorizer:application-name and will be displayed to the user on authentication pages + * returned by Google. If %NULL is provided, the value of g_get_application_name() will be used as a fallback. + * + * Return value: (transfer full): a new #GDataOAuth1Authorizer; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataOAuth1Authorizer * +gdata_oauth1_authorizer_new_for_authorization_domains (const gchar *application_name, GList *authorization_domains) +{ + GList *i; + GDataOAuth1Authorizer *authorizer; + + g_return_val_if_fail (authorization_domains != NULL, NULL); + + authorizer = GDATA_OAUTH1_AUTHORIZER (g_object_new (GDATA_TYPE_OAUTH1_AUTHORIZER, + "application-name", application_name, + NULL)); + + /* Register all the domains with the authorizer */ + for (i = authorization_domains; i != NULL; i = i->next) { + g_return_val_if_fail (GDATA_IS_AUTHORIZATION_DOMAIN (i->data), NULL); + + /* We don't have to lock the authoriser's mutex here as no other code has seen the authoriser yet */ + g_hash_table_insert (authorizer->priv->authorization_domains, g_object_ref (GDATA_AUTHORIZATION_DOMAIN (i->data)), i->data); + } + + return authorizer; +} + +/** + * gdata_oauth1_authorizer_request_authentication_uri: + * @self: a #GDataOAuth1Authorizer + * @token: (out callee-allocates): return location for the temporary credentials token returned by the authentication service; free with g_free() + * @token_secret: (out callee-allocates): return location for the temporary credentials token secret returned by the authentication service; free with + * g_free() + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Requests a fresh unauthenticated token from the Google accounts service and builds and returns the URI of an authentication page for that token. + * This should then be presented to the user (e.g. in an embedded or stand alone web browser). The authentication page will ask the user to log in + * using their Google account, then ask them to grant access to the #GDataAuthorizationDomains passed to the constructor of the + * #GDataOAuth1Authorizer. If the user grants access, they will be given a verifier, which can then be passed to + * gdata_oauth1_authorizer_request_authorization() (along with the @token and @token_secret values returned by this method) to authorize the token. + * + * This method can fail if the server returns an error, but this is unlikely. If it does happen, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be + * raised, @token and @token_secret will be set to %NULL and %NULL will be returned. + * + * This method implements Section 2.1 and + * Section 2.2 of the + * OAuth 1.0 protocol. + * + * When freeing @token_secret, it's advisable to set it to all zeros first, to reduce the chance of the sensitive token being recoverable from the + * free memory pool and (accidentally) leaked by a different part of the process. This can be achieved with the following code: + * |[ + * if (token_secret != NULL) { + * memset (token_secret, 0, strlen (token_secret)); + * g_free (token_secret); + * } + * ]| + * + * Return value: (transfer full): the URI of an authentication page for the user to use; free with g_free() + * + * Since: 0.9.0 + */ +gchar * +gdata_oauth1_authorizer_request_authentication_uri (GDataOAuth1Authorizer *self, gchar **token, gchar **token_secret, + GCancellable *cancellable, GError **error) +{ + GDataOAuth1AuthorizerPrivate *priv; + SoupMessage *message; + guint status; + gchar *request_body; + GString *scope_string, *authentication_uri; + GHashTable *parameters; + GHashTableIter iter; + gboolean is_first = TRUE; + GDataAuthorizationDomain *domain; + GHashTable *response_details; + const gchar *callback_uri, *_token, *_token_secret, *callback_confirmed; + SoupURI *_uri; + + g_return_val_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self), NULL); + g_return_val_if_fail (token != NULL, NULL); + g_return_val_if_fail (token_secret != NULL, NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + priv = self->priv; + + /* This implements OAuthGetRequestToken and returns the URI for OAuthAuthorizeToken, which the client must then use themselves (e.g. in an + * embedded web browser) to authorise the temporary credentials token. They then pass the request token and verification code they get back + * from that to gdata_oauth1_authorizer_request_authorization(). */ + + /* We default to out-of-band callbacks */ + callback_uri = "oob"; + + /* Set the output parameters to NULL in case of failure */ + *token = NULL; + *token_secret = NULL; + + /* Build up the space-separated list of scopes we're requesting authorisation for */ + g_mutex_lock (&(priv->mutex)); + + scope_string = g_string_new (NULL); + g_hash_table_iter_init (&iter, priv->authorization_domains); + + while (g_hash_table_iter_next (&iter, (gpointer*) &domain, NULL) == TRUE) { + if (is_first == FALSE) { + /* Delimiter */ + g_string_append_c (scope_string, ' '); + } + + g_string_append (scope_string, gdata_authorization_domain_get_scope (domain)); + + is_first = FALSE; + } + + g_mutex_unlock (&(priv->mutex)); + + /* Build the request body and the set of parameters to be signed */ + parameters = g_hash_table_new (g_str_hash, g_str_equal); + g_hash_table_insert (parameters, (gpointer) "scope", scope_string->str); + g_hash_table_insert (parameters, (gpointer) "xoauth_displayname", priv->application_name); + g_hash_table_insert (parameters, (gpointer) "oauth_callback", (gpointer) callback_uri); + request_body = soup_form_encode_hash (parameters); + + /* Build the message */ + _uri = soup_uri_new ("https://www.google.com/accounts/OAuthGetRequestToken"); + soup_uri_set_port (_uri, _gdata_service_get_https_port ()); + message = soup_message_new_from_uri (SOUP_METHOD_POST, _uri); + soup_uri_free (_uri); + + soup_message_set_request (message, "application/x-www-form-urlencoded", SOUP_MEMORY_TAKE, request_body, strlen (request_body)); + + sign_message (self, message, NULL, NULL, parameters); + + g_hash_table_destroy (parameters); + g_string_free (scope_string, TRUE); + + /* Send the message */ + _gdata_service_actually_send_message (priv->session, message, cancellable, error); + status = message->status_code; + + if (status == SOUP_STATUS_CANCELLED) { + /* Cancelled (the error has already been set) */ + g_object_unref (message); + return NULL; + } else if (status != SOUP_STATUS_OK) { + /* Server returned an error. Not much we can do, since the error codes aren't documented and it shouldn't normally ever happen + * anyway. */ + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server rejected the temporary credentials request.")); + g_object_unref (message); + + return NULL; + } + + g_assert (message->response_body->data != NULL); + + /* Parse the response. We expect something like: + * oauth_token=ab3cd9j4ks73hf7g&oauth_token_secret=ZXhhbXBsZS5jb20&oauth_callback_confirmed=true + * See: http://code.google.com/apis/accounts/docs/OAuth_ref.html#RequestToken and + * http://tools.ietf.org/html/rfc5849#section-2.1 for details. */ + response_details = soup_form_decode (message->response_body->data); + + g_object_unref (message); + + _token = g_hash_table_lookup (response_details, "oauth_token"); + _token_secret = g_hash_table_lookup (response_details, "oauth_token_secret"); + callback_confirmed = g_hash_table_lookup (response_details, "oauth_callback_confirmed"); + + /* Validate the returned values */ + if (_token == NULL || _token_secret == NULL || callback_confirmed == NULL || + *_token == '\0' || *_token_secret == '\0' || + strcmp (callback_confirmed, "true") != 0) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + g_hash_table_destroy (response_details); + + return NULL; + } + + /* Build the authentication URI which the user will then open in a web browser and use to authenticate and authorise our application. + * We expect to build something like this: + * https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=ab3cd9j4ks73hf7g&hd=mycollege.edu&hl=en&btmpl=mobile + * See: http://code.google.com/apis/accounts/docs/OAuth_ref.html#GetAuth for more details. */ + authentication_uri = g_string_new ("https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token="); + g_string_append_uri_escaped (authentication_uri, g_hash_table_lookup (response_details, "oauth_token"), NULL, TRUE); + + if (priv->locale != NULL) { + g_string_append (authentication_uri, "&hl="); + g_string_append_uri_escaped (authentication_uri, priv->locale, NULL, TRUE); + } + + /* Return the token and token secret */ + *token = g_strdup (_token); + *token_secret = g_strdup (_token_secret); /* NOTE: Ideally this would be allocated in non-pageable memory, but changing that would break API */ + + g_hash_table_destroy (response_details); + + return g_string_free (authentication_uri, FALSE); +} + +typedef struct { + /* All return values */ + gchar *token; + gchar *token_secret; /* NOTE: Ideally this would be allocated in non-pageable memory, but changing that would break API */ + gchar *authentication_uri; +} RequestAuthenticationUriAsyncData; + +static void +request_authentication_uri_async_data_free (RequestAuthenticationUriAsyncData *data) +{ + g_free (data->token); + g_free (data->token_secret); + g_free (data->authentication_uri); + + g_slice_free (RequestAuthenticationUriAsyncData, data); +} + +G_DEFINE_AUTOPTR_CLEANUP_FUNC (RequestAuthenticationUriAsyncData, request_authentication_uri_async_data_free) + +static void +request_authentication_uri_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataOAuth1Authorizer *authorizer = GDATA_OAUTH1_AUTHORIZER (source_object); + g_autoptr(RequestAuthenticationUriAsyncData) data = NULL; + g_autoptr(GError) error = NULL; + + data = g_slice_new0 (RequestAuthenticationUriAsyncData); + data->authentication_uri = gdata_oauth1_authorizer_request_authentication_uri (authorizer, &(data->token), &(data->token_secret), + cancellable, &error); + + if (error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&data), (GDestroyNotify) request_authentication_uri_async_data_free); +} + +/** + * gdata_oauth1_authorizer_request_authentication_uri_async: + * @self: a #GDataOAuth1Authorizer + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when building the URI is finished + * @user_data: (closure): data to pass to the @callback function + * + * Requests a fresh unauthenticated token from the Google accounts service and builds and returns the URI of an authentication page for that token. + * @self is reffed when this method is called, so can safely be unreffed after this method returns. + * + * For more details, see gdata_oauth1_authorizer_request_authentication_uri(), which is the synchronous version of this method. + * + * When the operation is finished, @callback will be called. You can then call gdata_oauth1_authorizer_request_authentication_uri_finish() to get the + * results of the operation. + * + * Since: 0.9.0 + */ +void +gdata_oauth1_authorizer_request_authentication_uri_async (GDataOAuth1Authorizer *self, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + + g_return_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_oauth1_authorizer_request_authentication_uri_async); + g_task_run_in_thread (task, request_authentication_uri_thread); +} + +/** + * gdata_oauth1_authorizer_request_authentication_uri_finish: + * @self: a #GDataOAuth1Authorizer + * @async_result: a #GAsyncResult + * @token: (out callee-allocates): return location for the temporary credentials token returned by the authentication service; free with g_free() + * @token_secret: (out callee-allocates): return location for the temporary credentials token secret returned by the authentication service; free with + * g_free() + * @error: a #GError, or %NULL + * + * Finishes an asynchronous authentication URI building operation started with gdata_oauth1_authorizer_request_authentication_uri_async(). + * + * This method can fail if the server has returned an error, but this is unlikely. If it does happen, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be + * raised, @token and @token_secret will be set to %NULL and %NULL will be returned. + * + * When freeing @token_secret, it's advisable to set it to all zeros first, to reduce the chance of the sensitive token being recoverable from the + * free memory pool and (accidentally) leaked by a different part of the process. This can be achieved with the following code: + * |[ + * if (token_secret != NULL) { + * memset (token_secret, 0, strlen (token_secret)); + * g_free (token_secret); + * } + * ]| + * + * Return value: (transfer full): the URI of an authentication page for the user to use; free with g_free() + * + * Since: 0.9.0 + */ +gchar * +gdata_oauth1_authorizer_request_authentication_uri_finish (GDataOAuth1Authorizer *self, GAsyncResult *async_result, gchar **token, + gchar **token_secret, GError **error) +{ + g_autoptr(RequestAuthenticationUriAsyncData) data = NULL; + + g_return_val_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (token != NULL, NULL); + g_return_val_if_fail (token_secret != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_oauth1_authorizer_request_authentication_uri_async), NULL); + + data = g_task_propagate_pointer (G_TASK (async_result), error); + + if (data == NULL) { + /* Return the error and set all of the output parameters to NULL */ + *token = NULL; + *token_secret = NULL; + + return NULL; + } + + /* Success! Transfer the output to the appropriate parameters and nullify it so it doesn't get freed when the async result gets finalised */ + *token = g_steal_pointer (&data->token); + *token_secret = g_steal_pointer (&data->token_secret); + + return g_steal_pointer (&data->authentication_uri); +} + +/** + * gdata_oauth1_authorizer_request_authorization: + * @self: a #GDataOAuth1Authorizer + * @token: the request token returned by gdata_oauth1_authorizer_request_authentication_uri() + * @token_secret: the request token secret returned by gdata_oauth1_authorizer_request_authentication_uri() + * @verifier: the verifier entered by the user from the authentication page + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Requests authorization of the given request @token from the Google accounts service using the given @verifier as entered by the user from the + * authentication page at the URI returned by gdata_oauth1_authorizer_request_authentication_uri(). @token and @token_secret must be the same values + * as were returned by gdata_oauth1_authorizer_request_authentication_uri() if it was successful. + * + * If the verifier is valid (i.e. the user granted access to the application and the Google accounts service has no reason to distrust the client), + * %TRUE will be returned and any operations performed from that point onwards on #GDataServices using this #GDataAuthorizer will be + * authorized. + * + * If the user denies access to the application or the Google accounts service distrusts it, a bogus verifier could be returned. In this case, %FALSE + * will be returned and a %GDATA_SERVICE_ERROR_FORBIDDEN error will be raised. + * + * Note that if the user denies access to the application, it may be the case that they have no verifier to enter. In this case, the client can simply + * not call this method. The #GDataOAuth1Authorizer stores no state for authentication operations which have succeeded in calling + * gdata_oauth1_authorizer_request_authentication_uri() but not yet successfully called gdata_oauth1_authorizer_request_authorization(). + * + * This method implements Section 2.3 of the + * OAuth 1.0 protocol. + * + * Return value: %TRUE if authorization was successful, %FALSE otherwise + * + * Since: 0.9.0 + */ +gboolean +gdata_oauth1_authorizer_request_authorization (GDataOAuth1Authorizer *self, const gchar *token, const gchar *token_secret, const gchar *verifier, + GCancellable *cancellable, GError **error) +{ + GDataOAuth1AuthorizerPrivate *priv; + SoupMessage *message; + guint status; + gchar *request_body; + GHashTable *parameters; + GHashTable *response_details; + const gchar *_token, *_token_secret; + SoupURI *_uri; + + g_return_val_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self), FALSE); + g_return_val_if_fail (token != NULL && *token != '\0', FALSE); + g_return_val_if_fail (token_secret != NULL && *token_secret != '\0', FALSE); + g_return_val_if_fail (verifier != NULL && *verifier != '\0', FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + /* This implements OAuthGetAccessToken using the request token returned by OAuthGetRequestToken and the verification code returned by + * OAuthAuthorizeToken. See: + * • http://code.google.com/apis/accounts/docs/OAuth_ref.html#AccessToken + * • http://tools.ietf.org/html/rfc5849#section-2.3 + */ + + priv = self->priv; + + /* Build the request body and the set of parameters to be signed */ + parameters = g_hash_table_new (g_str_hash, g_str_equal); + g_hash_table_insert (parameters, (gpointer) "oauth_verifier", (gpointer) verifier); + request_body = soup_form_encode_hash (parameters); + + /* Build the message */ + _uri = soup_uri_new ("https://www.google.com/accounts/OAuthGetAccessToken"); + soup_uri_set_port (_uri, _gdata_service_get_https_port ()); + message = soup_message_new_from_uri (SOUP_METHOD_POST, _uri); + soup_uri_free (_uri); + soup_message_set_request (message, "application/x-www-form-urlencoded", SOUP_MEMORY_TAKE, request_body, strlen (request_body)); + + sign_message (self, message, token, token_secret, parameters); + + g_hash_table_destroy (parameters); + + /* Send the message */ + _gdata_service_actually_send_message (priv->session, message, cancellable, error); + status = message->status_code; + + if (status == SOUP_STATUS_CANCELLED) { + /* Cancelled (the error has already been set) */ + g_object_unref (message); + return FALSE; + } else if (status != SOUP_STATUS_OK) { + /* Server returned an error. This either means that there was a server error or, more likely, the server doesn't trust the client + * or the user denied authorization to the token on the authorization web page. */ + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_FORBIDDEN, _("Access was denied by the user or server.")); + g_object_unref (message); + + return FALSE; + } + + g_assert (message->response_body->data != NULL); + + /* Parse the response. We expect something like: + * oauth_token=ab3cd9j4ks73hf7g&oauth_token_secret=ZXhhbXBsZS5jb20&oauth_callback_confirmed=true + * See: http://code.google.com/apis/accounts/docs/OAuth_ref.html#AccessToken and + * http://tools.ietf.org/html/rfc5849#section-2.3 for details. */ + response_details = soup_form_decode (message->response_body->data); + + /* Zero out the response body to lower the chance of it (with all the auth. tokens it contains) hitting disk or getting leaked in + * free memory. */ + memset ((void*) message->response_body->data, 0, message->response_body->length); + + g_object_unref (message); + + _token = g_hash_table_lookup (response_details, "oauth_token"); + _token_secret = g_hash_table_lookup (response_details, "oauth_token_secret"); + + /* Validate the returned values */ + if (_token == NULL || _token_secret == NULL || + *_token == '\0' || *_token_secret == '\0') { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, _("The server returned a malformed response.")); + g_hash_table_destroy (response_details); + + return FALSE; + } + + /* Store the token and token secret in the authoriser */ + g_mutex_lock (&(priv->mutex)); + + g_free (priv->token); + priv->token = g_strdup (_token); + + _gdata_service_secure_strfree (priv->token_secret); + priv->token_secret = _gdata_service_secure_strdup (_token_secret); + + g_mutex_unlock (&(priv->mutex)); + + /* Zero out the secret token before freeing the hash table, to reduce the chance of it hitting disk later. */ + memset ((void*) _token_secret, 0, strlen (_token_secret)); + + g_hash_table_destroy (response_details); + + return TRUE; +} + +typedef struct { + /* Input */ + gchar *token; + GDataSecureString token_secret; /* must be allocated by _gdata_service_secure_strdup() */ + gchar *verifier; +} RequestAuthorizationAsyncData; + +static void +request_authorization_async_data_free (RequestAuthorizationAsyncData *data) +{ + g_free (data->token); + _gdata_service_secure_strfree (data->token_secret); + g_free (data->verifier); + + g_slice_free (RequestAuthorizationAsyncData, data); +} + +static void +request_authorization_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataOAuth1Authorizer *authorizer = GDATA_OAUTH1_AUTHORIZER (source_object); + RequestAuthorizationAsyncData *data = task_data; + g_autoptr(GError) error = NULL; + + if (!gdata_oauth1_authorizer_request_authorization (authorizer, data->token, data->token_secret, data->verifier, cancellable, &error)) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_boolean (task, TRUE); +} + +/** + * gdata_oauth1_authorizer_request_authorization_async: + * @self: a #GDataOAuth1Authorizer + * @token: the request token returned by gdata_oauth1_authorizer_request_authentication_uri() + * @token_secret: the request token secret returned by gdata_oauth1_authorizer_request_authentication_uri() + * @verifier: the verifier entered by the user from the authentication page + * @cancellable: (allow-none): an optional #GCancellable, or %NULL + * @callback: a #GAsyncReadyCallback to call when authorization is finished + * @user_data: (closure): data to pass to the @callback function + * + * Requests authorization of the given request @token from the Google accounts service using the given @verifier as entered by the user. + * @self, @token, @token_secret and @verifier are reffed/copied when this method is called, so can safely be freed after this method returns. + * + * For more details, see gdata_oauth1_authorizer_request_authorization(), which is the synchronous version of this method. + * + * When the operation is finished, @callback will be called. You can then call gdata_oauth1_authorizer_request_authorization_finish() to get the + * results of the operation. + * + * Since: 0.9.0 + */ +void +gdata_oauth1_authorizer_request_authorization_async (GDataOAuth1Authorizer *self, const gchar *token, const gchar *token_secret, + const gchar *verifier, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + RequestAuthorizationAsyncData *data; + + g_return_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self)); + g_return_if_fail (token != NULL && *token != '\0'); + g_return_if_fail (token_secret != NULL && *token_secret != '\0'); + g_return_if_fail (verifier != NULL && *verifier != '\0'); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + data = g_slice_new (RequestAuthorizationAsyncData); + data->token = g_strdup (token); + data->token_secret = _gdata_service_secure_strdup (token_secret); + data->verifier = g_strdup (verifier); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_oauth1_authorizer_request_authorization_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) request_authorization_async_data_free); + g_task_run_in_thread (task, request_authorization_thread); +} + +/** + * gdata_oauth1_authorizer_request_authorization_finish: + * @self: a #GDataOAuth1Authorizer + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous authorization operation started with gdata_oauth1_authorizer_request_authorization_async(). + * + * Return value: %TRUE if authorization was successful, %FALSE otherwise + * + * Since: 0.9.0 + */ +gboolean +gdata_oauth1_authorizer_request_authorization_finish (GDataOAuth1Authorizer *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_return_val_if_fail (g_task_is_valid (async_result, self), FALSE); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_oauth1_authorizer_request_authorization_async), FALSE); + + return g_task_propagate_boolean (G_TASK (async_result), error); +} + +/** + * gdata_oauth1_authorizer_get_application_name: + * @self: a #GDataOAuth1Authorizer + * + * Returns the application name being used on the authentication page at the URI returned by gdata_oauth1_authorizer_request_authentication_uri(); + * i.e. the value of #GDataOAuth1Authorizer:application-name. + * + * Return value: (allow-none): the application name, or %NULL if one isn't set + * + * Since: 0.9.0 + */ +const gchar * +gdata_oauth1_authorizer_get_application_name (GDataOAuth1Authorizer *self) +{ + g_return_val_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self), NULL); + return self->priv->application_name; +} + +/** + * gdata_oauth1_authorizer_get_locale: + * @self: a #GDataOAuth1Authorizer + * + * Returns the locale currently being used for network requests, or %NULL if the locale is the default. + * + * Return value: (allow-none): the current locale + * + * Since: 0.9.0 + */ +const gchar * +gdata_oauth1_authorizer_get_locale (GDataOAuth1Authorizer *self) +{ + g_return_val_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self), NULL); + return self->priv->locale; +} + +/** + * gdata_oauth1_authorizer_set_locale: + * @self: a #GDataOAuth1Authorizer + * @locale: (allow-none): the new locale in Unix locale format, or %NULL for the default locale + * + * Set the locale used for network requests to @locale, given in standard Unix locale format. See #GDataOAuth1Authorizer:locale for more details. + * + * Note that while it's possible to change the locale after sending network requests (i.e. calling + * gdata_oauth1_authorizer_request_authentication_uri() for the first time), it is unsupported, as the server-side software may behave unexpectedly. + * The only supported use of this method is after creation of the authorizer, but before any network requests are made. + * + * Since: 0.9.0 + */ +void +gdata_oauth1_authorizer_set_locale (GDataOAuth1Authorizer *self, const gchar *locale) +{ + g_return_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self)); + + if (g_strcmp0 (locale, self->priv->locale) == 0) { + /* Already has this value */ + return; + } + + g_free (self->priv->locale); + self->priv->locale = g_strdup (locale); + g_object_notify (G_OBJECT (self), "locale"); +} + +static void +notify_proxy_uri_cb (GObject *gobject, GParamSpec *pspec, GDataOAuth1Authorizer *self) +{ + /* Flush our cached version */ + if (self->priv->proxy_uri != NULL) { + soup_uri_free (self->priv->proxy_uri); + self->priv->proxy_uri = NULL; + } + + g_object_notify (G_OBJECT (self), "proxy-uri"); +} + +/* Static function which isn't deprecated so we can continue using it internally. */ +static SoupURI * +_get_proxy_uri (GDataOAuth1Authorizer *self) +{ + SoupURI *proxy_uri; + + g_return_val_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self), NULL); + + /* If we have a cached version, return that */ + if (self->priv->proxy_uri != NULL) { + return self->priv->proxy_uri; + } + + g_object_get (self->priv->session, SOUP_SESSION_PROXY_URI, &proxy_uri, NULL); + + /* Update the cache; it takes ownership of the URI */ + self->priv->proxy_uri = proxy_uri; + + return proxy_uri; +} + +/** + * gdata_oauth1_authorizer_get_proxy_uri: + * @self: a #GDataOAuth1Authorizer + * + * Gets the proxy URI on the #GDataOAuth1Authorizer's #SoupSession. + * + * Return value: (transfer full) (allow-none): the proxy URI, or %NULL; free with soup_uri_free() + * + * Since: 0.9.0 + * Deprecated: 0.15.0: Use gdata_oauth1_authorizer_get_proxy_resolver() instead, which gives more flexibility over the proxy used. + */ +SoupURI * +gdata_oauth1_authorizer_get_proxy_uri (GDataOAuth1Authorizer *self) +{ + return _get_proxy_uri (self); +} + +/* Static function which isn't deprecated so we can continue using it internally. */ +static void +_set_proxy_uri (GDataOAuth1Authorizer *self, SoupURI *proxy_uri) +{ + g_return_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self)); + + g_object_set (self->priv->session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL); + + /* Notification is handled in notify_proxy_uri_cb() which is called as a result of setting the property on the session */ +} + +/** + * gdata_oauth1_authorizer_set_proxy_uri: + * @self: a #GDataOAuth1Authorizer + * @proxy_uri: (allow-none): the proxy URI, or %NULL + * + * Sets the proxy URI on the #SoupSession used internally by the #GDataOAuth1Authorizer. This forces all requests through the given proxy. + * + * If @proxy_uri is %NULL, no proxy will be used. + * + * Since: 0.9.0 + * Deprecated: 0.15.0: Use gdata_oauth1_authorizer_set_proxy_resolver() instead, which gives more flexibility over the proxy used. + */ +void +gdata_oauth1_authorizer_set_proxy_uri (GDataOAuth1Authorizer *self, SoupURI *proxy_uri) +{ + _set_proxy_uri (self, proxy_uri); +} + +/** + * gdata_oauth1_authorizer_get_proxy_resolver: + * @self: a #GDataOAuth1Authorizer + * + * Gets the #GProxyResolver on the #GDataOAuth1Authorizer's #SoupSession. + * + * Return value: (transfer none) (allow-none): a #GProxyResolver, or %NULL + * + * Since: 0.15.0 + */ +GProxyResolver * +gdata_oauth1_authorizer_get_proxy_resolver (GDataOAuth1Authorizer *self) +{ + g_return_val_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self), NULL); + + return self->priv->proxy_resolver; +} + +/** + * gdata_oauth1_authorizer_set_proxy_resolver: + * @self: a #GDataOAuth1Authorizer + * @proxy_resolver: (allow-none): a #GProxyResolver, or %NULL + * + * Sets the #GProxyResolver on the #SoupSession used internally by the given #GDataOAuth1Authorizer. + * + * Setting this will clear the #GDataOAuth1Authorizer:proxy-uri property. + * + * Since: 0.15.0 + */ +void +gdata_oauth1_authorizer_set_proxy_resolver (GDataOAuth1Authorizer *self, GProxyResolver *proxy_resolver) +{ + g_return_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self)); + g_return_if_fail (proxy_resolver == NULL || G_IS_PROXY_RESOLVER (proxy_resolver)); + + if (proxy_resolver != NULL) { + g_object_ref (proxy_resolver); + } + + g_clear_object (&self->priv->proxy_resolver); + self->priv->proxy_resolver = proxy_resolver; + + g_object_notify (G_OBJECT (self), "proxy-resolver"); +} + +static void +notify_timeout_cb (GObject *gobject, GParamSpec *pspec, GObject *self) +{ + g_object_notify (self, "timeout"); +} + +/** + * gdata_oauth1_authorizer_get_timeout: + * @self: a #GDataOAuth1Authorizer + * + * Gets the #GDataOAuth1Authorizer:timeout property; the network timeout, in seconds. + * + * Return value: the timeout, or 0 + * + * Since: 0.9.0 + */ +guint +gdata_oauth1_authorizer_get_timeout (GDataOAuth1Authorizer *self) +{ + guint timeout; + + g_return_val_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self), 0); + + g_object_get (self->priv->session, SOUP_SESSION_TIMEOUT, &timeout, NULL); + + return timeout; +} + +/** + * gdata_oauth1_authorizer_set_timeout: + * @self: a #GDataOAuth1Authorizer + * @timeout: the timeout, or 0 + * + * Sets the #GDataOAuth1Authorizer:timeout property; the network timeout, in seconds. + * + * If @timeout is 0, network operations will never time out. + * + * Since: 0.9.0 + */ +void +gdata_oauth1_authorizer_set_timeout (GDataOAuth1Authorizer *self, guint timeout) +{ + g_return_if_fail (GDATA_IS_OAUTH1_AUTHORIZER (self)); + + if (gdata_oauth1_authorizer_get_timeout (self) == timeout) { + /* Already has this value */ + return; + } + + g_object_set (self->priv->session, SOUP_SESSION_TIMEOUT, timeout, NULL); + + /* Notification is handled in notify_timeout_cb() which is called as a result of setting the property on the session */ +} diff --git a/gdata/gdata-oauth1-authorizer.h b/gdata/gdata-oauth1-authorizer.h new file mode 100644 index 0000000..9bb7943 --- /dev/null +++ b/gdata/gdata-oauth1-authorizer.h @@ -0,0 +1,107 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_OAUTH1_AUTHORIZER_H +#define GDATA_OAUTH1_AUTHORIZER_H + +#include +#include + +#include "gdata-authorizer.h" + +G_BEGIN_DECLS + +#define GDATA_TYPE_OAUTH1_AUTHORIZER (gdata_oauth1_authorizer_get_type ()) +#define GDATA_OAUTH1_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_OAUTH1_AUTHORIZER, GDataOAuth1Authorizer)) +#define GDATA_OAUTH1_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_OAUTH1_AUTHORIZER, GDataOAuth1AuthorizerClass)) +#define GDATA_IS_OAUTH1_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_OAUTH1_AUTHORIZER)) +#define GDATA_IS_OAUTH1_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_OAUTH1_AUTHORIZER)) +#define GDATA_OAUTH1_AUTHORIZER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_OAUTH1_AUTHORIZER, GDataOAuth1AuthorizerClass)) + +typedef struct _GDataOAuth1AuthorizerPrivate GDataOAuth1AuthorizerPrivate; + +/** + * GDataOAuth1Authorizer: + * + * All the fields in the #GDataOAuth1Authorizer structure are private and should never be accessed directly. + * + * Since: 0.9.0 + */ +typedef struct { + /*< private >*/ + GObject parent; + GDataOAuth1AuthorizerPrivate *priv; +} GDataOAuth1Authorizer; + +/** + * GDataOAuth1AuthorizerClass: + * + * All the fields in the #GDataOAuth1AuthorizerClass structure are private and should never be accessed directly. + * + * Since: 0.9.0 + */ +typedef struct { + /*< private >*/ + GObjectClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataOAuth1AuthorizerClass; + +GType gdata_oauth1_authorizer_get_type (void) G_GNUC_CONST; + +GDataOAuth1Authorizer *gdata_oauth1_authorizer_new (const gchar *application_name, GType service_type) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataOAuth1Authorizer *gdata_oauth1_authorizer_new_for_authorization_domains (const gchar *application_name, + GList *authorization_domains) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gchar *gdata_oauth1_authorizer_request_authentication_uri (GDataOAuth1Authorizer *self, gchar **token, gchar **token_secret, + GCancellable *cancellable, GError **error); +void gdata_oauth1_authorizer_request_authentication_uri_async (GDataOAuth1Authorizer *self, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +gchar *gdata_oauth1_authorizer_request_authentication_uri_finish (GDataOAuth1Authorizer *self, GAsyncResult *async_result, gchar **token, + gchar **token_secret, GError **error); + +gboolean gdata_oauth1_authorizer_request_authorization (GDataOAuth1Authorizer *self, const gchar *token, const gchar *token_secret, + const gchar *verifier, GCancellable *cancellable, GError **error); +void gdata_oauth1_authorizer_request_authorization_async (GDataOAuth1Authorizer *self, const gchar *token, const gchar *token_secret, + const gchar *verifier, GCancellable *cancellable, GAsyncReadyCallback callback, + gpointer user_data); +gboolean gdata_oauth1_authorizer_request_authorization_finish (GDataOAuth1Authorizer *self, GAsyncResult *async_result, GError **error); + +const gchar *gdata_oauth1_authorizer_get_application_name (GDataOAuth1Authorizer *self) G_GNUC_PURE; + +const gchar *gdata_oauth1_authorizer_get_locale (GDataOAuth1Authorizer *self) G_GNUC_PURE; +void gdata_oauth1_authorizer_set_locale (GDataOAuth1Authorizer *self, const gchar *locale); + +#ifndef LIBGDATA_DISABLE_DEPRECATED +SoupURI *gdata_oauth1_authorizer_get_proxy_uri (GDataOAuth1Authorizer *self) G_GNUC_PURE G_GNUC_DEPRECATED_FOR (gdata_oauth1_authorizer_get_proxy_resolver); +void gdata_oauth1_authorizer_set_proxy_uri (GDataOAuth1Authorizer *self, SoupURI *proxy_uri) G_GNUC_DEPRECATED_FOR (gdata_oauth1_authorizer_set_proxy_resolver); +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +GProxyResolver *gdata_oauth1_authorizer_get_proxy_resolver (GDataOAuth1Authorizer *self) G_GNUC_PURE; +void gdata_oauth1_authorizer_set_proxy_resolver (GDataOAuth1Authorizer *self, GProxyResolver *proxy_resolver); + +guint gdata_oauth1_authorizer_get_timeout (GDataOAuth1Authorizer *self) G_GNUC_PURE; +void gdata_oauth1_authorizer_set_timeout (GDataOAuth1Authorizer *self, guint timeout); + +G_END_DECLS + +#endif /* !GDATA_OAUTH1_AUTHORIZER_H */ diff --git a/gdata/gdata-oauth2-authorizer.c b/gdata/gdata-oauth2-authorizer.c new file mode 100644 index 0000000..a08a265 --- /dev/null +++ b/gdata/gdata-oauth2-authorizer.c @@ -0,0 +1,1592 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011, 2014, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-oauth2-authorizer + * @short_description: GData OAuth 2.0 authorization interface + * @stability: Stable + * @include: gdata/gdata-oauth2-authorizer.h + * + * #GDataOAuth2Authorizer provides an implementation of the #GDataAuthorizer + * interface for authentication and authorization using the + * OAuth 2.0 + * process, which is Google’s currently preferred authentication and + * authorization process. + * + * OAuth 2.0 replaces the deprecated OAuth 1.0 and ClientLogin processes. One of + * the main reasons for this is to allow two-factor authentication to be + * supported, by moving the authentication interface to a web page under + * Google’s control. + * + * The OAuth 2.0 process as implemented by Google follows the + * OAuth 2.0 + * protocol as specified by IETF in RFC 6749, with a few additions to + * support scopes (implemented in libgdata by #GDataAuthorizationDomains), + * locales and custom domains. Briefly, the process is initiated by building an + * authentication URI (using gdata_oauth2_authorizer_build_authentication_uri()) + * and opening it in the user’s web browser. The user authenticates and + * authorizes the requested scopes on Google’s website, then an authorization + * code is returned (via #GDataOAuth2Authorizer:redirect-uri) to the + * application, which then converts the code into an access and refresh token + * (using gdata_oauth2_authorizer_request_authorization()). The access token is + * then attached to all future requests to the online service, and the refresh + * token can be used in future (with gdata_authorizer_refresh_authorization()) + * to refresh authorization after the access token expires. + * + * The refresh token may also be accessed as + * #GDataOAuth2Authorizer:refresh-token and saved by the application. It may + * later be set on a new instance of #GDataOAuth2Authorizer, and + * gdata_authorizer_refresh_authorization_async() called to establish a new + * access token without requiring the user to re-authenticate unless they have + * explicitly revoked the refresh token. + * + * For an overview of the standard OAuth 2.0 flow, see + * RFC 6749. + * + * Before an application can be authorized using OAuth 2.0, it must be + * registered with + * Google’s + * Developer Console, and a client ID, client secret and redirect URI + * retrieved. These must be built into your application, and knowledge of them + * will allow any application to impersonate yours, so it is recommended that + * they are kept secret (e.g. as a configure-time option). + * + * libgdata supports + * incremental + * authorization, where multiple #GDataOAuth2Authorizers can be used to + * incrementally build up authorizations against multiple scopes. Typically, + * you should use one #GDataOAuth2Authorizer per #GDataService your application + * uses, limit the scope of each authorizer, and enable incremental + * authorization when calling + * gdata_oauth2_authorizer_build_authentication_uri(). + * + * Each access token is long lived, so reauthorization is rarely necessary with + * #GDataOAuth2Authorizer. It is supported using + * gdata_authorizer_refresh_authorization(). + * + * + * Authenticating Asynchronously Using OAuth 2.0 + * + * GDataSomeService *service; + * GDataOAuth2Authorizer *authorizer; + * gchar *authentication_uri, *authorization_code; + * + * /* Create an authorizer and authenticate and authorize the service we're using, asynchronously. */ + * authorizer = gdata_oauth2_authorizer_new ("some-client-id", "some-client-secret", + * GDATA_OAUTH2_REDIRECT_URI_OOB, GDATA_TYPE_SOME_SERVICE); + * authentication_uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, NULL, FALSE); + * + * /* (Present the page at the authentication URI to the user, either in an embedded or stand-alone web browser, and + * * ask them to grant access to the application and return the code Google gives them.) */ + * authorization_code = ask_user_for_code (authentication_uri); + * + * gdata_oauth2_authorizer_request_authorization_async (authorizer, authorization_code, cancellable, + * (GAsyncReadyCallback) request_authorization_cb, user_data); + * + * g_free (authentication_uri); + * + * /* Zero out the code before freeing. */ + * if (token_secret != NULL) { + * memset (authorization_code, 0, strlen (authorization_code)); + * } + * + * g_free (authorization_code); + * + * /* Create a service object and link it with the authorizer */ + * service = gdata_some_service_new (GDATA_AUTHORIZER (authorizer)); + * + * static void + * request_authorization_cb (GDataOAuth2Authorizer *authorizer, GAsyncResult *async_result, gpointer user_data) + * { + * GError *error = NULL; + * + * if (gdata_oauth2_authorizer_request_authorization_finish (authorizer, async_result, &error) == FALSE) { + * /* Notify the user of all errors except cancellation errors */ + * if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + * g_error ("Authorization failed: %s", error->message); + * } + * + * g_error_free (error); + * return; + * } + * + * /* (The client is now authenticated and authorized against the service. + * * It can now proceed to execute queries on the service object which require the user to be authenticated.) */ + * } + * + * g_object_unref (service); + * g_object_unref (authorizer); + * + * + * + * Since: 0.17.0 + */ + +#include +#include +#include +#include + +#include "gdata-oauth2-authorizer.h" +#include "gdata-private.h" + +static void authorizer_init (GDataAuthorizerInterface *iface); +static void dispose (GObject *object); +static void finalize (GObject *object); +static void get_property (GObject *object, guint property_id, GValue *value, + GParamSpec *pspec); +static void set_property (GObject *object, guint property_id, + const GValue *value, GParamSpec *pspec); + +static void process_request (GDataAuthorizer *self, + GDataAuthorizationDomain *domain, + SoupMessage *message); +static void sign_message_locked (GDataOAuth2Authorizer *self, + SoupMessage *message, + const gchar *access_token); +static gboolean is_authorized_for_domain (GDataAuthorizer *self, + GDataAuthorizationDomain *domain); +static gboolean refresh_authorization (GDataAuthorizer *self, + GCancellable *cancellable, + GError **error); + +static void parse_grant_response (GDataOAuth2Authorizer *self, guint status, + const gchar *reason_phrase, + const gchar *response_body, gssize length, + GError **error); +static void parse_grant_error (GDataOAuth2Authorizer *self, guint status, + const gchar *reason_phrase, + const gchar *response_body, gssize length, + GError **error); + +static void notify_timeout_cb (GObject *gobject, GParamSpec *pspec, + GObject *self); + +struct _GDataOAuth2AuthorizerPrivate { + SoupSession *session; /* owned */ + GProxyResolver *proxy_resolver; /* owned */ + + gchar *client_id; /* owned */ + gchar *redirect_uri; /* owned */ + gchar *client_secret; /* owned */ + gchar *locale; /* owned */ + + /* Mutex for access_token, refresh_token and authentication_domains. */ + GMutex mutex; + + /* These are both non-NULL when authorised. refresh_token may be + * non-NULL if access_token is NULL and refresh_authorization() has not + * yet been called on this authorizer. They may be both NULL. */ + gchar *access_token; /* owned */ + gchar *refresh_token; /* owned */ + + /* Mapping from GDataAuthorizationDomain to itself; a set of domains for + * which ->access_token is valid. */ + GHashTable *authentication_domains; /* owned */ +}; + +enum { + PROP_CLIENT_ID = 1, + PROP_REDIRECT_URI, + PROP_CLIENT_SECRET, + PROP_LOCALE, + PROP_TIMEOUT, + PROP_PROXY_RESOLVER, + PROP_REFRESH_TOKEN, +}; + +G_DEFINE_TYPE_WITH_CODE (GDataOAuth2Authorizer, gdata_oauth2_authorizer, + G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_AUTHORIZER, + authorizer_init)) + +static void +gdata_oauth2_authorizer_class_init (GDataOAuth2AuthorizerClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataOAuth2AuthorizerPrivate)); + + gobject_class->get_property = get_property; + gobject_class->set_property = set_property; + gobject_class->dispose = dispose; + gobject_class->finalize = finalize; + + /** + * GDataOAuth2Authorizer:client-id: + * + * A client ID for your application (see the + * reference documentation). + * + * It is recommended that the ID is of the form + * company name- + * application name- + * version ID. + * + * Since: 0.17.0 + */ + g_object_class_install_property (gobject_class, PROP_CLIENT_ID, + g_param_spec_string ("client-id", + "Client ID", + "A client ID for your application.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth2Authorizer:redirect-uri: + * + * Redirect URI to send the response from the authorisation request to. + * This must either be %GDATA_OAUTH2_REDIRECT_URI_OOB, + * %GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO, or a + * http://localhost URI with any port number (optionally) + * specified. + * + * This URI is where the authorisation server will redirect the user + * after they have completed interacting with the authentication page + * (gdata_oauth2_authorizer_build_authentication_uri()). If it is + * %GDATA_OAUTH2_REDIRECT_URI_OOB, a page will be returned in the user’s + * browser with the authorisation code in its title and also embedded in + * the page for the user to copy if it is not possible to automatically + * extract the code from the page title. If it is + * %GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO, a similar page will be returned + * with the authorisation code in its title, but without displaying the + * code to the user — the user will simply be asked to close the page. + * If it is a localhost URI, the authentication page will redirect to + * that URI with the authorisation code appended as a code + * query parameter. If the user denies the authentication request, the + * authentication page will redirect to that URI with + * error=access_denied appended as a query parameter. + * + * Note that the redirect URI used must match that registered in + * Google’s Developer Console for your application. + * + * See the reference + * documentation for details about choosing a redirect URI. + * + * Since: 0.17.0 + */ + g_object_class_install_property (gobject_class, PROP_REDIRECT_URI, + g_param_spec_string ("redirect-uri", + "Redirect URI", + "Redirect URI to send the response from the authorisation request to.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth2Authorizer:client-secret: + * + * Client secret provided by Google. This is unique for each application + * and is accessible from Google’s Developer Console when registering + * an application. It must be paired with the + * #GDataOAuth2Authorizer:client-id. + * + * See the + * reference + * documentation for details. + * + * Since: 0.17.0 + */ + g_object_class_install_property (gobject_class, PROP_CLIENT_SECRET, + g_param_spec_string ("client-secret", + "Client secret", + "Client secret provided by Google.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth2Authorizer:locale: + * + * The locale to use for network requests, in UNIX locale format. + * (e.g. "en_GB", "cs", "de_DE".) Use %NULL for the default "C" locale + * (typically "en_US"). + * + * This locale will be used by the server-side software to localise the + * authentication and authorization pages at the URI returned by + * gdata_oauth2_authorizer_build_authentication_uri(). + * + * The server-side behaviour is undefined if it doesn't support a given + * locale. + * + * Since: 0.17.0 + */ + g_object_class_install_property (gobject_class, PROP_LOCALE, + g_param_spec_string ("locale", + "Locale", + "The locale to use for network requests, in UNIX locale format.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth2Authorizer:timeout: + * + * A timeout, in seconds, for network operations. If the timeout is + * exceeded, the operation will be cancelled and + * %GDATA_SERVICE_ERROR_NETWORK_ERROR will be returned. + * + * If the timeout is 0, operations will + * never time out. + * + * Since: 0.17.0 + */ + g_object_class_install_property (gobject_class, PROP_TIMEOUT, + g_param_spec_uint ("timeout", + "Timeout", + "A timeout, in seconds, for network operations.", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth2Authorizer:proxy-resolver: + * + * The #GProxyResolver used to determine a proxy URI. + * + * Since: 0.17.0 + */ + g_object_class_install_property (gobject_class, PROP_PROXY_RESOLVER, + g_param_spec_object ("proxy-resolver", + "Proxy Resolver", + "A GProxyResolver used to determine a proxy URI.", + G_TYPE_PROXY_RESOLVER, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataOAuth2Authorizer:refresh-token: + * + * The server provided refresh token, which can be stored and passed in + * to new #GDataOAuth2Authorizer instances before calling + * gdata_authorizer_refresh_authorization_async() to create a new + * short-lived access token. + * + * The refresh token is opaque data and must not be parsed. + * + * Since: 0.17.2 + */ + g_object_class_install_property (gobject_class, PROP_REFRESH_TOKEN, + g_param_spec_string ("refresh-token", + "Refresh Token", + "The server provided refresh token.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +authorizer_init (GDataAuthorizerInterface *iface) +{ + iface->process_request = process_request; + iface->is_authorized_for_domain = is_authorized_for_domain; + + /* We only implement the synchronous version, as GDataAuthorizer will + * automatically wrap it in a thread for the asynchronous versions if + * they’re not specifically implemented, which is fine for our needs. We + * couldn’t do any better by implementing the asynchronous versions + * ourselves. */ + iface->refresh_authorization = refresh_authorization; +} + +static void +gdata_oauth2_authorizer_init (GDataOAuth2Authorizer *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + GDATA_TYPE_OAUTH2_AUTHORIZER, + GDataOAuth2AuthorizerPrivate); + + /* Set up the authorizer's mutex */ + g_mutex_init (&self->priv->mutex); + self->priv->authentication_domains = g_hash_table_new_full (g_direct_hash, + g_direct_equal, + g_object_unref, + NULL); + + /* Set up the session */ + self->priv->session = _gdata_service_build_session (); + + /* Proxy the SoupSession’s timeout property. */ + g_signal_connect (self->priv->session, "notify::timeout", + (GCallback) notify_timeout_cb, self); + + /* Keep our GProxyResolver synchronized with SoupSession’s. */ + g_object_bind_property (self->priv->session, "proxy-resolver", + self, "proxy-resolver", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); +} + +static void +dispose (GObject *object) +{ + GDataOAuth2AuthorizerPrivate *priv; + + priv = GDATA_OAUTH2_AUTHORIZER (object)->priv; + + g_clear_object (&priv->session); + g_clear_object (&priv->proxy_resolver); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_oauth2_authorizer_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + GDataOAuth2AuthorizerPrivate *priv; + + priv = GDATA_OAUTH2_AUTHORIZER (object)->priv; + + g_free (priv->client_id); + g_free (priv->client_secret); + g_free (priv->redirect_uri); + g_free (priv->locale); + + g_free (priv->access_token); + g_free (priv->refresh_token); + + g_hash_table_unref (priv->authentication_domains); + g_mutex_clear (&priv->mutex); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_oauth2_authorizer_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint property_id, GValue *value, + GParamSpec *pspec) +{ + GDataOAuth2Authorizer *self; + GDataOAuth2AuthorizerPrivate *priv; + + self = GDATA_OAUTH2_AUTHORIZER (object); + priv = self->priv; + + switch (property_id) { + case PROP_CLIENT_ID: + g_value_set_string (value, priv->client_id); + break; + case PROP_REDIRECT_URI: + g_value_set_string (value, priv->redirect_uri); + break; + case PROP_CLIENT_SECRET: + g_value_set_string (value, priv->client_secret); + break; + case PROP_LOCALE: + g_value_set_string (value, priv->locale); + break; + case PROP_TIMEOUT: + g_value_set_uint (value, + gdata_oauth2_authorizer_get_timeout (self)); + break; + case PROP_PROXY_RESOLVER: + g_value_set_object (value, + gdata_oauth2_authorizer_get_proxy_resolver (self)); + break; + case PROP_REFRESH_TOKEN: + g_mutex_lock (&priv->mutex); + g_value_set_string (value, priv->refresh_token); + g_mutex_unlock (&priv->mutex); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataOAuth2Authorizer *self; + GDataOAuth2AuthorizerPrivate *priv; + + self = GDATA_OAUTH2_AUTHORIZER (object); + priv = self->priv; + + switch (property_id) { + /* Construct only. */ + case PROP_CLIENT_ID: + priv->client_id = g_value_dup_string (value); + break; + /* Construct only. */ + case PROP_REDIRECT_URI: + priv->redirect_uri = g_value_dup_string (value); + break; + /* Construct only. */ + case PROP_CLIENT_SECRET: + priv->client_secret = g_value_dup_string (value); + break; + case PROP_LOCALE: + gdata_oauth2_authorizer_set_locale (self, + g_value_get_string (value)); + break; + case PROP_TIMEOUT: + gdata_oauth2_authorizer_set_timeout (self, + g_value_get_uint (value)); + break; + case PROP_PROXY_RESOLVER: + gdata_oauth2_authorizer_set_proxy_resolver (self, + g_value_get_object (value)); + break; + case PROP_REFRESH_TOKEN: + gdata_oauth2_authorizer_set_refresh_token (self, + g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +process_request (GDataAuthorizer *self, GDataAuthorizationDomain *domain, + SoupMessage *message) +{ + GDataOAuth2AuthorizerPrivate *priv; + + priv = GDATA_OAUTH2_AUTHORIZER (self)->priv; + + /* Set the authorisation header */ + g_mutex_lock (&priv->mutex); + + /* Sanity check */ + g_assert ((priv->access_token == NULL) || + (priv->refresh_token != NULL)); + + if (priv->access_token != NULL && + g_hash_table_lookup (priv->authentication_domains, + domain) != NULL) { + sign_message_locked (GDATA_OAUTH2_AUTHORIZER (self), message, + priv->access_token); + } + + g_mutex_unlock (&priv->mutex); +} + +static gboolean +is_authorized_for_domain (GDataAuthorizer *self, + GDataAuthorizationDomain *domain) +{ + GDataOAuth2AuthorizerPrivate *priv; + gpointer result; + const gchar *access_token; + + priv = GDATA_OAUTH2_AUTHORIZER (self)->priv; + + g_mutex_lock (&priv->mutex); + access_token = priv->access_token; + result = g_hash_table_lookup (priv->authentication_domains, domain); + g_mutex_unlock (&priv->mutex); + + /* Sanity check */ + g_assert (result == NULL || result == domain); + + return (access_token != NULL && result != NULL); +} + +/* Sign the message and add the Authorization header to it containing the + * signature. + * + * Reference: https://developers.google.com/accounts/docs/OAuth2InstalledApp#callinganapi + * + * NOTE: This must be called with the mutex locked. */ +static void +sign_message_locked (GDataOAuth2Authorizer *self, SoupMessage *message, + const gchar *access_token) +{ + SoupURI *message_uri; /* unowned */ + gchar *auth_header = NULL; /* owned */ + + g_return_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self)); + g_return_if_fail (SOUP_IS_MESSAGE (message)); + g_return_if_fail (access_token != NULL && *access_token != '\0'); + + /* Ensure that we’re using HTTPS: if not, we shouldn’t set the + * Authorization header or we could be revealing the access + * token to anyone snooping the connection, which would give + * them the same rights as us on the user’s data. Generally a + * bad thing to happen. */ + message_uri = soup_message_get_uri (message); + + if (message_uri->scheme != SOUP_URI_SCHEME_HTTPS) { + g_warning ("Not authorizing a non-HTTPS message with the " + "user’s OAuth 2.0 access token as the connection " + "isn’t secure."); + return; + } + + /* Add the authorisation header. */ + auth_header = g_strdup_printf ("Bearer %s", access_token); + soup_message_headers_append (message->request_headers, + "Authorization", auth_header); + g_free (auth_header); +} + +static gboolean +refresh_authorization (GDataAuthorizer *self, GCancellable *cancellable, + GError **error) +{ + /* See http://code.google.com/apis/accounts/docs/OAuth2.html#IAMoreToken */ + GDataOAuth2AuthorizerPrivate *priv; + SoupMessage *message = NULL; /* owned */ + SoupURI *_uri = NULL; /* owned */ + gchar *request_body; + guint status; + GError *child_error = NULL; + + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), FALSE); + + priv = GDATA_OAUTH2_AUTHORIZER (self)->priv; + + g_mutex_lock (&priv->mutex); + + /* If we don’t have a refresh token, we can’t refresh the + * authorisation. Do not set @error, as we haven’t been successfully + * authorised previously. */ + if (priv->refresh_token == NULL) { + g_mutex_unlock (&priv->mutex); + return FALSE; + } + + /* Prepare the request */ + request_body = soup_form_encode ("client_id", priv->client_id, + "client_secret", priv->client_secret, + "refresh_token", priv->refresh_token, + "grant_type", "refresh_token", + NULL); + + g_mutex_unlock (&priv->mutex); + + /* Build the message */ + _uri = soup_uri_new ("https://accounts.google.com/o/oauth2/token"); + soup_uri_set_port (_uri, _gdata_service_get_https_port ()); + message = soup_message_new_from_uri (SOUP_METHOD_POST, _uri); + soup_uri_free (_uri); + + soup_message_set_request (message, "application/x-www-form-urlencoded", + SOUP_MEMORY_TAKE, request_body, + strlen (request_body)); + + /* Send the message */ + _gdata_service_actually_send_message (priv->session, message, + cancellable, error); + status = message->status_code; + + if (status == SOUP_STATUS_CANCELLED) { + /* Cancelled (the error has already been set) */ + g_object_unref (message); + return FALSE; + } else if (status != SOUP_STATUS_OK) { + parse_grant_error (GDATA_OAUTH2_AUTHORIZER (self), + status, message->reason_phrase, + message->response_body->data, + message->response_body->length, + error); + g_object_unref (message); + + return FALSE; + } + + g_assert (message->response_body->data != NULL); + + /* Parse and handle the response */ + parse_grant_response (GDATA_OAUTH2_AUTHORIZER (self), + status, message->reason_phrase, + message->response_body->data, + message->response_body->length, &child_error); + + g_object_unref (message); + + if (child_error != NULL) { + g_propagate_error (error, child_error); + return FALSE; + } + + return TRUE; +} + +/** + * gdata_oauth2_authorizer_new: + * @client_id: your application’s client ID + * @client_secret: your application’s client secret + * @redirect_uri: authorisation redirect URI + * @service_type: the #GType of a #GDataService subclass which the + * #GDataOAuth2Authorizer will be used with + * + * Creates a new #GDataOAuth2Authorizer. The @client_id must be unique for your + * application, and as registered with Google, and the @client_secret must be + * paired with it. + * + * Return value: (transfer full): a new #GDataOAuth2Authorizer; unref with + * g_object_unref() + * + * Since: 0.17.0 + */ +GDataOAuth2Authorizer * +gdata_oauth2_authorizer_new (const gchar *client_id, const gchar *client_secret, + const gchar *redirect_uri, GType service_type) +{ + GList/**/ *domains; /* owned */ + GDataOAuth2Authorizer *retval = NULL; /* owned */ + + g_return_val_if_fail (client_id != NULL && *client_id != '\0', NULL); + g_return_val_if_fail (client_secret != NULL && *client_secret != '\0', + NULL); + g_return_val_if_fail (redirect_uri != NULL && *redirect_uri != '\0', + NULL); + g_return_val_if_fail (g_type_is_a (service_type, GDATA_TYPE_SERVICE), + NULL); + + domains = gdata_service_get_authorization_domains (service_type); + + retval = gdata_oauth2_authorizer_new_for_authorization_domains (client_id, + client_secret, + redirect_uri, + domains); + g_list_free (domains); + + return retval; +} + +/** + * gdata_oauth2_authorizer_new_for_authorization_domains: + * @client_id: your application’s client ID + * @client_secret: your application’s client secret + * @redirect_uri: authorisation redirect URI + * @authorization_domains: (element-type GDataAuthorizationDomain) (transfer none): + * a non-empty list of #GDataAuthorizationDomains to be authorized against by + * the #GDataOAuth2Authorizer + * + * Creates a new #GDataOAuth2Authorizer. The @client_id must be unique for your + * application, and as registered with Google, and the @client_secret must be + * paired with it. + * + * Return value: (transfer full): a new #GDataOAuth2Authorizer; unref with + * g_object_unref() + * + * Since: 0.17.0 + */ +GDataOAuth2Authorizer * +gdata_oauth2_authorizer_new_for_authorization_domains (const gchar *client_id, + const gchar *client_secret, + const gchar *redirect_uri, + GList *authorization_domains) +{ + GList *i; + GDataOAuth2Authorizer *authorizer; + + g_return_val_if_fail (client_id != NULL && *client_id != '\0', NULL); + g_return_val_if_fail (client_secret != NULL && *client_secret != '\0', + NULL); + g_return_val_if_fail (redirect_uri != NULL && *redirect_uri != '\0', + NULL); + g_return_val_if_fail (authorization_domains != NULL, NULL); + + authorizer = GDATA_OAUTH2_AUTHORIZER (g_object_new (GDATA_TYPE_OAUTH2_AUTHORIZER, + "client-id", client_id, + "client-secret", client_secret, + "redirect-uri", redirect_uri, + NULL)); + + /* Register all the domains with the authorizer */ + for (i = authorization_domains; i != NULL; i = i->next) { + GDataAuthorizationDomain *domain; /* unowned */ + + g_return_val_if_fail (GDATA_IS_AUTHORIZATION_DOMAIN (i->data), + NULL); + + /* We don’t have to lock the authoriser’s mutex here as no other + * code has seen the authoriser yet */ + domain = GDATA_AUTHORIZATION_DOMAIN (i->data); + g_hash_table_insert (authorizer->priv->authentication_domains, + g_object_ref (domain), domain); + } + + return authorizer; +} + +/** + * gdata_oauth2_authorizer_build_authentication_uri: + * @self: a #GDataOAuth2Authorizer + * @login_hint: (nullable): optional e-mail address or sub identifier for the + * user + * @include_granted_scopes: %TRUE to enable incremental authorisation + * + * Build an authentication URI to open in the user’s web browser (or an embedded + * browser widget). This will display an authentication page from Google, + * including an authentication form and confirmation of the authorisation + * domains being requested by this #GDataAuthorizer. The user will authenticate + * in the browser, then an authorisation code will be returned via the + * #GDataOAuth2Authorizer:redirect-uri, ready to be passed to + * gdata_oauth2_authorizer_request_authorization(). + * + * If @login_hint is non-%NULL, it will be passed to the server as a hint of + * which user is attempting to authenticate, which can be used to pre-fill the + * e-mail address box in the authentication form. + * + * If @include_granted_scopes is %TRUE, the authentication request will + * automatically include all authorisation domains previously granted to this + * user/application pair, allowing for incremental authentication — asking for + * permissions as needed, rather than all in one large bundle at the first + * opportunity. If @include_granted_scopes is %FALSE, incremental authentication + * will not be enabled, and only the domains passed to the + * #GDataOAuth2Authorizer constructor will eventually be authenticated. + * See the + * reference + * documentation for more details. + * + * Return value: (transfer full): the authentication URI to open in a web + * browser; free with g_free() + * + * Since: 0.17.0 + */ +gchar * +gdata_oauth2_authorizer_build_authentication_uri (GDataOAuth2Authorizer *self, + const gchar *login_hint, + gboolean include_granted_scopes) +{ + GDataOAuth2AuthorizerPrivate *priv; + GString *uri = NULL; /* owned */ + GDataAuthorizationDomain *domain; /* unowned */ + GHashTableIter iter; + gboolean is_first = TRUE; + + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), NULL); + + priv = self->priv; + + g_mutex_lock (&priv->mutex); + + /* Build and memoise the URI. + * + * Reference: https://developers.google.com/accounts/docs/OAuth2InstalledApp#formingtheurl + */ + g_assert (g_hash_table_size (priv->authentication_domains) > 0); + + uri = g_string_new ("https://accounts.google.com/o/oauth2/auth" + "?response_type=code" + "&client_id="); + g_string_append_uri_escaped (uri, priv->client_id, NULL, TRUE); + g_string_append (uri, "&redirect_uri="); + g_string_append_uri_escaped (uri, priv->redirect_uri, NULL, TRUE); + g_string_append (uri, "&scope="); + + /* Add the scopes of all our domains */ + g_hash_table_iter_init (&iter, priv->authentication_domains); + + while (g_hash_table_iter_next (&iter, (gpointer *) &domain, NULL)) { + const gchar *scope; + + if (!is_first) { + /* Delimiter */ + g_string_append (uri, "%20"); + } + + scope = gdata_authorization_domain_get_scope (domain); + g_string_append_uri_escaped (uri, scope, NULL, TRUE); + + is_first = FALSE; + } + + if (login_hint != NULL && *login_hint != '\0') { + g_string_append (uri, "&login_hint="); + g_string_append_uri_escaped (uri, login_hint, NULL, TRUE); + } + + if (priv->locale != NULL) { + g_string_append (uri, "&hl="); + g_string_append_uri_escaped (uri, priv->locale, NULL, TRUE); + } + + if (include_granted_scopes) { + g_string_append (uri, "&include_granted_scopes=true"); + } else { + g_string_append (uri, "&include_granted_scopes=false"); + } + + g_mutex_unlock (&priv->mutex); + + return g_string_free (uri, FALSE); +} + +/* NOTE: This has to be thread safe, as it can be called from + * refresh_authorization() at any time. + * + * Reference: https://developers.google.com/accounts/docs/OAuth2InstalledApp#handlingtheresponse + */ +static void +parse_grant_response (GDataOAuth2Authorizer *self, guint status, + const gchar *reason_phrase, const gchar *response_body, + gssize length, GError **error) +{ + GDataOAuth2AuthorizerPrivate *priv; + JsonParser *parser = NULL; /* owned */ + JsonNode *root_node; /* unowned */ + JsonObject *root_object; /* unowned */ + const gchar *access_token = NULL, *refresh_token = NULL; + GError *child_error = NULL; + + priv = self->priv; + + /* Parse the successful response */ + parser = json_parser_new (); + + json_parser_load_from_data (parser, response_body, length, + &child_error); + + if (child_error != NULL) { + g_clear_error (&child_error); + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + + goto done; + } + + /* Extract the access token, TTL and refresh token */ + root_node = json_parser_get_root (parser); + + if (JSON_NODE_HOLDS_OBJECT (root_node) == FALSE) { + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + goto done; + } + + root_object = json_node_get_object (root_node); + + if (json_object_has_member (root_object, "access_token")) { + access_token = json_object_get_string_member (root_object, + "access_token"); + } + if (json_object_has_member (root_object, "refresh_token")) { + refresh_token = json_object_get_string_member (root_object, + "refresh_token"); + } + + /* Always require an access token. */ + if (access_token == NULL || *access_token == '\0') { + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + + access_token = NULL; + refresh_token = NULL; + + goto done; + } + + /* Only require a refresh token if this is the first authentication. + * See the documentation for refreshing authentication: + * https://developers.google.com/accounts/docs/OAuth2InstalledApp#refresh + */ + if ((refresh_token == NULL || *refresh_token == '\0') && + priv->refresh_token == NULL) { + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + + access_token = NULL; + refresh_token = NULL; + + goto done; + } + +done: + /* Postconditions. */ + g_assert ((refresh_token == NULL) || (access_token != NULL)); + g_assert ((child_error != NULL) == (access_token == NULL)); + + /* Update state. */ + g_mutex_lock (&priv->mutex); + + g_free (priv->access_token); + priv->access_token = g_strdup (access_token); + + if (refresh_token != NULL) { + g_free (priv->refresh_token); + priv->refresh_token = g_strdup (refresh_token); + } + + g_mutex_unlock (&priv->mutex); + + if (child_error != NULL) { + g_propagate_error (error, child_error); + } + + g_object_unref (parser); +} + +/* NOTE: This has to be thread safe, as it can be called from + * refresh_authorization() at any time. + * + * There is no reference for this, because Google apparently don’t deem it + * necessary to document. + * + * Example response: + * HTTP/1.1 400 Bad Request + * Content-Type: application/json + * + * { + * "error" : "invalid_grant" + * } + */ +static void +parse_grant_error (GDataOAuth2Authorizer *self, guint status, + const gchar *reason_phrase, const gchar *response_body, + gssize length, GError **error) +{ + JsonParser *parser = NULL; /* owned */ + JsonNode *root_node; /* unowned */ + JsonObject *root_object; /* unowned */ + const gchar *error_code = NULL; + GError *child_error = NULL; + + /* Parse the error response */ + parser = json_parser_new (); + + if (response_body == NULL) { + g_clear_error (&child_error); + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + + goto done; + } + + json_parser_load_from_data (parser, response_body, length, + &child_error); + + if (child_error != NULL) { + g_clear_error (&child_error); + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + + goto done; + } + + /* Extract the error code. */ + root_node = json_parser_get_root (parser); + + if (JSON_NODE_HOLDS_OBJECT (root_node) == FALSE) { + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + goto done; + } + + root_object = json_node_get_object (root_node); + + if (json_object_has_member (root_object, "error")) { + error_code = json_object_get_string_member (root_object, + "error"); + } + + /* Always require an error_code. */ + if (error_code == NULL || *error_code == '\0') { + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + + error_code = NULL; + + goto done; + } + + /* Parse the error code. */ + if (strcmp (error_code, "invalid_grant") == 0) { + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_FORBIDDEN, + _("Access was denied by the user or server.")); + } else { + /* Unknown error code. */ + g_set_error_literal (&child_error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The server returned a malformed response.")); + } + +done: + /* Postconditions. */ + g_assert (child_error != NULL); + + if (child_error != NULL) { + g_propagate_error (error, child_error); + } + + g_object_unref (parser); +} + +/** + * gdata_oauth2_authorizer_request_authorization: + * @self: a #GDataOAuth2Authorizer + * @authorization_code: code returned from the authentication page + * @cancellable: (allow-none): a #GCancellable, or %NULL + * @error: return location for a #GError, or %NULL + * + * Request an authorisation code from the user’s web browser is converted to + * authorisation (access and refresh) tokens. This is the final step in the + * authentication process; once complete, the #GDataOAuth2Authorizer should be + * fully authorised for its domains. + * + * On failure, %GDATA_SERVICE_ERROR_FORBIDDEN will be returned if the user or + * server denied the authorisation request. %GDATA_SERVICE_ERROR_PROTOCOL_ERROR + * will be returned if the server didn’t follow the expected protocol. + * %G_IO_ERROR_CANCELLED will be returned if the operation was cancelled using + * @cancellable. + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.17.0 + */ +gboolean +gdata_oauth2_authorizer_request_authorization (GDataOAuth2Authorizer *self, + const gchar *authorization_code, + GCancellable *cancellable, + GError **error) +{ + GDataOAuth2AuthorizerPrivate *priv; + SoupMessage *message = NULL; /* owned */ + SoupURI *_uri = NULL; /* owned */ + gchar *request_body = NULL; /* owned */ + guint status; + GError *child_error = NULL; + + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), FALSE); + g_return_val_if_fail (authorization_code != NULL && + *authorization_code != '\0', FALSE); + g_return_val_if_fail (cancellable == NULL || + G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + priv = self->priv; + + /* Prepare the request. + * + * Reference: https://developers.google.com/accounts/docs/OAuth2InstalledApp#handlingtheresponse + */ + request_body = soup_form_encode ("client_id", priv->client_id, + "client_secret", priv->client_secret, + "code", authorization_code, + "redirect_uri", priv->redirect_uri, + "grant_type", "authorization_code", + NULL); + + /* Build the message */ + _uri = soup_uri_new ("https://accounts.google.com/o/oauth2/token"); + soup_uri_set_port (_uri, _gdata_service_get_https_port ()); + message = soup_message_new_from_uri (SOUP_METHOD_POST, _uri); + soup_uri_free (_uri); + + soup_message_set_request (message, "application/x-www-form-urlencoded", + SOUP_MEMORY_TAKE, request_body, + strlen (request_body)); + request_body = NULL; + + /* Send the message */ + _gdata_service_actually_send_message (priv->session, message, + cancellable, error); + status = message->status_code; + + if (status == SOUP_STATUS_CANCELLED) { + /* Cancelled (the error has already been set) */ + g_object_unref (message); + return FALSE; + } else if (status != SOUP_STATUS_OK) { + parse_grant_error (self, status, message->reason_phrase, + message->response_body->data, + message->response_body->length, + error); + g_object_unref (message); + + return FALSE; + } + + g_assert (message->response_body->data != NULL); + + /* Parse and handle the response */ + parse_grant_response (self, status, message->reason_phrase, + message->response_body->data, + message->response_body->length, &child_error); + + g_object_unref (message); + + if (child_error != NULL) { + g_propagate_error (error, child_error); + return FALSE; + } + + return TRUE; +} + +static void +request_authorization_thread (GTask *task, + gpointer source_object, + gpointer task_data, + GCancellable *cancellable) +{ + GDataOAuth2Authorizer *authorizer = GDATA_OAUTH2_AUTHORIZER (source_object); + g_autoptr(GError) error = NULL; + const gchar *authorization_code = task_data; + + if (!gdata_oauth2_authorizer_request_authorization (authorizer, + authorization_code, + cancellable, + &error)) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_boolean (task, TRUE); +} + +/** + * gdata_oauth2_authorizer_request_authorization_async: + * @self: a #GDataOAuth2Authorizer + * @authorization_code: code returned from the authentication page + * @cancellable: (allow-none): an optional #GCancellable, or %NULL + * @callback: a #GAsyncReadyCallback to call when authorization is finished + * @user_data: (closure): data to pass to the @callback function + * + * Asynchronous version of gdata_oauth2_authorizer_request_authorization(). + * + * Since: 0.17.0 + */ +void +gdata_oauth2_authorizer_request_authorization_async (GDataOAuth2Authorizer *self, + const gchar *authorization_code, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + + g_return_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self)); + g_return_if_fail (authorization_code != NULL && + *authorization_code != '\0'); + g_return_if_fail (cancellable == NULL || + G_IS_CANCELLABLE (cancellable)); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_oauth2_authorizer_request_authorization_async); + g_task_set_task_data (task, g_strdup (authorization_code), + (GDestroyNotify) g_free); + g_task_run_in_thread (task, request_authorization_thread); +} + +/** + * gdata_oauth2_authorizer_request_authorization_finish: + * @self: a #GDataOAuth2Authorizer + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous authorization operation started with + * gdata_oauth2_authorizer_request_authorization_async(). + * + * Return value: %TRUE if authorization was successful, %FALSE otherwise + * + * Since: 0.17.0 + */ +gboolean +gdata_oauth2_authorizer_request_authorization_finish (GDataOAuth2Authorizer *self, + GAsyncResult *async_result, + GError **error) +{ + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_return_val_if_fail (g_task_is_valid (async_result, self), FALSE); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_oauth2_authorizer_request_authorization_async), FALSE); + + return g_task_propagate_boolean (G_TASK (async_result), error); +} + +/** + * gdata_oauth2_authorizer_get_client_id: + * @self: a #GDataOAuth2Authorizer + * + * Returns the authorizer's client ID, #GDataOAuth2Authorizer:client-id, as + * specified on constructing the #GDataOAuth2Authorizer. + * + * Return value: the authorizer's client ID + * + * Since: 0.17.0 + */ +const gchar * +gdata_oauth2_authorizer_get_client_id (GDataOAuth2Authorizer *self) +{ + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), NULL); + return self->priv->client_id; +} + +/** + * gdata_oauth2_authorizer_get_redirect_uri: + * @self: a #GDataOAuth2Authorizer + * + * Returns the authorizer’s redirect URI, #GDataOAuth2Authorizer:redirect-uri, + * as specified on constructing the #GDataOAuth2Authorizer. + * + * Return value: the authorizer’s redirect URI + * + * Since: 0.17.0 + */ +const gchar * +gdata_oauth2_authorizer_get_redirect_uri (GDataOAuth2Authorizer *self) +{ + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), NULL); + return self->priv->redirect_uri; +} + +/** + * gdata_oauth2_authorizer_get_client_secret: + * @self: a #GDataOAuth2Authorizer + * + * Returns the authorizer's client secret, #GDataOAuth2Authorizer:client-secret, + * as specified on constructing the #GDataOAuth2Authorizer. + * + * Return value: the authorizer's client secret + * + * Since: 0.17.0 + */ +const gchar * +gdata_oauth2_authorizer_get_client_secret (GDataOAuth2Authorizer *self) +{ + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), NULL); + return self->priv->client_secret; +} + +/** + * gdata_oauth2_authorizer_dup_refresh_token: + * @self: a #GDataOAuth2Authorizer + * + * Returns the authorizer's refresh token, #GDataOAuth2Authorizer:refresh-token, + * as set by client code previously on the #GDataOAuth2Authorizer, or as + * returned by the most recent authentication operation. + * + * Return value: (transfer full): the authorizer's refresh token + * + * Since: 0.17.2 + */ +gchar * +gdata_oauth2_authorizer_dup_refresh_token (GDataOAuth2Authorizer *self) +{ + GDataOAuth2AuthorizerPrivate *priv; + gchar *refresh_token; /* owned */ + + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), NULL); + + priv = self->priv; + + g_mutex_lock (&priv->mutex); + refresh_token = g_strdup (priv->refresh_token); + g_mutex_unlock (&priv->mutex); + + return refresh_token; +} + +/** + * gdata_oauth2_authorizer_set_refresh_token: + * @self: a #GDataOAuth2Authorizer + * @refresh_token: (nullable): the new refresh token, or %NULL to clear + * authorization + * + * Sets the authorizer's refresh token, #GDataOAuth2Authorizer:refresh-token. + * This is used to periodically refresh the access token. Set it to %NULL to + * clear the current authentication from the authorizer. + * + * Since: 0.17.2 + */ +void +gdata_oauth2_authorizer_set_refresh_token (GDataOAuth2Authorizer *self, + const gchar *refresh_token) +{ + GDataOAuth2AuthorizerPrivate *priv; + + g_return_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self)); + + priv = self->priv; + + g_mutex_lock (&priv->mutex); + + if (g_strcmp0 (priv->refresh_token, refresh_token) == 0) { + g_mutex_unlock (&priv->mutex); + return; + } + + /* Clear the access token; if the refresh token has changed, it can + * no longer be valid, and we must avoid the situation: + * (access_token != NULL) && (refresh_token == NULL) */ + g_free (priv->access_token); + priv->access_token = NULL; + + /* Update the refresh token. */ + g_free (priv->refresh_token); + priv->refresh_token = g_strdup (refresh_token); + + g_mutex_unlock (&priv->mutex); + + g_object_notify (G_OBJECT (self), "refresh-token"); +} + +/** + * gdata_oauth2_authorizer_get_locale: + * @self: a #GDataOAuth2Authorizer + * + * Returns the locale currently being used for network requests, or %NULL if the + * locale is the default. + * + * Return value: (allow-none): the current locale + * + * Since: 0.17.0 + */ +const gchar * +gdata_oauth2_authorizer_get_locale (GDataOAuth2Authorizer *self) +{ + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), NULL); + return self->priv->locale; +} + +/** + * gdata_oauth2_authorizer_set_locale: + * @self: a #GDataOAuth2Authorizer + * @locale: (allow-none): the new locale in UNIX locale format, or %NULL for the + * default locale + * + * Set the locale used for network requests to @locale, given in standard UNIX + * locale format. See #GDataOAuth2Authorizer:locale for more details. + * + * Note that while it’s possible to change the locale after sending network + * requests (i.e. calling gdata_oauth2_authorizer_build_authentication_uri() for + * the first time), it is unsupported, as the server-side software may behave + * unexpectedly. The only supported use of this method is after creation of the + * authorizer, but before any network requests are made. + * + * Since: 0.17.0 + */ +void +gdata_oauth2_authorizer_set_locale (GDataOAuth2Authorizer *self, + const gchar *locale) +{ + g_return_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self)); + + if (g_strcmp0 (locale, self->priv->locale) == 0) { + /* Already has this value */ + return; + } + + g_free (self->priv->locale); + self->priv->locale = g_strdup (locale); + g_object_notify (G_OBJECT (self), "locale"); +} + +static void +notify_timeout_cb (GObject *gobject, GParamSpec *pspec, GObject *self) +{ + g_object_notify (self, "timeout"); +} + +/** + * gdata_oauth2_authorizer_get_timeout: + * @self: a #GDataOAuth2Authorizer + * + * Gets the #GDataOAuth2Authorizer:timeout property; the network timeout, in + * seconds. + * + * Return value: the timeout, or 0 + * + * Since: 0.17.0 + */ +guint +gdata_oauth2_authorizer_get_timeout (GDataOAuth2Authorizer *self) +{ + guint timeout; + + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), 0); + + g_object_get (self->priv->session, + SOUP_SESSION_TIMEOUT, &timeout, + NULL); + + return timeout; +} + +/** + * gdata_oauth2_authorizer_set_timeout: + * @self: a #GDataOAuth2Authorizer + * @timeout: the timeout, or 0 + * + * Sets the #GDataOAuth2Authorizer:timeout property; the network timeout, in + * seconds. + * + * If @timeout is 0, network operations will never + * time out. + * + * Since: 0.17.0 + */ +void +gdata_oauth2_authorizer_set_timeout (GDataOAuth2Authorizer *self, guint timeout) +{ + g_return_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self)); + + if (timeout == gdata_oauth2_authorizer_get_timeout (self)) { + return; + } + + g_object_set (self->priv->session, SOUP_SESSION_TIMEOUT, timeout, NULL); +} + +/** + * gdata_oauth2_authorizer_get_proxy_resolver: + * @self: a #GDataOAuth2Authorizer + * + * Gets the #GProxyResolver on the #GDataOAuth2Authorizer's #SoupSession. + * + * Return value: (transfer none) (allow-none): a #GProxyResolver, or %NULL + * + * Since: 0.17.0 + */ +GProxyResolver * +gdata_oauth2_authorizer_get_proxy_resolver (GDataOAuth2Authorizer *self) +{ + g_return_val_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self), NULL); + + return self->priv->proxy_resolver; +} + +/** + * gdata_oauth2_authorizer_set_proxy_resolver: + * @self: a #GDataOAuth2Authorizer + * @proxy_resolver: (allow-none): a #GProxyResolver, or %NULL + * + * Sets the #GProxyResolver on the #SoupSession used internally by the given + * #GDataOAuth2Authorizer. + * + * Since: 0.17.0 + */ +void +gdata_oauth2_authorizer_set_proxy_resolver (GDataOAuth2Authorizer *self, + GProxyResolver *proxy_resolver) +{ + g_return_if_fail (GDATA_IS_OAUTH2_AUTHORIZER (self)); + g_return_if_fail (proxy_resolver == NULL || + G_IS_PROXY_RESOLVER (proxy_resolver)); + + if (proxy_resolver != NULL) { + g_object_ref (proxy_resolver); + } + + g_clear_object (&self->priv->proxy_resolver); + self->priv->proxy_resolver = proxy_resolver; + + g_object_notify (G_OBJECT (self), "proxy-resolver"); +} diff --git a/gdata/gdata-oauth2-authorizer.h b/gdata/gdata-oauth2-authorizer.h new file mode 100644 index 0000000..be5abb1 --- /dev/null +++ b/gdata/gdata-oauth2-authorizer.h @@ -0,0 +1,136 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011, 2014, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_OAUTH2_AUTHORIZER_H +#define GDATA_OAUTH2_AUTHORIZER_H + +#include +#include + +#include "gdata-authorizer.h" + +G_BEGIN_DECLS + +/** + * GDATA_OAUTH2_REDIRECT_URI_OOB: + * + * OAuth 2 redirect URI for out-of-band authorisation code transfer, where the + * user is shown the authorisation code and asked to copy it. + * + * See + * reference + * documentation for details. + * + * Since: 0.17.0 + */ +#define GDATA_OAUTH2_REDIRECT_URI_OOB "urn:ietf:wg:oauth:2.0:oob" + +/** + * GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO: + * + * OAuth 2 redirect URI for out-of-band authorisation code transfer, where the + * user is not shown the authorisation code or asked to copy it. + * + * See + * reference + * documentation for details. + * + * Since: 0.17.0 + */ +#define GDATA_OAUTH2_REDIRECT_URI_OOB_AUTO "urn:ietf:wg:oauth:2.0:oob:auto" + +#define GDATA_TYPE_OAUTH2_AUTHORIZER (gdata_oauth2_authorizer_get_type ()) +#define GDATA_OAUTH2_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_OAUTH2_AUTHORIZER, GDataOAuth2Authorizer)) +#define GDATA_OAUTH2_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_OAUTH2_AUTHORIZER, GDataOAuth2AuthorizerClass)) +#define GDATA_IS_OAUTH2_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_OAUTH2_AUTHORIZER)) +#define GDATA_IS_OAUTH2_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_OAUTH2_AUTHORIZER)) +#define GDATA_OAUTH2_AUTHORIZER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_OAUTH2_AUTHORIZER, GDataOAuth2AuthorizerClass)) + +typedef struct _GDataOAuth2AuthorizerPrivate GDataOAuth2AuthorizerPrivate; + +/** + * GDataOAuth2Authorizer: + * + * All the fields in the #GDataOAuth2Authorizer structure are private and should never be accessed directly. + * + * Since: 0.17.0 + */ +typedef struct { + /*< private >*/ + GObject parent; + GDataOAuth2AuthorizerPrivate *priv; +} GDataOAuth2Authorizer; + +/** + * GDataOAuth2AuthorizerClass: + * + * All the fields in the #GDataOAuth2AuthorizerClass structure are private and should never be accessed directly. + * + * Since: 0.17.0 + */ +typedef struct { + /*< private >*/ + GObjectClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataOAuth2AuthorizerClass; + +GType gdata_oauth2_authorizer_get_type (void) G_GNUC_CONST; + +GDataOAuth2Authorizer *gdata_oauth2_authorizer_new (const gchar *client_id, + const gchar *client_secret, + const gchar *redirect_uri, + GType service_type) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataOAuth2Authorizer *gdata_oauth2_authorizer_new_for_authorization_domains (const gchar *client_id, + const gchar *client_secret, + const gchar *redirect_uri, + GList *authorization_domains) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gchar *gdata_oauth2_authorizer_build_authentication_uri (GDataOAuth2Authorizer *self, + const gchar *login_hint, + gboolean include_granted_scopes) G_GNUC_PURE; + +gboolean gdata_oauth2_authorizer_request_authorization (GDataOAuth2Authorizer *self, const gchar *authorization_code, + GCancellable *cancellable, GError **error); +void gdata_oauth2_authorizer_request_authorization_async (GDataOAuth2Authorizer *self, const gchar *authorization_code, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +gboolean gdata_oauth2_authorizer_request_authorization_finish (GDataOAuth2Authorizer *self, GAsyncResult *async_result, GError **error); + +const gchar *gdata_oauth2_authorizer_get_client_id (GDataOAuth2Authorizer *self) G_GNUC_PURE; +const gchar *gdata_oauth2_authorizer_get_redirect_uri (GDataOAuth2Authorizer *self) G_GNUC_PURE; +const gchar *gdata_oauth2_authorizer_get_client_secret (GDataOAuth2Authorizer *self) G_GNUC_PURE; + +gchar *gdata_oauth2_authorizer_dup_refresh_token (GDataOAuth2Authorizer *self) G_GNUC_PURE; +void gdata_oauth2_authorizer_set_refresh_token (GDataOAuth2Authorizer *self, const gchar *refresh_token); + +const gchar *gdata_oauth2_authorizer_get_locale (GDataOAuth2Authorizer *self) G_GNUC_PURE; +void gdata_oauth2_authorizer_set_locale (GDataOAuth2Authorizer *self, const gchar *locale); + +guint gdata_oauth2_authorizer_get_timeout (GDataOAuth2Authorizer *self) G_GNUC_PURE; +void gdata_oauth2_authorizer_set_timeout (GDataOAuth2Authorizer *self, guint timeout); + +GProxyResolver *gdata_oauth2_authorizer_get_proxy_resolver (GDataOAuth2Authorizer *self) G_GNUC_PURE; +void gdata_oauth2_authorizer_set_proxy_resolver (GDataOAuth2Authorizer *self, GProxyResolver *proxy_resolver); + +G_END_DECLS + +#endif /* !GDATA_OAUTH2_AUTHORIZER_H */ diff --git a/gdata/gdata-parsable.c b/gdata/gdata-parsable.c new file mode 100644 index 0000000..80b1a10 --- /dev/null +++ b/gdata/gdata-parsable.c @@ -0,0 +1,781 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-parsable + * @short_description: GData parsable object + * @stability: Stable + * @include: gdata/gdata-parsable.h + * + * #GDataParsable is an abstract class allowing easy implementation of an extensible parser. It is primarily extended by #GDataFeed and #GDataEntry, + * both of which require XML parsing which can be extended by subclassing. + * + * It allows methods to be defined for handling the root XML node, each of its child nodes, and a method to be called after parsing is complete. + * + * Since: 0.3.0 + */ + +#include +#include +#include +#include +#include +#include + +#include "gdata-parsable.h" +#include "gdata-private.h" +#include "gdata-parser.h" + +GQuark +gdata_parser_error_quark (void) +{ + return g_quark_from_static_string ("gdata-parser-error-quark"); +} + +static void gdata_parsable_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_parsable_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void gdata_parsable_finalize (GObject *object); +static gboolean real_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static gboolean real_parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static const gchar *get_content_type (void); + +struct _GDataParsablePrivate { + /* XML stuff. */ + GString *extra_xml; + GHashTable *extra_namespaces; + + /* JSON stuff. */ + GHashTable/**/ *extra_json; + + gboolean constructed_from_xml; +}; + +enum { + PROP_CONSTRUCTED_FROM_XML = 1, +}; + +G_DEFINE_ABSTRACT_TYPE (GDataParsable, gdata_parsable, G_TYPE_OBJECT) + +static void +gdata_parsable_class_init (GDataParsableClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataParsablePrivate)); + + gobject_class->get_property = gdata_parsable_get_property; + gobject_class->set_property = gdata_parsable_set_property; + gobject_class->finalize = gdata_parsable_finalize; + klass->parse_xml = real_parse_xml; + klass->parse_json = real_parse_json; + klass->get_content_type = get_content_type; + + /** + * GDataParsable:constructed-from-xml: + * + * Specifies whether the object was constructed by parsing XML or manually. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_CONSTRUCTED_FROM_XML, + g_param_spec_boolean ("constructed-from-xml", + "Constructed from XML?", + "Specifies whether the object was constructed by parsing XML or manually.", + FALSE, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_parsable_init (GDataParsable *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_PARSABLE, GDataParsablePrivate); + + self->priv->extra_xml = g_string_new (""); + self->priv->extra_namespaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + + self->priv->extra_json = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) json_node_free); + + self->priv->constructed_from_xml = FALSE; +} + + +static void +gdata_parsable_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataParsablePrivate *priv = GDATA_PARSABLE (object)->priv; + + switch (property_id) { + case PROP_CONSTRUCTED_FROM_XML: + g_value_set_boolean (value, priv->constructed_from_xml); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_parsable_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataParsablePrivate *priv = GDATA_PARSABLE (object)->priv; + + switch (property_id) { + case PROP_CONSTRUCTED_FROM_XML: + priv->constructed_from_xml = g_value_get_boolean (value); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_parsable_finalize (GObject *object) +{ + GDataParsablePrivate *priv = GDATA_PARSABLE (object)->priv; + + g_string_free (priv->extra_xml, TRUE); + g_hash_table_destroy (priv->extra_namespaces); + + g_hash_table_destroy (priv->extra_json); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_parsable_parent_class)->finalize (object); +} + +static gboolean +real_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + xmlBuffer *buffer; + xmlNs **namespaces, **namespace; + + /* Unhandled XML */ + buffer = xmlBufferCreate (); + xmlNodeDump (buffer, doc, node, 0, 0); + g_string_append (parsable->priv->extra_xml, (gchar*) xmlBufferContent (buffer)); + g_debug ("Unhandled XML in %s: %s", G_OBJECT_TYPE_NAME (parsable), (gchar*) xmlBufferContent (buffer)); + xmlBufferFree (buffer); + + /* Get the namespaces */ + namespaces = xmlGetNsList (doc, node); + if (namespaces == NULL) + return TRUE; + + for (namespace = namespaces; *namespace != NULL; namespace++) { + if ((*namespace)->prefix != NULL) { + /* NOTE: These two g_strdup()s leak, but it's probably acceptable, given that it saves us + * g_strdup()ing every other namespace we put in @extra_namespaces. */ + g_hash_table_insert (parsable->priv->extra_namespaces, + g_strdup ((gchar*) ((*namespace)->prefix)), + g_strdup ((gchar*) ((*namespace)->href))); + } + } + xmlFree (namespaces); + + return TRUE; +} + +/* Extract the member node. This would be a lot easier if JsonReader had an API to return + * the current node (regardless of whether it's a value, object or array). FIXME: bgo#707100. */ +static JsonNode * /* transfer full */ +_json_reader_dup_current_node (JsonReader *reader) +{ + JsonNode *value; + + if (json_reader_is_value (reader) == TRUE) { + /* Value nodes are easy. Well, ignoring the complication of nulls. */ + if (json_reader_get_null_value (reader) == TRUE) { + value = json_node_new (JSON_NODE_NULL); + } else { + value = json_node_copy (json_reader_get_value (reader)); + } + } else if (json_reader_is_object (reader) == TRUE) { + /* Object nodes require deep copies. */ + gint i; + gchar **members; + JsonObject *obj; + + obj = json_object_new (); + + for (i = 0, members = json_reader_list_members (reader); members[i] != NULL; i++) { + json_reader_read_member (reader, members[i]); + json_object_set_member (obj, members[i], _json_reader_dup_current_node (reader)); + json_reader_end_member (reader); + } + + g_strfreev (members); + + value = json_node_new (JSON_NODE_OBJECT); + json_node_take_object (value, obj); + } else if (json_reader_is_array (reader) == TRUE) { + /* Array nodes require deep copies. */ + gint i, elements; + JsonArray *arr; + + arr = json_array_new (); + + for (i = 0, elements = json_reader_count_elements (reader); i < elements; i++) { + json_reader_read_element (reader, i); + json_array_add_element (arr, _json_reader_dup_current_node (reader)); + json_reader_end_element (reader); + } + + value = json_node_new (JSON_NODE_ARRAY); + json_node_take_array (value, arr); + } else { + /* Uh-oh. */ + g_assert_not_reached (); + } + + return value; +} + +static gboolean +real_parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + gchar *json, *member_name; + JsonGenerator *generator; + JsonNode *value; + + /* Unhandled JSON member. Save it and its value to ->extra_xml so that it's not lost if we + * re-upload this Parsable to the server. */ + member_name = g_strdup (json_reader_get_member_name (reader)); + g_assert (member_name != NULL); + + /* Extract a copy of the current node. */ + value = _json_reader_dup_current_node (reader); + g_assert (value != NULL); + + /* Serialise the value for debugging. */ + generator = json_generator_new (); + json_generator_set_root (generator, value); + + json = json_generator_to_data (generator, NULL); + g_debug ("Unhandled JSON member ‘%s’ in %s: %s", member_name, G_OBJECT_TYPE_NAME (parsable), json); + g_free (json); + + g_object_unref (generator); + + /* Save the value. Transfer ownership of the member_name and value. */ + g_hash_table_replace (parsable->priv->extra_json, (gpointer) member_name, (gpointer) value); + + return TRUE; +} + +static const gchar * +get_content_type (void) { + return "application/atom+xml"; +} + +/** + * gdata_parsable_new_from_xml: + * @parsable_type: the type of the class represented by the XML + * @xml: the XML for just the parsable object, with full namespace declarations + * @length: the length of @xml, or -1 + * @error: a #GError, or %NULL + * + * Creates a new #GDataParsable subclass (of the given @parsable_type) from the given @xml. + * + * An object of the given @parsable_type is created, and its pre_parse_xml, parse_xml and + * post_parse_xml class functions called on the XML tree obtained from @xml. pre_parse_xml and + * post_parse_xml are called once each on the root node of the tree, while parse_xml is called for + * each of the child nodes of the root node. + * + * If @length is -1, @xml will be assumed to be null-terminated. + * + * If an error occurs during parsing, a suitable error from #GDataParserError will be returned. + * + * Return value: a new #GDataParsable, or %NULL; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataParsable * +gdata_parsable_new_from_xml (GType parsable_type, const gchar *xml, gint length, GError **error) +{ + g_return_val_if_fail (g_type_is_a (parsable_type, GDATA_TYPE_PARSABLE), NULL); + g_return_val_if_fail (xml != NULL && *xml != '\0', NULL); + g_return_val_if_fail (length >= -1, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + return _gdata_parsable_new_from_xml (parsable_type, xml, length, NULL, error); +} + +GDataParsable * +_gdata_parsable_new_from_xml (GType parsable_type, const gchar *xml, gint length, gpointer user_data, GError **error) +{ + xmlDoc *doc; + xmlNode *node; + GDataParsable *parsable; + static gboolean libxml_initialised = FALSE; + + g_return_val_if_fail (g_type_is_a (parsable_type, GDATA_TYPE_PARSABLE), NULL); + g_return_val_if_fail (xml != NULL && *xml != '\0', NULL); + g_return_val_if_fail (length >= -1, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Set up libxml. We do this here to avoid introducing a libgdata setup function, which would be unnecessary hassle. This is the only place + * that libxml can be initialised in the library. */ + if (libxml_initialised == FALSE) { + /* Change the libxml memory allocation functions to be GLib's. This means we don't have to re-allocate all the strings we get from + * libxml, which cuts down on strdup() calls dramatically. */ + xmlMemSetup ((xmlFreeFunc) g_free, (xmlMallocFunc) g_malloc, (xmlReallocFunc) g_realloc, (xmlStrdupFunc) g_strdup); + libxml_initialised = TRUE; + } + + if (length == -1) + length = strlen (xml); + + /* Parse the XML */ + doc = xmlReadMemory (xml, length, "/dev/null", NULL, 0); + if (doc == NULL) { + xmlError *xml_error = xmlGetLastError (); + g_set_error (error, GDATA_PARSER_ERROR, GDATA_PARSER_ERROR_PARSING_STRING, + /* Translators: the parameter is an error message */ + _("Error parsing XML: %s"), + (xml_error != NULL) ? xml_error->message : NULL); + return NULL; + } + + /* Get the root element */ + node = xmlDocGetRootElement (doc); + if (node == NULL) { + /* XML document's empty */ + xmlFreeDoc (doc); + g_set_error (error, GDATA_PARSER_ERROR, GDATA_PARSER_ERROR_EMPTY_DOCUMENT, + _("Error parsing XML: %s"), + /* Translators: this is a dummy error message to be substituted into "Error parsing XML: %s". */ + _("Empty document.")); + return NULL; + } + + parsable = _gdata_parsable_new_from_xml_node (parsable_type, doc, node, user_data, error); + xmlFreeDoc (doc); + + return parsable; +} + +GDataParsable * +_gdata_parsable_new_from_xml_node (GType parsable_type, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + GDataParsable *parsable; + GDataParsableClass *klass; + + g_return_val_if_fail (g_type_is_a (parsable_type, GDATA_TYPE_PARSABLE), NULL); + g_return_val_if_fail (doc != NULL, NULL); + g_return_val_if_fail (node != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + parsable = g_object_new (parsable_type, "constructed-from-xml", TRUE, NULL); + + klass = GDATA_PARSABLE_GET_CLASS (parsable); + if (klass->parse_xml == NULL) { + g_object_unref (parsable); + return NULL; + } + + g_assert (klass->element_name != NULL); + /* TODO: See gdata-documents-entry.c:260 for an example of where the code below doesn't work */ + /*if (xmlStrcmp (node->name, (xmlChar*) klass->element_name) != 0 || + (node->ns != NULL && xmlStrcmp (node->ns->prefix, (xmlChar*) klass->element_namespace) != 0)) { + * No element (required) * + gdata_parser_error_required_element_missing (klass->element_name, "root", error); + return NULL; + }*/ + + /* Call the pre-parse function first */ + if (klass->pre_parse_xml != NULL && + klass->pre_parse_xml (parsable, doc, node, user_data, error) == FALSE) { + g_object_unref (parsable); + return NULL; + } + + /* Parse each child element */ + node = node->children; + while (node != NULL) { + if (klass->parse_xml (parsable, doc, node, user_data, error) == FALSE) { + g_object_unref (parsable); + return NULL; + } + node = node->next; + } + + /* Call the post-parse function */ + if (klass->post_parse_xml != NULL && + klass->post_parse_xml (parsable, user_data, error) == FALSE) { + g_object_unref (parsable); + return NULL; + } + + return parsable; +} + +/** + * gdata_parsable_new_from_json: + * @parsable_type: the type of the class represented by the JSON + * @json: the JSON for just the parsable object + * @length: the length of @json, or -1 + * @error: a #GError, or %NULL + * + * Creates a new #GDataParsable subclass (of the given @parsable_type) from the given @json. + * + * An object of the given @parsable_type is created, and its parse_json and + * post_parse_json class functions called on the JSON node obtained from @json. + * post_parse_json is called once on the root node, while parse_json is called for + * each of the node's members. + * + * If @length is -1, @json will be assumed to be nul-terminated. + * + * If an error occurs during parsing, a suitable error from #GDataParserError will be returned. + * + * Return value: a new #GDataParsable, or %NULL; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataParsable * +gdata_parsable_new_from_json (GType parsable_type, const gchar *json, gint length, GError **error) +{ + g_return_val_if_fail (g_type_is_a (parsable_type, GDATA_TYPE_PARSABLE), NULL); + g_return_val_if_fail (json != NULL && *json != '\0', NULL); + g_return_val_if_fail (length >= -1, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + return _gdata_parsable_new_from_json (parsable_type, json, length, NULL, error); +} + +GDataParsable * +_gdata_parsable_new_from_json (GType parsable_type, const gchar *json, gint length, gpointer user_data, GError **error) +{ + JsonParser *parser; + JsonReader *reader; + GDataParsable *parsable; + GError *child_error = NULL; + + g_return_val_if_fail (g_type_is_a (parsable_type, GDATA_TYPE_PARSABLE), NULL); + g_return_val_if_fail (json != NULL && *json != '\0', NULL); + g_return_val_if_fail (length >= -1, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (length == -1) + length = strlen (json); + + parser = json_parser_new (); + if (!json_parser_load_from_data (parser, json, length, &child_error)) { + g_set_error (error, GDATA_PARSER_ERROR, GDATA_PARSER_ERROR_PARSING_STRING, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), child_error->message); + g_error_free (child_error); + g_object_unref (parser); + + return NULL; + } + + reader = json_reader_new (json_parser_get_root (parser)); + parsable = _gdata_parsable_new_from_json_node (parsable_type, reader, user_data, error); + + g_object_unref (reader); + g_object_unref (parser); + + return parsable; +} + +GDataParsable * +_gdata_parsable_new_from_json_node (GType parsable_type, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataParsable *parsable; + GDataParsableClass *klass; + gint i; + + g_return_val_if_fail (g_type_is_a (parsable_type, GDATA_TYPE_PARSABLE), NULL); + g_return_val_if_fail (reader != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Indicator property which allows distinguishing between locally created and server based objects + * as it is used for non-XML tasks, and adding another one for JSON would be a bit pointless. */ + parsable = g_object_new (parsable_type, "constructed-from-xml", TRUE, NULL); + + klass = GDATA_PARSABLE_GET_CLASS (parsable); + g_assert (klass->parse_json != NULL); + + /* Check that the outermost node is an object. */ + if (json_reader_is_object (reader) == FALSE) { + g_set_error (error, GDATA_PARSER_ERROR, GDATA_PARSER_ERROR_PARSING_STRING, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + _("Outermost JSON node is not an object.")); + g_object_unref (parsable); + return NULL; + } + + /* Parse each child member. This assumes the outermost node is an object. */ + for (i = 0; i < json_reader_count_members (reader); i++) { + g_return_val_if_fail (json_reader_read_element (reader, i), NULL); + + if (klass->parse_json (parsable, reader, user_data, error) == FALSE) { + json_reader_end_element (reader); + g_object_unref (parsable); + return NULL; + } + + json_reader_end_element (reader); + } + + /* Call the post-parse function */ + if (klass->post_parse_json != NULL && + klass->post_parse_json (parsable, user_data, error) == FALSE) { + g_object_unref (parsable); + return NULL; + } + + return parsable; +} + +/** + * gdata_parsable_get_content_type: + * @self: a #GDataParsable + * + * Returns the content type upon which the #GDataParsable is built. For example, `application/atom+xml` or `application/json`. + * + * Return value: the parsable's content type + * + * Since: 0.17.7 + */ +const gchar * +gdata_parsable_get_content_type (GDataParsable *self) +{ + GDataParsableClass *klass; + + g_return_val_if_fail (GDATA_IS_PARSABLE (self), NULL); + + klass = GDATA_PARSABLE_GET_CLASS (self); + g_assert (klass->get_content_type != NULL); + + return klass->get_content_type (); +} + +static void +build_namespaces_cb (gchar *prefix, gchar *href, GString *output) +{ + g_string_append_printf (output, " xmlns:%s='%s'", prefix, href); +} + +static gboolean +filter_namespaces_cb (gchar *prefix, gchar *href, GHashTable *canonical_namespaces) +{ + if (g_hash_table_lookup (canonical_namespaces, prefix) != NULL) + return TRUE; + return FALSE; +} + +/** + * gdata_parsable_get_xml: + * @self: a #GDataParsable + * + * Builds an XML representation of the #GDataParsable in its current state, such that it could be inserted on the server. The XML is guaranteed + * to have all its namespaces declared properly in a self-contained fashion, and is valid for stand-alone use. + * + * Return value: the object's XML; free with g_free() + * + * Since: 0.4.0 + */ +gchar * +gdata_parsable_get_xml (GDataParsable *self) +{ + GString *xml_string; + + g_return_val_if_fail (GDATA_IS_PARSABLE (self), NULL); + + xml_string = g_string_sized_new (1000); + g_string_append (xml_string, ""); + _gdata_parsable_get_xml (self, xml_string, TRUE); + return g_string_free (xml_string, FALSE); +} + +/* + * _gdata_parsable_get_xml: + * @self: a #GDataParsable + * @xml_string: a #GString to build the XML in + * @declare_namespaces: %TRUE if all the namespaces used in the outputted XML should be declared in the opening tag of the root element, + * %FALSE otherwise + * + * Builds an XML representation of the #GDataParsable in its current state, such that it could be inserted on the server. If @declare_namespaces is + * %TRUE, the XML is guaranteed to have all its namespaces declared properly in a self-contained fashion, and is valid for stand-alone use. If + * @declare_namespaces is %FALSE, none of the used namespaces are declared, and the XML is suitable for insertion into a larger XML tree. + * + * Return value: the object's XML; free with g_free() + * + * Since: 0.4.0 + */ +void +_gdata_parsable_get_xml (GDataParsable *self, GString *xml_string, gboolean declare_namespaces) +{ + GDataParsableClass *klass; + guint length; + GHashTable *namespaces = NULL; /* shut up, gcc */ + + g_return_if_fail (GDATA_IS_PARSABLE (self)); + g_return_if_fail (xml_string != NULL); + + klass = GDATA_PARSABLE_GET_CLASS (self); + g_assert (klass->element_name != NULL); + + /* Get the namespaces the class uses */ + if (declare_namespaces == TRUE && klass->get_namespaces != NULL) { + namespaces = g_hash_table_new (g_str_hash, g_str_equal); + klass->get_namespaces (self, namespaces); + + /* Remove any duplicate extra namespaces */ + g_hash_table_foreach_remove (self->priv->extra_namespaces, (GHRFunc) filter_namespaces_cb, namespaces); + } + + /* Build up the namespace list */ + if (klass->element_namespace != NULL) + g_string_append_printf (xml_string, "<%s:%s", klass->element_namespace, klass->element_name); + else + g_string_append_printf (xml_string, "<%s", klass->element_name); + + /* We only include the normal namespaces if we're not at the top level of XML building */ + if (declare_namespaces == TRUE) { + g_string_append (xml_string, " xmlns='http://www.w3.org/2005/Atom'"); + if (namespaces != NULL) { + g_hash_table_foreach (namespaces, (GHFunc) build_namespaces_cb, xml_string); + g_hash_table_destroy (namespaces); + } + } + + g_hash_table_foreach (self->priv->extra_namespaces, (GHFunc) build_namespaces_cb, xml_string); + + /* Add anything the class thinks is suitable */ + if (klass->pre_get_xml != NULL) + klass->pre_get_xml (self, xml_string); + g_string_append_c (xml_string, '>'); + + /* Store the length before we close the opening tag, so we can determine whether to self-close later on */ + length = xml_string->len; + + /* Add the rest of the XML */ + if (klass->get_xml != NULL) + klass->get_xml (self, xml_string); + + /* Any extra XML? */ + if (self->priv->extra_xml != NULL && self->priv->extra_xml->str != NULL) + g_string_append (xml_string, self->priv->extra_xml->str); + + /* Close the element; either by self-closing the opening tag, or by writing out a closing tag */ + if (xml_string->len == length) + g_string_overwrite (xml_string, length - 1, "/>"); + else if (klass->element_namespace != NULL) + g_string_append_printf (xml_string, "", klass->element_namespace, klass->element_name); + else + g_string_append_printf (xml_string, "", klass->element_name); +} + +/** + * gdata_parsable_get_json: + * @self: a #GDataParsable + * + * Builds a JSON representation of the #GDataParsable in its current state, such that it could be inserted on the server. The JSON + * is valid for stand-alone use. + * + * Return value: the object's JSON; free with g_free() + * + * Since: 0.15.0 + */ +gchar * +gdata_parsable_get_json (GDataParsable *self) +{ + JsonGenerator *generator; + JsonBuilder *builder; + JsonNode *root; + gchar *output; + + g_return_val_if_fail (GDATA_IS_PARSABLE (self), NULL); + + /* Build the JSON tree. */ + builder = json_builder_new (); + _gdata_parsable_get_json (self, builder); + root = json_builder_get_root (builder); + g_object_unref (builder); + + /* Serialise it to a string. */ + generator = json_generator_new (); + json_generator_set_root (generator, root); + output = json_generator_to_data (generator, NULL); + g_object_unref (generator); + + json_node_free (root); + + return output; +} + +/* + * _gdata_parsable_get_json: + * @self: a #GDataParsable + * @builder: a #JsonBuilder to build the JSON in + * + * Builds a JSON representation of the #GDataParsable in its current state, such that it could be inserted on the server. + * + * Since: 0.15.0 + */ +void +_gdata_parsable_get_json (GDataParsable *self, JsonBuilder *builder) +{ + GDataParsableClass *klass; + GHashTableIter iter; + gchar *member_name; + JsonNode *value; + + g_return_if_fail (GDATA_IS_PARSABLE (self)); + g_return_if_fail (JSON_IS_BUILDER (builder)); + + klass = GDATA_PARSABLE_GET_CLASS (self); + + json_builder_begin_object (builder); + + /* Add the JSON. */ + if (klass->get_json != NULL) + klass->get_json (self, builder); + + /* Any extra JSON which we couldn't parse before? */ + g_hash_table_iter_init (&iter, self->priv->extra_json); + while (g_hash_table_iter_next (&iter, (gpointer *) &member_name, (gpointer *) &value) == TRUE) { + json_builder_set_member_name (builder, member_name); + json_builder_add_value (builder, json_node_copy (value)); /* transfers ownership */ + } + + json_builder_end_object (builder); +} + +/* + * _gdata_parsable_is_constructed_from_xml: + * @self: a #GDataParsable + * + * Returns the value of #GDataParsable:constructed-from-xml. + * + * Return value: %TRUE if the #GDataParsable was constructed from XML, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +_gdata_parsable_is_constructed_from_xml (GDataParsable *self) +{ + g_return_val_if_fail (GDATA_IS_PARSABLE (self), FALSE); + return self->priv->constructed_from_xml; +} diff --git a/gdata/gdata-parsable.h b/gdata/gdata-parsable.h new file mode 100644 index 0000000..f4a090f --- /dev/null +++ b/gdata/gdata-parsable.h @@ -0,0 +1,135 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_PARSABLE_H +#define GDATA_PARSABLE_H + +#include +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDataParserError: + * @GDATA_PARSER_ERROR_PARSING_STRING: Error parsing the XML or JSON syntax itself + * @GDATA_PARSER_ERROR_EMPTY_DOCUMENT: Empty document + * + * Error codes for XML or JSON parsing operations. + */ +typedef enum { + GDATA_PARSER_ERROR_PARSING_STRING = 1, + GDATA_PARSER_ERROR_EMPTY_DOCUMENT +} GDataParserError; + +#define GDATA_PARSER_ERROR gdata_parser_error_quark () +GQuark gdata_parser_error_quark (void) G_GNUC_CONST; + +#define GDATA_TYPE_PARSABLE (gdata_parsable_get_type ()) +#define GDATA_PARSABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_PARSABLE, GDataParsable)) +#define GDATA_PARSABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_PARSABLE, GDataParsableClass)) +#define GDATA_IS_PARSABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_PARSABLE)) +#define GDATA_IS_PARSABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_PARSABLE)) +#define GDATA_PARSABLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_PARSABLE, GDataParsableClass)) + +typedef struct _GDataParsablePrivate GDataParsablePrivate; + +/** + * GDataParsable: + * + * All the fields in the #GDataParsable structure are private and should never be accessed directly. + * + * Since: 0.3.0 + */ +typedef struct { + GObject parent; + GDataParsablePrivate *priv; +} GDataParsable; + +/** + * GDataParsableClass: + * @parent: the parent class + * @pre_parse_xml: a function called before parsing of an XML tree is started, which allows properties from the root node to be extracted + * and used in @parsable + * @parse_xml: a function to parse an XML representation of the #GDataParsable to set the properties of the @parsable + * @post_parse_xml: a function called after parsing an XML tree, to allow the @parsable to validate the parsed properties + * @pre_get_xml: a function called before building the XML representation of the children of the #GDataParsable, which allows attributes of the root + * XML node to be added to @xml_string + * @get_xml: a function to build an XML representation of the #GDataParsable in its current state, appending it to the provided #GString + * @get_namespaces: a function to return a string containing the namespace declarations used by the @parsable when represented in XML form + * @parse_json: a function to parse a JSON representation of the #GDataParsable to set the properties of the @parsable + * @post_parse_json: a function called after parsing a JSON object, to allow the @parsable to validate the parsed properties + * @get_json: a function to build a JSON representation of the #GDataParsable in its current state, appending it to the provided #JsonBuilder + * @get_content_type: a function which returns content type upon which is #GDataParsable built + * @element_name: the name of the XML element which represents this parsable + * @element_namespace: the prefix of the XML namespace used for the parsable + * + * The class structure for the #GDataParsable class. Note that JSON and XML functions are mutually exclusive: + * a given implementation of #GDataParsable is represented as exactly one of JSON and XML. + * + * Since: 0.3.0 + */ +typedef struct { + GObjectClass parent; + + gboolean (*pre_parse_xml) (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); + gboolean (*parse_xml) (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); + gboolean (*post_parse_xml) (GDataParsable *parsable, gpointer user_data, GError **error); + + void (*pre_get_xml) (GDataParsable *parsable, GString *xml_string); + void (*get_xml) (GDataParsable *parsable, GString *xml_string); + void (*get_namespaces) (GDataParsable *parsable, GHashTable *namespaces); + + gboolean (*parse_json) (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); + gboolean (*post_parse_json) (GDataParsable *parsable, gpointer user_data, GError **error); + void (*get_json) (GDataParsable *parsable, JsonBuilder *builder); + + const gchar *(*get_content_type) (void); + + const gchar *element_name; + const gchar *element_namespace; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); + void (*_g_reserved6) (void); + void (*_g_reserved7) (void); +} GDataParsableClass; + +GType gdata_parsable_get_type (void) G_GNUC_CONST; + +const gchar *gdata_parsable_get_content_type (GDataParsable *self); + +GDataParsable *gdata_parsable_new_from_xml (GType parsable_type, const gchar *xml, gint length, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +gchar *gdata_parsable_get_xml (GDataParsable *self) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataParsable *gdata_parsable_new_from_json (GType parsable_type, const gchar *json, gint length, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +gchar *gdata_parsable_get_json (GDataParsable *self) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_PARSABLE_H */ diff --git a/gdata/gdata-parser.c b/gdata/gdata-parser.c new file mode 100644 index 0000000..ef10a47 --- /dev/null +++ b/gdata/gdata-parser.c @@ -0,0 +1,1312 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gdata-parser.h" +#include "gdata-service.h" +#include "gdata-types.h" +#include "gdata-private.h" + +static gchar * +print_element (xmlNode *node) +{ + gboolean node_has_ns = (node->ns == NULL || node->ns->prefix == NULL || + xmlStrcmp (node->ns->href, (xmlChar*) "http://www.w3.org/2005/Atom") == 0) ? FALSE : TRUE; + + if (node->parent == NULL) { + /* No parent node */ + if (node_has_ns == TRUE) + return g_strdup_printf ("<%s:%s>", node->ns->prefix, node->name); + else + return g_strdup_printf ("<%s>", node->name); + } else { + /* We have a parent node, which makes things a lot more complex */ + gboolean parent_has_ns = (node->parent->type == XML_DOCUMENT_NODE || node->parent->ns == NULL || node->parent->ns->prefix == NULL || + xmlStrcmp (node->parent->ns->href, (xmlChar*) "http://www.w3.org/2005/Atom") == 0) ? FALSE : TRUE; + + if (parent_has_ns == TRUE && node_has_ns == TRUE) + return g_strdup_printf ("<%s:%s/%s:%s>", node->parent->ns->prefix, node->parent->name, node->ns->prefix, node->name); + else if (parent_has_ns == FALSE && node_has_ns == TRUE) + return g_strdup_printf ("<%s/%s:%s>", node->parent->name, node->ns->prefix, node->name); + else + return g_strdup_printf ("<%s/%s>", node->parent->name, node->name); + } +} + +gboolean +gdata_parser_error_required_content_missing (xmlNode *element, GError **error) +{ + gchar *element_string = print_element (element); + + /* Translators: the parameter is the name of an XML element, including the angle brackets ("<" and ">"). + * + * For example: + * A element was missing required content. */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, _("A %s element was missing required content."), element_string); + g_free (element_string); + + return FALSE; +} + +gboolean +gdata_parser_error_not_iso8601_format (xmlNode *element, const gchar *actual_value, GError **error) +{ + gchar *element_string = print_element (element); + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is the name of an XML element (including the angle brackets ("<" and ">")), + * and the second parameter is the erroneous value (which was not in ISO 8601 format). + * + * For example: + * The content of a <media:group/media:uploaded> element (‘2009-05-06 26:30Z’) was not in ISO 8601 format. */ + _("The content of a %s element (‘%s’) was not in ISO 8601 format."), element_string, actual_value); + g_free (element_string); + + return FALSE; +} + +gboolean +gdata_parser_error_unknown_property_value (xmlNode *element, const gchar *property_name, const gchar *actual_value, GError **error) +{ + gchar *property_string, *element_string; + + property_string = g_strdup_printf ("@%s", property_name); + element_string = print_element (element); + + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is the name of an XML property, the second is the name of an XML element + * (including the angle brackets ("<" and ">")) to which the property belongs, and the third is the unknown value. + * + * For example: + * The value of the @time property of a <media:group/media:thumbnail> element (‘00:01:42.500’) was unknown. */ + _("The value of the %s property of a %s element (‘%s’) was unknown."), property_string, element_string, actual_value); + g_free (property_string); + g_free (element_string); + + return FALSE; +} + +gboolean +gdata_parser_error_unknown_content (xmlNode *element, const gchar *actual_content, GError **error) +{ + gchar *element_string = print_element (element); + + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is the name of an XML element (including the angle brackets ("<" and ">")), + * and the second parameter is the unknown content of that element. + * + * For example: + * The content of a <gphoto:access> element (‘protected’) was unknown. */ + _("The content of a %s element (‘%s’) was unknown."), element_string, actual_content); + g_free (element_string); + + return FALSE; +} + +gboolean +gdata_parser_error_required_property_missing (xmlNode *element, const gchar *property_name, GError **error) +{ + gchar *property_string, *element_string; + + property_string = g_strdup_printf ("@%s", property_name); + element_string = print_element (element); + + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is the name of an XML element (including the angle brackets ("<" and ">")), + * and the second is the name of an XML property which it should have contained. + * + * For example: + * A required property of a <entry/gAcl:role> element (@value) was not present. */ + _("A required property of a %s element (%s) was not present."), element_string, property_string); + g_free (property_string); + g_free (element_string); + + return FALSE; +} + +gboolean +gdata_parser_error_mutexed_properties (xmlNode *element, const gchar *property1_name, const gchar *property2_name, GError **error) +{ + gchar *property1_string, *property2_string, *element_string; + + property1_string = g_strdup_printf ("@%s", property1_name); + property2_string = g_strdup_printf ("@%s", property2_name); + element_string = print_element (element); + + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first two parameters are the names of XML properties of an XML element given in the third + * parameter (including the angle brackets ("<" and ">")). + * + * For example: + * Values were present for properties @rel and @label of a <entry/gContact:relation> element when only one of the + * two is allowed. */ + _("Values were present for properties %s and %s of a %s element when only one of the two is allowed."), + property1_string, property2_string, element_string); + g_free (property1_string); + g_free (property2_string); + g_free (element_string); + + return FALSE; +} + +gboolean +gdata_parser_error_required_element_missing (const gchar *element_name, const gchar *parent_element_name, GError **error) +{ + /* NOTE: This can't take an xmlNode, since such a node wouldn't exist. */ + gchar *element_string = g_strdup_printf ("<%s/%s>", parent_element_name, element_name); + + /* Translators: the parameter is the name of an XML element, including the angle brackets ("<" and ">"). + * + * For example: + * A required element (<entry/title>) was not present. */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, _("A required element (%s) was not present."), element_string); + g_free (element_string); + + return FALSE; +} + +gboolean +gdata_parser_error_duplicate_element (xmlNode *element, GError **error) +{ + gchar *element_string = print_element (element); + + /* Translators: the parameter is the name of an XML element, including the angle brackets ("<" and ">"). + * + * For example: + * A singleton element (<feed/title>) was duplicated. */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, _("A singleton element (%s) was duplicated."), element_string); + g_free (element_string); + + return FALSE; +} + +gboolean +gdata_parser_int64_from_date (const gchar *date, gint64 *_time) +{ + gchar *iso8601_date; + gboolean success; + GTimeVal time_val; + + if (strlen (date) != 10 && strlen (date) != 8) + return FALSE; + + /* Note: This doesn't need translating, as it's outputting an ISO 8601 time string */ + iso8601_date = g_strdup_printf ("%sT00:00:00Z", date); + success = g_time_val_from_iso8601 (iso8601_date, &time_val); + g_free (iso8601_date); + + if (success == TRUE) + *_time = time_val.tv_sec; + + return success; +} + +gchar * +gdata_parser_date_from_int64 (gint64 _time) +{ + time_t secs; + struct tm *tm; + + secs = _time; + tm = gmtime (&secs); + + /* Note: This doesn't need translating, as it's outputting an ISO 8601 date string */ + return g_strdup_printf ("%04d-%02d-%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); +} + +gchar * +gdata_parser_int64_to_iso8601 (gint64 _time) +{ + GTimeVal time_val; + + time_val.tv_sec = _time; + time_val.tv_usec = 0; + + return g_time_val_to_iso8601 (&time_val); +} + +gchar * +gdata_parser_int64_to_iso8601_numeric_timezone (gint64 _time) +{ + GTimeVal time_val; + gchar *iso8601; + gchar **date_time_components; + gchar *retval; + + time_val.tv_sec = _time; + time_val.tv_usec = 0; + + iso8601 = g_time_val_to_iso8601 (&time_val); + + /* FIXME: Work around for Google's incorrect ISO 8601 implementation. + * They appear to not like dates in the format ‘2014-08-09T21:07:05Z’ + * which specify a timezone using ‘Z’ and no microseconds. This varies + * between services. + * + * See: https://bugzilla.gnome.org/show_bug.cgi?id=732809 + * https://bugzilla.gnome.org/show_bug.cgi?id=780067 + * https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3595 + * http://stackoverflow.com/a/17630320/2931197 */ + date_time_components = g_strsplit (iso8601, "Z", 2); + retval = g_strjoinv (".000001+00:00", date_time_components); + g_strfreev (date_time_components); + + g_free (iso8601); + + return retval; +} + +gboolean +gdata_parser_int64_from_iso8601 (const gchar *date, gint64 *_time) +{ + GTimeVal time_val; + + if (g_time_val_from_iso8601 (date, &time_val) == TRUE) { + *_time = time_val.tv_sec; + return TRUE; + } + + return FALSE; +} + +gboolean +gdata_parser_error_required_json_content_missing (JsonReader *reader, GError **error) +{ + const gchar *element_string = json_reader_get_member_name (reader); + + /* Translators: the parameter is the name of an JSON element. + * + * For example: + * A ‘title’ element was missing required content. */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, _("A ‘%s’ element was missing required content."), element_string); + + return FALSE; +} + +gboolean +gdata_parser_error_duplicate_json_element (JsonReader *reader, GError **error) +{ + const gchar *element_string = json_reader_get_member_name (reader); + + /* Translators: the parameter is the name of an JSON element. + * + * For example: + * A singleton element (title) was duplicated. */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, _("A singleton element (%s) was duplicated."), element_string); + + return FALSE; +} + +gboolean +gdata_parser_error_not_iso8601_format_json (JsonReader *reader, const gchar *actual_value, GError **error) +{ + const gchar *element_string = json_reader_get_member_name (reader); + + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is the name of an JSON element, + * and the second parameter is the erroneous value (which was not in ISO 8601 format). + * + * For example: + * The content of a ‘uploaded’ element (‘2009-05-06 26:30Z’) was not in ISO 8601 format. */ + _("The content of a ‘%s’ element (‘%s’) was not in ISO 8601 format."), element_string, actual_value); + + return FALSE; +} + +gboolean +gdata_parser_error_from_json_error (JsonReader *reader, + const GError *json_error, GError **error) +{ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message. */ + _("Invalid JSON was received from the server: %s"), json_error->message); + + return FALSE; +} + +/* + * gdata_parser_boolean_from_property: + * @element: the XML element which owns the property to parse + * @property_name: the name of the property to parse + * @output: the return location for the parsed boolean value + * @default_output: the default value to return in @output if the property can't be found + * @error: a #GError, or %NULL + * + * Parses a GData boolean value from the property @property_name of @element. + * The boolean value should be of the form: "<element property_name='[true|false]'/>". + * A %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned in @error if parsing fails, and @output will not be set. + * + * If no property with the name @property_name exists in @element and @default_output is <code class="literal">0</code>, + * @output will be set to %FALSE. + * If @default_output is <code class="literal">1</code>, @output will be set to %TRUE. If @default_output is <code class="literal">-1</code>, + * a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be returned in @error. + * + * Return value: %TRUE on successful parsing, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_parser_boolean_from_property (xmlNode *element, const gchar *property_name, gboolean *output, gint default_output, GError **error) +{ + xmlChar *value = xmlGetProp (element, (xmlChar*) property_name); + + if (value == NULL) { + /* Missing property */ + if (default_output == -1) + return gdata_parser_error_required_property_missing (element, property_name, error); + *output = (default_output == 1) ? TRUE : FALSE; + } else if (xmlStrcmp (value, (xmlChar*) "false") == 0) { + *output = FALSE; + } else if (xmlStrcmp (value, (xmlChar*) "true") == 0) { + *output = TRUE; + } else { + /* Parsing failed */ + gdata_parser_error_unknown_property_value (element, property_name, (gchar*) value, error); + xmlFree (value); + return FALSE; + } + + xmlFree (value); + return TRUE; +} + +/* + * gdata_parser_is_namespace: + * @element: the element to check + * @namespace_uri: the URI of the desired namespace + * + * Checks whether @element is in the namespace identified by @namespace_uri. If @element isn't in a namespace, + * %FALSE is returned. + * + * Return value: %TRUE if @element is in @namespace_uri; %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_parser_is_namespace (xmlNode *element, const gchar *namespace_uri) +{ + if ((element->ns != NULL && xmlStrcmp (element->ns->href, (const xmlChar*) namespace_uri) == 0) || + (element->ns == NULL && strcmp (namespace_uri, "http://www.w3.org/2005/Atom") == 0)) + return TRUE; + return FALSE; +} + +/* + * gdata_parser_string_from_element: + * @element: the element to check against + * @element_name: the name of the element to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, or %P_NONE + * @output: the return location for the parsed string content + * @success: the return location for a value which is %TRUE if the string was parsed successfully, %FALSE if an error was encountered, + * and undefined if @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the string content of @element if its name is @element_name, subject to various checks specified by @options. + * + * If @element doesn't match @element_name, %FALSE will be returned, @error will be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by @options fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by @options pass, %TRUE will be returned, @error will be unset and + * @success will be set to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that calls to gdata_parser_string_from_element() can be chained + * together in a large "or" statement based on their return values, for the purposes of determining whether any of the calls matched + * a given @element. If any of the calls to gdata_parser_string_from_element() return %TRUE, the value of @success can be examined. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_parser_string_from_element (xmlNode *element, const gchar *element_name, GDataParserOptions options, + gchar **output, gboolean *success, GError **error) +{ + xmlChar *text; + + /* Check it's the right element */ + if (xmlStrcmp (element->name, (xmlChar*) element_name) != 0) + return FALSE; + + /* Check if the output string has already been set */ + if (options & P_NO_DUPES && *output != NULL) { + *success = gdata_parser_error_duplicate_element (element, error); + return TRUE; + } + + /* Get the string and check it for NULLness or emptiness */ + text = xmlNodeListGetString (element->doc, element->children, TRUE); + if ((options & P_REQUIRED && text == NULL) || (options & P_NON_EMPTY && text != NULL && *text == '\0')) { + xmlFree (text); + *success = gdata_parser_error_required_content_missing (element, error); + return TRUE; + } else if (options & P_DEFAULT && (text == NULL || *text == '\0')) { + text = (xmlChar*) g_strdup (""); + } + + /* Success! */ + g_free (*output); + *output = (gchar*) text; + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_int64_time_from_element: + * @element: the element to check against + * @element_name: the name of the element to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, or %P_NONE + * @output: (out caller-allocates): the return location for the parsed time value + * @success: the return location for a value which is %TRUE if the time val was parsed successfully, %FALSE if an error was encountered, + * and undefined if @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the time value of @element if its name is @element_name, subject to various checks specified by @options. It expects the text content + * of @element to be a date or time value in ISO 8601 format. The returned time value will be a UNIX timestamp (seconds since the epoch). + * + * If @element doesn't match @element_name, %FALSE will be returned, @error will be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by @options fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by @options pass, %TRUE will be returned, @error will be unset and + * @success will be set to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that calls to gdata_parser_int64_time_from_element() can be chained + * together in a large "or" statement based on their return values, for the purposes of determining whether any of the calls matched + * a given @element. If any of the calls to gdata_parser_int64_time_from_element() return %TRUE, the value of @success can be examined. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_parser_int64_time_from_element (xmlNode *element, const gchar *element_name, GDataParserOptions options, + gint64 *output, gboolean *success, GError **error) +{ + xmlChar *text; + GTimeVal time_val; + + /* Check it's the right element */ + if (xmlStrcmp (element->name, (xmlChar*) element_name) != 0) + return FALSE; + + /* Check if the output time val has already been set */ + if (options & P_NO_DUPES && *output != -1) { + *success = gdata_parser_error_duplicate_element (element, error); + return TRUE; + } + + /* Get the string and check it for NULLness */ + text = xmlNodeListGetString (element->doc, element->children, TRUE); + if (options & P_REQUIRED && (text == NULL || *text == '\0')) { + xmlFree (text); + *success = gdata_parser_error_required_content_missing (element, error); + return TRUE; + } + + /* Attempt to parse the string as a GTimeVal */ + if (g_time_val_from_iso8601 ((gchar*) text, &time_val) == FALSE) { + *success = gdata_parser_error_not_iso8601_format (element, (gchar*) text, error); + xmlFree (text); + return TRUE; + } + + *output = time_val.tv_sec; + + /* Success! */ + xmlFree (text); + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_int64_from_element: + * @element: the element to check against + * @element_name: the name of the element to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, or %P_NONE + * @output: (out caller-allocates): the return location for the parsed integer value + * @default_output: default value for the property, used with %P_NO_DUPES to detect duplicates + * @success: the return location for a value which is %TRUE if the integer was parsed successfully, %FALSE if an error was encountered, + * and undefined if @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the integer value of @element if its name is @element_name, subject to various checks specified by @options. It expects the text content + * of @element to be an integer in base 10 format. + * + * If @element doesn't match @element_name, %FALSE will be returned, @error will be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by @options fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by @options pass, %TRUE will be returned, @error will be unset and + * @success will be set to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that calls to gdata_parser_int64_from_element() can be chained + * together in a large "or" statement based on their return values, for the purposes of determining whether any of the calls matched + * a given @element. If any of the calls to gdata_parser_int64_from_element() return %TRUE, the value of @success can be examined. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.13.0 + */ +gboolean +gdata_parser_int64_from_element (xmlNode *element, const gchar *element_name, GDataParserOptions options, + gint64 *output, gint64 default_output, gboolean *success, GError **error) +{ + xmlChar *text; + gchar *end_ptr; + gint64 val; + + /* Check it's the right element */ + if (xmlStrcmp (element->name, (xmlChar*) element_name) != 0) { + return FALSE; + } + + /* Check if the output value has already been set */ + if (options & P_NO_DUPES && *output != default_output) { + *success = gdata_parser_error_duplicate_element (element, error); + return TRUE; + } + + /* Get the string and check it for NULLness */ + text = xmlNodeListGetString (element->doc, element->children, TRUE); + if (options & P_REQUIRED && (text == NULL || *text == '\0')) { + xmlFree (text); + *success = gdata_parser_error_required_content_missing (element, error); + return TRUE; + } + + /* Attempt to parse the string as a 64-bit integer */ + val = g_ascii_strtoll ((const gchar*) text, &end_ptr, 10); + if (*end_ptr != '\0') { + *success = gdata_parser_error_unknown_content (element, (gchar*) text, error); + xmlFree (text); + return TRUE; + } + + *output = val; + + /* Success! */ + xmlFree (text); + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_object_from_element_setter: + * @element: the element to check against + * @element_name: the name of the element to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, or %P_NONE + * @object_type: the type of the object to parse + * @_setter: a function to call once parsing's finished to return the object (#GDataParserSetterFunc) + * @_parent_parsable: the first parameter to pass to @_setter (of type #GDataParsable) + * @success: the return location for a value which is %TRUE if the object was parsed successfully, %FALSE if an error was encountered, + * and undefined if @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the object content of @element if its name is @element_name, subject to various checks specified by @options. If @element matches + * @element_name, @element will be parsed as an @object_type, which must extend #GDataParsable. If parsing is successful, @_setter will be called + * with its first parameter as @_parent_parsable, and its second as the parsed object of type @object_type. @_setter must reference the parsed object + * it's passed if it wants to keep it, as gdata_parser_object_from_element_setter will unreference it before returning. + * + * If @element doesn't match @element_name, %FALSE will be returned, @error will be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by @options fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by @options pass, %TRUE will be returned, @error will be unset and + * @success will be set to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that calls to gdata_parser_object_from_element_setter() can be chained + * together in a large "or" statement based on their return values, for the purposes of determining whether any of the calls matched + * a given @element. If any of the calls to gdata_parser_object_from_element_setter() return %TRUE, the value of @success can be examined. + * + * @_setter and @_parent_parsable are both #gpointer<!-- -->s to avoid casts having to be put into calls to gdata_parser_object_from_element_setter(). + * @_setter is actually of type #GDataParserSetterFunc, and @_parent_parsable should be a subclass of #GDataParsable. + * Neither parameter should be %NULL. No checks are implemented against these conditions (for efficiency reasons), so calling code must be correct. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_parser_object_from_element_setter (xmlNode *element, const gchar *element_name, GDataParserOptions options, GType object_type, + gpointer /* GDataParserSetterFunc */ _setter, gpointer /* GDataParsable * */ _parent_parsable, + gboolean *success, GError **error) +{ + GDataParsable *parsable, *parent_parsable; + GDataParserSetterFunc setter; + + /* We're lax on the types so that we don't have to do loads of casting when calling the function, which makes the parsing code more legible */ + setter = (GDataParserSetterFunc) _setter; + parent_parsable = (GDataParsable*) _parent_parsable; + + /* Check it's the right element */ + if (xmlStrcmp (element->name, (xmlChar*) element_name) != 0) + return FALSE; + + /* Get the object and check for instantiation failure */ + parsable = _gdata_parsable_new_from_xml_node (object_type, element->doc, element, NULL, error); + if (options & P_REQUIRED && parsable == NULL) { + /* The error has already been set by _gdata_parsable_new_from_xml_node() */ + *success = FALSE; + return TRUE; + } + + /* Success! */ + setter (parent_parsable, parsable); + g_object_unref (parsable); + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_object_from_element: + * @element: the element to check against + * @element_name: the name of the element to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, or %P_NONE + * @object_type: the type of the object to parse + * @_output: the return location for the parsed object (of type #GDataParsable) + * @success: the return location for a value which is %TRUE if the object was parsed successfully, %FALSE if an error was encountered, + * and undefined if @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the object content of @element if its name is @element_name, subject to various checks specified by @options. If @element matches + * @element_name, @element will be parsed as an @object_type, which must extend #GDataParsable. If parsing is successful, the parsed object will be + * returned in @_output, which must be of type #GDataParsable (or a subclass). Ownership of the parsed object will pass to the calling code. + * + * If @element doesn't match @element_name, %FALSE will be returned, @error will be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by @options fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by @options pass, %TRUE will be returned, @error will be unset and + * @success will be set to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that calls to gdata_parser_object_from_element() can be chained + * together in a large "or" statement based on their return values, for the purposes of determining whether any of the calls matched + * a given @element. If any of the calls to gdata_parser_object_from_element() return %TRUE, the value of @success can be examined. + * + * @_object is a #gpointer to avoid casts having to be put into calls to gdata_parser_object_from_element(). It is actually of type #GDataParsable + * and must not be %NULL. No check is implemented against this condition (for efficiency reasons), so calling code must be correct. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_parser_object_from_element (xmlNode *element, const gchar *element_name, GDataParserOptions options, GType object_type, + gpointer /* GDataParsable ** */ _output, gboolean *success, GError **error) +{ + GDataParsable *parsable, **output; + + /* We're lax on the types so that we don't have to do loads of casting when calling the function, which makes the parsing code more legible */ + output = (GDataParsable**) _output; + + /* Check it's the right element */ + if (xmlStrcmp (element->name, (xmlChar*) element_name) != 0) + return FALSE; + + /* If we're not using a setter, check if the output already exists */ + if (options & P_NO_DUPES && *output != NULL) { + *success = gdata_parser_error_duplicate_element (element, error); + return TRUE; + } + + /* Get the object and check for instantiation failure */ + parsable = _gdata_parsable_new_from_xml_node (object_type, element->doc, element, NULL, error); + if (options & P_REQUIRED && parsable == NULL) { + /* The error has already been set by _gdata_parsable_new_from_xml_node() */ + *success = FALSE; + return TRUE; + } + + /* Success! */ + if (*output != NULL) + g_object_unref (*output); + *output = parsable; + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_string_from_json_member: + * @reader: #JsonReader cursor object to read JSON node from + * @member_name: the name of the member to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, or %P_NONE + * @output: the return location for the parsed string content + * @success: the return location for a value which is %TRUE if the string was parsed successfully, %FALSE if an error was encountered, + * and undefined if @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the string content of @element if its name is @element_name, subject to various checks specified by @options. + * + * If @element doesn't match @element_name, %FALSE will be returned, @error will be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by @options fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by @options pass, %TRUE will be returned, @error will be unset and + * @success will be set to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that calls to gdata_parser_string_from_element() can be chained + * together in a large "or" statement based on their return values, for the purposes of determining whether any of the calls matched + * a given @element. If any of the calls to gdata_parser_string_from_element() return %TRUE, the value of @success can be examined. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.15.0 + */ +gboolean +gdata_parser_string_from_json_member (JsonReader *reader, const gchar *member_name, GDataParserOptions options, + gchar **output, gboolean *success, GError **error) +{ + const gchar *text; + const GError *child_error = NULL; + + /* Check if there's such element */ + if (g_strcmp0 (json_reader_get_member_name (reader), member_name) != 0) { + return FALSE; + } + + /* Check if the output string has already been set. The JSON parser guarantees this can't happen. */ + g_assert (!(options & P_NO_DUPES) || *output == NULL); + + /* Get the string and check it for NULLness or emptiness. Check for parser errors first. */ + text = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + return TRUE; + } else if ((options & P_REQUIRED && text == NULL) || (options & P_NON_EMPTY && text != NULL && *text == '\0')) { + *success = gdata_parser_error_required_json_content_missing (reader, error); + return TRUE; + } else if (options & P_DEFAULT && (text == NULL || *text == '\0')) { + text = ""; + } + + /* Success! */ + g_free (*output); + *output = g_strdup (text); + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_int_from_json_member: + * @reader: #JsonReader cursor object to read JSON node from + * @member_name: the name of the member to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, + * or %P_NONE + * @output: the return location for the parsed integer content + * @success: the return location for a value which is %TRUE if the integer was + * parsed successfully, %FALSE if an error was encountered, and undefined if + * @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the integer content of @element if its name is @element_name, subject to + * various checks specified by @options. + * + * If @element doesn't match @element_name, %FALSE will be returned, @error will + * be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by @options + * fails, %TRUE will be returned, @error will be set to a +* %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by @options + * pass, %TRUE will be returned, @error will be unset and @success will be set + * to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that + * calls to gdata_parser_int_from_element() can be chained together in a large + * "or" statement based on their return values, for the purposes of determining + * whether any of the calls matched a given @element. If any of the calls to + * gdata_parser_int_from_element() return %TRUE, the value of @success can be + * examined. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.17.0 + */ +gboolean +gdata_parser_int_from_json_member (JsonReader *reader, + const gchar *member_name, + GDataParserOptions options, + gint64 *output, gboolean *success, + GError **error) +{ + gint64 value; + const GError *child_error = NULL; + + /* Check if there's such element */ + if (g_strcmp0 (json_reader_get_member_name (reader), member_name) != 0) { + return FALSE; + } + + value = json_reader_get_int_value (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + return TRUE; + } + + /* Success! */ + *output = value; + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_int64_time_from_json_member: + * @reader: #JsonReader cursor object to read JSON node from + * @element_name: the name of the element to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, or %P_NONE + * @output: (out caller-allocates): the return location for the parsed time value + * @success: the return location for a value which is %TRUE if the time val was parsed successfully, %FALSE if an error was encountered, + * and undefined if @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the time value of @element if its name is @element_name, subject to various checks specified by @options. It expects the text content + * of @element to be a date or time value in ISO 8601 format. The returned time value will be a UNIX timestamp (seconds since the epoch). + * + * If @element doesn't match @element_name, %FALSE will be returned, @error will be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by @options fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by @options pass, %TRUE will be returned, @error will be unset and + * @success will be set to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that calls to gdata_parser_int64_time_from_element() can be chained + * together in a large "or" statement based on their return values, for the purposes of determining whether any of the calls matched + * a given @element. If any of the calls to gdata_parser_int64_time_from_element() return %TRUE, the value of @success can be examined. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.15.0 + */ +gboolean +gdata_parser_int64_time_from_json_member (JsonReader *reader, const gchar *member_name, GDataParserOptions options, + gint64 *output, gboolean *success, GError **error) +{ + const gchar *text; + GTimeVal time_val; + const GError *child_error = NULL; + + /* Check if there's such element */ + if (g_strcmp0 (json_reader_get_member_name (reader), member_name) != 0) { + return FALSE; + } + + /* Check if the output time val has already been set. The JSON parser guarantees this can't happen. */ + g_assert (!(options & P_NO_DUPES) || *output == -1); + + /* Get the string and check it for NULLness. Check for errors first. */ + text = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + return TRUE; + } else if (options & P_REQUIRED && (text == NULL || *text == '\0')) { + *success = gdata_parser_error_required_json_content_missing (reader, error); + return TRUE; + } + + /* Attempt to parse the string as a GTimeVal */ + if (g_time_val_from_iso8601 ((gchar*) text, &time_val) == FALSE) { + *success = gdata_parser_error_not_iso8601_format_json (reader, text, error); + return TRUE; + } + + /* Success! */ + *output = time_val.tv_sec; + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_boolean_from_json_member: + * @reader: #JsonReader cursor object to read the JSON node from + * @member_name: the name of the JSON object member to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, or %P_NONE + * @output: (out caller-allocates): the return location for the parsed boolean value + * @success: (out caller-allocates): the return location for a value which is %TRUE if the boolean was parsed successfully, %FALSE if an error was encountered, + * and undefined if @member_name was not found in the current object in @reader + * @error: (allow-none): a #GError, or %NULL + * + * Gets the boolean value of the @member_name member of the current object in the #JsonReader, subject to various checks specified by @options. + * + * If no member matching @member_name can be found in the current @reader JSON object, %FALSE will be returned, @error will be unset and @success will be unset. @output will be undefined. + * + * If @member_name is found but one of the checks specified by @options fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. @output will be undefined. + * + * If @member_name is found and all of the checks specified by @options pass, %TRUE will be returned, @error will be unset and + * @success will be set to %TRUE. @output will be set to the parsed value. + * + * The reason for returning the success of the parsing in @success is so that calls to gdata_parser_boolean_from_json_node() can be chained + * together in a large "or" statement based on their return values, for the purposes of determining whether any of the calls matched + * a given JSON node. If any of the calls to gdata_parser_boolean_from_json_node() return %TRUE, the value of @success can be examined. + * + * Return value: %TRUE if @member_name was found, %FALSE otherwise + * + * Since: 0.15.0 + */ +gboolean +gdata_parser_boolean_from_json_member (JsonReader *reader, const gchar *member_name, GDataParserOptions options, gboolean *output, gboolean *success, GError **error) +{ + gboolean val; + const GError *child_error = NULL; + + /* Check if there's such an element. */ + if (g_strcmp0 (json_reader_get_member_name (reader), member_name) != 0) { + return FALSE; + } + + /* Get the boolean. Check for parse errors. */ + val = json_reader_get_boolean_value (reader); + child_error = json_reader_get_error (reader); + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + return TRUE; + } + + /* Success! */ + *output = val; + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_strv_from_json_member: + * @reader: #JsonReader cursor object to read JSON node from + * @element_name: the name of the element to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, + * or %P_NONE + * @output: (out callee-allocates) (transfer full): the return location for the + * parsed string array + * @success: the return location for a value which is %TRUE if the string array + * was parsed successfully, %FALSE if an error was encountered, and undefined + * if @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the string array of @element if its name is @element_name, subject to + * various checks specified by @options. It expects the @element to be an array + * of strings. + * + * If @element doesn't match @element_name, %FALSE will be returned, @error will + * be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by @options + * fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by @options + * pass, %TRUE will be returned, @error will be unset and @success will be set + * to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that + * calls to gdata_parser_strv_from_element() can be chained together in a large + * "or" statement based on their return values, for the purposes of determining + * whether any of the calls matched a given @element. If any of the calls to + * gdata_parser_strv_from_element() return %TRUE, the value of @success can be + * examined. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.17.0 + */ +gboolean +gdata_parser_strv_from_json_member (JsonReader *reader, + const gchar *member_name, + GDataParserOptions options, + gchar ***output, gboolean *success, + GError **error) +{ + guint i, len; + GPtrArray *out; + const GError *child_error = NULL; + + /* Check if there's such element */ + if (g_strcmp0 (json_reader_get_member_name (reader), + member_name) != 0) { + return FALSE; + } + + /* Check if the output strv has already been set. The JSON parser + * guarantees this can't happen. */ + g_assert (!(options & P_NO_DUPES) || *output == NULL); + + len = json_reader_count_elements (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + return TRUE; + } + + out = g_ptr_array_new_full (len + 1 /* NULL terminator */, g_free); + + for (i = 0; i < len; i++) { + const gchar *val; + + json_reader_read_element (reader, i); + val = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + json_reader_end_element (reader); + g_ptr_array_unref (out); + return TRUE; + } + + g_ptr_array_add (out, g_strdup (val)); + + json_reader_end_element (reader); + } + + /* NULL terminator. */ + g_ptr_array_add (out, NULL); + + /* Success! */ + *output = (gchar **) g_ptr_array_free (out, FALSE); + *success = TRUE; + + return TRUE; +} + +/* + * gdata_parser_color_from_json_member: + * @reader: #JsonReader cursor object to read JSON node from + * @element_name: the name of the element to parse + * @options: a bitwise combination of parsing options from #GDataParserOptions, + * or %P_NONE + * @output: (out caller-allocates): the return location for the parsed colour + * value + * @success: the return location for a value which is %TRUE if the colour was + * parsed successfully, %FALSE if an error was encountered, and undefined if + * @element didn't match @element_name + * @error: a #GError, or %NULL + * + * Gets the colour value of @element if its name is @element_name, subject to + * various checks specified by @options. It expects the text content of + * @element to be an RGB colour in hexadecimal format, with an optional leading + * hash symbol (for example, `#RRGGBB` or `RRGGBB`). + * + * If @element doesn't match @element_name, %FALSE will be returned, @error + * will be unset and @success will be unset. + * + * If @element matches @element_name but one of the checks specified by + * @options fails, %TRUE will be returned, @error will be set to a + * %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error and @success will be set to %FALSE. + * + * If @element matches @element_name and all of the checks specified by + * @options pass, %TRUE will be returned, @error will be unset and @success + * will be set to %TRUE. + * + * The reason for returning the success of the parsing in @success is so that + * calls to gdata_parser_color_from_json_member() can be chained together in a + * large "or" statement based on their return values, for the purposes of + * determining whether any of the calls matched a given @element. If any of the + * calls to gdata_parser_color_from_json_member() return %TRUE, the value of + * @success can be examined. + * + * Return value: %TRUE if @element matched @element_name, %FALSE otherwise + * + * Since: 0.17.2 + */ +gboolean +gdata_parser_color_from_json_member (JsonReader *reader, + const gchar *member_name, + GDataParserOptions options, + GDataColor *output, + gboolean *success, + GError **error) +{ + const gchar *text; + GDataColor colour; + const GError *child_error = NULL; + + /* Check if there's such an element */ + if (g_strcmp0 (json_reader_get_member_name (reader), member_name) != 0) { + return FALSE; + } + + /* Check if the output colour has already been set. The JSON parser + * guarantees this can't happen. */ + g_assert (!(options & P_NO_DUPES) || + (output->red == 0 && output->green == 0 && output->blue == 0)); + + /* Get the string and check it for NULLness. Check for errors first. */ + text = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, child_error, error); + return TRUE; + } else if (options & P_REQUIRED && (text == NULL || *text == '\0')) { + *success = gdata_parser_error_required_json_content_missing (reader, error); + return TRUE; + } + + /* Attempt to parse the string as a hexadecimal colour. */ + if (gdata_color_from_hexadecimal (text, &colour) == FALSE) { + /* Error */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is the name of an XML element (including the angle brackets + * ("<" and ">"), and the second parameter is the erroneous value (which was not in hexadecimal + * RGB format). + * + * For example: + * The content of a <entry/gCal:color> element (‘00FG56’) was not in hexadecimal RGB format. */ + _("The content of a %s element (‘%s’) was not in hexadecimal RGB format."), + member_name, text); + *success = FALSE; + + return TRUE; + } + + /* Success! */ + *output = colour; + *success = TRUE; + + return TRUE; +} + +void +gdata_parser_string_append_escaped (GString *xml_string, const gchar *pre, const gchar *element_content, const gchar *post) +{ + /* Allocate 10 extra bytes when reallocating the GString, to try and avoid having to reallocate again, by assuming + * there will be an increase in the length of element_content when escaped of less than 10 characters. */ +/* #define SIZE_FUZZINESS 10*/ + +/* guint new_size;*/ + const gchar *p; + + /* Expand xml_string as necessary */ + /* TODO: There is no way to expand the allocation of a GString if you know in advance how much room + * lots of append operations are going to require. */ +/* new_size = xml_string->len + strlen (pre) + strlen (element_content) + strlen (post) + SIZE_FUZZINESS; + if (new_size > xml_string->allocated_len) + g_string_set_size (xml_string, new_size);*/ + + /* Append the pre content */ + if (pre != NULL) + g_string_append (xml_string, pre); + + /* Loop through the string to be escaped. Code adapted from GLib's g_markup_escape_text() function. + * Copyright 2000, 2003 Red Hat, Inc. + * Copyright 2007, 2008 Ryan Lortie <desrt@desrt.ca> */ + p = element_content; + while (p != NULL && *p != '\0') { + const gchar *next = g_utf8_next_char (p); + + switch (*p) { + case '&': + g_string_append (xml_string, "&"); + break; + case '<': + g_string_append (xml_string, "<"); + break; + case '>': + g_string_append (xml_string, ">"); + break; + case '\'': + g_string_append (xml_string, "'"); + break; + case '"': + g_string_append (xml_string, """); + break; + default: { + gunichar c = g_utf8_get_char (p); + + if ((0x1 <= c && c <= 0x8) || + (0xb <= c && c <= 0xc) || + (0xe <= c && c <= 0x1f) || + (0x7f <= c && c <= 0x84) || + (0x86 <= c && c <= 0x9f)) { + g_string_append_printf (xml_string, "&#x%x;", c); + } else { + g_string_append_len (xml_string, p, next - p); + break; + } + } + } + p = next; + } + + /* Append the post content */ + if (post != NULL) + g_string_append (xml_string, post); +} + +/* TODO: Should be perfectly possible to make this modify the string in-place */ +gchar * +gdata_parser_utf8_trim_whitespace (const gchar *s) +{ + glong len; + const gchar *_s; + + /* Skip the leading whitespace */ + while (*s != '\0' && g_unichar_isspace (g_utf8_get_char (s))) + s = g_utf8_next_char (s); + + /* Find the end of the string and backtrack until we've passed all the whitespace */ + len = g_utf8_strlen (s, -1); + _s = g_utf8_offset_to_pointer (s, len - 1); + while (len > 0 && g_unichar_isspace (g_utf8_get_char (_s))) { + _s = g_utf8_prev_char (_s); + len--; + } + _s = g_utf8_next_char (_s); + + return g_strndup (s, _s - s); +} diff --git a/gdata/gdata-parser.h b/gdata/gdata-parser.h new file mode 100644 index 0000000..6f0303f --- /dev/null +++ b/gdata/gdata-parser.h @@ -0,0 +1,123 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <glib.h> + +#include "gdata-parsable.h" +#include "gdata-types.h" + +#ifndef GDATA_PARSER_H +#define GDATA_PARSER_H + +G_BEGIN_DECLS + +gboolean gdata_parser_error_required_content_missing (xmlNode *element, GError **error); +gboolean gdata_parser_error_not_iso8601_format (xmlNode *element, const gchar *actual_value, GError **error); +gboolean gdata_parser_error_unknown_property_value (xmlNode *element, const gchar *property_name, const gchar *actual_value, GError **error); +gboolean gdata_parser_error_unknown_content (xmlNode *element, const gchar *actual_content, GError **error); +gboolean gdata_parser_error_required_property_missing (xmlNode *element, const gchar *property_name, GError **error); +gboolean gdata_parser_error_mutexed_properties (xmlNode *element, const gchar *property1_name, const gchar *property2_name, GError **error); +gboolean gdata_parser_error_required_element_missing (const gchar *element_name, const gchar *parent_element_name, GError **error); +gboolean gdata_parser_error_duplicate_element (xmlNode *element, GError **error); + +gboolean gdata_parser_error_duplicate_json_element (JsonReader *reader, GError **error); +gboolean gdata_parser_error_required_json_content_missing (JsonReader *reader, GError **error); +gboolean gdata_parser_error_not_iso8601_format_json (JsonReader *reader, const gchar *actual_value, GError **error); +gboolean +gdata_parser_error_from_json_error (JsonReader *reader, + const GError *json_error, GError **error); + +gboolean gdata_parser_int64_from_date (const gchar *date, gint64 *_time); +gchar *gdata_parser_date_from_int64 (gint64 _time) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +gchar *gdata_parser_int64_to_iso8601 (gint64 _time) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +gchar *gdata_parser_int64_to_iso8601_numeric_timezone (gint64 _time) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +gboolean gdata_parser_int64_from_iso8601 (const gchar *date, gint64 *_time); + +/* + * GDataParserOptions: + * @P_NONE: no special options; the content of the element will be outputted directly without any checks + * @P_NO_DUPES: the element must be encountered at most once; if encountered more than once, an error will be returned + * @P_REQUIRED: the element content must not be %NULL if the element exists + * @P_NON_EMPTY: the element content must not be empty (i.e. a zero-length string) if the element exists; + * this only applies to gdata_parser_string_from_element() + * @P_DEFAULT: if the element content is %NULL or empty, return an empty value instead of erroring (this is mutually exclusive with %P_REQUIRED + * and %P_NON_EMPTY) + * + * Parsing options to be passed in a bitwise fashion to gdata_parser_string_from_element() or gdata_parser_object_from_element(). + * Their names aren't namespaced as they aren't public, and brevity is important, since they're used frequently in the parsing code. + * + * Since: 0.7.0 + */ +typedef enum { + P_NONE = 0, + P_NO_DUPES = 1 << 0, + P_REQUIRED = 1 << 1, + P_NON_EMPTY = 1 << 2, + P_DEFAULT = 1 << 3 +} GDataParserOptions; + +typedef void (*GDataParserSetterFunc) (GDataParsable *parent_parsable, GDataParsable *parsable); + +gboolean gdata_parser_boolean_from_property (xmlNode *element, const gchar *property_name, gboolean *output, gint default_output, GError **error); + +gboolean gdata_parser_is_namespace (xmlNode *element, const gchar *namespace_uri); + +gboolean gdata_parser_string_from_element (xmlNode *element, const gchar *element_name, GDataParserOptions options, + gchar **output, gboolean *success, GError **error); +gboolean gdata_parser_int64_time_from_element (xmlNode *element, const gchar *element_name, GDataParserOptions options, + gint64 *output, gboolean *success, GError **error); +gboolean gdata_parser_int64_from_element (xmlNode *element, const gchar *element_name, GDataParserOptions options, + gint64 *output, gint64 default_output, gboolean *success, GError **error); +gboolean gdata_parser_object_from_element_setter (xmlNode *element, const gchar *element_name, GDataParserOptions options, GType object_type, + gpointer /* GDataParserSetterFunc */ _setter, gpointer /* GDataParsable * */ _parent_parsable, + gboolean *success, GError **error); +gboolean gdata_parser_object_from_element (xmlNode *element, const gchar *element_name, GDataParserOptions options, GType object_type, + gpointer /* GDataParsable ** */ _output, gboolean *success, GError **error); +gboolean gdata_parser_string_from_json_member (JsonReader *reader, const gchar *member_name, GDataParserOptions options, + gchar **output, gboolean *success, GError **error); +gboolean +gdata_parser_int_from_json_member (JsonReader *reader, + const gchar *member_name, + GDataParserOptions options, + gint64 *output, gboolean *success, + GError **error); +gboolean gdata_parser_int64_time_from_json_member (JsonReader *reader, const gchar *member_name, GDataParserOptions options, + gint64 *output, gboolean *success, GError **error); +gboolean gdata_parser_boolean_from_json_member (JsonReader *reader, const gchar *member_name, GDataParserOptions options, + gboolean *output, gboolean *success, GError **error); +gboolean +gdata_parser_strv_from_json_member (JsonReader *reader, + const gchar *member_name, + GDataParserOptions options, + gchar ***output, gboolean *success, + GError **error); +gboolean +gdata_parser_color_from_json_member (JsonReader *reader, + const gchar *member_name, + GDataParserOptions options, + GDataColor *output, + gboolean *success, + GError **error); + +void gdata_parser_string_append_escaped (GString *xml_string, const gchar *pre, const gchar *element_content, const gchar *post); +gchar *gdata_parser_utf8_trim_whitespace (const gchar *s) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_PARSER_H */ diff --git a/gdata/gdata-private.h b/gdata/gdata-private.h new file mode 100644 index 0000000..4d65bdd --- /dev/null +++ b/gdata/gdata-private.h @@ -0,0 +1,174 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008-2009 <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <glib.h> +#include <libxml/parser.h> +#include <libsoup/soup.h> + +#include <gdata/gdata-service.h> + +#ifndef GDATA_PRIVATE_H +#define GDATA_PRIVATE_H + +G_BEGIN_DECLS + +/** + * GDataLogLevel: + * @GDATA_LOG_NONE: Output no debug messages or network logs + * @GDATA_LOG_MESSAGES: Output debug messages, but not network logs + * @GDATA_LOG_HEADERS: Output debug messages and network traffic headers + * @GDATA_LOG_FULL: Output debug messages and full network traffic logs, + * redacting usernames, passwords and auth. tokens + * @GDATA_LOG_FULL_UNREDACTED: Output debug messages and full network traffic + * logs, and don't redact usernames, passwords and auth. tokens + * + * Logging level. + */ +typedef enum { + GDATA_LOG_NONE = 0, + GDATA_LOG_MESSAGES = 1, + GDATA_LOG_HEADERS = 2, + GDATA_LOG_FULL = 3, + GDATA_LOG_FULL_UNREDACTED = 4, +} GDataLogLevel; + +#include "gdata-service.h" +G_GNUC_INTERNAL SoupSession *_gdata_service_get_session (GDataService *self) G_GNUC_PURE; +G_GNUC_INTERNAL SoupMessage *_gdata_service_build_message (GDataService *self, GDataAuthorizationDomain *domain, const gchar *method, const gchar *uri, + const gchar *etag, gboolean etag_if_match); +G_GNUC_INTERNAL void _gdata_service_actually_send_message (SoupSession *session, SoupMessage *message, GCancellable *cancellable, GError **error); +G_GNUC_INTERNAL guint _gdata_service_send_message (GDataService *self, SoupMessage *message, GCancellable *cancellable, GError **error); +G_GNUC_INTERNAL SoupMessage *_gdata_service_query (GDataService *self, GDataAuthorizationDomain *domain, const gchar *feed_uri, GDataQuery *query, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL const gchar *_gdata_service_get_scheme (void) G_GNUC_CONST; +G_GNUC_INTERNAL gchar *_gdata_service_build_uri (const gchar *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL guint _gdata_service_get_https_port (void); +G_GNUC_INTERNAL gchar *_gdata_service_fix_uri_scheme (const gchar *uri) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL GDataLogLevel _gdata_service_get_log_level (void) G_GNUC_CONST; +G_GNUC_INTERNAL SoupSession *_gdata_service_build_session (void) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +typedef gchar *GDataSecureString; +typedef const gchar *GDataConstSecureString; + +G_GNUC_INTERNAL GDataSecureString _gdata_service_secure_strdup (const gchar *str) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL GDataSecureString _gdata_service_secure_strndup (const gchar *str, gsize n_bytes) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL void _gdata_service_secure_strfree (GDataSecureString str); + +#include "gdata-query.h" +typedef enum { + GDATA_QUERY_PAGINATION_INDEXED, + GDATA_QUERY_PAGINATION_URIS, + GDATA_QUERY_PAGINATION_TOKENS, +} GDataQueryPaginationType; + +G_GNUC_INTERNAL void _gdata_query_add_q_internal (GDataQuery *self, const gchar *q); +G_GNUC_INTERNAL void _gdata_query_clear_q_internal (GDataQuery *self); +G_GNUC_INTERNAL void _gdata_query_clear_pagination (GDataQuery *self); +G_GNUC_INTERNAL void _gdata_query_set_pagination_type (GDataQuery *self, + GDataQueryPaginationType type); +G_GNUC_INTERNAL void _gdata_query_set_next_page_token (GDataQuery *self, const gchar *next_page_token); +G_GNUC_INTERNAL void _gdata_query_set_next_uri (GDataQuery *self, const gchar *next_uri); +G_GNUC_INTERNAL gboolean _gdata_query_is_finished (GDataQuery *self); +G_GNUC_INTERNAL void _gdata_query_set_previous_uri (GDataQuery *self, const gchar *previous_uri); + +#include "gdata-parsable.h" +G_GNUC_INTERNAL GDataParsable *_gdata_parsable_new_from_xml (GType parsable_type, const gchar *xml, gint length, gpointer user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL GDataParsable *_gdata_parsable_new_from_xml_node (GType parsable_type, xmlDoc *doc, xmlNode *node, gpointer user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL GDataParsable *_gdata_parsable_new_from_json (GType parsable_type, const gchar *json, gint length, gpointer user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL GDataParsable *_gdata_parsable_new_from_json_node (GType parsable_type, JsonReader *reader, gpointer user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL void _gdata_parsable_get_xml (GDataParsable *self, GString *xml_string, gboolean declare_namespaces); +G_GNUC_INTERNAL void _gdata_parsable_get_json (GDataParsable *self, JsonBuilder *builder); +G_GNUC_INTERNAL void _gdata_parsable_string_append_escaped (GString *xml_string, const gchar *pre, const gchar *element_content, const gchar *post); +G_GNUC_INTERNAL gboolean _gdata_parsable_is_constructed_from_xml (GDataParsable *self); + +#include "gdata-feed.h" +G_GNUC_INTERNAL GDataFeed *_gdata_feed_new (GType feed_type, + const gchar *title, + const gchar *id, + gint64 updated) G_GNUC_WARN_UNUSED_RESULT; +G_GNUC_INTERNAL GDataFeed *_gdata_feed_new_from_xml (GType feed_type, const gchar *xml, gint length, GType entry_type, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL GDataFeed *_gdata_feed_new_from_json (GType feed_type, const gchar *json, gint length, GType entry_type, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +G_GNUC_INTERNAL void _gdata_feed_add_entry (GDataFeed *self, GDataEntry *entry); +G_GNUC_INTERNAL void _gdata_feed_add_link (GDataFeed *self, GDataLink *_link); +G_GNUC_INTERNAL gpointer _gdata_feed_parse_data_new (GType entry_type, GDataQueryProgressCallback progress_callback, gpointer progress_user_data); +G_GNUC_INTERNAL void _gdata_feed_parse_data_free (gpointer data); +G_GNUC_INTERNAL void _gdata_feed_call_progress_callback (GDataFeed *self, gpointer user_data, GDataEntry *entry); +G_GNUC_INTERNAL void +_gdata_feed_set_page_info (GDataFeed *self, guint total_results, + guint items_per_page); + +#include "gdata-entry.h" +#include "gdata-batch-operation.h" +G_GNUC_INTERNAL void _gdata_entry_set_updated (GDataEntry *self, gint64 updated); +G_GNUC_INTERNAL void _gdata_entry_set_published (GDataEntry *self, gint64 published); +G_GNUC_INTERNAL void _gdata_entry_set_id (GDataEntry *self, const gchar *id); +G_GNUC_INTERNAL void _gdata_entry_set_etag (GDataEntry *self, const gchar *etag); +G_GNUC_INTERNAL void _gdata_entry_set_batch_data (GDataEntry *self, guint id, GDataBatchOperationType type); + +#include "gdata-access-rule.h" +G_GNUC_INTERNAL void _gdata_access_rule_set_key (GDataAccessRule *self, const gchar *key); + +#include "gdata-parser.h" + +/** + * _GDATA_DEFINE_AUTHORIZATION_DOMAIN: + * @l_n: lowercase name for the authorization domain, separated by underscores + * @SERVICE_NAME: the service name, as listed here: http://code.google.com/apis/documents/faq_gdata.html#clientlogin + * @SCOPE: the scope URI, as listed here: http://code.google.com/apis/documents/faq_gdata.html#AuthScopes + * + * Defines a static function to return an interned singleton #GDataAuthorizationDomain instance for the given parameters. Every time it's called, the + * function will return the same instance. + * + * The function will be named <code class="literal">get_(l_n)_authorization_domain</code>. + * + * Return value: (transfer none): a #GDataAuthorizationDomain instance for the given parameters + * + * Since: 0.9.0 + */ +#define _GDATA_DEFINE_AUTHORIZATION_DOMAIN(l_n, SERVICE_NAME, SCOPE) \ +static GDataAuthorizationDomain * \ +get_##l_n##_authorization_domain (void) \ +{ \ + static volatile GDataAuthorizationDomain *domain__volatile = NULL; \ + \ + if (g_once_init_enter (&domain__volatile) == TRUE) { \ + GDataAuthorizationDomain *domain; \ + \ + domain = g_object_new (GDATA_TYPE_AUTHORIZATION_DOMAIN, \ + "service-name", SERVICE_NAME, \ + "scope", SCOPE, \ + NULL); \ + \ + g_once_init_leave (&domain__volatile, domain); \ + } \ + \ + return GDATA_AUTHORIZATION_DOMAIN (domain__volatile); \ +} + +G_END_DECLS + +#endif /* !GDATA_PRIVATE_H */ diff --git a/gdata/gdata-query.c b/gdata/gdata-query.c new file mode 100644 index 0000000..5e903ea --- /dev/null +++ b/gdata/gdata-query.c @@ -0,0 +1,1222 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 <philip@tecnocode.co.uk> + * Copyright (C) Red Hat, Inc. 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +/** + * SECTION:gdata-query + * @short_description: GData query object + * @stability: Stable + * @include: gdata/gdata-query.h + * + * #GDataQuery represents a collection of query parameters used in a series of queries on a #GDataService. It allows the query parameters to be + * set, with the aim of building a query URI using gdata_query_get_query_uri(). Pagination is supported using gdata_query_next_page() and + * gdata_query_previous_page(). + * + * Each query can have an ETag associated with it, which is a unique identifier for the set of query results produced by the query. + * Each time a query is made, gdata_service_query() will set the #GDataQuery:etag property of the accompanying query to a value returned by the + * server. If the same query is made again (using the same #GDataQuery instance), the server can skip returning the resulting #GDataFeed if its + * contents haven't changed (in this case, gdata_service_query() will return %NULL with an empty error). + * + * For this reason, code using #GDataQuery should be careful when reusing #GDataQuery instances: the code should either unset #GDataQuery:etag after + * every query or (preferably) gracefully handle the case where gdata_service_query() returns %NULL to signify unchanged results. + * + * Every time a property of a #GDataQuery instance is changed, the instance's ETag will be unset. + * + * For more information on the standard GData query parameters supported by #GDataQuery, see the <ulink type="http" + * url="http://code.google.com/apis/gdata/docs/2.0/reference.html#Queries">online documentation</ulink>. + */ + +#include <glib.h> +#include <string.h> + +#include "gdata-query.h" +#include "gdata-private.h" +#include "gdata-types.h" + +static void gdata_query_finalize (GObject *object); +static void gdata_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +struct _GDataQueryPrivate { + /* Standard query parameters (see: http://code.google.com/apis/gdata/docs/2.0/reference.html#Queries) */ + gchar *q; + gchar *q_internal; + gchar *categories; + gchar *author; + gint64 updated_min; + gint64 updated_max; + gint64 published_min; + gint64 published_max; + guint start_index; + gboolean is_strict; + guint max_results; + + /* Pagination management. The type of pagination is set as + * pagination_type, and should be set in the init() vfunc implementation + * of any class derived from GDataQuery. It defaults to + * %GDATA_QUERY_PAGINATION_INDEXED, which most subclasses will not want. + * + * The next_uri, previous_uri or next_page_token are set by + * #GDataService if a query returns a new #GDataFeed containing them. If + * the user then calls next_page() or previous_page(), use_next_page or + * use_previous_page are set as appopriate, and the next call to + * get_uri() will return a URI for the next or previous page. This might + * be next_uri, previous_uri, or a constructed URI which appends the + * next_page_token. + * + * Note that %GDATA_QUERY_PAGINATION_TOKENS does not support returning + * to the previous page. + * + * It is not invalid to have use_next_page set and to not have a + * next_uri for %GDATA_QUERY_PAGINATION_URIS; or to not have a + * next_page_token for %GDATA_QUERY_PAGINATION_TOKENS: this signifies + * that the current set of results are the last page. There are no + * further pages. Similarly for use_previous_page and a %NULL + * previous_page. + */ + GDataQueryPaginationType pagination_type; + + gchar *next_uri; + gchar *previous_uri; + gchar *next_page_token; + + gboolean use_next_page; + gboolean use_previous_page; + + gchar *etag; +}; + +enum { + PROP_Q = 1, + PROP_CATEGORIES, + PROP_AUTHOR, + PROP_UPDATED_MIN, + PROP_UPDATED_MAX, + PROP_PUBLISHED_MIN, + PROP_PUBLISHED_MAX, + PROP_START_INDEX, + PROP_IS_STRICT, + PROP_MAX_RESULTS, + PROP_ETAG +}; + +G_DEFINE_TYPE (GDataQuery, gdata_query, G_TYPE_OBJECT) + +static void +gdata_query_class_init (GDataQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataQueryPrivate)); + + gobject_class->set_property = gdata_query_set_property; + gobject_class->get_property = gdata_query_get_property; + gobject_class->finalize = gdata_query_finalize; + + klass->get_query_uri = get_query_uri; + + /** + * GDataQuery:q: + * + * A full-text query string. + * + * When creating a query, list search terms separated by spaces, in the form <userinput>term1 term2 term3</userinput>. + * (As with all of the query parameter values, the spaces must be URL encoded.) The service returns all entries that match all of the + * search terms (like using AND between terms). Like Google's web search, a service searches on complete words (and related words with + * the same stem), not substrings. + * + * To search for an exact phrase, enclose the phrase in quotation marks: <userinput>"exact phrase"</userinput>. + * + * To exclude entries that match a given term, use the form <userinput>-term</userinput>. + * + * The search is case-insensitive. + * + * Example: to search for all entries that contain the exact phrase "Elizabeth Bennet" and the word "Darcy" but don't contain the + * word "Austen", use the following query: <userinput>"Elizabeth Bennet" Darcy -Austen</userinput>. + */ + g_object_class_install_property (gobject_class, PROP_Q, + g_param_spec_string ("q", + "Query terms", "Query terms for which to search.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:categories: + * + * A category filter. + * + * You can query on multiple categories by listing multiple categories separated by slashes. The service returns all entries that match all + * of the categories (like using AND between terms). For example: <userinput>Fritz/Laurie</userinput> returns + * entries that match both categories ("Fritz" and "Laurie"). + * + * To do an OR between terms, use a pipe character (<literal>|</literal>). For example: <userinput>Fritz\%7CLaurie</userinput> returns + * entries that match either category. + * + * An entry matches a specified category if the entry is in a category that has a matching term or label, as defined in the Atom + * specification. (Roughly, the "term" is the internal string used by the software to identify the category, while the "label" is the + * human-readable string presented to a user in a user interface.) + * + * To exclude entries that match a given category, use the form <userinput>-categoryname</userinput>. + * + * To query for a category that has a scheme – such as <literal><category scheme="urn:google.com" term="public"/></literal> – you must + * place the scheme in curly braces before the category name. For example: <userinput>{urn:google.com}public</userinput>. To match a category + * that has no scheme, use an empty pair of curly braces. If you don't specify curly braces, then categories in any scheme will match. + * + * The above features can be combined. For example: <userinput>A|-{urn:google.com}B/-C</userinput> means (A OR (NOT B)) AND (NOT C). + */ + g_object_class_install_property (gobject_class, PROP_CATEGORIES, + g_param_spec_string ("categories", + "Category string", "Category search string.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:author: + * + * An entry author. The service returns entries where the author name and/or e-mail address match your query string. + */ + g_object_class_install_property (gobject_class, PROP_AUTHOR, + g_param_spec_string ("author", + "Author", "Author search string.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:updated-min: + * + * Lower bound on the entry update date, inclusive. + */ + g_object_class_install_property (gobject_class, PROP_UPDATED_MIN, + g_param_spec_int64 ("updated-min", + "Minimum update date", "Minimum date for updates on returned entries.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:updated-max: + * + * Upper bound on the entry update date, exclusive. + */ + g_object_class_install_property (gobject_class, PROP_UPDATED_MAX, + g_param_spec_int64 ("updated-max", + "Maximum update date", "Maximum date for updates on returned entries.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:published-min: + * + * Lower bound on the entry publish date, inclusive. + */ + g_object_class_install_property (gobject_class, PROP_PUBLISHED_MIN, + g_param_spec_int64 ("published-min", + "Minimum publish date", "Minimum date for returned entries to be published.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:published-max: + * + * Upper bound on the entry publish date, exclusive. + */ + g_object_class_install_property (gobject_class, PROP_PUBLISHED_MAX, + g_param_spec_int64 ("published-max", + "Maximum publish date", "Maximum date for returned entries to be published.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:start-index: + * + * The one-based index of the first result to be retrieved. Use gdata_query_next_page() and gdata_query_previous_page() to + * implement pagination, rather than manually changing #GDataQuery:start-index. + * + * Use <code class="literal">0</code> to not specify a start index. + */ + g_object_class_install_property (gobject_class, PROP_START_INDEX, + g_param_spec_uint ("start-index", + "Start index", "One-based result start index.", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:is-strict: + * + * Strict query parameter checking. If this is enabled, an error will be returned by the online service if a parameter is + * not recognised. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_STRICT, + g_param_spec_boolean ("is-strict", + "Strict?", "Should the server be strict about the query?", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:max-results: + * + * Maximum number of results to be retrieved. Most services have a default #GDataQuery:max-results size imposed by the server; if you wish + * to receive the entire feed, specify a large number such as %G_MAXUINT for this property. + * + * Use <code class="literal">0</code> to not specify a maximum number of results. + */ + g_object_class_install_property (gobject_class, PROP_MAX_RESULTS, + g_param_spec_uint ("max-results", + "Maximum number of results", "The maximum number of entries to return.", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataQuery:etag: + * + * The ETag against which to check for updates. If the server-side ETag matches this one, the requested feed hasn't changed, and is not + * returned unnecessarily. + * + * Setting any of the other query properties will unset the ETag, as ETags match against entire queries. If the ETag should be used in a + * query, it must be set again using gdata_query_set_etag() after setting any other properties. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_ETAG, + g_param_spec_string ("etag", + "ETag", "An ETag against which to check.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_query_init (GDataQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_QUERY, GDataQueryPrivate); + self->priv->updated_min = -1; + self->priv->updated_max = -1; + self->priv->published_min = -1; + self->priv->published_max = -1; + + _gdata_query_set_pagination_type (self, GDATA_QUERY_PAGINATION_INDEXED); +} + +static void +gdata_query_finalize (GObject *object) +{ + GDataQueryPrivate *priv = GDATA_QUERY (object)->priv; + + g_free (priv->q); + g_free (priv->q_internal); + g_free (priv->categories); + g_free (priv->author); + g_free (priv->next_uri); + g_free (priv->previous_uri); + g_free (priv->etag); + g_free (priv->next_page_token); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_query_parent_class)->finalize (object); +} + +static void +gdata_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataQueryPrivate *priv = GDATA_QUERY (object)->priv; + + switch (property_id) { + case PROP_Q: + g_value_set_string (value, priv->q); + break; + case PROP_CATEGORIES: + g_value_set_string (value, priv->categories); + break; + case PROP_AUTHOR: + g_value_set_string (value, priv->author); + break; + case PROP_UPDATED_MIN: + g_value_set_int64 (value, priv->updated_min); + break; + case PROP_UPDATED_MAX: + g_value_set_int64 (value, priv->updated_max); + break; + case PROP_PUBLISHED_MIN: + g_value_set_int64 (value, priv->published_min); + break; + case PROP_PUBLISHED_MAX: + g_value_set_int64 (value, priv->published_max); + break; + case PROP_START_INDEX: + g_value_set_uint (value, priv->start_index); + break; + case PROP_IS_STRICT: + g_value_set_boolean (value, priv->is_strict); + break; + case PROP_MAX_RESULTS: + g_value_set_uint (value, priv->max_results); + break; + case PROP_ETAG: + g_value_set_string (value, priv->etag); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataQuery *self = GDATA_QUERY (object); + + switch (property_id) { + case PROP_Q: + gdata_query_set_q (self, g_value_get_string (value)); + break; + case PROP_CATEGORIES: + gdata_query_set_categories (self, g_value_get_string (value)); + break; + case PROP_AUTHOR: + gdata_query_set_author (self, g_value_get_string (value)); + break; + case PROP_UPDATED_MIN: + gdata_query_set_updated_min (self, g_value_get_int64 (value)); + break; + case PROP_UPDATED_MAX: + gdata_query_set_updated_max (self, g_value_get_int64 (value)); + break; + case PROP_PUBLISHED_MIN: + gdata_query_set_published_min (self, g_value_get_int64 (value)); + break; + case PROP_PUBLISHED_MAX: + gdata_query_set_published_max (self, g_value_get_int64 (value)); + break; + case PROP_START_INDEX: + gdata_query_set_start_index (self, g_value_get_uint (value)); + break; + case PROP_IS_STRICT: + gdata_query_set_is_strict (self, g_value_get_boolean (value)); + break; + case PROP_MAX_RESULTS: + gdata_query_set_max_results (self, g_value_get_uint (value)); + break; + case PROP_ETAG: + gdata_query_set_etag (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataQueryPrivate *priv = self->priv; + + #define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + /* Categories */ + if (priv->categories != NULL) { + g_string_append (query_uri, "/-/"); + g_string_append_uri_escaped (query_uri, priv->categories, "/", FALSE); + } + + /* q param */ + if (priv->q != NULL || priv->q_internal != NULL) { + APPEND_SEP + g_string_append (query_uri, "q="); + + if (priv->q != NULL) { + g_string_append_uri_escaped (query_uri, priv->q, NULL, FALSE); + if (priv->q_internal != NULL) + g_string_append (query_uri, "%20and%20"); + } + if (priv->q_internal != NULL) + g_string_append_uri_escaped (query_uri, priv->q_internal, NULL, FALSE); + } + + if (priv->author != NULL) { + APPEND_SEP + g_string_append (query_uri, "author="); + g_string_append_uri_escaped (query_uri, priv->author, NULL, FALSE); + } + + if (priv->updated_min != -1) { + gchar *updated_min; + + APPEND_SEP + g_string_append (query_uri, "updated-min="); + updated_min = gdata_parser_int64_to_iso8601 (priv->updated_min); + g_string_append (query_uri, updated_min); + g_free (updated_min); + } + + if (priv->updated_max != -1) { + gchar *updated_max; + + APPEND_SEP + g_string_append (query_uri, "updated-max="); + updated_max = gdata_parser_int64_to_iso8601 (priv->updated_max); + g_string_append (query_uri, updated_max); + g_free (updated_max); + } + + if (priv->published_min != -1) { + gchar *published_min; + + APPEND_SEP + g_string_append (query_uri, "published-min="); + published_min = gdata_parser_int64_to_iso8601 (priv->published_min); + g_string_append (query_uri, published_min); + g_free (published_min); + } + + if (priv->published_max != -1) { + gchar *published_max; + + APPEND_SEP + g_string_append (query_uri, "published-max="); + published_max = gdata_parser_int64_to_iso8601 (priv->published_max); + g_string_append (query_uri, published_max); + g_free (published_max); + } + + if (priv->start_index > 0) { + APPEND_SEP + g_string_append_printf (query_uri, "start-index=%u", priv->start_index); + } + + if (priv->is_strict == TRUE) { + APPEND_SEP + g_string_append (query_uri, "strict=true"); + } + + if (priv->max_results > 0) { + APPEND_SEP + g_string_append_printf (query_uri, "max-results=%u", priv->max_results); + } + + if (priv->pagination_type == GDATA_QUERY_PAGINATION_TOKENS && priv->use_next_page && + priv->next_page_token != NULL && *priv->next_page_token != '\0') { + APPEND_SEP + g_string_append (query_uri, "pageToken="); + g_string_append_uri_escaped (query_uri, priv->next_page_token, NULL, FALSE); + } +} + +/** + * gdata_query_new: + * @q: (allow-none): a query string, or %NULL + * + * Creates a new #GDataQuery with its #GDataQuery:q property set to @q. + * + * Return value: a new #GDataQuery + */ +GDataQuery * +gdata_query_new (const gchar *q) +{ + return g_object_new (GDATA_TYPE_QUERY, "q", q, NULL); +} + +/** + * gdata_query_new_with_limits: + * @q: (allow-none): a query string, or %NULL + * @start_index: a one-based start index for the results, or <code class="literal">0</code> + * @max_results: the maximum number of results to return, or <code class="literal">0</code> + * + * Creates a new #GDataQuery with its #GDataQuery:q property set to @q, and the limits @start_index and @max_results + * applied. + * + * Return value: a new #GDataQuery + */ +GDataQuery * +gdata_query_new_with_limits (const gchar *q, guint start_index, guint max_results) +{ + return g_object_new (GDATA_TYPE_QUERY, + "q", q, + "start-index", start_index, + "max-results", max_results, + NULL); +} + +/** + * gdata_query_get_query_uri: + * @self: a #GDataQuery + * @feed_uri: the feed URI on which to build the query URI + * + * Builds a query URI from the given base feed URI, using the properties of the #GDataQuery. This function will take care + * of all necessary URI escaping, so it should <emphasis>not</emphasis> be done beforehand. + * + * The query URI is what functions like gdata_service_query() use to query the online service. + * + * Return value: a query URI; free with g_free() + */ +gchar * +gdata_query_get_query_uri (GDataQuery *self, const gchar *feed_uri) +{ + GDataQueryClass *klass; + GString *query_uri; + gboolean params_started; + + g_return_val_if_fail (GDATA_IS_QUERY (self), NULL); + g_return_val_if_fail (feed_uri != NULL, NULL); + + /* Check to see if we're paginating first */ + if (self->priv->pagination_type == GDATA_QUERY_PAGINATION_URIS) { + if (self->priv->use_next_page) + return g_strdup (self->priv->next_uri); + if (self->priv->use_previous_page) + return g_strdup (self->priv->previous_uri); + } + + klass = GDATA_QUERY_GET_CLASS (self); + g_assert (klass->get_query_uri != NULL); + + /* Determine whether the first param has already been appended (e.g. it exists in the feed_uri) */ + params_started = (strstr (feed_uri, "?") != NULL) ? TRUE : FALSE; + + /* Build the query URI */ + query_uri = g_string_new (feed_uri); + klass->get_query_uri (self, feed_uri, query_uri, ¶ms_started); + + return g_string_free (query_uri, FALSE); +} + +/* Used internally by child classes of GDataQuery to add search clauses that represent service-specific + * query properties. For example, in the Drive v2 API, certain GDataDocumentsQuery properties like + * show-deleted and show-folders no longer have their own parameters, but have to be specified as a search + * clause in the query string. */ +void +_gdata_query_add_q_internal (GDataQuery *self, const gchar *q) +{ + GDataQueryPrivate *priv = self->priv; + GString *str; + + g_return_if_fail (GDATA_IS_QUERY (self)); + g_return_if_fail (q != NULL && q[0] != '\0'); + + str = g_string_new (priv->q_internal); + + /* Search parameters: https://developers.google.com/drive/web/search-parameters */ + if (str->len > 0) + g_string_append (str, " and "); + + g_string_append (str, q); + + g_free (priv->q_internal); + priv->q_internal = g_string_free (str, FALSE); +} + +/* Used internally by child classes of GDataQuery to clear the internal query string when building the + * query URI in GDataQueryClass->get_query_uri */ +void +_gdata_query_clear_q_internal (GDataQuery *self) +{ + GDataQueryPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_QUERY (self)); + + g_free (priv->q_internal); + priv->q_internal = NULL; +} + +/** + * gdata_query_get_q: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:q property. + * + * Return value: the q property, or %NULL if it is unset + */ +const gchar * +gdata_query_get_q (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), NULL); + return self->priv->q; +} + +/** + * gdata_query_set_q: + * @self: a #GDataQuery + * @q: (allow-none): a new query string, or %NULL + * + * Sets the #GDataQuery:q property of the #GDataQuery to the new query string, @q. + * + * Set @q to %NULL to unset the property in the query URI. + */ +void +gdata_query_set_q (GDataQuery *self, const gchar *q) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + + g_free (self->priv->q); + self->priv->q = g_strdup (q); + g_object_notify (G_OBJECT (self), "q"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_get_categories: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:categories property. + * + * Return value: the categories property, or %NULL if it is unset + */ +const gchar * +gdata_query_get_categories (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), NULL); + return self->priv->categories; +} + +/** + * gdata_query_set_categories: + * @self: a #GDataQuery + * @categories: (allow-none): the new category string, or %NULL + * + * Sets the #GDataQuery:categories property of the #GDataQuery to the new category string, @categories. + * + * Set @categories to %NULL to unset the property in the query URI. + */ +void +gdata_query_set_categories (GDataQuery *self, const gchar *categories) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + + g_free (self->priv->categories); + self->priv->categories = g_strdup (categories); + g_object_notify (G_OBJECT (self), "categories"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_get_author: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:author property. + * + * Return value: the author property, or %NULL if it is unset + */ +const gchar * +gdata_query_get_author (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), NULL); + return self->priv->author; +} + +/** + * gdata_query_set_author: + * @self: a #GDataQuery + * @author: (allow-none): the new author string, or %NULL + * + * Sets the #GDataQuery:author property of the #GDataQuery to the new author string, @author. + * + * Set @author to %NULL to unset the property in the query URI. + */ +void +gdata_query_set_author (GDataQuery *self, const gchar *author) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + + g_free (self->priv->author); + self->priv->author = g_strdup (author); + g_object_notify (G_OBJECT (self), "author"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_get_updated_min: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:updated-min property. If the property is unset, <code class="literal">-1</code> will be returned. + * + * Return value: the updated-min property, or <code class="literal">-1</code> + */ +gint64 +gdata_query_get_updated_min (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), -1); + return self->priv->updated_min; +} + +/** + * gdata_query_set_updated_min: + * @self: a #GDataQuery + * @updated_min: the new minimum update time, or <code class="literal">-1</code> + * + * Sets the #GDataQuery:updated-min property of the #GDataQuery to the new minimum update time, @updated_min. + * + * Set @updated_min to <code class="literal">-1</code> to unset the property in the query URI. + */ +void +gdata_query_set_updated_min (GDataQuery *self, gint64 updated_min) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + g_return_if_fail (updated_min >= -1); + + self->priv->updated_min = updated_min; + g_object_notify (G_OBJECT (self), "updated-min"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_get_updated_max: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:updated-max property. If the property is unset, <code class="literal">-1</code> will be returned. + * + * Return value: the updated-max property, or <code class="literal">-1</code> + */ +gint64 +gdata_query_get_updated_max (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), -1); + return self->priv->updated_max; +} + +/** + * gdata_query_set_updated_max: + * @self: a #GDataQuery + * @updated_max: the new maximum update time, or <code class="literal">-1</code> + * + * Sets the #GDataQuery:updated-max property of the #GDataQuery to the new maximum update time, @updated_max. + * + * Set @updated_max to <code class="literal">-1</code> to unset the property in the query URI. + */ +void +gdata_query_set_updated_max (GDataQuery *self, gint64 updated_max) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + g_return_if_fail (updated_max >= -1); + + self->priv->updated_max = updated_max; + g_object_notify (G_OBJECT (self), "updated-max"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_get_published_min: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:published-min property. If the property is unset, <code class="literal">-1</code> will be returned. + * + * Return value: the published-min property, or <code class="literal">-1</code> + */ +gint64 +gdata_query_get_published_min (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), -1); + return self->priv->published_min; +} + +/** + * gdata_query_set_published_min: + * @self: a #GDataQuery + * @published_min: the new minimum publish time, or <code class="literal">-1</code> + * + * Sets the #GDataQuery:published-min property of the #GDataQuery to the new minimum publish time, @published_min. + * + * Set @published_min to <code class="literal">-1</code> to unset the property in the query URI. + */ +void +gdata_query_set_published_min (GDataQuery *self, gint64 published_min) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + g_return_if_fail (published_min >= -1); + + self->priv->published_min = published_min; + g_object_notify (G_OBJECT (self), "published-min"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_get_published_max: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:published-max property. If the property is unset, <code class="literal">-1</code> will be returned. + * + * Return value: the published-max property, or <code class="literal">-1</code> + */ +gint64 +gdata_query_get_published_max (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), -1); + return self->priv->published_max; +} + +/** + * gdata_query_set_published_max: + * @self: a #GDataQuery + * @published_max: the new maximum publish time, or <code class="literal">-1</code> + * + * Sets the #GDataQuery:published-max property of the #GDataQuery to the new maximum publish time, @published_max. + * + * Set @published_max to <code class="literal">-1</code> to unset the property in the query URI. + */ +void +gdata_query_set_published_max (GDataQuery *self, gint64 published_max) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + g_return_if_fail (published_max >= -1); + + self->priv->published_max = published_max; + g_object_notify (G_OBJECT (self), "published-max"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_get_start_index: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:start-index property. + * + * Return value: the start index property, or <code class="literal">0</code> if it is unset + */ +guint +gdata_query_get_start_index (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), 0); + return self->priv->start_index; +} + +/** + * gdata_query_set_start_index: + * @self: a #GDataQuery + * @start_index: the new start index, or <code class="literal">0</code> + * + * Sets the #GDataQuery:start-index property of the #GDataQuery to the new one-based start index, @start_index. + * + * Set @start_index to <code class="literal">0</code> to unset the property in the query URI. + */ +void +gdata_query_set_start_index (GDataQuery *self, guint start_index) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + + self->priv->start_index = start_index; + g_object_notify (G_OBJECT (self), "start-index"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_is_strict: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:is-strict property. + * + * Return value: the strict property + * + * Since: 0.2.0 + */ +gboolean +gdata_query_is_strict (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), FALSE); + return self->priv->is_strict; +} + +/** + * gdata_query_set_is_strict: + * @self: a #GDataQuery + * @is_strict: the new strict value + * + * Sets the #GDataQuery:is-strict property of the #GDataQuery to the new strict value, @is_strict. + * + * Since: 0.2.0 + */ +void +gdata_query_set_is_strict (GDataQuery *self, gboolean is_strict) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + + self->priv->is_strict = is_strict; + g_object_notify (G_OBJECT (self), "is-strict"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_get_max_results: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:max-results property. + * + * Return value: the maximum results property, or <code class="literal">0</code> if it is unset + */ +guint +gdata_query_get_max_results (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), 0); + return self->priv->max_results; +} + +/** + * gdata_query_set_max_results: + * @self: a #GDataQuery + * @max_results: the new maximum results value, or <code class="literal">0</code> + * + * Sets the #GDataQuery:max-results property of the #GDataQuery to the new maximum results value, @max_results. + * + * Set @max_results to <code class="literal">0</code> to unset the property in the query URI. + */ +void +gdata_query_set_max_results (GDataQuery *self, guint max_results) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + + self->priv->max_results = max_results; + g_object_notify (G_OBJECT (self), "max-results"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_get_etag: + * @self: a #GDataQuery + * + * Gets the #GDataQuery:etag property. + * + * Return value: the ETag property, or %NULL if it is unset + * + * Since: 0.2.0 + */ +const gchar * +gdata_query_get_etag (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), NULL); + return self->priv->etag; +} + +/** + * gdata_query_set_etag: + * @self: a #GDataQuery + * @etag: (allow-none): the new ETag, or %NULL + * + * Sets the #GDataQuery:etag property of the #GDataQuery to the new ETag, @etag. + * + * Set @etag to %NULL to not check against the server-side ETag. + * + * Since: 0.2.0 + */ +void +gdata_query_set_etag (GDataQuery *self, const gchar *etag) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + + g_free (self->priv->etag); + self->priv->etag = g_strdup (etag); + g_object_notify (G_OBJECT (self), "etag"); +} + +void +_gdata_query_clear_pagination (GDataQuery *self) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + + switch (self->priv->pagination_type) { + case GDATA_QUERY_PAGINATION_INDEXED: + /* Nothing to do here: indexes can always be incremented. */ + break; + case GDATA_QUERY_PAGINATION_URIS: + g_clear_pointer (&self->priv->next_uri, g_free); + g_clear_pointer (&self->priv->previous_uri, g_free); + break; + case GDATA_QUERY_PAGINATION_TOKENS: + g_clear_pointer (&self->priv->next_page_token, g_free); + break; + default: + g_assert_not_reached (); + } + + self->priv->use_next_page = FALSE; + self->priv->use_previous_page = FALSE; +} + +void +_gdata_query_set_pagination_type (GDataQuery *self, + GDataQueryPaginationType type) +{ + g_debug ("%s: Pagination type set to %u", G_STRFUNC, type); + + _gdata_query_clear_pagination (self); + self->priv->pagination_type = type; +} + +void +_gdata_query_set_next_page_token (GDataQuery *self, + const gchar *next_page_token) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + g_return_if_fail (self->priv->pagination_type == + GDATA_QUERY_PAGINATION_TOKENS); + + g_free (self->priv->next_page_token); + self->priv->next_page_token = g_strdup (next_page_token); +} + +void +_gdata_query_set_next_uri (GDataQuery *self, const gchar *next_uri) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + g_return_if_fail (self->priv->pagination_type == + GDATA_QUERY_PAGINATION_URIS); + + g_free (self->priv->next_uri); + self->priv->next_uri = g_strdup (next_uri); +} + +gboolean +_gdata_query_is_finished (GDataQuery *self) +{ + g_return_val_if_fail (GDATA_IS_QUERY (self), FALSE); + + switch (self->priv->pagination_type) { + case GDATA_QUERY_PAGINATION_INDEXED: + return FALSE; + case GDATA_QUERY_PAGINATION_URIS: + return (self->priv->next_uri == NULL && self->priv->use_next_page); + case GDATA_QUERY_PAGINATION_TOKENS: + return (self->priv->next_page_token == NULL && self->priv->use_next_page); + default: + g_assert_not_reached (); + } +} + +void +_gdata_query_set_previous_uri (GDataQuery *self, const gchar *previous_uri) +{ + g_return_if_fail (GDATA_IS_QUERY (self)); + g_return_if_fail (self->priv->pagination_type == + GDATA_QUERY_PAGINATION_URIS); + + g_free (self->priv->previous_uri); + self->priv->previous_uri = g_strdup (previous_uri); +} + +/** + * gdata_query_next_page: + * @self: a #GDataQuery + * + * Changes the state of the #GDataQuery such that when gdata_query_get_query_uri() is next called, it will build the + * query URI for the next page in the result set. + * + * Ideally, the URI of the next page is retrieved from a feed automatically when gdata_service_query() is called, but + * gdata_query_next_page() will fall back to using #GDataQuery:start-index to emulate true pagination if this fails. + * + * You <emphasis>should not</emphasis> implement pagination manually using #GDataQuery:start-index. + */ +void +gdata_query_next_page (GDataQuery *self) +{ + GDataQueryPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_QUERY (self)); + + switch (self->priv->pagination_type) { + case GDATA_QUERY_PAGINATION_INDEXED: + if (priv->start_index == 0) + priv->start_index++; + priv->start_index += priv->max_results; + break; + case GDATA_QUERY_PAGINATION_URIS: + case GDATA_QUERY_PAGINATION_TOKENS: + priv->use_next_page = TRUE; + priv->use_previous_page = FALSE; + break; + default: + g_assert_not_reached (); + } + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); +} + +/** + * gdata_query_previous_page: + * @self: a #GDataQuery + * + * Changes the state of the #GDataQuery such that when gdata_query_get_query_uri() is next called, it will build the + * query URI for the previous page in the result set. + * + * See the documentation for gdata_query_next_page() for an explanation of how query URIs from the feeds are used to this end. + * + * Return value: %TRUE if there is a previous page and it has been switched to, %FALSE otherwise + */ +gboolean +gdata_query_previous_page (GDataQuery *self) +{ + GDataQueryPrivate *priv = self->priv; + gboolean retval; + + g_return_val_if_fail (GDATA_IS_QUERY (self), FALSE); + + switch (self->priv->pagination_type) { + case GDATA_QUERY_PAGINATION_INDEXED: + if (priv->start_index <= priv->max_results) { + retval = FALSE; + } else { + priv->start_index -= priv->max_results; + if (priv->start_index == 1) + priv->start_index--; + retval = TRUE; + } + break; + case GDATA_QUERY_PAGINATION_URIS: + if (priv->previous_uri != NULL) { + priv->use_next_page = FALSE; + priv->use_previous_page = TRUE; + retval = TRUE; + } else { + retval = FALSE; + } + break; + case GDATA_QUERY_PAGINATION_TOKENS: + /* There are no previous page tokens, unfortunately. */ + retval = FALSE; + break; + default: + g_assert_not_reached (); + } + + if (retval) { + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (self, NULL); + } + + return retval; +} diff --git a/gdata/gdata-query.h b/gdata/gdata-query.h new file mode 100644 index 0000000..f80cc8c --- /dev/null +++ b/gdata/gdata-query.h @@ -0,0 +1,102 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef GDATA_QUERY_H +#define GDATA_QUERY_H + +#include <glib.h> +#include <glib-object.h> + +G_BEGIN_DECLS + +#define GDATA_TYPE_QUERY (gdata_query_get_type ()) +#define GDATA_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_QUERY, GDataQuery)) +#define GDATA_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_QUERY, GDataQueryClass)) +#define GDATA_IS_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_QUERY)) +#define GDATA_IS_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_QUERY)) +#define GDATA_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_QUERY, GDataQueryClass)) + +typedef struct _GDataQueryPrivate GDataQueryPrivate; + +/** + * GDataQuery: + * + * All the fields in the #GDataQuery structure are private and should never be accessed directly. + */ +typedef struct { + GObject parent; + GDataQueryPrivate *priv; +} GDataQuery; + +/** + * GDataQueryClass: + * + * All the fields in the #GDataQueryClass structure are private and should never be accessed directly. + */ +typedef struct { + /*< private >*/ + GObjectClass parent; + + void (*get_query_uri) (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataQueryClass; + +GType gdata_query_get_type (void) G_GNUC_CONST; + +GDataQuery *gdata_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataQuery *gdata_query_new_with_limits (const gchar *q, guint start_index, guint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gchar *gdata_query_get_query_uri (GDataQuery *self, const gchar *feed_uri) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_query_next_page (GDataQuery *self); +gboolean gdata_query_previous_page (GDataQuery *self); + +const gchar *gdata_query_get_q (GDataQuery *self) G_GNUC_PURE; +void gdata_query_set_q (GDataQuery *self, const gchar *q); +const gchar *gdata_query_get_categories (GDataQuery *self) G_GNUC_PURE; +void gdata_query_set_categories (GDataQuery *self, const gchar *categories); +const gchar *gdata_query_get_author (GDataQuery *self) G_GNUC_PURE; +void gdata_query_set_author (GDataQuery *self, const gchar *author); +gint64 gdata_query_get_updated_min (GDataQuery *self); +void gdata_query_set_updated_min (GDataQuery *self, gint64 updated_min); +gint64 gdata_query_get_updated_max (GDataQuery *self); +void gdata_query_set_updated_max (GDataQuery *self, gint64 updated_max); +gint64 gdata_query_get_published_min (GDataQuery *self); +void gdata_query_set_published_min (GDataQuery *self, gint64 published_min); +gint64 gdata_query_get_published_max (GDataQuery *self); +void gdata_query_set_published_max (GDataQuery *self, gint64 published_max); +guint gdata_query_get_start_index (GDataQuery *self) G_GNUC_PURE; +void gdata_query_set_start_index (GDataQuery *self, guint start_index); +gboolean gdata_query_is_strict (GDataQuery *self) G_GNUC_PURE; +void gdata_query_set_is_strict (GDataQuery *self, gboolean is_strict); +guint gdata_query_get_max_results (GDataQuery *self) G_GNUC_PURE; +void gdata_query_set_max_results (GDataQuery *self, guint max_results); +const gchar *gdata_query_get_etag (GDataQuery *self) G_GNUC_PURE; +void gdata_query_set_etag (GDataQuery *self, const gchar *etag); + +G_END_DECLS + +#endif /* !GDATA_QUERY_H */ diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c new file mode 100644 index 0000000..527805d --- /dev/null +++ b/gdata/gdata-service.c @@ -0,0 +1,2499 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008, 2009, 2010, 2014 <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +/** + * SECTION:gdata-service + * @short_description: GData service object + * @stability: Stable + * @include: gdata/gdata-service.h + * + * #GDataService represents a GData API service, typically a website using the GData API, such as YouTube or Google Calendar. One + * #GDataService instance is required to issue queries to the service, handle insertions, updates and deletions, and generally + * communicate with the online service. + * + * If operations performed on a #GDataService need authorization (such as uploading a video to YouTube or querying the user's personal calendar on + * Google Calendar), the service needs a #GDataAuthorizer instance set as #GDataService:authorizer. Once the user is appropriately authenticated and + * authorized by the #GDataAuthorizer implementation (see the documentation for #GDataAuthorizer for details on how this is achieved for specific + * implementations), all operations will be automatically authorized. + * + * Note that it's not always necessary to supply a #GDataAuthorizer instance to a #GDataService. If the only operations to be performed on the + * #GDataService don't need authorization (e.g. they only query public information), setting up a #GDataAuthorizer is just extra overhead. See the + * documentation for the operations on individual #GDataService subclasses to see which need authorization and which don't. + */ + +#include <config.h> +#include <glib.h> +#include <glib/gi18n-lib.h> +#include <libsoup/soup.h> +#include <string.h> +#include <stdarg.h> + +#ifdef HAVE_GNOME +#define GCR_API_SUBJECT_TO_CHANGE +#include <gcr/gcr-base.h> +#endif /* HAVE_GNOME */ + +#include "gdata-service.h" +#include "gdata-private.h" +#include "gdata-client-login-authorizer.h" +#include "gdata-marshal.h" +#include "gdata-types.h" + +GQuark +gdata_service_error_quark (void) +{ + return g_quark_from_static_string ("gdata-service-error-quark"); +} + +static void gdata_service_dispose (GObject *object); +static void gdata_service_finalize (GObject *object); +static void gdata_service_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_service_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void real_append_query_headers (GDataService *self, GDataAuthorizationDomain *domain, SoupMessage *message); +static void real_parse_error_response (GDataService *self, GDataOperationType operation_type, guint status, const gchar *reason_phrase, + const gchar *response_body, gint length, GError **error); +static GDataFeed * +real_parse_feed (GDataService *self, + GDataAuthorizationDomain *domain, + GDataQuery *query, + GType entry_type, + SoupMessage *message, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, + GError **error); +static void notify_proxy_uri_cb (GObject *gobject, GParamSpec *pspec, GObject *self); +static void notify_timeout_cb (GObject *gobject, GParamSpec *pspec, GObject *self); +static void debug_handler (const char *log_domain, GLogLevelFlags log_level, const char *message, gpointer user_data); +static void soup_log_printer (SoupLogger *logger, SoupLoggerLogLevel level, char direction, const char *data, gpointer user_data); + +static GDataFeed *__gdata_service_query (GDataService *self, GDataAuthorizationDomain *domain, const gchar *feed_uri, GDataQuery *query, + GType entry_type, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, GError **error); + +static SoupURI *_get_proxy_uri (GDataService *self); +static void _set_proxy_uri (GDataService *self, SoupURI *proxy_uri); + +struct _GDataServicePrivate { + SoupSession *session; + gchar *locale; + GDataAuthorizer *authorizer; + GProxyResolver *proxy_resolver; +}; + +enum { + PROP_PROXY_URI = 1, + PROP_TIMEOUT, + PROP_LOCALE, + PROP_AUTHORIZER, + PROP_PROXY_RESOLVER, +}; + +G_DEFINE_TYPE (GDataService, gdata_service, G_TYPE_OBJECT) + +static void +gdata_service_class_init (GDataServiceClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataServicePrivate)); + + gobject_class->set_property = gdata_service_set_property; + gobject_class->get_property = gdata_service_get_property; + gobject_class->dispose = gdata_service_dispose; + gobject_class->finalize = gdata_service_finalize; + + klass->api_version = "2"; + klass->feed_type = GDATA_TYPE_FEED; + klass->append_query_headers = real_append_query_headers; + klass->parse_error_response = real_parse_error_response; + klass->parse_feed = real_parse_feed; + klass->get_authorization_domains = NULL; /* equivalent to returning an empty list of domains */ + + /** + * GDataService:proxy-uri: + * + * The proxy URI used internally for all network requests. + * + * Note that if a #GDataAuthorizer is being used with this #GDataService, the authorizer might also need its proxy URI setting. + * + * Since: 0.2.0 + * Deprecated: 0.15.0: Use #GDataService:proxy-resolver instead, which gives more flexibility over the proxy used. + */ + g_object_class_install_property (gobject_class, PROP_PROXY_URI, + g_param_spec_boxed ("proxy-uri", + "Proxy URI", "The proxy URI used internally for all network requests.", + SOUP_TYPE_URI, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataService:timeout: + * + * A timeout, in seconds, for network operations. If the timeout is exceeded, the operation will be cancelled and + * %GDATA_SERVICE_ERROR_NETWORK_ERROR will be returned. + * + * If the timeout is <code class="literal">0</code>, operations will never time out. + * + * Note that if a #GDataAuthorizer is being used with this #GDataService, the authorizer might also need its timeout setting. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_TIMEOUT, + g_param_spec_uint ("timeout", + "Timeout", "A timeout, in seconds, for network operations.", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataService:locale: + * + * The locale to use for network requests, in Unix locale format. (e.g. "en_GB", "cs", "de_DE".) Use %NULL for the default "C" locale + * (typically "en_US"). + * + * Typically, this locale will be used by the server-side software to localise results, such as by translating category names, or by choosing + * geographically relevant search results. This will vary from service to service. + * + * The server-side behaviour is undefined if it doesn't support a given locale. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_LOCALE, + g_param_spec_string ("locale", + "Locale", "The locale to use for network requests, in Unix locale format.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataService:authorizer: + * + * An object which implements #GDataAuthorizer. This should have previously been authenticated authorized against this service type (and + * potentially other service types). The service will use the authorizer to add an authorization token to each request it performs. + * + * Your application should call methods on the #GDataAuthorizer object itself in order to authenticate with the Google accounts service and + * authorize against this service type. See the documentation for the particular #GDataAuthorizer implementation being used for more details. + * + * The authorizer for a service can be changed at runtime for a different #GDataAuthorizer object or %NULL without affecting ongoing requests + * and operations. + * + * Note that it's only necessary to set an authorizer on the service if your application is going to make requests of the service which + * require authorization. For example, listing the current most popular videos on YouTube does not require authorization, but uploading a + * video to YouTube does. It's an unnecessary overhead to require the user to authorize against a service when not strictly required. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_AUTHORIZER, + g_param_spec_object ("authorizer", + "Authorizer", "An authorizer object to provide an authorization token for each request.", + GDATA_TYPE_AUTHORIZER, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataService:proxy-resolver: + * + * The #GProxyResolver used to determine a proxy URI. Setting this will clear the #GDataService:proxy-uri property. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_PROXY_RESOLVER, + g_param_spec_object ("proxy-resolver", + "Proxy Resolver", "A GProxyResolver used to determine a proxy URI.", + G_TYPE_PROXY_RESOLVER, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_service_init (GDataService *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_SERVICE, GDataServicePrivate); + self->priv->session = _gdata_service_build_session (); + + /* Log handling for all message types except debug */ + g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_LEVEL_INFO | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_WARNING, (GLogFunc) debug_handler, self); + + /* Proxy the SoupSession's proxy-uri and timeout properties */ + g_signal_connect (self->priv->session, "notify::proxy-uri", (GCallback) notify_proxy_uri_cb, self); + g_signal_connect (self->priv->session, "notify::timeout", (GCallback) notify_timeout_cb, self); + + /* Keep our GProxyResolver synchronized with SoupSession's. */ + g_object_bind_property (self->priv->session, "proxy-resolver", self, "proxy-resolver", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); +} + +static void +gdata_service_dispose (GObject *object) +{ + GDataServicePrivate *priv = GDATA_SERVICE (object)->priv; + + if (priv->authorizer != NULL) + g_object_unref (priv->authorizer); + priv->authorizer = NULL; + + if (priv->session != NULL) + g_object_unref (priv->session); + priv->session = NULL; + + g_clear_object (&priv->proxy_resolver); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_service_parent_class)->dispose (object); +} + +static void +gdata_service_finalize (GObject *object) +{ + GDataServicePrivate *priv = GDATA_SERVICE (object)->priv; + + g_free (priv->locale); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_service_parent_class)->finalize (object); +} + +static void +gdata_service_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataServicePrivate *priv = GDATA_SERVICE (object)->priv; + + switch (property_id) { + case PROP_PROXY_URI: + g_value_set_boxed (value, _get_proxy_uri (GDATA_SERVICE (object))); + break; + case PROP_TIMEOUT: + g_value_set_uint (value, gdata_service_get_timeout (GDATA_SERVICE (object))); + break; + case PROP_LOCALE: + g_value_set_string (value, priv->locale); + break; + case PROP_AUTHORIZER: + g_value_set_object (value, priv->authorizer); + break; + case PROP_PROXY_RESOLVER: + g_value_set_object (value, priv->proxy_resolver); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_service_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + switch (property_id) { + case PROP_PROXY_URI: + _set_proxy_uri (GDATA_SERVICE (object), g_value_get_boxed (value)); + break; + case PROP_TIMEOUT: + gdata_service_set_timeout (GDATA_SERVICE (object), g_value_get_uint (value)); + break; + case PROP_LOCALE: + gdata_service_set_locale (GDATA_SERVICE (object), g_value_get_string (value)); + break; + case PROP_AUTHORIZER: + gdata_service_set_authorizer (GDATA_SERVICE (object), g_value_get_object (value)); + break; + case PROP_PROXY_RESOLVER: + gdata_service_set_proxy_resolver (GDATA_SERVICE (object), g_value_get_object (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +real_append_query_headers (GDataService *self, GDataAuthorizationDomain *domain, SoupMessage *message) +{ + g_assert (message != NULL); + + /* Set the authorisation header */ + if (self->priv->authorizer != NULL) { + gdata_authorizer_process_request (self->priv->authorizer, domain, message); + + if (domain != NULL) { + /* Store the authorisation domain on the message so that we can access it again after refreshing authorisation if necessary. + * See _gdata_service_send_message(). */ + g_object_set_data_full (G_OBJECT (message), "gdata-authorization-domain", g_object_ref (domain), + (GDestroyNotify) g_object_unref); + } + } + + /* Set the GData-Version header to tell it we want to use the v2 API */ + soup_message_headers_append (message->request_headers, "GData-Version", GDATA_SERVICE_GET_CLASS (self)->api_version); + + /* Set the locale, if it's been set for the service */ + if (self->priv->locale != NULL) + soup_message_headers_append (message->request_headers, "Accept-Language", self->priv->locale); +} + +static void +real_parse_error_response (GDataService *self, GDataOperationType operation_type, guint status, const gchar *reason_phrase, + const gchar *response_body, gint length, GError **error) +{ + /* We prefer to include the @response_body in the error message, but if it's empty, fall back to the @reason_phrase */ + if (response_body == NULL || *response_body == '\0') + response_body = reason_phrase; + + /* See: http://code.google.com/apis/gdata/docs/2.0/reference.html#HTTPStatusCodes */ + switch (status) { + case SOUP_STATUS_CANT_RESOLVE: + case SOUP_STATUS_CANT_CONNECT: + case SOUP_STATUS_SSL_FAILED: + case SOUP_STATUS_IO_ERROR: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NETWORK_ERROR, + _("Cannot connect to the service’s server.")); + return; + case SOUP_STATUS_CANT_RESOLVE_PROXY: + case SOUP_STATUS_CANT_CONNECT_PROXY: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROXY_ERROR, + _("Cannot connect to the proxy server.")); + return; + case SOUP_STATUS_MALFORMED: + case SOUP_STATUS_BAD_REQUEST: /* 400 */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message returned by the server. */ + _("Invalid request URI or header, or unsupported nonstandard parameter: %s"), response_body); + return; + case SOUP_STATUS_UNAUTHORIZED: /* 401 */ + case SOUP_STATUS_FORBIDDEN: /* 403 */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + /* Translators: the parameter is an error message returned by the server. */ + _("Authentication required: %s"), response_body); + return; + case SOUP_STATUS_NOT_FOUND: /* 404 */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NOT_FOUND, + /* Translators: the parameter is an error message returned by the server. */ + _("The requested resource was not found: %s"), response_body); + return; + case SOUP_STATUS_CONFLICT: /* 409 */ + case SOUP_STATUS_PRECONDITION_FAILED: /* 412 */ + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_CONFLICT, + /* Translators: the parameter is an error message returned by the server. */ + _("The entry has been modified since it was downloaded: %s"), response_body); + return; + case SOUP_STATUS_INTERNAL_SERVER_ERROR: /* 500 */ + default: + /* We'll fall back to generic errors, below */ + break; + } + + /* If the error hasn't been handled already, throw a generic error */ + switch (operation_type) { + case GDATA_OPERATION_AUTHENTICATION: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is an HTTP status, + * and the second is an error message returned by the server. */ + _("Error code %u when authenticating: %s"), status, response_body); + break; + case GDATA_OPERATION_QUERY: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is an HTTP status, + * and the second is an error message returned by the server. */ + _("Error code %u when querying: %s"), status, response_body); + break; + case GDATA_OPERATION_INSERTION: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is an HTTP status, + * and the second is an error message returned by the server. */ + _("Error code %u when inserting an entry: %s"), status, response_body); + break; + case GDATA_OPERATION_UPDATE: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is an HTTP status, + * and the second is an error message returned by the server. */ + _("Error code %u when updating an entry: %s"), status, response_body); + break; + case GDATA_OPERATION_DELETION: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is an HTTP status, + * and the second is an error message returned by the server. */ + _("Error code %u when deleting an entry: %s"), status, response_body); + break; + case GDATA_OPERATION_DOWNLOAD: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is an HTTP status, + * and the second is an error message returned by the server. */ + _("Error code %u when downloading: %s"), status, response_body); + break; + case GDATA_OPERATION_UPLOAD: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the first parameter is an HTTP status, + * and the second is an error message returned by the server. */ + _("Error code %u when uploading: %s"), status, response_body); + break; + case GDATA_OPERATION_BATCH: + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION, + /* Translators: the first parameter is a HTTP status, + * and the second is an error message returned by the server. */ + _("Error code %u when running a batch operation: %s"), status, response_body); + break; + default: + /* We should not be called with anything other than the above operation types */ + g_assert_not_reached (); + } +} + +/** + * gdata_service_is_authorized: + * @self: a #GDataService + * + * Determines whether the service is authorized for all the #GDataAuthorizationDomain<!-- -->s it belongs to (as returned by + * gdata_service_get_authorization_domains()). If the service's #GDataService:authorizer is %NULL, %FALSE is always returned. + * + * This is basically a convenience method for checking that the service's #GDataAuthorizer is authorized for all the service's + * #GDataAuthorizationDomain<!-- -->s. + * + * Return value: %TRUE if the service is authorized for all its domains, %FALSE otherwise + * + * Since: 0.9.0 + */ +gboolean +gdata_service_is_authorized (GDataService *self) +{ + GList *domains, *i; + gboolean authorised = TRUE; + + g_return_val_if_fail (GDATA_IS_SERVICE (self), FALSE); + + /* If we don't have an authoriser set, we can't be authorised */ + if (self->priv->authorizer == NULL) { + return FALSE; + } + + domains = gdata_service_get_authorization_domains (G_OBJECT_TYPE (self)); + + /* Find any domains which we're not authorised for */ + for (i = domains; i != NULL; i = i->next) { + if (gdata_authorizer_is_authorized_for_domain (self->priv->authorizer, GDATA_AUTHORIZATION_DOMAIN (i->data)) == FALSE) { + authorised = FALSE; + break; + } + } + + g_list_free (domains); + + return authorised; +} + +/** + * gdata_service_get_authorizer: + * @self: a #GDataService + * + * Gets the #GDataAuthorizer object currently in use by the service. See the documentation for #GDataService:authorizer for more details. + * + * Return value: (transfer none): the authorizer object for this service, or %NULL + * + * Since: 0.9.0 + */ +GDataAuthorizer * +gdata_service_get_authorizer (GDataService *self) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + + return self->priv->authorizer; +} + +/** + * gdata_service_set_authorizer: + * @self: a #GDataService + * @authorizer: a new authorizer object for the service, or %NULL + * + * Sets #GDataService:authorizer to @authorizer. This may be %NULL if the service will only make requests in future which don't require authorization. + * See the documentation for #GDataService:authorizer for more information. + * + * Since: 0.9.0 + */ +void +gdata_service_set_authorizer (GDataService *self, GDataAuthorizer *authorizer) +{ + GDataServicePrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_SERVICE (self)); + g_return_if_fail (authorizer == NULL || GDATA_IS_AUTHORIZER (authorizer)); + + if (priv->authorizer != NULL) { + g_object_unref (priv->authorizer); + } + + priv->authorizer = authorizer; + + if (priv->authorizer != NULL) { + g_object_ref (priv->authorizer); + } + + g_object_notify (G_OBJECT (self), "authorizer"); +} + +/** + * gdata_service_get_authorization_domains: + * @service_type: the #GType of the #GDataService subclass to retrieve the authorization domains for + * + * Retrieves the full list of #GDataAuthorizationDomain<!-- -->s which relate to the specified @service_type. All the + * #GDataAuthorizationDomain<!-- -->s are unique and interned, so can be compared with other domains by simple pointer comparison. + * + * Note that in addition to this method, #GDataService subclasses may expose some or all of their authorization domains individually by means of + * individual accessor functions. + * + * Return value: (transfer container) (element-type GDataAuthorizationDomain): an unordered list of #GDataAuthorizationDomain<!-- -->s; free with + * g_list_free() + * + * Since: 0.9.0 + */ +GList * +gdata_service_get_authorization_domains (GType service_type) +{ + GDataServiceClass *klass; + GList *domains = NULL; + + g_return_val_if_fail (g_type_is_a (service_type, GDATA_TYPE_SERVICE), NULL); + + klass = GDATA_SERVICE_CLASS (g_type_class_ref (service_type)); + if (klass->get_authorization_domains != NULL) { + domains = klass->get_authorization_domains (); + } + g_type_class_unref (klass); + + return domains; +} + +SoupMessage * +_gdata_service_build_message (GDataService *self, GDataAuthorizationDomain *domain, const gchar *method, const gchar *uri, + const gchar *etag, gboolean etag_if_match) +{ + SoupMessage *message; + GDataServiceClass *klass; + SoupURI *_uri; + + /* Create the message. Allow changing the HTTPS port just for testing, + * but require that the URI is always HTTPS for privacy. */ + _uri = soup_uri_new (uri); + soup_uri_set_port (_uri, _gdata_service_get_https_port ()); + g_assert_cmpstr (soup_uri_get_scheme (_uri), ==, SOUP_URI_SCHEME_HTTPS); + message = soup_message_new_from_uri (method, _uri); + soup_uri_free (_uri); + + /* Make sure subclasses set their headers */ + klass = GDATA_SERVICE_GET_CLASS (self); + if (klass->append_query_headers != NULL) + klass->append_query_headers (self, domain, message); + + /* Append the ETag header if possible */ + if (etag != NULL) + soup_message_headers_append (message->request_headers, (etag_if_match == TRUE) ? "If-Match" : "If-None-Match", etag); + + return message; +} + +typedef struct { + GMutex mutex; /* mutex to prevent cancellation before the message has been added to the session's message queue */ + SoupSession *session; + SoupMessage *message; +} MessageData; + +static void +message_cancel_cb (GCancellable *cancellable, MessageData *data) +{ + g_mutex_lock (&(data->mutex)); + soup_session_cancel_message (data->session, data->message, SOUP_STATUS_CANCELLED); + g_mutex_unlock (&(data->mutex)); +} + +static void +message_request_queued_cb (SoupSession *session, SoupMessage *message, MessageData *data) +{ + if (message == data->message) { + g_mutex_unlock (&(data->mutex)); + } +} + +/* Synchronously send @message via @service, handling asynchronous cancellation as best we can. If @cancellable has been cancelled before we start + * network activity, return without doing any network activity. Otherwise, if @cancellable is cancelled (from another thread) after network activity + * has started, we wait until the message has been queued by the session, then cancel the network activity and return as soon as possible. + * + * If cancellation has been handled, @error is guaranteed to be set to %G_IO_ERROR_CANCELLED. Otherwise, @error is guaranteed to be unset. */ +void +_gdata_service_actually_send_message (SoupSession *session, SoupMessage *message, GCancellable *cancellable, GError **error) +{ + MessageData data; + gulong cancel_signal = 0, request_queued_signal = 0; + + /* Hold references to the session and message so they can't be freed by other threads. For example, if the SoupSession was freed by another + * thread while we were making a request, the request would be unexpectedly cancelled. See bgo#650835 for an example of this breaking things. + */ + g_object_ref (session); + g_object_ref (message); + + /* Listen for cancellation */ + if (cancellable != NULL) { + g_mutex_init (&(data.mutex)); + data.session = session; + data.message = message; + + cancel_signal = g_cancellable_connect (cancellable, (GCallback) message_cancel_cb, &data, NULL); + request_queued_signal = g_signal_connect (session, "request-queued", (GCallback) message_request_queued_cb, &data); + + /* We lock this mutex until the message has been queued by the session (i.e. it's unlocked in the request-queued callback), and require + * the mutex to be held to cancel the message. Consequently, if the message is cancelled (in another thread) any time between this lock + * and the request being queued, the cancellation will wait until the request has been queued before taking effect. + * This is a little ugly, but is the only way I can think of to avoid a race condition between calling soup_session_cancel_message() + * and soup_session_send_message(), as the former doesn't have any effect until the request has been queued, and once the latter has + * returned, all network activity has been finished so cancellation is pointless. */ + g_mutex_lock (&(data.mutex)); + } + + /* Only send the message if it hasn't already been cancelled. There is no race condition here for the above reasons: if the cancellable has + * been cancelled, it's because it was cancelled before we called g_cancellable_connect(). + * + * Otherwise, manually set the message's status code to SOUP_STATUS_CANCELLED, as the message was cancelled before even being queued to be + * sent. */ + if (cancellable == NULL || g_cancellable_is_cancelled (cancellable) == FALSE) + soup_session_send_message (session, message); + else { + if (cancellable != NULL) { + g_mutex_unlock (&data.mutex); + } + + soup_message_set_status (message, SOUP_STATUS_CANCELLED); + } + + /* Clean up the cancellation code */ + if (cancellable != NULL) { + g_signal_handler_disconnect (session, request_queued_signal); + + if (cancel_signal != 0) + g_cancellable_disconnect (cancellable, cancel_signal); + + g_mutex_clear (&(data.mutex)); + } + + /* Set the cancellation error if applicable. We can't assume that our GCancellable has been cancelled just because the message has; + * libsoup may internally cancel messages if, for example, the proxy URI of the SoupSession is changed. + * libsoup also sometimes seems to return a SOUP_STATUS_IO_ERROR when we cancel a message, even though we've specified SOUP_STATUS_CANCELLED + * at cancellation time. Ho Hum. */ + g_assert (message->status_code != SOUP_STATUS_NONE); + + if (message->status_code == SOUP_STATUS_CANCELLED || + ((message->status_code == SOUP_STATUS_IO_ERROR || message->status_code == SOUP_STATUS_SSL_FAILED || + message->status_code == SOUP_STATUS_CANT_CONNECT || message->status_code == SOUP_STATUS_CANT_RESOLVE) && + cancellable != NULL && g_cancellable_is_cancelled (cancellable) == TRUE)) { + /* We hackily create and cancel a new GCancellable so that we can set the error using it and therefore save ourselves a translatable + * string and the associated maintenance. */ + GCancellable *error_cancellable = g_cancellable_new (); + g_cancellable_cancel (error_cancellable); + g_assert (g_cancellable_set_error_if_cancelled (error_cancellable, error) == TRUE); + g_object_unref (error_cancellable); + + /* As per the above comment, force the status to be SOUP_STATUS_CANCELLED. */ + soup_message_set_status (message, SOUP_STATUS_CANCELLED); + } + + /* Free things */ + g_object_unref (message); + g_object_unref (session); +} + +guint +_gdata_service_send_message (GDataService *self, SoupMessage *message, GCancellable *cancellable, GError **error) +{ + /* Based on code from evolution-data-server's libgdata: + * Ebby Wiselyn <ebbywiselyn@gmail.com> + * Jason Willis <zenbrother@gmail.com> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + */ + + soup_message_set_flags (message, SOUP_MESSAGE_NO_REDIRECT); + _gdata_service_actually_send_message (self->priv->session, message, cancellable, error); + soup_message_set_flags (message, 0); + + /* Handle redirections specially so we don't lose our custom headers when making the second request */ + if (SOUP_STATUS_IS_REDIRECTION (message->status_code)) { + SoupURI *new_uri; + const gchar *new_location; + + new_location = soup_message_headers_get_one (message->response_headers, "Location"); + g_return_val_if_fail (new_location != NULL, SOUP_STATUS_NONE); + + new_uri = soup_uri_new_with_base (soup_message_get_uri (message), new_location); + if (new_uri == NULL) { + gchar *uri_string = soup_uri_to_string (new_uri, FALSE); + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is the URI which is invalid. */ + _("Invalid redirect URI: %s"), uri_string); + g_free (uri_string); + return SOUP_STATUS_NONE; + } + + /* Allow overriding the URI for testing. */ + soup_uri_set_port (new_uri, _gdata_service_get_https_port ()); + + soup_message_set_uri (message, new_uri); + soup_uri_free (new_uri); + + /* Send the message again */ + _gdata_service_actually_send_message (self->priv->session, message, cancellable, error); + } + + /* Not authorised, or authorisation has expired. If we were authorised in the first place, attempt to refresh the authorisation and + * try sending the message again (but only once, so we don't get caught in an infinite loop of denied authorisation errors). + * + * Note that we have to re-process the message with the authoriser so that its authorisation headers get updated after the refresh + * (bgo#653535). */ + if (message->status_code == SOUP_STATUS_UNAUTHORIZED || + message->status_code == SOUP_STATUS_FORBIDDEN || + message->status_code == SOUP_STATUS_NOT_FOUND) { + GDataAuthorizer *authorizer = self->priv->authorizer; + + if (authorizer != NULL && gdata_authorizer_refresh_authorization (authorizer, cancellable, NULL) == TRUE) { + GDataAuthorizationDomain *domain; + + /* Re-process the request */ + domain = g_object_get_data (G_OBJECT (message), "gdata-authorization-domain"); + g_assert (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain)); + + gdata_authorizer_process_request (authorizer, domain, message); + + /* Send the message again */ + g_clear_error (error); + _gdata_service_actually_send_message (self->priv->session, message, cancellable, error); + } + } + + return message->status_code; +} + +typedef struct { + /* Input */ + GDataAuthorizationDomain *domain; + gchar *feed_uri; + GDataQuery *query; + GType entry_type; + + /* Output */ + GDataQueryProgressCallback progress_callback; + gpointer progress_user_data; + GDestroyNotify destroy_progress_user_data; +} QueryAsyncData; + +static void +query_async_data_free (QueryAsyncData *self) +{ + if (self->domain != NULL) + g_object_unref (self->domain); + + g_free (self->feed_uri); + if (self->query) + g_object_unref (self->query); + + g_slice_free (QueryAsyncData, self); +} + +static void +query_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataService *service = GDATA_SERVICE (source_object); + g_autoptr(GError) error = NULL; + QueryAsyncData *data = task_data; + g_autoptr(GDataFeed) feed = NULL; + + /* Execute the query and return */ + feed = __gdata_service_query (service, data->domain, data->feed_uri, data->query, data->entry_type, cancellable, + data->progress_callback, data->progress_user_data, &error); + if (feed == NULL && error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&feed), g_object_unref); + + if (data->destroy_progress_user_data != NULL) { + data->destroy_progress_user_data (data->progress_user_data); + } +} + +/** + * gdata_service_query_async: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the query falls under, or %NULL + * @feed_uri: the feed URI to query, including the host name and protocol + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @entry_type: a #GType for the #GDataEntry<!-- -->s to build from the XML + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service's @feed_uri feed to build a #GDataFeed. @self, @feed_uri and + * @query are all reffed/copied when this function is called, so can safely be freed after this function returns. + * + * For more details, see gdata_service_query(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_service_query_finish() + * to get the results of the operation. + * + * Since: 0.9.1 + */ +void +gdata_service_query_async (GDataService *self, GDataAuthorizationDomain *domain, const gchar *feed_uri, GDataQuery *query, GType entry_type, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + QueryAsyncData *data; + + g_return_if_fail (GDATA_IS_SERVICE (self)); + g_return_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain)); + g_return_if_fail (feed_uri != NULL); + g_return_if_fail (g_type_is_a (entry_type, GDATA_TYPE_ENTRY)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + data = g_slice_new (QueryAsyncData); + data->domain = (domain != NULL) ? g_object_ref (domain) : NULL; + data->feed_uri = g_strdup (feed_uri); + data->query = (query != NULL) ? g_object_ref (query) : NULL; + data->entry_type = entry_type; + data->progress_callback = progress_callback; + data->progress_user_data = progress_user_data; + data->destroy_progress_user_data = destroy_progress_user_data; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) query_async_data_free); + g_task_run_in_thread (task, query_thread); +} + +/** + * gdata_service_query_finish: + * @self: a #GDataService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous query operation started with gdata_service_query_async(). + * + * Return value: (transfer full): a #GDataFeed of query results, or %NULL; unref with g_object_unref() + */ +GDataFeed * +gdata_service_query_finish (GDataService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_service_query_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} + +/* Does the bulk of the work of gdata_service_query. Split out because certain queries (such as that done by + * gdata_service_query_single_entry()) only return a single entry, and thus need special parsing code. */ +SoupMessage * +_gdata_service_query (GDataService *self, GDataAuthorizationDomain *domain, const gchar *feed_uri, GDataQuery *query, + GCancellable *cancellable, GError **error) +{ + SoupMessage *message; + guint status; + const gchar *etag = NULL; + + /* Append the ETag header if possible */ + if (query != NULL) + etag = gdata_query_get_etag (query); + + /* Build the message */ + if (query != NULL) { + gchar *query_uri = gdata_query_get_query_uri (query, feed_uri); + message = _gdata_service_build_message (self, domain, SOUP_METHOD_GET, query_uri, etag, FALSE); + g_free (query_uri); + } else { + message = _gdata_service_build_message (self, domain, SOUP_METHOD_GET, feed_uri, etag, FALSE); + } + + /* Note that cancellation only applies to network activity; not to the processing done afterwards */ + status = _gdata_service_send_message (self, message, cancellable, error); + + if (status == SOUP_STATUS_NOT_MODIFIED || status == SOUP_STATUS_CANCELLED) { + /* Not modified (ETag has worked), or cancelled (in which case the error has been set) */ + g_object_unref (message); + return NULL; + } else if (status != SOUP_STATUS_OK) { + /* Error */ + GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (self); + g_assert (klass->parse_error_response != NULL); + klass->parse_error_response (self, GDATA_OPERATION_QUERY, status, message->reason_phrase, message->response_body->data, + message->response_body->length, error); + g_object_unref (message); + return NULL; + } + + return message; +} + +static GDataFeed * +__gdata_service_query (GDataService *self, GDataAuthorizationDomain *domain, const gchar *feed_uri, GDataQuery *query, GType entry_type, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + GDataServiceClass *klass; + SoupMessage *message; + GDataFeed *feed; + + klass = GDATA_SERVICE_GET_CLASS (self); + + /* Are we off the end of the final page? */ + if (query != NULL && _gdata_query_is_finished (query)) { + GTimeVal updated; + + /* Build an empty dummy feed to signify the end of the list. */ + g_get_current_time (&updated); + return _gdata_feed_new (klass->feed_type, "Empty feed", "feed1", + updated.tv_sec); + } + + /* Send the request. */ + message = _gdata_service_query (self, domain, feed_uri, query, cancellable, error); + if (message == NULL) + return NULL; + + g_assert (message->response_body->data != NULL); + g_assert (klass->parse_feed != NULL); + + /* Parse the response. */ + feed = klass->parse_feed (self, domain, query, entry_type, + message, cancellable, progress_callback, + progress_user_data, error); + + g_object_unref (message); + + return feed; +} + +static GDataFeed * +real_parse_feed (GDataService *self, + GDataAuthorizationDomain *domain, + GDataQuery *query, + GType entry_type, + SoupMessage *message, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, + GError **error) +{ + GDataServiceClass *klass; + GDataFeed *feed = NULL; + SoupMessageHeaders *headers; + const gchar *content_type; + + klass = GDATA_SERVICE_GET_CLASS (self); + headers = message->response_headers; + content_type = soup_message_headers_get_content_type (headers, NULL); + + if (content_type != NULL && strcmp (content_type, "application/json") == 0) { + /* Definitely JSON. */ + g_debug("JSON content type detected."); + feed = _gdata_feed_new_from_json (klass->feed_type, message->response_body->data, message->response_body->length, entry_type, + progress_callback, progress_user_data, error); + } else { + /* Potentially XML. Don't bother checking the Content-Type, since the parser + * will fail gracefully if the response body is not valid XML. */ + g_debug("XML content type detected."); + feed = _gdata_feed_new_from_xml (klass->feed_type, message->response_body->data, message->response_body->length, entry_type, + progress_callback, progress_user_data, error); + } + + /* Update the query with the feed's ETag */ + if (query != NULL && feed != NULL && gdata_feed_get_etag (feed) != NULL) + gdata_query_set_etag (query, gdata_feed_get_etag (feed)); + + /* Update the query with the next and previous URIs from the feed */ + if (query != NULL && feed != NULL) { + GDataLink *_link; + const gchar *token; + + _gdata_query_clear_pagination (query); + + /* Atom-style next and previous page links. */ + _link = gdata_feed_look_up_link (feed, "http://www.iana.org/assignments/relation/next"); + if (_link != NULL) + _gdata_query_set_next_uri (query, gdata_link_get_uri (_link)); + _link = gdata_feed_look_up_link (feed, "http://www.iana.org/assignments/relation/previous"); + if (_link != NULL) + _gdata_query_set_previous_uri (query, gdata_link_get_uri (_link)); + + /* JSON-style next page token. (There is no previous page + * token.) */ + token = gdata_feed_get_next_page_token (feed); + if (token != NULL) + _gdata_query_set_next_page_token (query, token); + } + + return feed; +} + +/** + * gdata_service_query: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the query falls under, or %NULL + * @feed_uri: the feed URI to query, including the host name and protocol + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @entry_type: a #GType for the #GDataEntry<!-- -->s to build from the XML + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service's @feed_uri feed to build a #GDataFeed. + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled before or during network activity, the error %G_IO_ERROR_CANCELLED will be returned. Cancellation has no effect + * after network activity has finished, however, and the query will return successfully (or return an error sent by the server) if it is first + * cancelled after network activity has finished. See the <link linkend="cancellable-support">overview of cancellation</link> for + * more details. + * + * A %GDATA_SERVICE_ERROR_PROTOCOL_ERROR will be returned if the server indicates there is a problem with the query, but subclasses may override + * this and return their own errors. See their documentation for more details. + * + * For each entry in the response feed, @progress_callback will be called in the main thread. If there was an error parsing the XML response, + * a #GDataParserError will be returned. + * + * If the query is successful and the feed supports pagination, @query will be updated with the pagination URIs, and the next or previous page + * can then be loaded by calling gdata_query_next_page() or gdata_query_previous_page() before running the query again. + * + * If the #GDataQuery's ETag is set and it finds a match on the server, %NULL will be returned, but @error will remain unset. Otherwise, + * @query's ETag will be updated with the ETag from the returned feed, if available. + * + * Return value: (transfer full): a #GDataFeed of query results, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataFeed * +gdata_service_query (GDataService *self, GDataAuthorizationDomain *domain, const gchar *feed_uri, GDataQuery *query, GType entry_type, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), NULL); + g_return_val_if_fail (feed_uri != NULL, NULL); + g_return_val_if_fail (g_type_is_a (entry_type, GDATA_TYPE_ENTRY), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + return __gdata_service_query (self, domain, feed_uri, query, entry_type, cancellable, progress_callback, progress_user_data, error); +} + +/** + * gdata_service_query_single_entry: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the query falls under, or %NULL + * @entry_id: the entry ID of the desired entry + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @entry_type: a #GType for the #GDataEntry to build from the XML + * @cancellable: (allow-none): a #GCancellable, or %NULL + * @error: a #GError, or %NULL + * + * Retrieves information about the single entry with the given @entry_id. @entry_id should be as returned by + * gdata_entry_get_id(). + * + * Parameters and errors are as for gdata_service_query(). Most of the properties of @query aren't relevant, and + * will cause a server-side error if used. The most useful property to use is #GDataQuery:etag, which will cause the + * server to not return anything if the entry hasn't been modified since it was given the specified ETag; thus saving + * bandwidth. If the server does not return anything for this reason, gdata_service_query_single_entry() will return + * %NULL, but will not set an error in @error. + * + * Return value: (transfer full): a #GDataEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataEntry * +gdata_service_query_single_entry (GDataService *self, GDataAuthorizationDomain *domain, const gchar *entry_id, GDataQuery *query, GType entry_type, + GCancellable *cancellable, GError **error) +{ + GDataEntryClass *klass; + GDataEntry *entry; + gchar *entry_uri; + SoupMessage *message; + SoupMessageHeaders *headers; + const gchar *content_type; + + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), NULL); + g_return_val_if_fail (entry_id != NULL, NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (g_type_is_a (entry_type, GDATA_TYPE_ENTRY) == TRUE, NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Query for just the specified entry */ + klass = GDATA_ENTRY_CLASS (g_type_class_ref (entry_type)); + g_assert (klass->get_entry_uri != NULL); + + entry_uri = klass->get_entry_uri (entry_id); + message = _gdata_service_query (GDATA_SERVICE (self), domain, entry_uri, query, cancellable, error); + g_free (entry_uri); + + if (message == NULL) { + g_type_class_unref (klass); + return NULL; + } + + g_assert (message->response_body->data != NULL); + + headers = message->response_headers; + content_type = soup_message_headers_get_content_type (headers, NULL); + + if (g_strcmp0 (content_type, "application/json") == 0) { + entry = GDATA_ENTRY (gdata_parsable_new_from_json (entry_type, message->response_body->data, message->response_body->length, error)); + } else { + entry = GDATA_ENTRY (gdata_parsable_new_from_xml (entry_type, message->response_body->data, message->response_body->length, error)); + } + + g_object_unref (message); + g_type_class_unref (klass); + + return entry; +} + +typedef struct { + GDataAuthorizationDomain *domain; + gchar *entry_id; + GDataQuery *query; + GType entry_type; +} QuerySingleEntryAsyncData; + +static void +query_single_entry_async_data_free (QuerySingleEntryAsyncData *data) +{ + if (data->domain != NULL) + g_object_unref (data->domain); + + g_free (data->entry_id); + if (data->query != NULL) + g_object_unref (data->query); + g_slice_free (QuerySingleEntryAsyncData, data); +} + +static void +query_single_entry_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataService *service = GDATA_SERVICE (source_object); + g_autoptr(GDataEntry) entry = NULL; + g_autoptr(GError) error = NULL; + QuerySingleEntryAsyncData *data = task_data; + + /* Execute the query and return */ + entry = gdata_service_query_single_entry (service, data->domain, data->entry_id, data->query, data->entry_type, cancellable, &error); + if (entry == NULL && error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&entry), g_object_unref); +} + +/** + * gdata_service_query_single_entry_async: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the query falls under, or %NULL + * @entry_id: the entry ID of the desired entry + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @entry_type: a #GType for the #GDataEntry to build from the XML + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Retrieves information about the single entry with the given @entry_id. @entry_id should be as returned by + * gdata_entry_get_id(). @self, @query and @entry_id are reffed/copied when this + * function is called, so can safely be freed after this function returns. + * + * For more details, see gdata_service_query_single_entry(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_service_query_single_entry_finish() + * to get the results of the operation. + * + * Since: 0.9.0 + */ +void +gdata_service_query_single_entry_async (GDataService *self, GDataAuthorizationDomain *domain, const gchar *entry_id, GDataQuery *query, + GType entry_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + QuerySingleEntryAsyncData *data; + + g_return_if_fail (GDATA_IS_SERVICE (self)); + g_return_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain)); + g_return_if_fail (entry_id != NULL); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (g_type_is_a (entry_type, GDATA_TYPE_ENTRY) == TRUE); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + data = g_slice_new (QuerySingleEntryAsyncData); + data->domain = (domain != NULL) ? g_object_ref (domain) : NULL; + data->query = (query != NULL) ? g_object_ref (query) : NULL; + data->entry_id = g_strdup (entry_id); + data->entry_type = entry_type; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_single_entry_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) query_single_entry_async_data_free); + g_task_run_in_thread (task, query_single_entry_thread); +} + +/** + * gdata_service_query_single_entry_finish: + * @self: a #GDataService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous query operation for a single entry, as started with gdata_service_query_single_entry_async(). + * + * Return value: (transfer full): a #GDataEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataEntry * +gdata_service_query_single_entry_finish (GDataService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_service_query_single_entry_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} + +typedef struct { + GDataAuthorizationDomain *domain; + gchar *upload_uri; + GDataEntry *entry; +} InsertEntryAsyncData; + +static void +insert_entry_async_data_free (InsertEntryAsyncData *self) +{ + if (self->domain != NULL) + g_object_unref (self->domain); + + g_free (self->upload_uri); + if (self->entry) + g_object_unref (self->entry); + + g_slice_free (InsertEntryAsyncData, self); +} + +static void +insert_entry_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataService *service = GDATA_SERVICE (source_object); + g_autoptr(GDataEntry) updated_entry = NULL; + g_autoptr(GError) error = NULL; + InsertEntryAsyncData *data = task_data; + + /* Insert the entry and return */ + updated_entry = gdata_service_insert_entry (service, data->domain, data->upload_uri, data->entry, cancellable, &error); + if (updated_entry == NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&updated_entry), g_object_unref); +} + +/** + * gdata_service_insert_entry_async: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the insertion operation falls under, or %NULL + * @upload_uri: the URI to which the upload should be sent + * @entry: the #GDataEntry to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Inserts @entry by uploading it to the online service at @upload_uri. @self, @upload_uri and + * @entry are all reffed/copied when this function is called, so can safely be freed after this function returns. + * + * For more details, see gdata_service_insert_entry(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_service_insert_entry_finish() + * to get the results of the operation. + * + * Since: 0.9.0 + */ +void +gdata_service_insert_entry_async (GDataService *self, GDataAuthorizationDomain *domain, const gchar *upload_uri, GDataEntry *entry, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + InsertEntryAsyncData *data; + + g_return_if_fail (GDATA_IS_SERVICE (self)); + g_return_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain)); + g_return_if_fail (upload_uri != NULL); + g_return_if_fail (GDATA_IS_ENTRY (entry)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + data = g_slice_new (InsertEntryAsyncData); + data->domain = (domain != NULL) ? g_object_ref (domain) : NULL; + data->upload_uri = g_strdup (upload_uri); + data->entry = g_object_ref (entry); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_insert_entry_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) insert_entry_async_data_free); + g_task_run_in_thread (task, insert_entry_thread); +} + +/** + * gdata_service_insert_entry_finish: + * @self: a #GDataService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous entry insertion operation started with gdata_service_insert_entry_async(). + * + * Return value: (transfer full): an updated #GDataEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.3.0 + */ +GDataEntry * +gdata_service_insert_entry_finish (GDataService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_service_insert_entry_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} + +/** + * gdata_service_insert_entry: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the insertion operation falls under, or %NULL + * @upload_uri: the URI to which the upload should be sent + * @entry: the #GDataEntry to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Inserts @entry by uploading it to the online service at @upload_uri. For more information about the concept of inserting entries, see + * the <ulink type="http" url="http://code.google.com/apis/gdata/docs/2.0/basics.html#InsertingEntry">online documentation</ulink> for the GData + * protocol. + * + * The service will return an updated version of the entry, which is the return value of this function on success. + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled before or during network activity, the error %G_IO_ERROR_CANCELLED will be returned. Cancellation has no effect + * after network activity has finished, however, and the insertion will return successfully (or return an error sent by the server) if it is first + * cancelled after network activity has finished. See the <link linkend="cancellable-support">overview of cancellation</link> for + * more details. + * + * If the entry is marked as already having been inserted a %GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED error will be returned immediately + * (there will be no network requests). + * + * If there is an error inserting the entry, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. Currently, subclasses + * <emphasis>cannot</emphasis> cannot override this or provide more specific errors. + * + * Return value: (transfer full): an updated #GDataEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataEntry * +gdata_service_insert_entry (GDataService *self, GDataAuthorizationDomain *domain, const gchar *upload_uri, GDataEntry *entry, + GCancellable *cancellable, GError **error) +{ + GDataEntry *updated_entry; + SoupMessage *message; + gchar *upload_data; + guint status; + GDataParsableClass *klass; + + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), NULL); + g_return_val_if_fail (upload_uri != NULL, NULL); + g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + if (gdata_entry_is_inserted (entry) == TRUE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED, + _("The entry has already been inserted.")); + return NULL; + } + + message = _gdata_service_build_message (self, domain, SOUP_METHOD_POST, upload_uri, NULL, FALSE); + + /* Append the data */ + klass = GDATA_PARSABLE_GET_CLASS (entry); + g_assert (klass->get_content_type != NULL); + if (g_strcmp0 (klass->get_content_type (), "application/json") == 0) { + upload_data = gdata_parsable_get_json (GDATA_PARSABLE (entry)); + soup_message_set_request (message, "application/json", SOUP_MEMORY_TAKE, upload_data, strlen (upload_data)); + } else { + upload_data = gdata_parsable_get_xml (GDATA_PARSABLE (entry)); + soup_message_set_request (message, "application/atom+xml", SOUP_MEMORY_TAKE, upload_data, strlen (upload_data)); + } + + /* Send the message */ + status = _gdata_service_send_message (self, message, cancellable, error); + + if (status == SOUP_STATUS_NONE || status == SOUP_STATUS_CANCELLED) { + /* Redirect error or cancelled */ + g_object_unref (message); + return NULL; + } else if (status != SOUP_STATUS_CREATED && status != SOUP_STATUS_OK) { + /* Error: for XML APIs Google returns CREATED and for JSON it returns OK. */ + GDataServiceClass *service_klass = GDATA_SERVICE_GET_CLASS (self); + g_assert (service_klass->parse_error_response != NULL); + service_klass->parse_error_response (self, GDATA_OPERATION_INSERTION, status, message->reason_phrase, message->response_body->data, + message->response_body->length, error); + g_object_unref (message); + return NULL; + } + + /* Parse the XML or JSON according to GDataEntry type; create and return a new GDataEntry of the same type as @entry */ + g_assert (message->response_body->data != NULL); + if (g_strcmp0 (klass->get_content_type (), "application/json") == 0) { + updated_entry = GDATA_ENTRY (gdata_parsable_new_from_json (G_OBJECT_TYPE (entry), message->response_body->data, + message->response_body->length, error)); + } else { + updated_entry = GDATA_ENTRY (gdata_parsable_new_from_xml (G_OBJECT_TYPE (entry), message->response_body->data, + message->response_body->length, error)); + } + g_object_unref (message); + + return updated_entry; +} + +typedef struct { + GDataAuthorizationDomain *domain; + GDataEntry *entry; +} UpdateEntryAsyncData; + +static void +update_entry_async_data_free (UpdateEntryAsyncData *data) +{ + if (data->domain != NULL) + g_object_unref (data->domain); + + if (data->entry != NULL) + g_object_unref (data->entry); + + g_slice_free (UpdateEntryAsyncData, data); +} + +static void +update_entry_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataService *service = GDATA_SERVICE (source_object); + g_autoptr(GDataEntry) updated_entry = NULL; + g_autoptr(GError) error = NULL; + UpdateEntryAsyncData *data = task_data; + + /* Update the entry and return */ + updated_entry = gdata_service_update_entry (service, data->domain, data->entry, cancellable, &error); + if (updated_entry == NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&updated_entry), g_object_unref); +} + +/** + * gdata_service_update_entry_async: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the update operation falls under, or %NULL + * @entry: the #GDataEntry to update + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the update is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Updates @entry by PUTting it to its <literal>edit</literal> link's URI. @self and + * @entry are both reffed when this function is called, so can safely be unreffed after this function returns. + * + * For more details, see gdata_service_update_entry(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_service_update_entry_finish() + * to get the results of the operation. + * + * Since: 0.9.0 + */ +void +gdata_service_update_entry_async (GDataService *self, GDataAuthorizationDomain *domain, GDataEntry *entry, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + UpdateEntryAsyncData *data; + + g_return_if_fail (GDATA_IS_SERVICE (self)); + g_return_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain)); + g_return_if_fail (GDATA_IS_ENTRY (entry)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + data = g_slice_new (UpdateEntryAsyncData); + data->domain = (domain != NULL) ? g_object_ref (domain) : NULL; + data->entry = g_object_ref (entry); + + task = g_task_new (task, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_update_entry_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) update_entry_async_data_free); + g_task_run_in_thread (task, update_entry_thread); +} + +/** + * gdata_service_update_entry_finish: + * @self: a #GDataService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous entry update operation started with gdata_service_update_entry_async(). + * + * Return value: (transfer full): an updated #GDataEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.3.0 + */ +GDataEntry * +gdata_service_update_entry_finish (GDataService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_service_update_entry_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} + +/** + * gdata_service_update_entry: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the update operation falls under, or %NULL + * @entry: the #GDataEntry to update + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Updates @entry by PUTting it to its <literal>edit</literal> link's URI. For more information about the concept of updating entries, see + * the <ulink type="http" url="http://code.google.com/apis/gdata/docs/2.0/basics.html#UpdatingEntry">online documentation</ulink> for the GData + * protocol. + * + * The service will return an updated version of the entry, which is the return value of this function on success. + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled before or during network activity, the error %G_IO_ERROR_CANCELLED will be returned. Cancellation has no effect + * after network activity has finished, however, and the update will return successfully (or return an error sent by the server) if it is first + * cancelled after network activity has finished. See the <link linkend="cancellable-support">overview of cancellation</link> for + * more details. + * + * If there is an error updating the entry, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. Currently, subclasses + * <emphasis>cannot</emphasis> cannot override this or provide more specific errors. + * + * Return value: (transfer full): an updated #GDataEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataEntry * +gdata_service_update_entry (GDataService *self, GDataAuthorizationDomain *domain, GDataEntry *entry, GCancellable *cancellable, GError **error) +{ + GDataEntry *updated_entry; + GDataLink *_link; + SoupMessage *message; + gchar *upload_data; + guint status; + GDataParsableClass *klass; + + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), NULL); + g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + /* Append the data */ + klass = GDATA_PARSABLE_GET_CLASS (entry); + g_assert (klass->get_content_type != NULL); + if (g_strcmp0 (klass->get_content_type (), "application/json") == 0) { + /* Get the edit URI */ + _link = gdata_entry_look_up_link (entry, GDATA_LINK_SELF); + g_assert (_link != NULL); + message = _gdata_service_build_message (self, domain, SOUP_METHOD_PUT, gdata_link_get_uri (_link), gdata_entry_get_etag (entry), TRUE); + upload_data = gdata_parsable_get_json (GDATA_PARSABLE (entry)); + soup_message_set_request (message, "application/json", SOUP_MEMORY_TAKE, upload_data, strlen (upload_data)); + } else { + /* Get the edit URI */ + _link = gdata_entry_look_up_link (entry, GDATA_LINK_EDIT); + g_assert (_link != NULL); + message = _gdata_service_build_message (self, domain, SOUP_METHOD_PUT, gdata_link_get_uri (_link), gdata_entry_get_etag (entry), TRUE); + upload_data = gdata_parsable_get_xml (GDATA_PARSABLE (entry)); + soup_message_set_request (message, "application/atom+xml", SOUP_MEMORY_TAKE, upload_data, strlen (upload_data)); + } + + /* Send the message */ + status = _gdata_service_send_message (self, message, cancellable, error); + + if (status == SOUP_STATUS_NONE || status == SOUP_STATUS_CANCELLED) { + /* Redirect error or cancelled */ + g_object_unref (message); + return NULL; + } else if (status != SOUP_STATUS_OK) { + /* Error */ + GDataServiceClass *service_klass = GDATA_SERVICE_GET_CLASS (self); + g_assert (service_klass->parse_error_response != NULL); + service_klass->parse_error_response (self, GDATA_OPERATION_UPDATE, status, message->reason_phrase, message->response_body->data, + message->response_body->length, error); + g_object_unref (message); + return NULL; + } + + /* Parse the XML; create and return a new GDataEntry of the same type as @entry */ + if (g_strcmp0 (klass->get_content_type (), "application/json") == 0) { + updated_entry = GDATA_ENTRY (gdata_parsable_new_from_json (G_OBJECT_TYPE (entry), message->response_body->data, + message->response_body->length, error)); + } else { + updated_entry = GDATA_ENTRY (gdata_parsable_new_from_xml (G_OBJECT_TYPE (entry), message->response_body->data, + message->response_body->length, error)); + } + g_object_unref (message); + + return updated_entry; +} + +typedef struct { + GDataAuthorizationDomain *domain; + GDataEntry *entry; +} DeleteEntryAsyncData; + +static void +delete_entry_async_data_free (DeleteEntryAsyncData *data) +{ + if (data->domain != NULL) + g_object_unref (data->domain); + + if (data->entry != NULL) + g_object_unref (data->entry); + + g_slice_free (DeleteEntryAsyncData, data); +} + +static void +delete_entry_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataService *service = GDATA_SERVICE (source_object); + g_autoptr(GError) error = NULL; + DeleteEntryAsyncData *data = task_data; + + /* Delete the entry and return */ + if (!gdata_service_delete_entry (service, data->domain, data->entry, cancellable, &error)) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_boolean (task, TRUE); +} + +/** + * gdata_service_delete_entry_async: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the deletion falls under, or %NULL + * @entry: the #GDataEntry to delete + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when deletion is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Deletes @entry from the server. @self and @entry are both reffed when this function is called, + * so can safely be unreffed after this function returns. + * + * For more details, see gdata_service_delete_entry(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_service_delete_entry_finish() + * to get the results of the operation. + * + * Since: 0.9.0 + */ +void +gdata_service_delete_entry_async (GDataService *self, GDataAuthorizationDomain *domain, GDataEntry *entry, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + DeleteEntryAsyncData *data; + + g_return_if_fail (GDATA_IS_SERVICE (self)); + g_return_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain)); + g_return_if_fail (GDATA_IS_ENTRY (entry)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + data = g_slice_new (DeleteEntryAsyncData); + data->domain = (domain != NULL) ? g_object_ref (domain) : NULL; + data->entry = g_object_ref (entry); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_delete_entry_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) delete_entry_async_data_free); + g_task_run_in_thread (task, delete_entry_thread); +} + +/** + * gdata_service_delete_entry_finish: + * @self: a #GDataService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous entry deletion operation started with gdata_service_delete_entry_async(). + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.3.0 + */ +gboolean +gdata_service_delete_entry_finish (GDataService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_return_val_if_fail (g_task_is_valid (async_result, self), FALSE); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_service_delete_entry_async), FALSE); + + return g_task_propagate_boolean (G_TASK (async_result), error); +} + +/** + * gdata_service_delete_entry: + * @self: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain the deletion falls under, or %NULL + * @entry: the #GDataEntry to delete + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Deletes @entry from the server. For more information about the concept of deleting entries, see the + * <ulink type="http" url="http://code.google.com/apis/gdata/docs/2.0/basics.html#DeletingEntry">online documentation</ulink> for the GData + * protocol. + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled before or during network activity, the error %G_IO_ERROR_CANCELLED will be returned. Cancellation has no effect + * after network activity has finished, however, and the deletion will return successfully (or return an error sent by the server) if it is first + * cancelled after network activity has finished. See the <link linkend="cancellable-support">overview of cancellation</link> for + * more details. + * + * If there is an error deleting the entry, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. Currently, subclasses + * <emphasis>cannot</emphasis> cannot override this or provide more specific errors. + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.9.0 + */ +gboolean +gdata_service_delete_entry (GDataService *self, GDataAuthorizationDomain *domain, GDataEntry *entry, GCancellable *cancellable, GError **error) +{ + GDataLink *_link; + SoupMessage *message; + guint status; + gchar *fixed_uri; + GDataParsableClass *klass; + + g_return_val_if_fail (GDATA_IS_SERVICE (self), FALSE); + g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), FALSE); + g_return_val_if_fail (GDATA_IS_ENTRY (entry), FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + /* Get the edit URI. We have to fix it to always use HTTPS as YouTube videos appear to incorrectly return a HTTP URI as their edit URI. */ + klass = GDATA_PARSABLE_GET_CLASS (entry); + g_assert (klass->get_content_type != NULL); + if (g_strcmp0 (klass->get_content_type (), "application/json") == 0) { + _link = gdata_entry_look_up_link (entry, GDATA_LINK_SELF); + } else { + _link = gdata_entry_look_up_link (entry, GDATA_LINK_EDIT); + } + g_assert (_link != NULL); + + fixed_uri = _gdata_service_fix_uri_scheme (gdata_link_get_uri (_link)); + message = _gdata_service_build_message (self, domain, SOUP_METHOD_DELETE, fixed_uri, gdata_entry_get_etag (entry), TRUE); + g_free (fixed_uri); + + /* Send the message */ + status = _gdata_service_send_message (self, message, cancellable, error); + + if (status == SOUP_STATUS_NONE || status == SOUP_STATUS_CANCELLED) { + /* Redirect error or cancelled */ + g_object_unref (message); + return FALSE; + } else if (status != SOUP_STATUS_OK && status != SOUP_STATUS_NO_CONTENT) { + /* Error */ + GDataServiceClass *service_klass = GDATA_SERVICE_GET_CLASS (self); + g_assert (service_klass->parse_error_response != NULL); + service_klass->parse_error_response (self, GDATA_OPERATION_DELETION, status, message->reason_phrase, message->response_body->data, + message->response_body->length, error); + g_object_unref (message); + return FALSE; + } + + g_object_unref (message); + + return TRUE; +} + +static void +notify_proxy_uri_cb (GObject *gobject, GParamSpec *pspec, GObject *self) +{ + g_object_notify (self, "proxy-uri"); +} + +/* Static function which isn't deprecated so we can continue using it internally. */ +static SoupURI * +_get_proxy_uri (GDataService *self) +{ + SoupURI *proxy_uri; + + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + + g_object_get (self->priv->session, SOUP_SESSION_PROXY_URI, &proxy_uri, NULL); + g_object_unref (proxy_uri); /* remove the ref added by g_object_get */ + + return proxy_uri; +} + +/** + * gdata_service_get_proxy_uri: + * @self: a #GDataService + * + * Gets the proxy URI on the #GDataService's #SoupSession. + * + * Return value: (transfer none): the proxy URI, or %NULL + * + * Since: 0.2.0 + * Deprecated: 0.15.0: Use gdata_service_get_proxy_resolver() instead, which gives more flexibility over the proxy used. + */ +SoupURI * +gdata_service_get_proxy_uri (GDataService *self) +{ + return _get_proxy_uri (self); +} + +/* Static function which isn't deprecated so we can continue using it internally. */ +static void +_set_proxy_uri (GDataService *self, SoupURI *proxy_uri) +{ + g_return_if_fail (GDATA_IS_SERVICE (self)); + g_object_set (self->priv->session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL); + g_object_notify (G_OBJECT (self), "proxy-uri"); +} + +/** + * gdata_service_set_proxy_uri: + * @self: a #GDataService + * @proxy_uri: (allow-none): the proxy URI, or %NULL + * + * Sets the proxy URI on the #SoupSession used internally by the given #GDataService. + * This forces all requests through the given proxy. + * + * If @proxy_uri is %NULL, no proxy will be used. + * + * Note that if a #GDataAuthorizer is being used with this #GDataService, the authorizer might also need its proxy URI setting. + * + * Since: 0.2.0 + * Deprecated: 0.15.0: Use gdata_service_set_proxy_resolver() instead, which gives more flexibility over the proxy used. + */ +void +gdata_service_set_proxy_uri (GDataService *self, SoupURI *proxy_uri) +{ + _set_proxy_uri (self, proxy_uri); +} + +/** + * gdata_service_get_proxy_resolver: + * @self: a #GDataService + * + * Gets the #GProxyResolver on the #GDataService's #SoupSession. + * + * Return value: (transfer none) (allow-none): a #GProxyResolver, or %NULL + * + * Since: 0.15.0 + */ +GProxyResolver * +gdata_service_get_proxy_resolver (GDataService *self) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + + return self->priv->proxy_resolver; +} + +/** + * gdata_service_set_proxy_resolver: + * @self: a #GDataService + * @proxy_resolver: (allow-none): a #GProxyResolver, or %NULL + * + * Sets the #GProxyResolver on the #SoupSession used internally by the given #GDataService. + * + * Setting this will clear the #GDataService:proxy-uri property. + * + * Since: 0.15.0 + */ +void +gdata_service_set_proxy_resolver (GDataService *self, GProxyResolver *proxy_resolver) +{ + g_return_if_fail (GDATA_IS_SERVICE (self)); + g_return_if_fail (proxy_resolver == NULL || G_IS_PROXY_RESOLVER (proxy_resolver)); + + if (proxy_resolver != NULL) { + g_object_ref (proxy_resolver); + } + + g_clear_object (&self->priv->proxy_resolver); + self->priv->proxy_resolver = proxy_resolver; + + g_object_notify (G_OBJECT (self), "proxy-resolver"); +} + +static void +notify_timeout_cb (GObject *gobject, GParamSpec *pspec, GObject *self) +{ + g_object_notify (self, "timeout"); +} + +/** + * gdata_service_get_timeout: + * @self: a #GDataService + * + * Gets the #GDataService:timeout property; the network timeout, in seconds. + * + * Return value: the timeout, or <code class="literal">0</code> + * + * Since: 0.7.0 + */ +guint +gdata_service_get_timeout (GDataService *self) +{ + guint timeout; + + g_return_val_if_fail (GDATA_IS_SERVICE (self), 0); + + g_object_get (self->priv->session, SOUP_SESSION_TIMEOUT, &timeout, NULL); + + return timeout; +} + +/** + * gdata_service_set_timeout: + * @self: a #GDataService + * @timeout: the timeout, or <code class="literal">0</code> + * + * Sets the #GDataService:timeout property; the network timeout, in seconds. + * + * If @timeout is <code class="literal">0</code>, network operations will never time out. + * + * Note that if a #GDataAuthorizer is being used with this #GDataService, the authorizer might also need its timeout setting. + * + * Since: 0.7.0 + */ +void +gdata_service_set_timeout (GDataService *self, guint timeout) +{ + g_return_if_fail (GDATA_IS_SERVICE (self)); + g_object_set (self->priv->session, SOUP_SESSION_TIMEOUT, timeout, NULL); + g_object_notify (G_OBJECT (self), "timeout"); +} + +SoupSession * +_gdata_service_get_session (GDataService *self) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + return self->priv->session; +} + +/* + * _gdata_service_get_scheme: + * + * Returns the name of the scheme to use, which will always be <code class="literal">https</code>. The return type used to vary according to the + * environment variable <code class="literal">LIBGDATA_FORCE_HTTP</code>, but Google has since switched to using HTTPS exclusively. + * + * See <ulink type="http" url="http://googlecode.blogspot.com/2011/03/improving-security-of-google-apis-with.html">Improving the security of Google + * APIs with SSL</ulink>. + * + * Return value: the scheme to use (<code class="literal">https</code>) + * + * Since: 0.6.0 + */ +const gchar * +_gdata_service_get_scheme (void) +{ + return "https"; +} + +/* + * _gdata_service_build_uri: + * @format: a standard printf() format string + * @...: the arguments to insert in the output + * + * Builds a URI from the given @format string, replacing each <code class="literal">%%s</code> format placeholder with a URI-escaped version of the + * corresponding argument, and each <code class="literal">%%p</code> format placeholder with a non-escaped version of the corresponding argument. No + * other printf() format placeholders are supported at the moment except <code class="literal">%%d</code>, which prints a signed integer; and + * <code class="literal">%%</code>, which prints a literal percent symbol. + * + * The returned URI is guaranteed to use the scheme returned by _gdata_service_get_scheme(). The format string, once all the arguments have been + * inserted into it, must include a scheme, but it doesn't matter which one. + * + * Return value: a newly allocated URI string; free with g_free() + */ +gchar * +_gdata_service_build_uri (const gchar *format, ...) +{ + const gchar *p; + gchar *fixed_uri; + GString *uri; + va_list args; + + g_return_val_if_fail (format != NULL, NULL); + + /* Allocate a GString to build the URI in with at least as much space as the format string */ + uri = g_string_sized_new (strlen (format)); + + /* Build the URI */ + va_start (args, format); + + for (p = format; *p != '\0'; p++) { + if (*p != '%') { + g_string_append_c (uri, *p); + continue; + } + + switch(*++p) { + case 's': + g_string_append_uri_escaped (uri, va_arg (args, gchar*), NULL, TRUE); + break; + case 'p': + g_string_append (uri, va_arg (args, gchar*)); + break; + case 'd': + g_string_append_printf (uri, "%d", va_arg (args, gint)); + break; + case '%': + g_string_append_c (uri, '%'); + break; + default: + g_error ("Unrecognized format placeholder '%%%c' in format '%s'. This is a programmer error.", *p, format); + break; + } + } + + va_end (args); + + /* Fix the scheme to always be HTTPS */ + fixed_uri = _gdata_service_fix_uri_scheme (uri->str); + g_string_free (uri, TRUE); + + return fixed_uri; +} + +/** + * _gdata_service_fix_uri_scheme: + * @uri: an URI with either HTTP or HTTPS as the scheme + * + * Fixes the given URI to always have HTTPS as its scheme. + * + * Return value: (transfer full): the URI with HTTPS as its scheme + * + * Since: 0.9.0 + */ +gchar * +_gdata_service_fix_uri_scheme (const gchar *uri) +{ + g_return_val_if_fail (uri != NULL && *uri != '\0', NULL); + + /* Ensure we're using the correct scheme (HTTP or HTTPS) */ + if (g_str_has_prefix (uri, "https") == FALSE) { + gchar *fixed_uri, **pieces; + + pieces = g_strsplit (uri, ":", 2); + g_assert (pieces[0] != NULL && pieces[1] != NULL && pieces[2] == NULL); + + fixed_uri = g_strconcat ("https:", pieces[1], NULL); + + g_strfreev (pieces); + + return fixed_uri; + } + + return g_strdup (uri); +} + +/** + * _gdata_service_get_https_port: + * + * Gets the destination TCP/IP port number which libgdata should use for all outbound HTTPS traffic. + * This defaults to 443, but may be overridden using the <code class="literal">LIBGDATA_HTTPS_PORT</code> + * environment variable. This is intended to allow network traffic to be redirected to a local server for + * unit testing, with a listening port above 1024 so the tests don't need root privileges. + * + * The value returned by this function may change at any time (e.g. between unit tests), so callers must not cache the result. + * + * Return value: port number to use for HTTPS traffic + */ +guint +_gdata_service_get_https_port (void) +{ + const gchar *port_string; + + /* Allow changing the HTTPS port just for testing. */ + port_string = g_getenv ("LIBGDATA_HTTPS_PORT"); + if (port_string != NULL) { + const gchar *end; + + guint64 port = g_ascii_strtoull (port_string, (gchar **) &end, 10); + + if (port != 0 && *end == '\0') { + g_debug ("Overriding message port to %" G_GUINT64_FORMAT ".", port); + return port; + } + } + + /* Return the default. */ + return 443; +} + +/* + * debug_handler: + * + * GLib debug message handler, which is passed all messages from g_debug() calls, and decides whether to print them. + */ +static void +debug_handler (const char *log_domain, GLogLevelFlags log_level, const char *message, gpointer user_data) +{ + if (_gdata_service_get_log_level () != GDATA_LOG_NONE) + g_log_default_handler (log_domain, log_level, message, NULL); +} + +/* + * soup_log_printer: + * + * Log printer for the libsoup logging functionality, which just marshals all soup log output to the standard GLib logging framework + * (and thus to debug_handler(), above). + */ +static void +soup_log_printer (SoupLogger *logger, SoupLoggerLogLevel level, char direction, const char *data, gpointer user_data) +{ + gboolean filter_data; + gchar *_data = NULL; + + filter_data = (_gdata_service_get_log_level () > GDATA_LOG_NONE && _gdata_service_get_log_level () < GDATA_LOG_FULL_UNREDACTED) ? TRUE : FALSE; + + if (filter_data == TRUE) { + /* Filter out lines which look like they might contain usernames, passwords or auth. tokens. */ + if (direction == '>' && g_str_has_prefix (data, "Authorization: GoogleLogin ") == TRUE) { + _data = g_strdup ("Authorization: GoogleLogin <redacted>"); + } else if (direction == '>' && g_str_has_prefix (data, "Authorization: OAuth ") == TRUE) { + _data = g_strdup ("Authorization: OAuth <redacted>"); + } else if (direction == '<' && g_str_has_prefix (data, "Set-Cookie: ") == TRUE) { + _data = g_strdup ("Set-Cookie: <redacted>"); + } else if (direction == '<' && g_str_has_prefix (data, "Location: ") == TRUE) { + /* Looks like: + * "Location: https://www.google.com/calendar/feeds/default/owncalendars/full?gsessionid=sBjmp05m5i67exYA51XjDA". */ + SoupURI *uri; + gchar *_uri; + GHashTable *params; + + uri = soup_uri_new (data + strlen ("Location: ")); + + if (uri->query != NULL) { + params = soup_form_decode (uri->query); + + /* strdup()s are necessary because the hash table's set up to free keys. */ + if (g_hash_table_lookup (params, "gsessionid") != NULL) { + g_hash_table_insert (params, (gpointer) g_strdup ("gsessionid"), (gpointer) "<redacted>"); + } + + soup_uri_set_query_from_form (uri, params); + g_hash_table_destroy (params); + } + + _uri = soup_uri_to_string (uri, FALSE); + _data = g_strconcat ("Location: ", _uri, NULL); + g_free (_uri); + + soup_uri_free (uri); + } else if (direction == '<' && g_str_has_prefix (data, "SID=") == TRUE) { + _data = g_strdup ("SID=<redacted>"); + } else if (direction == '<' && g_str_has_prefix (data, "LSID=") == TRUE) { + _data = g_strdup ("LSID=<redacted>"); + } else if (direction == '<' && g_str_has_prefix (data, "Auth=") == TRUE) { + _data = g_strdup ("Auth=<redacted>"); + } else if (direction == '>' && g_str_has_prefix (data, "accountType=") == TRUE) { + /* Looks like: "> accountType=HOSTED%5FOR%5FGOOGLE&Email=[e-mail address]&Passwd=[plaintex password]" + "&service=[service name]&source=ytapi%2DGNOME%2Dlibgdata%2D444fubtt%2D0". */ + GHashTable *params = soup_form_decode (data); + + /* strdup()s are necessary because the hash table's set up to free keys. */ + if (g_hash_table_lookup (params, "Email") != NULL) { + g_hash_table_insert (params, (gpointer) g_strdup ("Email"), (gpointer) "<redacted>"); + } + if (g_hash_table_lookup (params, "Passwd") != NULL) { + g_hash_table_insert (params, (gpointer) g_strdup ("Passwd"), (gpointer) "<redacted>"); + } + + _data = soup_form_encode_hash (params); + + g_hash_table_destroy (params); + } else if (direction == '<' && g_str_has_prefix (data, "oauth_token=") == TRUE) { + /* Looks like: "< oauth_token=4%2FI-WU7sBzKk5GhGlQUF8a_TCZRnb7&oauth_token_secret=qTTTJg3no25auiiWFerzjW4I" + "&oauth_callback_confirmed=true". */ + GHashTable *params = soup_form_decode (data); + + /* strdup()s are necessary because the hash table's set up to free keys. */ + if (g_hash_table_lookup (params, "oauth_token") != NULL) { + g_hash_table_insert (params, (gpointer) g_strdup ("oauth_token"), (gpointer) "<redacted>"); + } + if (g_hash_table_lookup (params, "oauth_token_secret") != NULL) { + g_hash_table_insert (params, (gpointer) g_strdup ("oauth_token_secret"), (gpointer) "<redacted>"); + } + + _data = soup_form_encode_hash (params); + + g_hash_table_destroy (params); + } else if (direction == '>' && g_str_has_prefix (data, "X-GData-Key: key=") == TRUE) { + /* Looks like: "> X-GData-Key: key=[dev key in hex]". */ + _data = g_strdup ("X-GData-Key: key=<redacted>"); + } else { + /* Nothing to redact. */ + _data = g_strdup (data); + } + } else { + /* Don't dupe the string. */ + _data = (gchar*) data; + } + + /* Log the data. */ + g_debug ("%c %s", direction, _data); + + if (filter_data == TRUE) { + g_free (_data); + } +} + +/** + * _gdata_service_get_log_level: + * + * Returns the logging level for the library, currently set by an environment variable. + * + * Return value: the log level + * + * Since: 0.7.0 + */ +GDataLogLevel +_gdata_service_get_log_level (void) +{ + static int level = -1; + + if (level < 0) { + const gchar *envvar = g_getenv ("LIBGDATA_DEBUG"); + if (envvar != NULL) + level = atoi (envvar); + level = MIN (MAX (level, 0), GDATA_LOG_FULL_UNREDACTED); + } + + return level; +} + +/* Build a User-Agent value to send to the server. + * + * If we support gzip, we can request gzip from the server by both including + * the appropriate Accept-Encoding header and putting 'gzip' in the User-Agent + * header: + * - https://developers.google.com/drive/web/performance#gzip + * - http://googleappsdeveloper.blogspot.co.uk/2011/12/optimizing-bandwidth-usage-with-gzip.html + */ +static gchar * +build_user_agent (gboolean supports_gzip) +{ + if (supports_gzip) { + return g_strdup_printf ("libgdata/%s - gzip", VERSION); + } else { + return g_strdup_printf ("libgdata/%s", VERSION); + } +} + +/** + * _gdata_service_build_session: + * + * Build a new #SoupSession, enabling GNOME features if support has been compiled for them, and adding a log printer which is hooked into + * libgdata's logging functionality. + * + * Return value: a new #SoupSession; unref with g_object_unref() + * + * Since: 0.9.0 + */ +SoupSession * +_gdata_service_build_session (void) +{ + SoupSession *session; + gboolean ssl_strict = TRUE; + gchar *user_agent; + + /* Iff LIBGDATA_LAX_SSL_CERTIFICATES=1, relax SSL certificate validation to allow using invalid/unsigned certificates for testing. */ + if (g_strcmp0 (g_getenv ("LIBGDATA_LAX_SSL_CERTIFICATES"), "1") == 0) { + ssl_strict = FALSE; + } + + session = soup_session_new_with_options ("ssl-strict", ssl_strict, + "timeout", 0, + NULL); + + user_agent = build_user_agent (soup_session_has_feature (session, SOUP_TYPE_CONTENT_DECODER)); + g_object_set (session, "user-agent", user_agent, NULL); + g_free (user_agent); + + soup_session_add_feature_by_type (session, SOUP_TYPE_PROXY_RESOLVER_DEFAULT); + + /* Log all libsoup traffic if debugging's turned on */ + if (_gdata_service_get_log_level () > GDATA_LOG_MESSAGES) { + SoupLoggerLogLevel level; + SoupLogger *logger; + + switch (_gdata_service_get_log_level ()) { + case GDATA_LOG_FULL_UNREDACTED: + case GDATA_LOG_FULL: + level = SOUP_LOGGER_LOG_BODY; + break; + case GDATA_LOG_HEADERS: + level = SOUP_LOGGER_LOG_HEADERS; + break; + case GDATA_LOG_MESSAGES: + case GDATA_LOG_NONE: + default: + g_assert_not_reached (); + } + + logger = soup_logger_new (level, -1); + soup_logger_set_printer (logger, (SoupLoggerPrinter) soup_log_printer, NULL, NULL); + + soup_session_add_feature (session, SOUP_SESSION_FEATURE (logger)); + + g_object_unref (logger); + } + + return session; +} + +/** + * gdata_service_get_locale: + * @self: a #GDataService + * + * Returns the locale currently being used for network requests, or %NULL if the locale is the default. + * + * Return value: the current locale + * + * Since: 0.7.0 + */ +const gchar * +gdata_service_get_locale (GDataService *self) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (self), NULL); + return self->priv->locale; +} + +/** + * gdata_service_set_locale: + * @self: a #GDataService + * @locale: (allow-none): the new locale in Unix locale format, or %NULL for the default locale + * + * Set the locale used for network requests to @locale, given in standard Unix locale format. See #GDataService:locale for more details. + * + * Note that while it's possible to change the locale after sending network requests, it is unsupported, as the server-side software may behave + * unexpectedly. The only supported use of this function is after creation of a service, but before any network requests are made. + * + * Since: 0.7.0 + */ +void +gdata_service_set_locale (GDataService *self, const gchar *locale) +{ + g_return_if_fail (GDATA_IS_SERVICE (self)); + + g_free (self->priv->locale); + self->priv->locale = g_strdup (locale); + g_object_notify (G_OBJECT (self), "locale"); +} + +/* + * _gdata_service_secure_strdup: + * @str: string (which may be in pageable memory) to be duplicated, or %NULL + * + * Duplicate a string into non-pageable memory (if libgdata has been compiled with HAVE_GNOME) or just fall back to g_strdup() (if libgdata hasn't). + * Passing %NULL to this function will cause %NULL to be returned. + * + * Strings allocated using this function must be freed using _gdata_service_secure_strfree(). + * + * Return value: non-pageable copy of @str, or %NULL + * Since: 0.11.0 + */ +GDataSecureString +_gdata_service_secure_strdup (const gchar *str) +{ +#ifdef HAVE_GNOME + return gcr_secure_memory_strdup (str); +#else /* if !HAVE_GNOME */ + return g_strdup (str); +#endif /* !HAVE_GNOME */ +} + +/* + * _gdata_service_secure_strndup: + * @str: string (which may be in pageable memory) to be duplicated, or %NULL + * @n_bytes: maximum number of bytes to copy from @str + * + * Duplicate at most @n_bytes bytes from @str into non-pageable memory. See _gdata_service_secure_strdup() for more information; this function is just + * a version of that with the same semantics as strndup(). + * + * Return value: non-pageable copy of at most the first @n_bytes bytes of @str, or %NULL + * Since: 0.11.0 + */ +GDataSecureString +_gdata_service_secure_strndup (const gchar *str, gsize n_bytes) +{ +#ifdef HAVE_GNOME + gsize str_len; + GDataSecureString duped_str; + + if (str == NULL) { + return NULL; + } + + str_len = MIN (strlen (str), n_bytes); + duped_str = (GDataSecureString) gcr_secure_memory_alloc (str_len + 1); + strncpy (duped_str, str, str_len); + *(duped_str + str_len) = '\0'; + + return duped_str; +#else /* if !HAVE_GNOME */ + return g_strndup (str, n_bytes); +#endif /* !HAVE_GNOME */ +} + +/* + * _gdata_service_secure_strfree: + * @str: a string to free, or %NULL + * + * Free a string which was allocated securely using _gdata_service_secure_strdup(). + * Passing %NULL to this function is safe. + * + * Since: 0.11.0 + */ +void +_gdata_service_secure_strfree (GDataSecureString str) +{ +#ifdef HAVE_GNOME + gcr_secure_memory_free (str); +#else /* if !HAVE_GNOME */ + /* Poor man's approximation to non-pageable memory: the best we can do is ensure that we don't leak it in free memory. + * This can't guarantee that it hasn't hit disk at some point, but does mean it can't hit disk in future. */ + if (str != NULL) { + memset (str, 0, strlen (str)); + } + + g_free (str); +#endif /* !HAVE_GNOME */ +} diff --git a/gdata/gdata-service.h b/gdata/gdata-service.h new file mode 100644 index 0000000..d0c656f --- /dev/null +++ b/gdata/gdata-service.h @@ -0,0 +1,247 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008, 2009, 2010, 2014 <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef GDATA_SERVICE_H +#define GDATA_SERVICE_H + +#include <glib.h> +#include <glib-object.h> +#include <libsoup/soup.h> + +#include <gdata/gdata-authorizer.h> +#include <gdata/gdata-feed.h> +#include <gdata/gdata-query.h> + +G_BEGIN_DECLS + +/** + * GDataOperationType: + * @GDATA_OPERATION_QUERY: a query + * @GDATA_OPERATION_INSERTION: an insertion of a #GDataEntry + * @GDATA_OPERATION_UPDATE: an update of a #GDataEntry + * @GDATA_OPERATION_DELETION: a deletion of a #GDataEntry + * @GDATA_OPERATION_DOWNLOAD: a download of a file + * @GDATA_OPERATION_UPLOAD: an upload of a file + * @GDATA_OPERATION_AUTHENTICATION: authentication with the service + * @GDATA_OPERATION_BATCH: a batch operation with #GDataBatchOperation + * + * Representations of the different operations performed by the library. + * + * Since: 0.6.0 + */ +typedef enum { + GDATA_OPERATION_QUERY = 1, + GDATA_OPERATION_INSERTION, + GDATA_OPERATION_UPDATE, + GDATA_OPERATION_DELETION, + GDATA_OPERATION_DOWNLOAD, + GDATA_OPERATION_UPLOAD, + GDATA_OPERATION_AUTHENTICATION, + GDATA_OPERATION_BATCH +} GDataOperationType; + +/** + * GDataServiceError: + * @GDATA_SERVICE_ERROR_UNAVAILABLE: The service is unavailable due to maintainence or other reasons (e.g. network errors at the server end) + * @GDATA_SERVICE_ERROR_PROTOCOL_ERROR: The client or server unexpectedly strayed from the protocol (fatal error) + * @GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED: An entry has already been inserted, and cannot be re-inserted + * @GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED: The user attempted to do something which required authentication, and they weren't authenticated or + * didn't have authorization for the operation + * @GDATA_SERVICE_ERROR_NOT_FOUND: A requested resource (feed or entry) was not found on the server + * @GDATA_SERVICE_ERROR_CONFLICT: There was a conflict when updating an entry on the server; the server-side copy was modified inbetween downloading + * and uploading the modified entry + * @GDATA_SERVICE_ERROR_FORBIDDEN: Generic error for a forbidden action (not due to having insufficient permissions) + * @GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER: A given query parameter was invalid for the query type + * @GDATA_SERVICE_ERROR_NETWORK_ERROR: The service is unavailable due to local network errors (e.g. no Internet connection) + * @GDATA_SERVICE_ERROR_PROXY_ERROR: The service is unavailable due to proxy network errors (e.g. proxy unreachable) + * @GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION: Generic error when running a batch operation and the whole operation fails + * @GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED: The API request quota for this + * developer account has been exceeded for the current time period (e.g. day). + * Try again later. (Since: 0.16.0.) + * + * Error codes for #GDataService operations. + */ +typedef enum { + GDATA_SERVICE_ERROR_UNAVAILABLE = 1, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED, + GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + GDATA_SERVICE_ERROR_NOT_FOUND, + GDATA_SERVICE_ERROR_CONFLICT, + GDATA_SERVICE_ERROR_FORBIDDEN, + GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER, + GDATA_SERVICE_ERROR_NETWORK_ERROR, + GDATA_SERVICE_ERROR_PROXY_ERROR, + GDATA_SERVICE_ERROR_WITH_BATCH_OPERATION, + GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED, +} GDataServiceError; + +/** + * GDataQueryProgressCallback: + * @entry: a new #GDataEntry + * @entry_key: the key of the entry (zero-based index of its position in the feed) + * @entry_count: the total number of entries in the feed + * @user_data: user data passed to the callback + * + * Callback function called for each #GDataEntry parsed in a #GDataFeed when loading the results of a query. + * + * It is called in the main thread, so there is no guarantee on the order in which the callbacks are executed, + * or whether they will be called in a timely manner. It is, however, guaranteed that they will all be called before + * the #GAsyncReadyCallback which signals the completion of the query is called. + */ +typedef void (*GDataQueryProgressCallback) (GDataEntry *entry, guint entry_key, guint entry_count, gpointer user_data); + +#define GDATA_TYPE_SERVICE (gdata_service_get_type ()) +#define GDATA_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_SERVICE, GDataService)) +#define GDATA_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_SERVICE, GDataServiceClass)) +#define GDATA_IS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_SERVICE)) +#define GDATA_IS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_SERVICE)) +#define GDATA_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_SERVICE, GDataServiceClass)) + +#define GDATA_SERVICE_ERROR gdata_service_error_quark () + +typedef struct _GDataServicePrivate GDataServicePrivate; + +/** + * GDataService: + * + * All the fields in the #GDataService structure are private and should never be accessed directly. + */ +typedef struct { + GObject parent; + GDataServicePrivate *priv; +} GDataService; + +/** + * GDataServiceClass: + * @parent: the parent class + * @api_version: the version of the GData API used by the service (typically <code class="literal">2</code>) + * @feed_type: the #GType of the feed class (subclass of #GDataFeed) to use for query results from this service + * @append_query_headers: a function to allow subclasses to append their own headers to queries before they are submitted to the online service, + * using the given authorization domain; new in version 0.9.0 + * @parse_error_response: a function to parse error responses to queries from the online service. It should set the error + * from the status, reason phrase and response body it is passed. + * @get_authorization_domains: a function to return a newly-allocated list of all the #GDataAuthorizationDomain<!-- -->s the service makes use of; + * while the list should be newly-allocated, the individual domains should not be; not implementing this function is equivalent to returning an + * empty list; new in version 0.9.0 + * @parse_feed: a function to parse feed responses to queries from the online + * service; new in version 0.17.0 + * + * The class structure for the #GDataService type. + * + * Since: 0.9.0 + */ +typedef struct { + GObjectClass parent; + + const gchar *api_version; + GType feed_type; + + void (*append_query_headers) (GDataService *self, GDataAuthorizationDomain *domain, SoupMessage *message); + void (*parse_error_response) (GDataService *self, GDataOperationType operation_type, guint status, const gchar *reason_phrase, + const gchar *response_body, gint length, GError **error); + GList *(*get_authorization_domains) (void); + GDataFeed *(*parse_feed) (GDataService *self, + GDataAuthorizationDomain *domain, + GDataQuery *query, + GType entry_type, + SoupMessage *message, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, + GError **error); + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); + void (*_g_reserved6) (void); + void (*_g_reserved7) (void); +} GDataServiceClass; + +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataService, g_object_unref) + +GType gdata_service_get_type (void) G_GNUC_CONST; +GQuark gdata_service_error_quark (void) G_GNUC_CONST; + +GList *gdata_service_get_authorization_domains (GType service_type) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +gboolean gdata_service_is_authorized (GDataService *self); + +GDataAuthorizer *gdata_service_get_authorizer (GDataService *self) G_GNUC_PURE; +void gdata_service_set_authorizer (GDataService *self, GDataAuthorizer *authorizer); + +#include <gdata/gdata-query.h> + +GDataFeed *gdata_service_query (GDataService *self, GDataAuthorizationDomain *domain, const gchar *feed_uri, GDataQuery *query, GType entry_type, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_service_query_async (GDataService *self, GDataAuthorizationDomain *domain, const gchar *feed_uri, GDataQuery *query, GType entry_type, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); +GDataFeed *gdata_service_query_finish (GDataService *self, GAsyncResult *async_result, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataEntry *gdata_service_query_single_entry (GDataService *self, GDataAuthorizationDomain *domain, const gchar *entry_id, GDataQuery *query, + GType entry_type, GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_service_query_single_entry_async (GDataService *self, GDataAuthorizationDomain *domain, const gchar *entry_id, GDataQuery *query, + GType entry_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +GDataEntry *gdata_service_query_single_entry_finish (GDataService *self, GAsyncResult *async_result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataEntry *gdata_service_insert_entry (GDataService *self, GDataAuthorizationDomain *domain, const gchar *upload_uri, GDataEntry *entry, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_service_insert_entry_async (GDataService *self, GDataAuthorizationDomain *domain, const gchar *upload_uri, GDataEntry *entry, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +GDataEntry *gdata_service_insert_entry_finish (GDataService *self, GAsyncResult *async_result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataEntry *gdata_service_update_entry (GDataService *self, GDataAuthorizationDomain *domain, GDataEntry *entry, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_service_update_entry_async (GDataService *self, GDataAuthorizationDomain *domain, GDataEntry *entry, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +GDataEntry *gdata_service_update_entry_finish (GDataService *self, GAsyncResult *async_result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gboolean gdata_service_delete_entry (GDataService *self, GDataAuthorizationDomain *domain, GDataEntry *entry, + GCancellable *cancellable, GError **error); +void gdata_service_delete_entry_async (GDataService *self, GDataAuthorizationDomain *domain, GDataEntry *entry, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +gboolean gdata_service_delete_entry_finish (GDataService *self, GAsyncResult *async_result, GError **error); + +#ifndef LIBGDATA_DISABLE_DEPRECATED +SoupURI *gdata_service_get_proxy_uri (GDataService *self) G_GNUC_PURE G_GNUC_DEPRECATED_FOR (gdata_service_get_proxy_resolver); +void gdata_service_set_proxy_uri (GDataService *self, SoupURI *proxy_uri) G_GNUC_DEPRECATED_FOR (gdata_service_set_proxy_resolver); +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +GProxyResolver *gdata_service_get_proxy_resolver (GDataService *self) G_GNUC_PURE; +void gdata_service_set_proxy_resolver (GDataService *self, GProxyResolver *proxy_resolver); + +guint gdata_service_get_timeout (GDataService *self) G_GNUC_PURE; +void gdata_service_set_timeout (GDataService *self, guint timeout); + +const gchar *gdata_service_get_locale (GDataService *self) G_GNUC_PURE; +void gdata_service_set_locale (GDataService *self, const gchar *locale); + +G_END_DECLS + +#endif /* !GDATA_SERVICE_H */ diff --git a/gdata/gdata-types.c b/gdata/gdata-types.c new file mode 100644 index 0000000..fd36705 --- /dev/null +++ b/gdata/gdata-types.c @@ -0,0 +1,134 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008-2009 <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +/** + * SECTION:gdata-types + * @short_description: miscellaneous data types + * @stability: Stable + * @include: gdata/gdata-types.h + * + * The structures here are used haphazardly across the library, describing + * various small data types. + */ + +#include <glib.h> +#include <glib-object.h> +#include <string.h> +#include <stdlib.h> +#include <libsoup/soup.h> + +#include "gdata-types.h" + +static gpointer +gdata_color_copy (gpointer color) +{ + return g_memdup (color, sizeof (GDataColor)); +} + +GType +gdata_color_get_type (void) +{ + static GType type_id = 0; + + if (type_id == 0) { + type_id = g_boxed_type_register_static (g_intern_static_string ("GDataColor"), + (GBoxedCopyFunc) gdata_color_copy, + (GBoxedFreeFunc) g_free); + } + + return type_id; +} + +/** + * gdata_color_from_hexadecimal: + * @hexadecimal: a hexadecimal color string + * @color: (out caller-allocates): a #GDataColor + * + * Parses @hexadecimal and returns a #GDataColor describing it in @color. + * + * @hexadecimal should be in the form <literal>#<replaceable>rr</replaceable><replaceable>gg</replaceable><replaceable>bb</replaceable></literal>, + * where <replaceable>rr</replaceable> is a two-digit hexadecimal red intensity value, <replaceable>gg</replaceable> is green + * and <replaceable>bb</replaceable> is blue. The hash is optional. + * + * Return value: %TRUE on success, %FALSE otherwise + */ +gboolean +gdata_color_from_hexadecimal (const gchar *hexadecimal, GDataColor *color) +{ + gint temp; + + g_return_val_if_fail (hexadecimal != NULL, FALSE); + g_return_val_if_fail (color != NULL, FALSE); + + if (*hexadecimal == '#') + hexadecimal++; + if (strlen (hexadecimal) != 6) + return FALSE; + + /* Red */ + temp = g_ascii_xdigit_value (*(hexadecimal++)) * 16; + if (temp < 0) + return FALSE; + color->red = temp; + temp = g_ascii_xdigit_value (*(hexadecimal++)); + if (temp < 0) + return FALSE; + color->red += temp; + + /* Green */ + temp = g_ascii_xdigit_value (*(hexadecimal++)) * 16; + if (temp < 0) + return FALSE; + color->green = temp; + temp = g_ascii_xdigit_value (*(hexadecimal++)); + if (temp < 0) + return FALSE; + color->green += temp; + + /* Blue */ + temp = g_ascii_xdigit_value (*(hexadecimal++)) * 16; + if (temp < 0) + return FALSE; + color->blue = temp; + temp = g_ascii_xdigit_value (*(hexadecimal++)); + if (temp < 0) + return FALSE; + color->blue += temp; + + return TRUE; +} + +/** + * gdata_color_to_hexadecimal: + * @color: a #GDataColor + * + * Returns a string describing @color in hexadecimal form; in the form <literal>#<replaceable>rr</replaceable><replaceable>gg</replaceable> + * <replaceable>bb</replaceable></literal>, where <replaceable>rr</replaceable> is a two-digit hexadecimal red intensity value, + * <replaceable>gg</replaceable> is green and <replaceable>bb</replaceable> is blue. The hash is always present. + * + * Return value: the color string; free with g_free() + * + * Since: 0.3.0 + */ +gchar * +gdata_color_to_hexadecimal (const GDataColor *color) +{ + g_return_val_if_fail (color != NULL, NULL); + return g_strdup_printf ("#%02x%02x%02x", color->red, color->green, color->blue); +} diff --git a/gdata/gdata-types.h b/gdata/gdata-types.h new file mode 100644 index 0000000..8b7e68c --- /dev/null +++ b/gdata/gdata-types.h @@ -0,0 +1,50 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008-2009 <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <glib.h> + +#ifndef GDATA_TYPES_H +#define GDATA_TYPES_H + +G_BEGIN_DECLS + +/** + * GDataColor: + * @red: red color intensity, from 0–255 + * @green: green color intensity, from 0–255 + * @blue: blue color intensity, from 0–255 + * + * Describes a color, such as used in the Google Calendar interface to + * differentiate calendars. + */ +typedef struct { + /*< public >*/ + guint16 red; + guint16 green; + guint16 blue; +} GDataColor; + +#define GDATA_TYPE_COLOR (gdata_color_get_type ()) +GType gdata_color_get_type (void) G_GNUC_CONST; +gboolean gdata_color_from_hexadecimal (const gchar *hexadecimal, GDataColor *color); +gchar *gdata_color_to_hexadecimal (const GDataColor *color) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_TYPES_H */ diff --git a/gdata/gdata-upload-stream.c b/gdata/gdata-upload-stream.c new file mode 100644 index 0000000..85807fe --- /dev/null +++ b/gdata/gdata-upload-stream.c @@ -0,0 +1,1646 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 <philip@tecnocode.co.uk> + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. + */ + +/** + * SECTION:gdata-upload-stream + * @short_description: GData upload stream object + * @stability: Stable + * @include: gdata/gdata-upload-stream.h + * + * #GDataUploadStream is a #GOutputStream subclass to allow uploading of files from GData services with authorization from a #GDataService under + * the given #GDataAuthorizationDomain. If authorization is not required to perform the upload, a #GDataAuthorizationDomain doesn't have to be + * specified. + * + * Once a #GDataUploadStream is instantiated with gdata_upload_stream_new(), the standard #GOutputStream API can be used on the stream to upload + * the file. Network communication may not actually begin until the first call to g_output_stream_write(), so having a #GDataUploadStream around is no + * guarantee that data is being uploaded. + * + * Uploads of a file, or a file with associated metadata (a #GDataEntry) should use #GDataUploadStream, but if you want to simply upload a single + * #GDataEntry, use gdata_service_insert_entry() instead. #GDataUploadStream is for large streaming uploads. + * + * Once an upload is complete, the server's response can be retrieved from the #GDataUploadStream using gdata_upload_stream_get_response(). In order + * for network communication to be guaranteed to have stopped (and thus the response definitely available), g_output_stream_close() must be called + * on the #GDataUploadStream first. Otherwise, gdata_upload_stream_get_response() may return saying that the operation is still in progress. + * + * If the server returns an error instead of a success response, the error will be returned by g_output_stream_close() as a #GDataServiceError. + * + * The entire upload operation can be cancelled using the #GCancellable instance provided to gdata_upload_stream_new(), or returned by + * gdata_upload_stream_get_cancellable(). Cancelling this at any time will cause all future #GOutputStream method calls to return + * %G_IO_ERROR_CANCELLED. If any #GOutputStream methods are in the process of being called, they will be cancelled and return %G_IO_ERROR_CANCELLED as + * soon as possible. + * + * Note that cancelling an individual method call (such as a call to g_output_stream_write()) using the #GCancellable parameter of the method will not + * cancel the upload as a whole — just that particular method call. In the case of g_output_stream_write(), this will cause it to return the number of + * bytes it has successfully written up to the point of cancellation (up to the requested number of bytes), or return a %G_IO_ERROR_CANCELLED if it + * had not managed to write any bytes to the network by that point. This is also the behaviour of g_output_stream_write() when the upload operation as + * a whole is cancelled. + * + * In the case of g_output_stream_close(), the call will return immediately if network activity hasn't yet started. If it has, the network activity + * will be cancelled, regardless of whether the call to g_output_stream_close() is cancelled. Cancelling a pending call to g_output_stream_close() + * (either using the method's #GCancellable, or by cancelling the upload stream as a whole) will cause it to stop waiting for the network activity to + * finish, and return %G_IO_ERROR_CANCELLED immediately. Network activity will continue to be shut down in the background. + * + * Any outstanding data is guaranteed to be written to the network successfully even if a call to g_output_stream_close() is cancelled. However, if + * the upload stream as a whole is cancelled using #GDataUploadStream:cancellable, no more data will be sent over the network, and the network + * connection will be closed immediately. i.e. #GDataUploadStream will do its best to instruct the server to cancel the upload and any associated + * server-side changes of state. + * + * If the server returns an error message (for example, if the user is not correctly authenticated/authorized or doesn't have suitable permissions + * to upload from the given URI), it will be returned as a #GDataServiceError by g_output_stream_close(). + * + * <example> + * <title>Uploading from a File + * + * GDataService *service; + * GDataAuthorizationDomain *domain; + * GCancellable *cancellable; + * GInputStream *input_stream; + * GOutputStream *upload_stream; + * GFile *file; + * GFileInfo *file_info; + * GError *error = NULL; + * + * /* Get the file to upload */ + * file = get_file_to_upload (); + * file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," + * G_FILE_ATTRIBUTE_STANDARD_SIZE, + * G_FILE_QUERY_INFO_NONE, NULL, &error); + * + * if (file_info == NULL) { + * g_error ("Error getting file info: %s", error->message); + * g_error_free (error); + * g_object_unref (file); + * return; + * } + * + * input_stream = g_file_read (file, NULL, &error); + * g_object_unref (file); + * + * if (input_stream == NULL) { + * g_error ("Error getting file input stream: %s", error->message); + * g_error_free (error); + * g_object_unref (file_info); + * return; + * } + * + * /* Create the upload stream */ + * service = create_my_service (); + * domain = get_my_authorization_domain_from_service (service); + * cancellable = g_cancellable_new (); /* cancel this to cancel the entire upload operation */ + * upload_stream = gdata_upload_stream_new_resumable (service, domain, SOUP_METHOD_POST, upload_uri, NULL, + * g_file_info_get_display_name (file_info), g_file_info_get_content_type (file_info), + * g_file_info_get_size (file_info), cancellable); + * g_object_unref (file_info); + * + * /* Perform the upload asynchronously */ + * g_output_stream_splice_async (upload_stream, input_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, + * G_PRIORITY_DEFAULT, NULL, (GAsyncReadyCallback) upload_splice_cb, NULL); + * + * g_object_unref (upload_stream); + * g_object_unref (input_stream); + * g_object_unref (cancellable); + * g_object_unref (domain); + * g_object_unref (service); + * + * static void + * upload_splice_cb (GOutputStream *upload_stream, GAsyncResult *result, gpointer user_data) + * { + * gssize length; + * GError *error = NULL; + * + * g_output_stream_splice_finish (upload_stream, result, &error); + * + * if (error != NULL && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) == FALSE)) { + * /* Error upload the file; potentially an I/O error (GIOError), or an error response from the server + * * (GDataServiceError). */ + * g_error ("Error uploading file: %s", error->message); + * g_error_free (error); + * } + * + * /* If the upload was successful, carry on to parse the result. Note that this will normally be handled by methods like + * * gdata_youtube_service_finish_video_upload(), gdata_picasaweb_service_finish_file_upload() and + * * gdata_documents_service_finish_upload() */ + * parse_server_result (gdata_upload_stream_get_response (GDATA_UPLOAD_STREAM (upload_stream), &length), length); + * } + * + * + * + * Since: 0.5.0 + */ + +/* + * We have a network thread which does all the uploading work. We send the message encoded as chunks, but cannot use the SoupMessageBody as a + * data buffer, since it can only ever be touched by the network thread. Instead, we pass data to the network thread through a GDataBuffer, with + * the main thread pushing it on as and when write() is called. The network thread cannot block on popping data off the buffer, as it requests fixed- + * size chunks, and there's no way to notify it that we've reached EOF; so when it gets to popping the last chunk off the buffer, which may well be + * smaller than its chunk size, it would block for more data and therefore hang. Consequently, the network thread instead pops as much data as it can + * off the buffer, up to its chunk size, which is a non-blocking operation. + * + * The write() and close() operations on the output stream are synchronised with the network thread, so that the write() call only returns once the + * network thread has written at least as many bytes as were passed to the write() call, and the close() call only returns once all network activity + * has finished (including receiving the response from the server). Async versions of these calls are provided by GOutputStream. + * + * The number of bytes in the various buffers are recorded using: + * • message_bytes_outstanding: the number of bytes in the GDataBuffer which are waiting to be written to the SoupMessageBody + * • network_bytes_outstanding: the number of bytes which have been written to the SoupMessageBody, and are waiting to be written to the network + * • network_bytes_written: the total number of bytes which have been successfully written to the network + * + * Mutex locking order: + * 1. response_mutex + * 2. write_mutex + */ + +#include +#include +#include +#include + +#include "gdata-upload-stream.h" +#include "gdata-buffer.h" +#include "gdata-private.h" + +#define BOUNDARY_STRING "0003Z5W789deadbeefRTE456KlemsnoZV" +#define MAX_RESUMABLE_CHUNK_SIZE (512 * 1024) /* bytes = 512 KiB */ + +static void gdata_upload_stream_constructed (GObject *object); +static void gdata_upload_stream_dispose (GObject *object); +static void gdata_upload_stream_finalize (GObject *object); +static void gdata_upload_stream_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_upload_stream_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); + +static gssize gdata_upload_stream_write (GOutputStream *stream, const void *buffer, gsize count, GCancellable *cancellable, GError **error); +static gboolean gdata_upload_stream_flush (GOutputStream *stream, GCancellable *cancellable, GError **error); +static gboolean gdata_upload_stream_close (GOutputStream *stream, GCancellable *cancellable, GError **error); + +static void create_network_thread (GDataUploadStream *self, GError **error); + +typedef enum { + STATE_INITIAL_REQUEST, /* initial POST request to the resumable-create-media link (unused for non-resumable uploads) */ + STATE_DATA_REQUESTS, /* one or more subsequent PUT requests (only state used for non-resumable uploads) */ + STATE_FINISHED, /* finished successfully or in error */ +} UploadState; + +struct _GDataUploadStreamPrivate { + gchar *method; + gchar *upload_uri; + GDataService *service; + GDataAuthorizationDomain *authorization_domain; + GDataEntry *entry; + gchar *slug; + gchar *content_type; + goffset content_length; /* -1 for non-resumable uploads; 0 or greater for resumable ones */ + SoupSession *session; + SoupMessage *message; + GDataBuffer *buffer; + + GCancellable *cancellable; + GThread *network_thread; + + UploadState state; /* protected by write_mutex */ + GMutex write_mutex; /* mutex for write operations (specifically, write_finished) */ + /* This persists across all resumable upload chunks. Note that it doesn't count bytes from the entry XML. */ + gsize total_network_bytes_written; /* the number of bytes which have been written to the network in STATE_DATA_REQUESTS */ + + /* All of the following apply only to the current resumable upload chunk. */ + gsize message_bytes_outstanding; /* the number of bytes which have been written to the buffer but not libsoup (signalled by write_cond) */ + gsize network_bytes_outstanding; /* the number of bytes which have been written to libsoup but not the network (signalled by write_cond) */ + gsize network_bytes_written; /* the number of bytes which have been written to the network (signalled by write_cond) */ + gsize chunk_size; /* the size of the current chunk (in bytes); 0 iff content_length <= 0; must be <= MAX_RESUMABLE_CHUNK_SIZE */ + GCond write_cond; /* signalled when a chunk has been written (protected by write_mutex) */ + + GCond finished_cond; /* signalled when sending the message (and receiving the response) is finished (protected by response_mutex) */ + guint response_status; /* set once we finish receiving the response (SOUP_STATUS_NONE otherwise) (protected by response_mutex) */ + GError *response_error; /* error asynchronously set by the network thread, and picked up by the main thread when appropriate */ + GMutex response_mutex; /* mutex for ->response_error, ->response_status and ->finished_cond */ +}; + +enum { + PROP_SERVICE = 1, + PROP_UPLOAD_URI, + PROP_ENTRY, + PROP_SLUG, + PROP_CONTENT_TYPE, + PROP_METHOD, + PROP_CANCELLABLE, + PROP_AUTHORIZATION_DOMAIN, + PROP_CONTENT_LENGTH, +}; + +G_DEFINE_TYPE (GDataUploadStream, gdata_upload_stream, G_TYPE_OUTPUT_STREAM) + +static void +gdata_upload_stream_class_init (GDataUploadStreamClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataUploadStreamPrivate)); + + gobject_class->constructed = gdata_upload_stream_constructed; + gobject_class->dispose = gdata_upload_stream_dispose; + gobject_class->finalize = gdata_upload_stream_finalize; + gobject_class->get_property = gdata_upload_stream_get_property; + gobject_class->set_property = gdata_upload_stream_set_property; + + /* We use the default implementations of the async functions, which just run + * our implementation of the sync function in a thread. */ + stream_class->write_fn = gdata_upload_stream_write; + stream_class->flush = gdata_upload_stream_flush; + stream_class->close_fn = gdata_upload_stream_close; + + /** + * GDataUploadStream:service: + * + * The service which is used to authorize the upload, and to which the upload relates. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_SERVICE, + g_param_spec_object ("service", + "Service", "The service which is used to authorize the upload.", + GDATA_TYPE_SERVICE, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataUploadStream:authorization-domain: + * + * The authorization domain for the upload, against which the #GDataService:authorizer for the #GDataDownloadStream:service should be + * authorized. This may be %NULL if authorization is not needed for the upload. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_AUTHORIZATION_DOMAIN, + g_param_spec_object ("authorization-domain", + "Authorization domain", "The authorization domain for the upload.", + GDATA_TYPE_AUTHORIZATION_DOMAIN, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataUploadStream:method: + * + * The HTTP request method to use when uploading the file. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_METHOD, + g_param_spec_string ("method", + "Method", "The HTTP request method to use when uploading the file.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataUploadStream:upload-uri: + * + * The URI to upload the data and metadata to. This must be HTTPS. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_UPLOAD_URI, + g_param_spec_string ("upload-uri", + "Upload URI", "The URI to upload the data and metadata to.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataUploadStream:entry: + * + * The entry used for metadata to upload. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_ENTRY, + g_param_spec_object ("entry", + "Entry", "The entry used for metadata to upload.", + GDATA_TYPE_ENTRY, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataUploadStream:slug: + * + * The slug of the file being uploaded. This is usually the display name of the file (i.e. as returned by g_file_info_get_display_name()). + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_SLUG, + g_param_spec_string ("slug", + "Slug", "The slug of the file being uploaded.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataUploadStream:content-length: + * + * The content length (in bytes) of the file being uploaded (i.e. as returned by g_file_info_get_size()). Note that this does not include the + * length of the XML serialisation of #GDataUploadStream:entry, if set. + * + * If this is -1 the upload will be non-resumable; if it is non-negative, the upload will be resumable. + * + * Since: 0.13.0 + */ + g_object_class_install_property (gobject_class, PROP_CONTENT_LENGTH, + g_param_spec_int64 ("content-length", + "Content length", "The content length (in bytes) of the file being uploaded.", + -1, G_MAXINT64, -1, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataUploadStream:content-type: + * + * The content type of the file being uploaded (i.e. as returned by g_file_info_get_content_type()). + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_CONTENT_TYPE, + g_param_spec_string ("content-type", + "Content type", "The content type of the file being uploaded.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataUploadStream:cancellable: + * + * An optional cancellable used to cancel the entire upload operation. If a #GCancellable instance isn't provided for this property at + * construction time (i.e. to gdata_upload_stream_new()), one will be created internally and can be retrieved using + * gdata_upload_stream_get_cancellable() and used to cancel the upload operation with g_cancellable_cancel() just as if it was passed to + * gdata_upload_stream_new(). + * + * If the upload operation is cancelled using this #GCancellable, any ongoing network activity will be stopped, and any pending or future calls + * to #GOutputStream API on the #GDataUploadStream will return %G_IO_ERROR_CANCELLED. Note that the #GCancellable objects which can be passed + * to individual #GOutputStream operations will not cancel the upload operation proper if cancelled — they will merely cancel that API call. + * The only way to cancel the upload operation completely is using #GDataUploadStream:cancellable. + * + * Since: 0.8.0 + */ + g_object_class_install_property (gobject_class, PROP_CANCELLABLE, + g_param_spec_object ("cancellable", + "Cancellable", "An optional cancellable used to cancel the entire upload operation.", + G_TYPE_CANCELLABLE, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_upload_stream_init (GDataUploadStream *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_UPLOAD_STREAM, GDataUploadStreamPrivate); + self->priv->buffer = gdata_buffer_new (); + g_mutex_init (&(self->priv->write_mutex)); + g_cond_init (&(self->priv->write_cond)); + g_cond_init (&(self->priv->finished_cond)); + g_mutex_init (&(self->priv->response_mutex)); +} + +static SoupMessage * +build_message (GDataUploadStream *self, const gchar *method, const gchar *upload_uri) +{ + SoupMessage *new_message; + SoupURI *_uri; + + /* Build the message */ + _uri = soup_uri_new (upload_uri); + soup_uri_set_port (_uri, _gdata_service_get_https_port ()); + new_message = soup_message_new_from_uri (method, _uri); + soup_uri_free (_uri); + + /* We don't want to accumulate chunks */ + soup_message_body_set_accumulate (new_message->request_body, FALSE); + + return new_message; +} + +static void +gdata_upload_stream_constructed (GObject *object) +{ + GDataUploadStreamPrivate *priv; + GDataServiceClass *service_klass; + SoupURI *uri = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_upload_stream_parent_class)->constructed (object); + priv = GDATA_UPLOAD_STREAM (object)->priv; + + /* The upload URI must be HTTPS. */ + uri = soup_uri_new (priv->upload_uri); + g_assert_cmpstr (soup_uri_get_scheme (uri), ==, SOUP_URI_SCHEME_HTTPS); + soup_uri_free (uri); + + /* Create a #GCancellable for the entire upload operation if one wasn't specified for #GDataUploadStream:cancellable during construction */ + if (priv->cancellable == NULL) + priv->cancellable = g_cancellable_new (); + + /* Build the message */ + priv->message = build_message (GDATA_UPLOAD_STREAM (object), priv->method, priv->upload_uri); + + if (priv->slug != NULL) + soup_message_headers_append (priv->message->request_headers, "Slug", priv->slug); + + if (priv->content_length == -1) { + /* Non-resumable upload */ + soup_message_headers_set_encoding (priv->message->request_headers, SOUP_ENCODING_CHUNKED); + + /* The Content-Type should be multipart/related if we're also uploading the metadata (entry != NULL), + * and the given content_type otherwise. */ + if (priv->entry != NULL) { + gchar *first_part_header, *upload_data; + gchar *second_part_header; + GDataParsableClass *parsable_klass; + + parsable_klass = GDATA_PARSABLE_GET_CLASS (priv->entry); + g_assert (parsable_klass->get_content_type != NULL); + + soup_message_headers_set_content_type (priv->message->request_headers, "multipart/related; boundary=" BOUNDARY_STRING, NULL); + + if (g_strcmp0 (parsable_klass->get_content_type (), "application/json") == 0) { + upload_data = gdata_parsable_get_json (GDATA_PARSABLE (priv->entry)); + } else { + upload_data = gdata_parsable_get_xml (GDATA_PARSABLE (priv->entry)); + } + + /* Start by writing out the entry; then the thread has something to write to the network when it's created */ + first_part_header = g_strdup_printf ("--" BOUNDARY_STRING "\n" + "Content-Type: %s; charset=UTF-8\n\n", + parsable_klass->get_content_type ()); + second_part_header = g_strdup_printf ("\n--" BOUNDARY_STRING "\n" + "Content-Type: %s\n" + "Content-Transfer-Encoding: binary\n\n", + priv->content_type); + + /* Push the message parts onto the message body; we can skip the buffer, since the network thread hasn't yet been created, + * so we're the sole thread accessing the SoupMessage. */ + soup_message_body_append (priv->message->request_body, + SOUP_MEMORY_TAKE, + first_part_header, + strlen (first_part_header)); + soup_message_body_append (priv->message->request_body, + SOUP_MEMORY_TAKE, upload_data, + strlen (upload_data)); + soup_message_body_append (priv->message->request_body, + SOUP_MEMORY_TAKE, + second_part_header, + strlen (second_part_header)); + + first_part_header = NULL; + upload_data = NULL; + second_part_header = NULL; + + priv->network_bytes_outstanding = priv->message->request_body->length; + } else { + soup_message_headers_set_content_type (priv->message->request_headers, priv->content_type, NULL); + } + + /* Non-resumable uploads start with the data requests immediately. */ + priv->state = STATE_DATA_REQUESTS; + } else { + gchar *content_length_str; + + /* Resumable upload's initial request */ + soup_message_headers_set_encoding (priv->message->request_headers, SOUP_ENCODING_CONTENT_LENGTH); + soup_message_headers_replace (priv->message->request_headers, "X-Upload-Content-Type", priv->content_type); + + content_length_str = g_strdup_printf ("%" G_GOFFSET_FORMAT, priv->content_length); + soup_message_headers_replace (priv->message->request_headers, "X-Upload-Content-Length", content_length_str); + g_free (content_length_str); + + if (priv->entry != NULL) { + GDataParsableClass *parsable_klass; + gchar *content_type, *upload_data; + + parsable_klass = GDATA_PARSABLE_GET_CLASS (priv->entry); + g_assert (parsable_klass->get_content_type != NULL); + + if (g_strcmp0 (parsable_klass->get_content_type (), "application/json") == 0) { + upload_data = gdata_parsable_get_json (GDATA_PARSABLE (priv->entry)); + } else { + upload_data = gdata_parsable_get_xml (GDATA_PARSABLE (priv->entry)); + } + + content_type = g_strdup_printf ("%s; charset=UTF-8", + parsable_klass->get_content_type ()); + soup_message_headers_set_content_type (priv->message->request_headers, + content_type, + NULL); + g_free (content_type); + + soup_message_body_append (priv->message->request_body, + SOUP_MEMORY_TAKE, + upload_data, + strlen (upload_data)); + upload_data = NULL; + + priv->network_bytes_outstanding = priv->message->request_body->length; + } else { + soup_message_headers_set_content_length (priv->message->request_headers, 0); + } + + /* Resumable uploads always start with an initial request, which either contains the XML or is empty. */ + priv->state = STATE_INITIAL_REQUEST; + priv->chunk_size = MIN (priv->content_length, MAX_RESUMABLE_CHUNK_SIZE); + } + + /* Make sure the headers are set. HACK: This should actually be in build_message(), but we have to work around + * http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3033 in GDataDocumentsService's append_query_headers(). */ + service_klass = GDATA_SERVICE_GET_CLASS (priv->service); + if (service_klass->append_query_headers != NULL) { + service_klass->append_query_headers (priv->service, priv->authorization_domain, priv->message); + } + + /* If the entry exists and has an ETag, we assume we're updating the entry, so we can set the If-Match header */ + if (priv->entry != NULL && gdata_entry_get_etag (priv->entry) != NULL) + soup_message_headers_append (priv->message->request_headers, "If-Match", gdata_entry_get_etag (priv->entry)); + + /* Uploading doesn't actually start until the first call to write() */ +} + +static void +gdata_upload_stream_dispose (GObject *object) +{ + GDataUploadStreamPrivate *priv = GDATA_UPLOAD_STREAM (object)->priv; + + /* Close the stream before unreffing things like priv->service, which stops crashes like bgo#602156 if the stream is unreffed in the middle + * of network operations */ + g_output_stream_close (G_OUTPUT_STREAM (object), NULL, NULL); + + if (priv->cancellable != NULL) + g_object_unref (priv->cancellable); + priv->cancellable = NULL; + + if (priv->service != NULL) + g_object_unref (priv->service); + priv->service = NULL; + + if (priv->authorization_domain != NULL) + g_object_unref (priv->authorization_domain); + priv->authorization_domain = NULL; + + if (priv->message != NULL) + g_object_unref (priv->message); + priv->message = NULL; + + if (priv->entry != NULL) + g_object_unref (priv->entry); + priv->entry = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_upload_stream_parent_class)->dispose (object); +} + +static void +gdata_upload_stream_finalize (GObject *object) +{ + GDataUploadStreamPrivate *priv = GDATA_UPLOAD_STREAM (object)->priv; + + g_mutex_clear (&(priv->response_mutex)); + g_cond_clear (&(priv->finished_cond)); + g_cond_clear (&(priv->write_cond)); + g_mutex_clear (&(priv->write_mutex)); + gdata_buffer_free (priv->buffer); + g_clear_error (&(priv->response_error)); + g_free (priv->upload_uri); + g_free (priv->method); + g_free (priv->slug); + g_free (priv->content_type); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_upload_stream_parent_class)->finalize (object); +} + +static void +gdata_upload_stream_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataUploadStreamPrivate *priv = GDATA_UPLOAD_STREAM (object)->priv; + + switch (property_id) { + case PROP_SERVICE: + g_value_set_object (value, priv->service); + break; + case PROP_AUTHORIZATION_DOMAIN: + g_value_set_object (value, priv->authorization_domain); + break; + case PROP_METHOD: + g_value_set_string (value, priv->method); + break; + case PROP_UPLOAD_URI: + g_value_set_string (value, priv->upload_uri); + break; + case PROP_ENTRY: + g_value_set_object (value, priv->entry); + break; + case PROP_SLUG: + g_value_set_string (value, priv->slug); + break; + case PROP_CONTENT_TYPE: + g_value_set_string (value, priv->content_type); + break; + case PROP_CONTENT_LENGTH: + g_value_set_int64 (value, priv->content_length); + break; + case PROP_CANCELLABLE: + g_value_set_object (value, priv->cancellable); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_upload_stream_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataUploadStreamPrivate *priv = GDATA_UPLOAD_STREAM (object)->priv; + + switch (property_id) { + case PROP_SERVICE: + priv->service = g_value_dup_object (value); + priv->session = _gdata_service_get_session (priv->service); + break; + case PROP_AUTHORIZATION_DOMAIN: + priv->authorization_domain = g_value_dup_object (value); + break; + case PROP_METHOD: + priv->method = g_value_dup_string (value); + break; + case PROP_UPLOAD_URI: + priv->upload_uri = g_value_dup_string (value); + break; + case PROP_ENTRY: + priv->entry = g_value_dup_object (value); + break; + case PROP_SLUG: + priv->slug = g_value_dup_string (value); + break; + case PROP_CONTENT_TYPE: + priv->content_type = g_value_dup_string (value); + break; + case PROP_CONTENT_LENGTH: + priv->content_length = g_value_get_int64 (value); + break; + case PROP_CANCELLABLE: + /* Construction only */ + priv->cancellable = g_value_dup_object (value); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +typedef struct { + GDataUploadStream *upload_stream; + gboolean *cancelled; +} CancelledData; + +static void +write_cancelled_cb (GCancellable *cancellable, CancelledData *data) +{ + GDataUploadStreamPrivate *priv = data->upload_stream->priv; + + /* Signal the gdata_upload_stream_write() function that it should stop blocking and cancel */ + g_mutex_lock (&(priv->write_mutex)); + *(data->cancelled) = TRUE; + g_cond_signal (&(priv->write_cond)); + g_mutex_unlock (&(priv->write_mutex)); +} + +static gssize +gdata_upload_stream_write (GOutputStream *stream, const void *buffer, gsize count, GCancellable *cancellable, GError **error_out) +{ + GDataUploadStreamPrivate *priv = GDATA_UPLOAD_STREAM (stream)->priv; + gssize length_written = -1; + gulong cancelled_signal = 0, global_cancelled_signal = 0; + gboolean cancelled = FALSE; /* must only be touched with ->write_mutex held */ + gsize old_total_network_bytes_written; + CancelledData data; + GError *error = NULL; + + /* Listen for cancellation events */ + data.upload_stream = GDATA_UPLOAD_STREAM (stream); + data.cancelled = &cancelled; + + global_cancelled_signal = g_cancellable_connect (priv->cancellable, (GCallback) write_cancelled_cb, &data, NULL); + + if (cancellable != NULL) + cancelled_signal = g_cancellable_connect (cancellable, (GCallback) write_cancelled_cb, &data, NULL); + + /* Check for an error and return if necessary */ + g_mutex_lock (&(priv->write_mutex)); + + if (cancelled == TRUE) { + g_assert (g_cancellable_set_error_if_cancelled (cancellable, &error) == TRUE || + g_cancellable_set_error_if_cancelled (priv->cancellable, &error) == TRUE); + g_mutex_unlock (&(priv->write_mutex)); + + length_written = -1; + goto done; + } + + g_mutex_unlock (&(priv->write_mutex)); + + /* Increment the number of bytes outstanding for the new write, and keep a record of the old number written so we know if the write's + * finished before we reach write_cond. */ + old_total_network_bytes_written = priv->total_network_bytes_written; + priv->message_bytes_outstanding += count; + + /* Handle the more common case of the network thread already having been created first */ + if (priv->network_thread != NULL) { + /* Push the new data into the buffer */ + gdata_buffer_push_data (priv->buffer, buffer, count); + goto write; + } + + /* Write out the first chunk of data, so there's guaranteed to be something in the buffer */ + gdata_buffer_push_data (priv->buffer, buffer, count); + + /* Create the thread and let the writing commence! */ + create_network_thread (GDATA_UPLOAD_STREAM (stream), &error); + if (priv->network_thread == NULL) { + length_written = -1; + goto done; + } + +write: + g_mutex_lock (&(priv->write_mutex)); + + /* Wait for it to be written */ + while (priv->total_network_bytes_written - old_total_network_bytes_written < count && cancelled == FALSE && priv->state != STATE_FINISHED) { + g_cond_wait (&(priv->write_cond), &(priv->write_mutex)); + } + length_written = MIN (count, priv->total_network_bytes_written - old_total_network_bytes_written); + + /* Check for an error and return if necessary */ + if (cancelled == TRUE && length_written < 1) { + /* Cancellation. */ + g_assert (g_cancellable_set_error_if_cancelled (cancellable, &error) == TRUE || + g_cancellable_set_error_if_cancelled (priv->cancellable, &error) == TRUE); + length_written = -1; + } else if (priv->state == STATE_FINISHED && (length_written < 0 || (gsize) length_written < count)) { + /* Resumable upload error. */ + g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Error received from server after uploading a resumable upload chunk.")); + length_written = -1; + } + + g_mutex_unlock (&(priv->write_mutex)); + +done: + /* Disconnect from the cancelled signals. Note that we have to do this with @write_mutex not held, as g_cancellable_disconnect() blocks + * until any outstanding cancellation callbacks return, and they will block on @write_mutex. */ + if (cancelled_signal != 0) + g_cancellable_disconnect (cancellable, cancelled_signal); + if (global_cancelled_signal != 0) + g_cancellable_disconnect (priv->cancellable, global_cancelled_signal); + + g_assert (error != NULL || length_written > 0); + + if (error != NULL) { + g_propagate_error (error_out, error); + } + + return length_written; +} + +static void +flush_cancelled_cb (GCancellable *cancellable, CancelledData *data) +{ + GDataUploadStreamPrivate *priv = data->upload_stream->priv; + + /* Signal the gdata_upload_stream_flush() function that it should stop blocking and cancel */ + g_mutex_lock (&(priv->write_mutex)); + *(data->cancelled) = TRUE; + g_cond_signal (&(priv->write_cond)); + g_mutex_unlock (&(priv->write_mutex)); +} + +/* Block until ->network_bytes_outstanding reaches zero. Cancelling the cancellable passed to gdata_upload_stream_flush() breaks out of the wait(), + * but doesn't stop the network thread from continuing to write the remaining bytes to the network. + * The wrapper function, g_output_stream_flush(), calls g_output_stream_set_pending() before calling this function, and calls + * g_output_stream_clear_pending() afterwards, so we don't need to worry about other operations happening concurrently. We also don't need to worry + * about being called after the stream has been closed (though the network activity could finish before or during this function). */ +static gboolean +gdata_upload_stream_flush (GOutputStream *stream, GCancellable *cancellable, GError **error) +{ + GDataUploadStreamPrivate *priv = GDATA_UPLOAD_STREAM (stream)->priv; + gulong cancelled_signal = 0, global_cancelled_signal = 0; + gboolean cancelled = FALSE; /* must only be touched with ->write_mutex held */ + gboolean success = TRUE; + CancelledData data; + + /* Listen for cancellation events */ + data.upload_stream = GDATA_UPLOAD_STREAM (stream); + data.cancelled = &cancelled; + + global_cancelled_signal = g_cancellable_connect (priv->cancellable, (GCallback) flush_cancelled_cb, &data, NULL); + + if (cancellable != NULL) + cancelled_signal = g_cancellable_connect (cancellable, (GCallback) flush_cancelled_cb, &data, NULL); + + /* Create the thread if it hasn't been created already. This can happen if flush() is called immediately after creating the stream. */ + if (priv->network_thread == NULL) { + create_network_thread (GDATA_UPLOAD_STREAM (stream), error); + if (priv->network_thread == NULL) { + success = FALSE; + goto done; + } + } + + /* Start the flush operation proper */ + g_mutex_lock (&(priv->write_mutex)); + + /* Wait for all outstanding bytes to be written to the network */ + while (priv->network_bytes_outstanding > 0 && cancelled == FALSE && priv->state != STATE_FINISHED) { + g_cond_wait (&(priv->write_cond), &(priv->write_mutex)); + } + + /* Check for an error and return if necessary */ + if (cancelled == TRUE) { + g_assert (g_cancellable_set_error_if_cancelled (cancellable, error) == TRUE || + g_cancellable_set_error_if_cancelled (priv->cancellable, error) == TRUE); + success = FALSE; + } else if (priv->state == STATE_FINISHED && priv->network_bytes_outstanding > 0) { + /* Resumable upload error. */ + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Error received from server after uploading a resumable upload chunk.")); + success = FALSE; + } + + g_mutex_unlock (&(priv->write_mutex)); + +done: + /* Disconnect from the cancelled signals. Note that we have to do this without @write_mutex held, as g_cancellable_disconnect() blocks + * until any outstanding cancellation callbacks return, and they will block on @write_mutex. */ + if (cancelled_signal != 0) + g_cancellable_disconnect (cancellable, cancelled_signal); + if (global_cancelled_signal != 0) + g_cancellable_disconnect (priv->cancellable, global_cancelled_signal); + + return success; +} + +static void +close_cancelled_cb (GCancellable *cancellable, CancelledData *data) +{ + GDataUploadStreamPrivate *priv = data->upload_stream->priv; + + /* Signal the gdata_upload_stream_close() function that it should stop blocking and cancel */ + g_mutex_lock (&(priv->response_mutex)); + *(data->cancelled) = TRUE; + g_cond_signal (&(priv->finished_cond)); + g_mutex_unlock (&(priv->response_mutex)); +} + +/* It's guaranteed that we have set ->response_status and ->response_error and are done with *all* network activity before this returns, unless it's + * cancelled. This means that it's safe to call gdata_upload_stream_get_response() once a call to close() has returned without being cancelled. + * + * Even though calling g_output_stream_close() multiple times on this stream is guaranteed to call gdata_upload_stream_close() at most once, other + * GIO methods (notably g_output_stream_splice()) can call gdata_upload_stream_close() directly. Consequently, we need to be careful to be idempotent + * after the first call. + * + * If the network thread hasn't yet been started (i.e. gdata_upload_stream_write() hasn't been called at all yet), %TRUE will be returned immediately. + * + * If the global cancellable, ->cancellable, or @cancellable are cancelled before the call to gdata_upload_stream_close(), gdata_upload_stream_close() + * should return immediately with %G_IO_ERROR_CANCELLED. If they're cancelled during the call, gdata_upload_stream_close() should stop waiting for + * any outstanding data to be flushed to the network and return %G_IO_ERROR_CANCELLED (though the operation to finish off network activity and close + * the stream will still continue). + * + * If the call to gdata_upload_stream_close() is not cancelled by any #GCancellable, it will wait until all the data has been flushed to the network + * and a response has been received. At this point, ->response_status and ->response_error have been set (and won't ever change) and we can return + * either success or an error code. */ +static gboolean +gdata_upload_stream_close (GOutputStream *stream, GCancellable *cancellable, GError **error) +{ + GDataUploadStreamPrivate *priv = GDATA_UPLOAD_STREAM (stream)->priv; + gboolean success = TRUE; + gboolean cancelled = FALSE; /* must only be touched with ->response_mutex held */ + gulong cancelled_signal = 0, global_cancelled_signal = 0; + CancelledData data; + gboolean is_finished; + GError *child_error = NULL; + + /* If the operation was never started, return successfully immediately */ + if (priv->network_thread == NULL) + return TRUE; + + /* If we've already closed the stream, return G_IO_ERROR_CLOSED */ + g_mutex_lock (&(priv->response_mutex)); + + if (priv->response_status != SOUP_STATUS_NONE) { + g_mutex_unlock (&(priv->response_mutex)); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CLOSED, _("Stream is already closed")); + return FALSE; + } + + g_mutex_unlock (&(priv->response_mutex)); + + /* Allow cancellation */ + data.upload_stream = GDATA_UPLOAD_STREAM (stream); + data.cancelled = &cancelled; + + global_cancelled_signal = g_cancellable_connect (priv->cancellable, (GCallback) close_cancelled_cb, &data, NULL); + + if (cancellable != NULL) + cancelled_signal = g_cancellable_connect (cancellable, (GCallback) close_cancelled_cb, &data, NULL); + + g_mutex_lock (&(priv->response_mutex)); + + g_mutex_lock (&(priv->write_mutex)); + is_finished = (priv->state == STATE_FINISHED); + g_mutex_unlock (&(priv->write_mutex)); + + /* If an operation is still in progress, the upload thread hasn't finished yet… */ + if (!is_finished) { + /* We've reached the end of the stream, so append the footer if the entire operation hasn't been cancelled. */ + if (priv->entry != NULL && g_cancellable_is_cancelled (priv->cancellable) == FALSE) { + const gchar *footer = "\n--" BOUNDARY_STRING "--"; + gsize footer_length = strlen (footer); + + gdata_buffer_push_data (priv->buffer, (const guint8*) footer, footer_length); + + g_mutex_lock (&(priv->write_mutex)); + priv->message_bytes_outstanding += footer_length; + g_mutex_unlock (&(priv->write_mutex)); + } + + /* Mark the buffer as having reached EOF, and the write operation will close in its own time */ + gdata_buffer_push_data (priv->buffer, NULL, 0); + + /* Wait for the signal that we've finished. Cancelling the call to gdata_upload_stream_close() will cause this wait to be aborted, + * but won't actually prevent the stream being closed (i.e. all it means is that the stream isn't guaranteed to have been closed by + * the time gdata_upload_stream_close() returns — whereas normally it would be). */ + if (cancelled == FALSE) { + g_cond_wait (&(priv->finished_cond), &(priv->response_mutex)); + } + } + + g_assert (priv->response_status == SOUP_STATUS_NONE); + g_assert (priv->response_error == NULL); + + g_mutex_lock (&(priv->write_mutex)); + is_finished = (priv->state == STATE_FINISHED); + g_mutex_unlock (&(priv->write_mutex)); + + /* Error handling */ + if (!is_finished && cancelled == TRUE) { + /* Cancelled? If ->state == STATE_FINISHED, the network activity finished before the gdata_upload_stream_close() operation was + * cancelled, so we don't need to return an error. */ + g_assert (g_cancellable_set_error_if_cancelled (cancellable, &child_error) == TRUE || + g_cancellable_set_error_if_cancelled (priv->cancellable, &child_error) == TRUE); + priv->response_status = SOUP_STATUS_CANCELLED; + success = FALSE; + } else if (SOUP_STATUS_IS_SUCCESSFUL (priv->message->status_code) == FALSE) { + GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (priv->service); + + /* Parse the error */ + g_assert (klass->parse_error_response != NULL); + klass->parse_error_response (priv->service, GDATA_OPERATION_UPLOAD, priv->message->status_code, priv->message->reason_phrase, + priv->message->response_body->data, priv->message->response_body->length, &child_error); + priv->response_status = priv->message->status_code; + success = FALSE; + } else { + /* Success! Set the response status */ + priv->response_status = priv->message->status_code; + } + + g_assert (priv->response_status != SOUP_STATUS_NONE && (SOUP_STATUS_IS_SUCCESSFUL (priv->response_status) || child_error != NULL)); + + g_mutex_unlock (&(priv->response_mutex)); + + /* Disconnect from the signal handler. Note that we have to do this with @response_mutex not held, as g_cancellable_disconnect() blocks + * until any outstanding cancellation callbacks return, and they will block on @response_mutex. */ + if (cancelled_signal != 0) + g_cancellable_disconnect (cancellable, cancelled_signal); + if (global_cancelled_signal != 0) + g_cancellable_disconnect (priv->cancellable, global_cancelled_signal); + + g_assert ((success == TRUE && child_error == NULL) || (success == FALSE && child_error != NULL)); + + if (child_error != NULL) + g_propagate_error (error, child_error); + + return success; +} + +/* In the network thread context, called just after writing the headers, or just after writing a chunk, to write the next chunk to libsoup. + * We don't let it return until we've finished pushing all the data into the buffer. + * This is due to http://bugzilla.gnome.org/show_bug.cgi?id=522147, which means that + * we can't use soup_session_(un)?pause_message() with a SoupSessionSync. + * If we don't return from this signal handler, the message is never paused, and thus + * Bad Things don't happen (due to the bug, messages can be paused, but not unpaused). + * Obviously this means that our memory usage will increase, and we'll eventually end + * up storing the entire request body in memory, but that's unavoidable at this point. */ +static void +write_next_chunk (GDataUploadStream *self, SoupMessage *message) +{ + #define CHUNK_SIZE 8192 /* 8KiB */ + + GDataUploadStreamPrivate *priv = self->priv; + gboolean has_network_bytes_outstanding, is_complete; + gsize length; + gboolean reached_eof = FALSE; + guint8 next_buffer[CHUNK_SIZE]; + + g_mutex_lock (&(priv->write_mutex)); + has_network_bytes_outstanding = (priv->network_bytes_outstanding > 0); + is_complete = (priv->state == STATE_INITIAL_REQUEST || + (priv->content_length != -1 && priv->network_bytes_written + priv->network_bytes_outstanding == priv->chunk_size)); + g_mutex_unlock (&(priv->write_mutex)); + + /* If there are still bytes in libsoup's buffer, don't block on getting new bytes into the stream. Also, if we're making the initial request + * of a resumable upload, don't push new data onto the network, since all of the XML was pushed into the buffer when we started. */ + if (has_network_bytes_outstanding) { + return; + } else if (is_complete) { + soup_message_body_complete (priv->message->request_body); + + return; + } + + /* Append the next chunk to the message body so it can join in the fun. + * Note that this call isn't necessarily blocking, and can return less than the CHUNK_SIZE. This is because + * we could deadlock if we block on getting CHUNK_SIZE bytes at the end of the stream. write() could + * easily be called with fewer bytes, but has no way to notify us that we've reached the end of the + * stream, so we'd happily block on receiving more bytes which weren't forthcoming. + * + * Note also that we can't block on this call with write_mutex locked, or we could get into a deadlock if the stream is flushed at the same + * time (in the case that we don't know the content length ahead of time). */ + if (priv->content_length == -1) { + /* Non-resumable upload. */ + length = gdata_buffer_pop_data_limited (priv->buffer, next_buffer, CHUNK_SIZE, &reached_eof); + } else { + /* Resumable upload. Ensure we don't exceed the chunk size. */ + length = gdata_buffer_pop_data_limited (priv->buffer, next_buffer, + MIN (CHUNK_SIZE, priv->chunk_size - (priv->network_bytes_written + + priv->network_bytes_outstanding)), &reached_eof); + } + + g_mutex_lock (&(priv->write_mutex)); + + priv->message_bytes_outstanding -= length; + priv->network_bytes_outstanding += length; + + /* Append whatever data was returned */ + if (length > 0) + soup_message_body_append (priv->message->request_body, SOUP_MEMORY_COPY, next_buffer, length); + + /* Finish off the request body if we've reached EOF (i.e. the stream has been closed), or if we're doing a resumable upload and we reach + * the maximum chunk size. */ + if (reached_eof == TRUE || + (priv->content_length != -1 && priv->network_bytes_written + priv->network_bytes_outstanding == priv->chunk_size)) { + g_assert (reached_eof == FALSE || priv->message_bytes_outstanding == 0); + + soup_message_body_complete (priv->message->request_body); + } + + g_mutex_unlock (&(priv->write_mutex)); +} + +static void +wrote_headers_cb (SoupMessage *message, GDataUploadStream *self) +{ + GDataUploadStreamPrivate *priv = self->priv; + + /* Signal the main thread that the headers have been written */ + g_mutex_lock (&(priv->write_mutex)); + g_cond_signal (&(priv->write_cond)); + g_mutex_unlock (&(priv->write_mutex)); + + /* Send the first chunk to libsoup */ + write_next_chunk (self, message); +} + +static void +wrote_body_data_cb (SoupMessage *message, SoupBuffer *buffer, GDataUploadStream *self) +{ + GDataUploadStreamPrivate *priv = self->priv; + + /* Signal the main thread that the chunk has been written */ + g_mutex_lock (&(priv->write_mutex)); + g_assert (priv->network_bytes_outstanding > 0); + priv->network_bytes_outstanding -= buffer->length; + priv->network_bytes_written += buffer->length; + + if (priv->state == STATE_DATA_REQUESTS) { + priv->total_network_bytes_written += buffer->length; + } + + g_cond_signal (&(priv->write_cond)); + g_mutex_unlock (&(priv->write_mutex)); + + /* Send the next chunk to libsoup */ + write_next_chunk (self, message); +} + +static gpointer +upload_thread (GDataUploadStream *self) +{ + GDataUploadStreamPrivate *priv = self->priv; + + g_assert (priv->cancellable != NULL); + + while (TRUE) { + GDataServiceClass *klass; + gulong wrote_headers_signal, wrote_body_data_signal; + gchar *new_uri; + SoupMessage *new_message; + gsize next_chunk_length; + + /* Connect to the wrote-* signals so we can prepare the next chunk for transmission */ + wrote_headers_signal = g_signal_connect (priv->message, "wrote-headers", (GCallback) wrote_headers_cb, self); + wrote_body_data_signal = g_signal_connect (priv->message, "wrote-body-data", (GCallback) wrote_body_data_cb, self); + + _gdata_service_actually_send_message (priv->session, priv->message, priv->cancellable, NULL); + + g_mutex_lock (&(priv->write_mutex)); + + /* If this is a resumable upload, continue to the next chunk. If it's a non-resumable upload, we're done. We have several cases: + * • Non-resumable upload: + * - Content only: STATE_DATA_REQUESTS → STATE_FINISHED + * - Metadata only: not supported + * - Content and metadata: STATE_DATA_REQUESTS → STATE_FINISHED + * • Resumable upload: + * - Content only: + * * STATE_INITIAL_REQUEST → STATE_DATA_REQUESTS + * * STATE_DATA_REQUESTS → STATE_DATA_REQUESTS + * * STATE_DATA_REQUESTS → STATE_FINISHED + * - Metadata only: STATE_INITIAL_REQUEST → STATE_FINISHED + * - Content and metadata: + * * STATE_INITIAL_REQUEST → STATE_DATA_REQUESTS + * * STATE_DATA_REQUESTS → STATE_DATA_REQUESTS + * * STATE_DATA_REQUESTS → STATE_FINISHED + */ + switch (priv->state) { + case STATE_INITIAL_REQUEST: + /* We're either a content-only or a content-and-metadata resumable upload. */ + priv->state = STATE_DATA_REQUESTS; + + /* Check the response. On success it should be empty, status 200, with a Location header telling us where to upload + * next. If it's an error response, bail out and let the code in gdata_upload_stream_close() parse the error..*/ + if (!SOUP_STATUS_IS_SUCCESSFUL (priv->message->status_code)) { + goto finished; + } else if (priv->content_length == 0 && priv->message->status_code == SOUP_STATUS_CREATED) { + /* If this was a metadata-only upload, we're done. */ + goto finished; + } + + /* Fall out and prepare the next message */ + g_assert (priv->total_network_bytes_written == 0); /* haven't written any data yet */ + + break; + case STATE_DATA_REQUESTS: + /* Check the response. On completion it should contain the resulting entry's XML, status 201. On continuation it should + * be empty, status 308, with a Range header and potentially a Location header telling us what/where to upload next. + * If it's an error response, bail out and let the code in gdata_upload_stream_close() parse the error..*/ + if (priv->message->status_code == 308) { + /* Continuation: fall out and prepare the next message */ + g_assert (priv->content_length == -1 || priv->total_network_bytes_written < (gsize) priv->content_length); + } else if (SOUP_STATUS_IS_SUCCESSFUL (priv->message->status_code)) { + /* Completion. Check the server isn't misbehaving. */ + g_assert (priv->content_length == -1 || priv->total_network_bytes_written == (gsize) priv->content_length); + + goto finished; + } else { + /* Error */ + goto finished; + } + + /* Fall out and prepare the next message */ + g_assert (priv->total_network_bytes_written > 0); + + break; + case STATE_FINISHED: + default: + g_assert_not_reached (); + } + + /* Prepare the next message. */ + g_assert (priv->content_length != -1); + + next_chunk_length = MIN (priv->content_length - priv->total_network_bytes_written, MAX_RESUMABLE_CHUNK_SIZE); + + new_uri = g_strdup (soup_message_headers_get_one (priv->message->response_headers, "Location")); + if (new_uri == NULL) { + new_uri = soup_uri_to_string (soup_message_get_uri (priv->message), FALSE); + } + + new_message = build_message (self, SOUP_METHOD_PUT, new_uri); + + g_free (new_uri); + + soup_message_headers_set_encoding (new_message->request_headers, SOUP_ENCODING_CONTENT_LENGTH); + soup_message_headers_set_content_type (new_message->request_headers, priv->content_type, NULL); + soup_message_headers_set_content_length (new_message->request_headers, next_chunk_length); + soup_message_headers_set_content_range (new_message->request_headers, priv->total_network_bytes_written, + priv->total_network_bytes_written + next_chunk_length - 1, priv->content_length); + + /* Make sure the headers are set. HACK: This should actually be in build_message(), but we have to work around + * http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3033 in GDataDocumentsService's append_query_headers(). */ + klass = GDATA_SERVICE_GET_CLASS (priv->service); + if (klass->append_query_headers != NULL) { + klass->append_query_headers (priv->service, priv->authorization_domain, new_message); + } + + g_signal_handler_disconnect (priv->message, wrote_body_data_signal); + g_signal_handler_disconnect (priv->message, wrote_headers_signal); + + g_object_unref (priv->message); + priv->message = new_message; + + /* Reset various counters for the next upload. Note that message_bytes_outstanding may be > 0 at this point, since the client may + * have pushed some content into the buffer while we were waiting for the response to this request. */ + g_assert (priv->network_bytes_outstanding == 0); + priv->chunk_size = next_chunk_length; + priv->network_bytes_written = 0; + + /* Loop round and upload this chunk now. */ + g_mutex_unlock (&(priv->write_mutex)); + + continue; + +finished: + g_mutex_unlock (&(priv->write_mutex)); + + goto finished_outer; + } + +finished_outer: + /* Signal that the operation has finished (either successfully or in error). + * Also signal write_cond, just in case we errored out and finished sending in the middle of a write. */ + g_mutex_lock (&(priv->write_mutex)); + priv->state = STATE_FINISHED; + g_cond_signal (&(priv->write_cond)); + g_mutex_unlock (&(priv->write_mutex)); + + g_cond_signal (&(priv->finished_cond)); + + /* Referenced in create_network_thread(). */ + g_object_unref (self); + + return NULL; +} + +static void +create_network_thread (GDataUploadStream *self, GError **error) +{ + GDataUploadStreamPrivate *priv = self->priv; + + g_assert (priv->network_thread == NULL); + g_object_ref (self); /* ownership transferred to thread */ + priv->network_thread = g_thread_try_new ("upload-thread", (GThreadFunc) upload_thread, self, error); +} + +/** + * gdata_upload_stream_new: + * @service: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain to authorize the upload, or %NULL + * @method: the HTTP method to use + * @upload_uri: the URI to upload, which must be HTTPS + * @entry: (allow-none): the entry to upload as metadata, or %NULL + * @slug: the file's slug (filename) + * @content_type: the content type of the file being uploaded + * @cancellable: (allow-none): a #GCancellable for the entire upload stream, or %NULL + * + * Creates a new #GDataUploadStream, allowing a file to be uploaded from a GData service using standard #GOutputStream API. + * + * The HTTP method to use should be specified in @method, and will typically be either %SOUP_METHOD_POST (for insertions) or %SOUP_METHOD_PUT + * (for updates), according to the server and the @upload_uri. + * + * If @entry is specified, it will be attached to the upload as the entry to which the file being uploaded belongs. Otherwise, just the file + * written to the stream will be uploaded, and given a default entry as determined by the server. + * + * @slug and @content_type must be specified before the upload begins, as they describe the file being streamed. @slug is the filename given to the + * file, which will typically be stored on the server and made available when downloading the file again. @content_type must be the correct + * content type for the file, and should be in the service's list of acceptable content types. + * + * As well as the standard GIO errors, calls to the #GOutputStream API on a #GDataUploadStream can also return any relevant specific error from + * #GDataServiceError, or %GDATA_SERVICE_ERROR_PROTOCOL_ERROR in the general case. + * + * If a #GCancellable is provided in @cancellable, the upload operation may be cancelled at any time from another thread using g_cancellable_cancel(). + * In this case, any ongoing network activity will be stopped, and any pending or future calls to #GOutputStream API on the #GDataUploadStream will + * return %G_IO_ERROR_CANCELLED. Note that the #GCancellable objects which can be passed to individual #GOutputStream operations will not cancel the + * upload operation proper if cancelled — they will merely cancel that API call. The only way to cancel the upload operation completely is using this + * @cancellable. + * + * Note that network communication won't begin until the first call to g_output_stream_write() on the #GDataUploadStream. + * + * Return value: a new #GOutputStream, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GOutputStream * +gdata_upload_stream_new (GDataService *service, GDataAuthorizationDomain *domain, const gchar *method, const gchar *upload_uri, GDataEntry *entry, + const gchar *slug, const gchar *content_type, GCancellable *cancellable) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL); + g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), NULL); + g_return_val_if_fail (method != NULL, NULL); + g_return_val_if_fail (upload_uri != NULL, NULL); + g_return_val_if_fail (entry == NULL || GDATA_IS_ENTRY (entry), NULL); + g_return_val_if_fail (slug != NULL, NULL); + g_return_val_if_fail (content_type != NULL, NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + + /* Create the upload stream */ + return G_OUTPUT_STREAM (g_object_new (GDATA_TYPE_UPLOAD_STREAM, + "method", method, + "upload-uri", upload_uri, + "service", service, + "authorization-domain", domain, + "entry", entry, + "slug", slug, + "content-type", content_type, + "cancellable", cancellable, + NULL)); +} + +/** + * gdata_upload_stream_new_resumable: + * @service: a #GDataService + * @domain: (allow-none): the #GDataAuthorizationDomain to authorize the upload, or %NULL + * @method: the HTTP method to use + * @upload_uri: the URI to upload + * @entry: (allow-none): the entry to upload as metadata, or %NULL + * @slug: the file's slug (filename) + * @content_type: the content type of the file being uploaded + * @content_length: the size (in bytes) of the file being uploaded + * @cancellable: (allow-none): a #GCancellable for the entire upload stream, or %NULL + * + * Creates a new resumable #GDataUploadStream, allowing a file to be uploaded from a GData service using standard #GOutputStream API. The upload will + * use GData's resumable upload API, so should be more reliable than a normal upload (especially if the file is large). See the + * GData documentation on resumable uploads for more + * information. + * + * The HTTP method to use should be specified in @method, and will typically be either %SOUP_METHOD_POST (for insertions) or %SOUP_METHOD_PUT + * (for updates), according to the server and the @upload_uri. + * + * If @entry is specified, it will be attached to the upload as the entry to which the file being uploaded belongs. Otherwise, just the file + * written to the stream will be uploaded, and given a default entry as determined by the server. + * + * @slug, @content_type and @content_length must be specified before the upload begins, as they describe the file being streamed. @slug is the filename + * given to the file, which will typically be stored on the server and made available when downloading the file again. @content_type must be the + * correct content type for the file, and should be in the service's list of acceptable content types. @content_length must be the size of the file + * being uploaded (not including the XML for any associated #GDataEntry) in bytes. Zero is accepted if a metadata-only upload is being performed. + * + * As well as the standard GIO errors, calls to the #GOutputStream API on a #GDataUploadStream can also return any relevant specific error from + * #GDataServiceError, or %GDATA_SERVICE_ERROR_PROTOCOL_ERROR in the general case. + * + * If a #GCancellable is provided in @cancellable, the upload operation may be cancelled at any time from another thread using g_cancellable_cancel(). + * In this case, any ongoing network activity will be stopped, and any pending or future calls to #GOutputStream API on the #GDataUploadStream will + * return %G_IO_ERROR_CANCELLED. Note that the #GCancellable objects which can be passed to individual #GOutputStream operations will not cancel the + * upload operation proper if cancelled — they will merely cancel that API call. The only way to cancel the upload operation completely is using this + * @cancellable. + * + * Note that network communication won't begin until the first call to g_output_stream_write() on the #GDataUploadStream. + * + * Return value: a new #GOutputStream, or %NULL; unref with g_object_unref() + * + * Since: 0.13.0 + */ +GOutputStream * +gdata_upload_stream_new_resumable (GDataService *service, GDataAuthorizationDomain *domain, const gchar *method, const gchar *upload_uri, + GDataEntry *entry, const gchar *slug, const gchar *content_type, goffset content_length, GCancellable *cancellable) +{ + g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL); + g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), NULL); + g_return_val_if_fail (method != NULL, NULL); + g_return_val_if_fail (upload_uri != NULL, NULL); + g_return_val_if_fail (entry == NULL || GDATA_IS_ENTRY (entry), NULL); + g_return_val_if_fail (slug != NULL, NULL); + g_return_val_if_fail (content_type != NULL, NULL); + g_return_val_if_fail (content_length >= 0, NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + + /* Create the upload stream */ + return G_OUTPUT_STREAM (g_object_new (GDATA_TYPE_UPLOAD_STREAM, + "method", method, + "upload-uri", upload_uri, + "service", service, + "authorization-domain", domain, + "entry", entry, + "slug", slug, + "content-type", content_type, + "content-length", content_length, + "cancellable", cancellable, + NULL)); +} + +/** + * gdata_upload_stream_get_response: + * @self: a #GDataUploadStream + * @length: (allow-none) (out caller-allocates): return location for the length of the response, or %NULL + * + * Returns the server's response to the upload operation performed by the #GDataUploadStream. If the operation + * is still underway, or the server's response hasn't been received yet, %NULL is returned and @length is set to -1. + * + * If there was an error during the upload operation (but it is complete), %NULL is returned, and @length is set to 0. + * + * While it is safe to call this function from any thread at any time during the network operation, the only way to guarantee that the response has + * been set before calling this function is to have closed the #GDataUploadStream by calling g_output_stream_close() on it, without cancelling + * the close operation. Once the stream has been closed, all network communication is guaranteed to have finished. Note that if a call to + * g_output_stream_close() is cancelled, g_output_stream_is_closed() will immediately start to return %TRUE, even if the #GDataUploadStream is still + * attempting to flush the network buffers asynchronously — consequently, gdata_upload_stream_get_response() may still return %NULL and a @length of + * -1. The only reliable way to determine if the stream has been fully closed in this situation is to check the results + * of gdata_upload_stream_get_response(), rather than g_output_stream_is_closed(). + * + * Return value: the server's response to the upload, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_upload_stream_get_response (GDataUploadStream *self, gssize *length) +{ + gssize _length; + const gchar *_response; + + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), NULL); + + g_mutex_lock (&(self->priv->response_mutex)); + + if (self->priv->response_status == SOUP_STATUS_NONE) { + /* We can't touch the message until the network thread has finished using it, since it isn't threadsafe */ + _length = -1; + _response = NULL; + } else if (SOUP_STATUS_IS_SUCCESSFUL (self->priv->response_status) == FALSE) { + /* The response has been received, and was unsuccessful */ + _length = 0; + _response = NULL; + } else { + /* The response has been received, and was successful */ + _length = self->priv->message->response_body->length; + _response = self->priv->message->response_body->data; + } + + g_mutex_unlock (&(self->priv->response_mutex)); + + if (length != NULL) + *length = _length; + return _response; +} + +/** + * gdata_upload_stream_get_service: + * @self: a #GDataUploadStream + * + * Gets the service used to authorize the upload, as passed to gdata_upload_stream_new(). + * + * Return value: (transfer none): the #GDataService used to authorize the upload + * + * Since: 0.5.0 + */ +GDataService * +gdata_upload_stream_get_service (GDataUploadStream *self) +{ + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), NULL); + return self->priv->service; +} + +/** + * gdata_upload_stream_get_authorization_domain: + * @self: a #GDataUploadStream + * + * Gets the authorization domain used to authorize the upload, as passed to gdata_upload_stream_new(). It may be %NULL if authorization is not + * needed for the upload. + * + * Return value: (transfer none) (allow-none): the #GDataAuthorizationDomain used to authorize the upload, or %NULL + * + * Since: 0.9.0 + */ +GDataAuthorizationDomain * +gdata_upload_stream_get_authorization_domain (GDataUploadStream *self) +{ + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), NULL); + return self->priv->authorization_domain; +} + +/** + * gdata_upload_stream_get_method: + * @self: a #GDataUploadStream + * + * Gets the HTTP request method being used to upload the file, as passed to gdata_upload_stream_new(). + * + * Return value: the HTTP request method in use + * + * Since: 0.7.0 + */ +const gchar * +gdata_upload_stream_get_method (GDataUploadStream *self) +{ + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), NULL); + return self->priv->method; +} + +/** + * gdata_upload_stream_get_upload_uri: + * @self: a #GDataUploadStream + * + * Gets the URI the file is being uploaded to, as passed to gdata_upload_stream_new(). + * + * Return value: the URI which the file is being uploaded to + * + * Since: 0.5.0 + */ +const gchar * +gdata_upload_stream_get_upload_uri (GDataUploadStream *self) +{ + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), NULL); + return self->priv->upload_uri; +} + +/** + * gdata_upload_stream_get_entry: + * @self: a #GDataUploadStream + * + * Gets the entry being used to upload metadata, if one was passed to gdata_upload_stream_new(). + * + * Return value: (transfer none): the entry used for metadata, or %NULL + * + * Since: 0.5.0 + */ +GDataEntry * +gdata_upload_stream_get_entry (GDataUploadStream *self) +{ + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), NULL); + return self->priv->entry; +} + +/** + * gdata_upload_stream_get_slug: + * @self: a #GDataUploadStream + * + * Gets the slug (filename) of the file being uploaded. + * + * Return value: the slug of the file being uploaded + * + * Since: 0.5.0 + */ +const gchar * +gdata_upload_stream_get_slug (GDataUploadStream *self) +{ + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), NULL); + return self->priv->slug; +} + +/** + * gdata_upload_stream_get_content_type: + * @self: a #GDataUploadStream + * + * Gets the content type of the file being uploaded. + * + * Return value: the content type of the file being uploaded + * + * Since: 0.5.0 + */ +const gchar * +gdata_upload_stream_get_content_type (GDataUploadStream *self) +{ + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), NULL); + return self->priv->content_type; +} + +/** + * gdata_upload_stream_get_content_length: + * @self: a #GDataUploadStream + * + * Gets the size (in bytes) of the file being uploaded. This will be -1 for a non-resumable upload, and zero or greater + * for a resumable upload. + * + * Return value: the size of the file being uploaded + * + * Since: 0.13.0 + */ +goffset +gdata_upload_stream_get_content_length (GDataUploadStream *self) +{ + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), -1); + return self->priv->content_length; +} + +/** + * gdata_upload_stream_get_cancellable: + * @self: a #GDataUploadStream + * + * Gets the #GCancellable for the entire upload operation, #GDataUploadStream:cancellable. + * + * Return value: (transfer none): the #GCancellable for the entire upload operation + * + * Since: 0.8.0 + */ +GCancellable * +gdata_upload_stream_get_cancellable (GDataUploadStream *self) +{ + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (self), NULL); + g_assert (self->priv->cancellable != NULL); + return self->priv->cancellable; +} diff --git a/gdata/gdata-upload-stream.h b/gdata/gdata-upload-stream.h new file mode 100644 index 0000000..36784ae --- /dev/null +++ b/gdata/gdata-upload-stream.h @@ -0,0 +1,123 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_UPLOAD_STREAM_H +#define GDATA_UPLOAD_STREAM_H + +#include +#include +#include + +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_LINK_RESUMABLE_CREATE_MEDIA: + * + * The relation type URI of the resumable upload location for resources attached to this resource. + * + * For more information, see the + * GData resumable upload protocol + * specification. + * + * Since: 0.13.0 + */ +#define GDATA_LINK_RESUMABLE_CREATE_MEDIA "http://schemas.google.com/g/2005#resumable-create-media" + +/** + * GDATA_LINK_RESUMABLE_EDIT_MEDIA: + * + * The relation type URI of the resumable update location for resources attached to this resource. + * + * For more information, see the + * GData resumable upload protocol + * specification. + * + * Since: 0.13.0 + */ +#define GDATA_LINK_RESUMABLE_EDIT_MEDIA "http://schemas.google.com/g/2005#resumable-edit-media" + +#define GDATA_TYPE_UPLOAD_STREAM (gdata_upload_stream_get_type ()) +#define GDATA_UPLOAD_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_UPLOAD_STREAM, GDataUploadStream)) +#define GDATA_UPLOAD_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_UPLOAD_STREAM, GDataUploadStreamClass)) +#define GDATA_IS_UPLOAD_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_UPLOAD_STREAM)) +#define GDATA_IS_UPLOAD_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_UPLOAD_STREAM)) +#define GDATA_UPLOAD_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_UPLOAD_STREAM, GDataUploadStreamClass)) + +typedef struct _GDataUploadStreamPrivate GDataUploadStreamPrivate; + +/** + * GDataUploadStream: + * + * All the fields in the #GDataUploadStream structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + GOutputStream parent; + GDataUploadStreamPrivate *priv; +} GDataUploadStream; + +/** + * GDataUploadStreamClass: + * + * All the fields in the #GDataUploadStreamClass structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + /*< private >*/ + GOutputStreamClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataUploadStreamClass; + +GType gdata_upload_stream_get_type (void) G_GNUC_CONST; + +GOutputStream *gdata_upload_stream_new (GDataService *service, GDataAuthorizationDomain *domain, const gchar *method, const gchar *upload_uri, + GDataEntry *entry, const gchar *slug, const gchar *content_type, + GCancellable *cancellable) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GOutputStream *gdata_upload_stream_new_resumable (GDataService *service, GDataAuthorizationDomain *domain, const gchar *method, const gchar *upload_uri, + GDataEntry *entry, const gchar *slug, const gchar *content_type, goffset content_length, + GCancellable *cancellable) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_upload_stream_get_response (GDataUploadStream *self, gssize *length); + +GDataService *gdata_upload_stream_get_service (GDataUploadStream *self) G_GNUC_PURE; +GDataAuthorizationDomain *gdata_upload_stream_get_authorization_domain (GDataUploadStream *self) G_GNUC_PURE; +const gchar *gdata_upload_stream_get_method (GDataUploadStream *self) G_GNUC_PURE; +const gchar *gdata_upload_stream_get_upload_uri (GDataUploadStream *self) G_GNUC_PURE; +GDataEntry *gdata_upload_stream_get_entry (GDataUploadStream *self) G_GNUC_PURE; +const gchar *gdata_upload_stream_get_slug (GDataUploadStream *self) G_GNUC_PURE; +const gchar *gdata_upload_stream_get_content_type (GDataUploadStream *self) G_GNUC_PURE; +goffset gdata_upload_stream_get_content_length (GDataUploadStream *self) G_GNUC_PURE; +GCancellable *gdata_upload_stream_get_cancellable (GDataUploadStream *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_UPLOAD_STREAM_H */ diff --git a/gdata/gdata-version.h b/gdata/gdata-version.h new file mode 100644 index 0000000..33b99b8 --- /dev/null +++ b/gdata/gdata-version.h @@ -0,0 +1,80 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Holger Berndt 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_VERSION_H +#define GDATA_VERSION_H + +/** + * SECTION:gdata-version + * @Short_description: Macros to check the libgdata version + * @Title: Version Information + * + * libgdata provides compile-time version information. + * + * Since: 0.11.0 + */ + +/** + * GDATA_MAJOR_VERSION: + * + * Evaluates to the major version of the GData headers at compile time. + * (e.g. in libgdata version 1.2.3 this is 1). + * + * Since: 0.11.0 + */ +#define GDATA_MAJOR_VERSION (0) + +/** + * GDATA_MINOR_VERSION: + * + * Evaluates to the minor version of the GData headers at compile time. + * (e.g. in libgdata version 1.2.3 this is 2). + * + * Since: 0.11.0 + */ +#define GDATA_MINOR_VERSION (17) + +/** + * GDATA_MICRO_VERSION: + * + * Evaluates to the micro version of the GData headers at compile time. + * (e.g. in libgdata version 1.2.3 this is 3). + * + * Since: 0.11.0 + */ +#define GDATA_MICRO_VERSION (9) + +/** + * GDATA_CHECK_VERSION: + * @major: major version (e.g. 1 for version 1.2.3) + * @minor: minor version (e.g. 2 for version 1.2.3) + * @micro: micro version (e.g. 3 for version 1.2.3) + * + * Evaluates to %TRUE if the version of the GData header files + * is the same as or newer than the passed-in version. + * + * Since: 0.11.0 + */ +#define GDATA_CHECK_VERSION(major,minor,micro) \ + (GDATA_MAJOR_VERSION > (major) || \ + (GDATA_MAJOR_VERSION == (major) && GDATA_MINOR_VERSION > (minor)) || \ + (GDATA_MAJOR_VERSION == (major) && GDATA_MINOR_VERSION == (minor) && \ + GDATA_MICRO_VERSION >= (micro))) + +#endif /* !GDATA_VERSION_H */ diff --git a/gdata/gdata-version.h.in b/gdata/gdata-version.h.in new file mode 100644 index 0000000..994032e --- /dev/null +++ b/gdata/gdata-version.h.in @@ -0,0 +1,80 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Holger Berndt 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_VERSION_H +#define GDATA_VERSION_H + +/** + * SECTION:gdata-version + * @Short_description: Macros to check the libgdata version + * @Title: Version Information + * + * libgdata provides compile-time version information. + * + * Since: 0.11.0 + */ + +/** + * GDATA_MAJOR_VERSION: + * + * Evaluates to the major version of the GData headers at compile time. + * (e.g. in libgdata version 1.2.3 this is 1). + * + * Since: 0.11.0 + */ +#define GDATA_MAJOR_VERSION (@GDATA_VERSION_MAJOR@) + +/** + * GDATA_MINOR_VERSION: + * + * Evaluates to the minor version of the GData headers at compile time. + * (e.g. in libgdata version 1.2.3 this is 2). + * + * Since: 0.11.0 + */ +#define GDATA_MINOR_VERSION (@GDATA_VERSION_MINOR@) + +/** + * GDATA_MICRO_VERSION: + * + * Evaluates to the micro version of the GData headers at compile time. + * (e.g. in libgdata version 1.2.3 this is 3). + * + * Since: 0.11.0 + */ +#define GDATA_MICRO_VERSION (@GDATA_VERSION_MICRO@) + +/** + * GDATA_CHECK_VERSION: + * @major: major version (e.g. 1 for version 1.2.3) + * @minor: minor version (e.g. 2 for version 1.2.3) + * @micro: micro version (e.g. 3 for version 1.2.3) + * + * Evaluates to %TRUE if the version of the GData header files + * is the same as or newer than the passed-in version. + * + * Since: 0.11.0 + */ +#define GDATA_CHECK_VERSION(major,minor,micro) \ + (GDATA_MAJOR_VERSION > (major) || \ + (GDATA_MAJOR_VERSION == (major) && GDATA_MINOR_VERSION > (minor)) || \ + (GDATA_MAJOR_VERSION == (major) && GDATA_MINOR_VERSION == (minor) && \ + GDATA_MICRO_VERSION >= (micro))) + +#endif /* !GDATA_VERSION_H */ diff --git a/gdata/gdata.h b/gdata/gdata.h new file mode 100644 index 0000000..405993e --- /dev/null +++ b/gdata/gdata.h @@ -0,0 +1,161 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008-2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_H +#define GDATA_H + +/* Core files */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef GOA_API_IS_SUBJECT_TO_CHANGE +/* You need to define GOA_API_IS_SUBJECT_TO_CHANGE in order to use the GOA authoriser. */ +#include +#endif /* GOA_API_IS_SUBJECT_TO_CHANGE */ +#include +#include +#include + +/* Namespaces */ + +/* Atom */ +#include +#include +#include +#include + +/* APP */ +#include + +/* GData */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* GContact */ +#include +#include +#include +#include +#include +#include +#include + +/* Media RSS */ +#include +#include +#include +#include +#include + +/* Services */ + +/* YouTube */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Google Calendar */ +#include +#include +#include +#include +#include +#include + +/* Google PicasaWeb */ +#include +#include +#include +#include +#include +#include +#include +#include + +/* Google Contacts */ +#include +#include +#include +#include + +/* Google Documents*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Google Tasks */ +#include +#include +#include +#include + +/* Google Freebase */ +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* !GDATA_H */ diff --git a/gdata/georss/gdata-georss-where.c b/gdata/georss/gdata-georss-where.c new file mode 100644 index 0000000..8673c26 --- /dev/null +++ b/gdata/georss/gdata-georss-where.c @@ -0,0 +1,223 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * Copyright (C) Richard Schwarting 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/* + * SECTION:gdata-georss-where + * @short_description: GeoRSS where element + * @stability: Stable + * @include: gdata/georss/gdata-georss-where.h + * + * #GDataGeoRSSWhere represents a "where" element from the + * GeoRSS specification. + * with PicasaWeb usage defined at + * PicasaWeb API reference. + * + * It is private API, since implementing classes are likely to proxy the properties and functions + * of #GDataGeoRSSWhere as appropriate; most entry types which implement #GDataGeoRSSWhere have no use + * for most of its properties, and it would be unnecessary and confusing to expose #GDataGeoRSSWhere itself. + * + * Since: 0.5.0 + */ + +#include +#include +#include + +#include "gdata-georss-where.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); +static void get_xml (GDataParsable *parsable, GString *xml_string); + +struct _GDataGeoRSSWherePrivate { + gdouble latitude; + gdouble longitude; +}; + +G_DEFINE_TYPE (GDataGeoRSSWhere, gdata_georss_where, GDATA_TYPE_PARSABLE) + +static void +gdata_georss_where_class_init (GDataGeoRSSWhereClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataGeoRSSWherePrivate)); + + parsable_class->get_xml = get_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "where"; + parsable_class->element_namespace = "georss"; +} + +static void +gdata_georss_where_init (GDataGeoRSSWhere *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_GEORSS_WHERE, GDataGeoRSSWherePrivate); + + self->priv->latitude = G_MAXDOUBLE; + self->priv->longitude = G_MAXDOUBLE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + GDataGeoRSSWhere *self = GDATA_GEORSS_WHERE (parsable); + + if (gdata_parser_is_namespace (node, "http://www.opengis.net/gml") == TRUE && + xmlStrcmp (node->name, (xmlChar*) "Point") == 0) { + /* gml:Point */ + gboolean found_pos = FALSE; + xmlNode *child; + + for (child = node->children; child != NULL; child = child->next) { + if (xmlStrcmp (child->name, (xmlChar*) "pos") == 0) { + xmlChar *pos = xmlNodeListGetString (doc, child->children, TRUE); + gchar *endptr; + + self->priv->latitude = g_ascii_strtod ((gchar*) pos, &endptr); + self->priv->longitude = g_ascii_strtod (endptr, NULL); + + xmlFree (pos); + found_pos = TRUE; + } else { + /* TODO: this logic copied from gdata-parsable.c. Re-evaluate this at some point in the future. + If GeoRSS and GML support were to be used more widely, it might due to implement GML objects. */ + xmlBuffer *buffer; + + /* Unhandled XML */ + buffer = xmlBufferCreate (); + xmlNodeDump (buffer, doc, child, 0, 0); + g_debug ("Unhandled XML in : %s", (gchar*) xmlBufferContent (buffer)); + xmlBufferFree (buffer); + } + } + + if (found_pos == FALSE) + return gdata_parser_error_required_element_missing ("pos", "gml:Point", error); + return TRUE; + } + + return GDATA_PARSABLE_CLASS (gdata_georss_where_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataGeoRSSWherePrivate *priv = GDATA_GEORSS_WHERE (parsable)->priv; + gchar latitude_str[G_ASCII_DTOSTR_BUF_SIZE]; + gchar longitude_str[G_ASCII_DTOSTR_BUF_SIZE]; + + if (priv->latitude != G_MAXDOUBLE && priv->longitude != G_MAXDOUBLE) { + g_string_append_printf (xml_string, "%s %s", + g_ascii_dtostr (latitude_str, sizeof (latitude_str), priv->latitude), + g_ascii_dtostr (longitude_str, sizeof (longitude_str), priv->longitude)); + } +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "georss", (gchar*) "http://www.georss.org/georss"); + g_hash_table_insert (namespaces, (gchar*) "gml", (gchar*) "http://www.opengis.net/gml"); +} + +/** + * gdata_georss_where_get_latitude: + * @self: a #GDataGeoRSSWhere + * + * Gets the #GDataGeoRSSWhere:latitude property. + * + * Return value: the latitude of this position, or %G_MAXDOUBLE if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_georss_where_get_latitude (GDataGeoRSSWhere *self) +{ + g_return_val_if_fail (GDATA_IS_GEORSS_WHERE (self), G_MAXDOUBLE); + return self->priv->latitude; +} + +/** + * gdata_georss_where_get_longitude: + * @self: a #GDataGeoRSSWhere + * + * Gets the #GDataGeoRSSWhere:longitude property. + * + * Return value: the longitude of this position, or %G_MAXDOUBLE if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_georss_where_get_longitude (GDataGeoRSSWhere *self) +{ + g_return_val_if_fail (GDATA_IS_GEORSS_WHERE (self), G_MAXDOUBLE); + return self->priv->longitude; +} + +/** + * gdata_georss_where_set_latitude: + * @self: a #GDataGeoRSSWhere + * @latitude: the new latitude coordinate, or %G_MAXDOUBLE + * + * Sets the #GDataGeoRSSWhere:latitude property to @latitude. + * + * Valid values range from -90.0 to 90.0 inclusive. + * Set @latitude to %G_MAXDOUBLE to unset it. + * + * Since: 0.5.0 + */ +void +gdata_georss_where_set_latitude (GDataGeoRSSWhere *self, gdouble latitude) +{ + g_return_if_fail (GDATA_IS_GEORSS_WHERE (self)); + + if (latitude < -90.0 || latitude > 90.0) + self->priv->latitude = G_MAXDOUBLE; + else + self->priv->latitude = latitude; +} + +/** + * gdata_georss_where_set_longitude: + * @self: a #GDataGeoRSSWhere + * @longitude: the new longitude coordinate, or %G_MAXDOUBLE + * + * Sets the #GDataGeoRSSWhere:longitude property to @longitude. + * + * Valid values range from -180.0 to 180.0 inclusive. + * Set @longitude to %G_MAXDOUBLE to unset it. + * + * Since: 0.5.0 + */ +void +gdata_georss_where_set_longitude (GDataGeoRSSWhere *self, gdouble longitude) +{ + g_return_if_fail (GDATA_IS_GEORSS_WHERE (self)); + + if (longitude < -180.0 || longitude > 180.0) + self->priv->longitude = G_MAXDOUBLE; + else + self->priv->longitude = longitude; +} diff --git a/gdata/georss/gdata-georss-where.h b/gdata/georss/gdata-georss-where.h new file mode 100644 index 0000000..a949bb0 --- /dev/null +++ b/gdata/georss/gdata-georss-where.h @@ -0,0 +1,77 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_GEORSS_WHERE_H +#define GDATA_GEORSS_WHERE_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_GEORSS_WHERE (gdata_georss_where_get_type ()) +#define GDATA_GEORSS_WHERE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_GEORSS_WHERE, GDataGeoRSSWhere)) +#define GDATA_GEORSS_WHERE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_GEORSS_WHERE, GDataGeoRSSWhereClass)) +#define GDATA_IS_GEORSS_WHERE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_GEORSS_WHERE)) +#define GDATA_IS_GEORSS_WHERE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_GEORSS_WHERE)) +#define GDATA_GEORSS_WHERE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_GEORSS_WHERE, GDataGeoRSSWhereClass)) + +typedef struct _GDataGeoRSSWherePrivate GDataGeoRSSWherePrivate; + +/** + * GDataGeoRSSWhere: + * + * All the fields in the #GDataGeoRSSWhere structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + GDataParsable parent; + GDataGeoRSSWherePrivate *priv; +} GDataGeoRSSWhere; + +/** + * GDataGeoRSSWhereClass: + * + * All the fields in the #GDataGeoRSSWhereClass structure are private and should never be accessed directly. + * + * Since: 0.5.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataGeoRSSWhereClass; + +GType gdata_georss_where_get_type (void) G_GNUC_CONST; + +gdouble gdata_georss_where_get_latitude (GDataGeoRSSWhere *self) G_GNUC_PURE; +gdouble gdata_georss_where_get_longitude (GDataGeoRSSWhere *self) G_GNUC_PURE; +void gdata_georss_where_set_latitude (GDataGeoRSSWhere *self, gdouble latitude); +void gdata_georss_where_set_longitude (GDataGeoRSSWhere *self, gdouble longitude); + +G_END_DECLS + +#endif /* !GDATA_GEORSS_WHERE_H */ diff --git a/gdata/media/gdata-media-category.c b/gdata/media/gdata-media-category.c new file mode 100644 index 0000000..da7e156 --- /dev/null +++ b/gdata/media/gdata-media-category.c @@ -0,0 +1,388 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-media-category + * @short_description: Media RSS category element + * @stability: Stable + * @include: gdata/media/gdata-media-category.h + * + * #GDataMediaCategory represents a "category" element from the + * Media RSS specification. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-media-category.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-types.h" + +static void gdata_media_category_finalize (GObject *object); +static void gdata_media_category_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_media_category_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataMediaCategoryPrivate { + gchar *category; + gchar *scheme; + gchar *label; +}; + +enum { + PROP_CATEGORY = 1, + PROP_SCHEME, + PROP_LABEL +}; + +G_DEFINE_TYPE (GDataMediaCategory, gdata_media_category, GDATA_TYPE_PARSABLE) + +static void +gdata_media_category_class_init (GDataMediaCategoryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataMediaCategoryPrivate)); + + gobject_class->get_property = gdata_media_category_get_property; + gobject_class->set_property = gdata_media_category_set_property; + gobject_class->finalize = gdata_media_category_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "category"; + parsable_class->element_namespace = "media"; + + /** + * GDataMediaCategory:category: + * + * The category name. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_CATEGORY, + g_param_spec_string ("category", + "Category", "The category name.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaCategory:scheme: + * + * A URI that identifies the categorization scheme. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_SCHEME, + g_param_spec_string ("scheme", + "Scheme", "A URI that identifies the categorization scheme.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaCategory:label: + * + * A human-readable label that can be displayed in end-user applications. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LABEL, + g_param_spec_string ("label", + "Label", "A human-readable label that can be displayed in end-user applications.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_media_category_init (GDataMediaCategory *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_MEDIA_CATEGORY, GDataMediaCategoryPrivate); +} + +static void +gdata_media_category_finalize (GObject *object) +{ + GDataMediaCategoryPrivate *priv = GDATA_MEDIA_CATEGORY (object)->priv; + + g_free (priv->category); + g_free (priv->scheme); + g_free (priv->label); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_media_category_parent_class)->finalize (object); +} + +static void +gdata_media_category_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataMediaCategoryPrivate *priv = GDATA_MEDIA_CATEGORY (object)->priv; + + switch (property_id) { + case PROP_CATEGORY: + g_value_set_string (value, priv->category); + break; + case PROP_SCHEME: + g_value_set_string (value, priv->scheme); + break; + case PROP_LABEL: + g_value_set_string (value, priv->label); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_media_category_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataMediaCategory *self = GDATA_MEDIA_CATEGORY (object); + + switch (property_id) { + case PROP_CATEGORY: + gdata_media_category_set_category (self, g_value_get_string (value)); + break; + case PROP_SCHEME: + gdata_media_category_set_scheme (self, g_value_get_string (value)); + break; + case PROP_LABEL: + gdata_media_category_set_label (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + GDataMediaCategoryPrivate *priv = GDATA_MEDIA_CATEGORY (parsable)->priv; + xmlChar *category, *scheme; + + category = xmlNodeListGetString (doc, root_node->children, TRUE); + if (category == NULL || *category == '\0') { + xmlFree (category); + return gdata_parser_error_required_content_missing (root_node, error); + } + + scheme = xmlGetProp (root_node, (xmlChar*) "scheme"); + if (scheme != NULL && *scheme == '\0') { + xmlFree (scheme); + xmlFree (category); + return gdata_parser_error_required_property_missing (root_node, "scheme", error); + } else if (scheme == NULL) { + /* Default */ + scheme = xmlStrdup ((xmlChar*) "http://video.search.yahoo.com/mrss/category_schema"); + } + + priv->category = (gchar*) category; + priv->scheme = (gchar*) scheme; + priv->label = (gchar*) xmlGetProp (root_node, (xmlChar*) "label"); + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + /* Textual content's handled in pre_parse_xml */ + if (node->type != XML_ELEMENT_NODE) + return TRUE; + + return GDATA_PARSABLE_CLASS (gdata_media_category_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataMediaCategoryPrivate *priv = GDATA_MEDIA_CATEGORY (parsable)->priv; + + if (priv->scheme != NULL) + gdata_parser_string_append_escaped (xml_string, " scheme='", priv->scheme, "'"); + if (priv->label != NULL) + gdata_parser_string_append_escaped (xml_string, " label='", priv->label, "'"); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + gdata_parser_string_append_escaped (xml_string, NULL, GDATA_MEDIA_CATEGORY (parsable)->priv->category, NULL); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "media", (gchar*) "http://search.yahoo.com/mrss/"); +} + +/** + * gdata_media_category_new: + * @category: a category describing the content + * @scheme: (allow-none): a URI identifying the categorisation scheme, or %NULL + * @label: (allow-none): a human-readable name for the category, or %NULL + * + * Creates a new #GDataMediaCategory. More information is available in the Media RSS specification. + * + * Return value: a new #GDataMediaCategory, or %NULL; unref with g_object_unref() + */ +GDataMediaCategory * +gdata_media_category_new (const gchar *category, const gchar *scheme, const gchar *label) +{ + g_return_val_if_fail (category != NULL && *category != '\0', NULL); + g_return_val_if_fail (scheme == NULL || *scheme != '\0', NULL); + return g_object_new (GDATA_TYPE_MEDIA_CATEGORY, "category", category, "scheme", scheme, "label", label, NULL); +} + +/** + * gdata_media_category_get_category: + * @self: a #GDataMediaCategory + * + * Gets the #GDataMediaCategory:category property. + * + * Return value: the actual category + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_category_get_category (GDataMediaCategory *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CATEGORY (self), NULL); + return self->priv->category; +} + +/** + * gdata_media_category_set_category: + * @self: a #GDataMediaCategory + * @category: the new category + * + * Sets the #GDataMediaCategory:category property to @category. + * + * Since: 0.4.0 + */ +void +gdata_media_category_set_category (GDataMediaCategory *self, const gchar *category) +{ + g_return_if_fail (GDATA_IS_MEDIA_CATEGORY (self)); + g_return_if_fail (category != NULL && *category != '\0'); + + g_free (self->priv->category); + self->priv->category = g_strdup (category); + g_object_notify (G_OBJECT (self), "category"); +} + +/** + * gdata_media_category_get_scheme: + * @self: a #GDataMediaCategory + * + * Gets the #GDataMediaCategory:scheme property. + * + * Return value: the category's scheme, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_category_get_scheme (GDataMediaCategory *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CATEGORY (self), NULL); + return self->priv->scheme; +} + +/** + * gdata_media_category_set_scheme: + * @self: a #GDataMediaCategory + * @scheme: (allow-none): the category's new scheme, or %NULL + * + * Sets the #GDataMediaCategory:scheme property to @scheme. + * + * Set @scheme to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_media_category_set_scheme (GDataMediaCategory *self, const gchar *scheme) +{ + g_return_if_fail (GDATA_IS_MEDIA_CATEGORY (self)); + g_return_if_fail (scheme == NULL || *scheme != '\0'); + + if (scheme == NULL) + scheme = "http://video.search.yahoo.com/mrss/category_schema"; + + g_free (self->priv->scheme); + self->priv->scheme = g_strdup (scheme); + g_object_notify (G_OBJECT (self), "scheme"); +} + +/** + * gdata_media_category_get_label: + * @self: a #GDataMediaCategory + * + * Gets the #GDataMediaCategory:label property. + * + * Return value: the category's label, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_category_get_label (GDataMediaCategory *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CATEGORY (self), NULL); + return self->priv->label; +} + +/** + * gdata_media_category_set_label: + * @self: a #GDataMediaCategory + * @label: (allow-none): the category's new label, or %NULL + * + * Sets the #GDataMediaCategory:label property to @label. + * + * Set @label to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_media_category_set_label (GDataMediaCategory *self, const gchar *label) +{ + g_return_if_fail (GDATA_IS_MEDIA_CATEGORY (self)); + + g_free (self->priv->label); + self->priv->label = g_strdup (label); + g_object_notify (G_OBJECT (self), "label"); +} diff --git a/gdata/media/gdata-media-category.h b/gdata/media/gdata-media-category.h new file mode 100644 index 0000000..0715fe3 --- /dev/null +++ b/gdata/media/gdata-media-category.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_MEDIA_CATEGORY_H +#define GDATA_MEDIA_CATEGORY_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_MEDIA_CATEGORY (gdata_media_category_get_type ()) +#define GDATA_MEDIA_CATEGORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_MEDIA_CATEGORY, GDataMediaCategory)) +#define GDATA_MEDIA_CATEGORY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_MEDIA_CATEGORY, GDataMediaCategoryClass)) +#define GDATA_IS_MEDIA_CATEGORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_MEDIA_CATEGORY)) +#define GDATA_IS_MEDIA_CATEGORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_MEDIA_CATEGORY)) +#define GDATA_MEDIA_CATEGORY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_MEDIA_CATEGORY, GDataMediaCategoryClass)) + +typedef struct _GDataMediaCategoryPrivate GDataMediaCategoryPrivate; + +/** + * GDataMediaCategory: + * + * All the fields in the #GDataMediaCategory structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataMediaCategoryPrivate *priv; +} GDataMediaCategory; + +/** + * GDataMediaCategoryClass: + * + * All the fields in the #GDataMediaCategoryClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataMediaCategoryClass; + +GType gdata_media_category_get_type (void) G_GNUC_CONST; + +GDataMediaCategory *gdata_media_category_new (const gchar *category, const gchar *scheme, const gchar *label) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_media_category_get_category (GDataMediaCategory *self) G_GNUC_PURE; +void gdata_media_category_set_category (GDataMediaCategory *self, const gchar *category); + +const gchar *gdata_media_category_get_scheme (GDataMediaCategory *self) G_GNUC_PURE; +void gdata_media_category_set_scheme (GDataMediaCategory *self, const gchar *scheme); + +const gchar *gdata_media_category_get_label (GDataMediaCategory *self) G_GNUC_PURE; +void gdata_media_category_set_label (GDataMediaCategory *self, const gchar *label); + +G_END_DECLS + +#endif /* !GDATA_MEDIA_CATEGORY_H */ diff --git a/gdata/media/gdata-media-content.c b/gdata/media/gdata-media-content.c new file mode 100644 index 0000000..50a35d3 --- /dev/null +++ b/gdata/media/gdata-media-content.c @@ -0,0 +1,573 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-media-content + * @short_description: Media RSS content element + * @stability: Stable + * @include: gdata/media/gdata-media-content.h + * + * #GDataMediaContent represents a "content" element from the + * Media RSS specification. + * + * The class only implements parsing, not XML output, at the moment. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-media-content.h" +#include "gdata-download-stream.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-media-enums.h" +#include "gdata-private.h" + +static void gdata_media_content_finalize (GObject *object); +static void gdata_media_content_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataMediaContentPrivate { + gchar *uri; + gsize filesize; + gchar *content_type; + GDataMediaMedium medium; + gboolean is_default; + GDataMediaExpression expression; + gint64 duration; + guint height; + guint width; + /* TODO: implement other properties from the Media RSS standard */ +}; + +enum { + PROP_URI = 1, + PROP_FILESIZE, + PROP_CONTENT_TYPE, + PROP_MEDIUM, + PROP_IS_DEFAULT, + PROP_EXPRESSION, + PROP_DURATION, + PROP_HEIGHT, + PROP_WIDTH +}; + +G_DEFINE_TYPE (GDataMediaContent, gdata_media_content, GDATA_TYPE_PARSABLE) + +static void +gdata_media_content_class_init (GDataMediaContentClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataMediaContentPrivate)); + + gobject_class->get_property = gdata_media_content_get_property; + gobject_class->finalize = gdata_media_content_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "content"; + parsable_class->element_namespace = "media"; + + /** + * GDataMediaContent:uri: + * + * The direct URI to the media object. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", + "URI", "The direct URI to the media object.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaContent:filesize: + * + * The number of bytes of the media object. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_FILESIZE, + g_param_spec_ulong ("filesize", + "Filesize", "The number of bytes of the media object.", + 0, G_MAXULONG, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaContent:content-type: + * + * The standard MIME type of the object. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_CONTENT_TYPE, + g_param_spec_string ("content-type", + "Content type", "The standard MIME type of the object.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaContent:medium: + * + * The type of object, complementing #GDataMediaContent:content-type. It allows the consuming application to make simpler decisions between + * different content objects, based on whether they're a video or audio stream, for example. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_MEDIUM, + g_param_spec_enum ("medium", + "Medium", "The type of object.", + GDATA_TYPE_MEDIA_MEDIUM, GDATA_MEDIA_UNKNOWN, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaContent:is-default: + * + * Determines if this is the default content for the media group. There should only be one default object per media group. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_DEFAULT, + g_param_spec_boolean ("is-default", + "Default?", "Determines if this is the default content for the media group.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaContent:expression: + * + * Determines if the object is a sample or the full version of the object, or even if it is a continuous stream. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_EXPRESSION, + g_param_spec_enum ("expression", + "Expression", "Determines if the object is a sample or the full version of the object.", + GDATA_TYPE_MEDIA_EXPRESSION, GDATA_MEDIA_EXPRESSION_FULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaContent:duration: + * + * The number of seconds for which the media object plays. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_DURATION, + g_param_spec_int64 ("duration", + "Duration", "The number of seconds for which the media object plays.", + 0, G_MAXINT64, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaContent:height: + * + * The height of the media object. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_HEIGHT, + g_param_spec_uint ("height", + "Height", "The height of the media object.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaContent:width: + * + * The width of the media object. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_WIDTH, + g_param_spec_uint ("width", + "Width", "The width of the media object.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_media_content_init (GDataMediaContent *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_MEDIA_CONTENT, GDataMediaContentPrivate); +} + +static void +gdata_media_content_finalize (GObject *object) +{ + GDataMediaContentPrivate *priv = GDATA_MEDIA_CONTENT (object)->priv; + + g_free (priv->uri); + g_free (priv->content_type); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_media_content_parent_class)->finalize (object); +} + +static void +gdata_media_content_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataMediaContentPrivate *priv = GDATA_MEDIA_CONTENT (object)->priv; + + switch (property_id) { + case PROP_URI: + g_value_set_string (value, priv->uri); + break; + case PROP_FILESIZE: + g_value_set_ulong (value, priv->filesize); + break; + case PROP_CONTENT_TYPE: + g_value_set_string (value, priv->content_type); + break; + case PROP_MEDIUM: + g_value_set_enum (value, priv->medium); + break; + case PROP_IS_DEFAULT: + g_value_set_boolean (value, priv->is_default); + break; + case PROP_EXPRESSION: + g_value_set_enum (value, priv->expression); + break; + case PROP_DURATION: + g_value_set_int64 (value, priv->duration); + break; + case PROP_HEIGHT: + g_value_set_uint (value, priv->height); + break; + case PROP_WIDTH: + g_value_set_uint (value, priv->width); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + GDataMediaContentPrivate *priv = GDATA_MEDIA_CONTENT (parsable)->priv; + xmlChar *uri, *expression, *medium, *duration, *filesize, *height, *width; + gboolean is_default_bool; + GDataMediaExpression expression_enum; + GDataMediaMedium medium_enum; + guint height_uint, width_uint; + gint64 duration_int64; + gulong filesize_ulong; + + /* Parse isDefault */ + if (gdata_parser_boolean_from_property (root_node, "isDefault", &is_default_bool, 0, error) == FALSE) + return FALSE; + + /* Parse expression */ + expression = xmlGetProp (root_node, (xmlChar*) "expression"); + if (expression == NULL || xmlStrcmp (expression, (xmlChar*) "full") == 0) { + expression_enum = GDATA_MEDIA_EXPRESSION_FULL; + } else if (xmlStrcmp (expression, (xmlChar*) "sample") == 0) { + expression_enum = GDATA_MEDIA_EXPRESSION_SAMPLE; + } else if (xmlStrcmp (expression, (xmlChar*) "nonstop") == 0) { + expression_enum = GDATA_MEDIA_EXPRESSION_NONSTOP; + } else { + gdata_parser_error_unknown_property_value (root_node, "expression", (gchar*) expression, error); + xmlFree (expression); + return FALSE; + } + xmlFree (expression); + + /* Parse medium */ + medium = xmlGetProp (root_node, (xmlChar*) "medium"); + if (medium == NULL) { + medium_enum = GDATA_MEDIA_UNKNOWN; + } else if (xmlStrcmp (medium, (xmlChar*) "image") == 0) { + medium_enum = GDATA_MEDIA_IMAGE; + } else if (xmlStrcmp (medium, (xmlChar*) "audio") == 0) { + medium_enum = GDATA_MEDIA_AUDIO; + } else if (xmlStrcmp (medium, (xmlChar*) "video") == 0) { + medium_enum = GDATA_MEDIA_VIDEO; + } else if (xmlStrcmp (medium, (xmlChar*) "document") == 0) { + medium_enum = GDATA_MEDIA_DOCUMENT; + } else if (xmlStrcmp (medium, (xmlChar*) "executable") == 0) { + medium_enum = GDATA_MEDIA_EXECUTABLE; + } else { + gdata_parser_error_unknown_property_value (root_node, "medium", (gchar*) medium, error); + xmlFree (medium); + return FALSE; + } + xmlFree (medium); + + /* Parse duration */ + duration = xmlGetProp (root_node, (xmlChar*) "duration"); + duration_int64 = (duration == NULL) ? 0 : g_ascii_strtoll ((gchar*) duration, NULL, 10); + xmlFree (duration); + + /* Parse filesize */ + filesize = xmlGetProp (root_node, (xmlChar*) "fileSize"); + filesize_ulong = (filesize == NULL) ? 0 : g_ascii_strtoull ((gchar*) filesize, NULL, 10); + xmlFree (filesize); + + /* Parse height and width */ + height = xmlGetProp (root_node, (xmlChar*) "height"); + height_uint = (height == NULL) ? 0 : g_ascii_strtoull ((gchar*) height, NULL, 10); + xmlFree (height); + + width = xmlGetProp (root_node, (xmlChar*) "width"); + width_uint = (width == NULL) ? 0 : g_ascii_strtoull ((gchar*) width, NULL, 10); + xmlFree (width); + + /* Other properties */ + uri = xmlGetProp (root_node, (xmlChar*) "url"); + if (uri != NULL && *uri == '\0') { + xmlFree (uri); + return gdata_parser_error_required_property_missing (root_node, "url", error); + } + + priv->uri = (gchar*) uri; + priv->filesize = filesize_ulong; + priv->content_type = (gchar*) xmlGetProp (root_node, (xmlChar*) "type"); + priv->medium = medium_enum; + priv->is_default = is_default_bool; + priv->expression = expression_enum; + priv->duration = duration_int64; + priv->height = height_uint; + priv->width = width_uint; + + return TRUE; +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "media", (gchar*) "http://search.yahoo.com/mrss/"); +} + +/** + * gdata_media_content_get_uri: + * @self: a #GDataMediaContent + * + * Gets the #GDataMediaContent:uri property. + * + * Return value: the content's URI + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_content_get_uri (GDataMediaContent *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), NULL); + return self->priv->uri; +} + +/** + * gdata_media_content_get_filesize: + * @self: a #GDataMediaContent + * + * Gets the #GDataMediaContent:filesize property. + * + * Return value: the number of bytes in the content, or 0 + * + * Since: 0.4.0 + */ +gsize +gdata_media_content_get_filesize (GDataMediaContent *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), 0); + return self->priv->filesize; +} + +/** + * gdata_media_content_get_content_type: + * @self: a #GDataMediaContent + * + * Gets the #GDataMediaContent:content-type property. + * + * Return value: the content's content (MIME) type, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_content_get_content_type (GDataMediaContent *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), NULL); + return self->priv->content_type; +} + +/** + * gdata_media_content_get_medium: + * @self: a #GDataMediaContent + * + * Gets the #GDataMediaContent:medium property. + * + * Return value: the type of the content, or %GDATA_MEDIA_UNKNOWN + * + * Since: 0.4.0 + */ +GDataMediaMedium +gdata_media_content_get_medium (GDataMediaContent *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), GDATA_MEDIA_UNKNOWN); + return self->priv->medium; +} + +/** + * gdata_media_content_is_default: + * @self: a #GDataMediaContent + * + * Gets the #GDataMediaContent:is-default property. + * + * Return value: %TRUE if the #GDataMediaContent is the default content for the media group, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_media_content_is_default (GDataMediaContent *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), FALSE); + return self->priv->is_default; +} + +/** + * gdata_media_content_get_expression: + * @self: a #GDataMediaContent + * + * Gets the #GDataMediaContent:expression property. + * + * Return value: the content's expression, or %GDATA_MEDIA_EXPRESSION_FULL + * + * Since: 0.4.0 + */ +GDataMediaExpression +gdata_media_content_get_expression (GDataMediaContent *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), GDATA_MEDIA_EXPRESSION_FULL); + return self->priv->expression; +} + +/** + * gdata_media_content_get_duration: + * @self: a #GDataMediaContent + * + * Gets the #GDataMediaContent:duration property. + * + * Return value: the content's duration in seconds, or 0 + * + * Since: 0.4.0 + */ +gint64 +gdata_media_content_get_duration (GDataMediaContent *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), 0); + return self->priv->duration; +} + +/** + * gdata_media_content_get_height: + * @self: a #GDataMediaContent + * + * Gets the #GDataMediaContent:height property. + * + * Return value: the content's height in pixels, or 0 + * + * Since: 0.4.0 + */ +guint +gdata_media_content_get_height (GDataMediaContent *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), 0); + return self->priv->height; +} + +/** + * gdata_media_content_get_width: + * @self: a #GDataMediaContent + * + * Gets the #GDataMediaContent:width property. + * + * Return value: the content's width in pixels, or 0 + * + * Since: 0.4.0 + */ +guint +gdata_media_content_get_width (GDataMediaContent *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), 0); + return self->priv->width; +} + +/** + * gdata_media_content_download: + * @self: a #GDataMediaContent + * @service: the #GDataService + * @cancellable: (allow-none): a #GCancellable for the entire download stream, or %NULL + * @error: a #GError, or %NULL + * + * Downloads and returns a #GDataDownloadStream allowing the content represented by @self to be read. + * + * To get the content type of the downloaded data, gdata_download_stream_get_content_type() can be called on the returned #GDataDownloadStream. + * Calling gdata_download_stream_get_content_length() on the stream will not return a meaningful result, however, as the stream is encoded in chunks, + * rather than by content length. + * + * In order to cancel the download, a #GCancellable passed in to @cancellable must be cancelled using g_cancellable_cancel(). Cancelling the individual + * #GInputStream operations on the #GDataDownloadStream will not cancel the entire download; merely the read or close operation in question. See the + * #GDataDownloadStream:cancellable for more details. + * + * Return value: (transfer full): a #GDataDownloadStream to download the content with, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataDownloadStream * +gdata_media_content_download (GDataMediaContent *self, GDataService *service, GCancellable *cancellable, GError **error) +{ + const gchar *src_uri; + + g_return_val_if_fail (GDATA_IS_MEDIA_CONTENT (self), NULL); + g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* We keep a GError in the argument list so that we can add authentication errors, etc., in future if necessary */ + + /* Get the download URI and create a stream for it */ + src_uri = gdata_media_content_get_uri (self); + return GDATA_DOWNLOAD_STREAM (gdata_download_stream_new (service, NULL, src_uri, cancellable)); +} diff --git a/gdata/media/gdata-media-content.h b/gdata/media/gdata-media-content.h new file mode 100644 index 0000000..c7c4954 --- /dev/null +++ b/gdata/media/gdata-media-content.h @@ -0,0 +1,121 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_MEDIA_CONTENT_H +#define GDATA_MEDIA_CONTENT_H + +#include +#include + +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDataMediaExpression: + * @GDATA_MEDIA_EXPRESSION_SAMPLE: the media is a sample of a larger video + * @GDATA_MEDIA_EXPRESSION_FULL: the media is the full version + * @GDATA_MEDIA_EXPRESSION_NONSTOP: the media is a continuous stream + * + * An enum representing the possible values of #GDataMediaContent:expression. + */ +typedef enum { + GDATA_MEDIA_EXPRESSION_SAMPLE, + GDATA_MEDIA_EXPRESSION_FULL, + GDATA_MEDIA_EXPRESSION_NONSTOP +} GDataMediaExpression; + +/** + * GDataMediaMedium: + * @GDATA_MEDIA_UNKNOWN: the type of the media is unknown + * @GDATA_MEDIA_IMAGE: the media is an image + * @GDATA_MEDIA_AUDIO: the media is an audio stream + * @GDATA_MEDIA_VIDEO: the media is a video + * @GDATA_MEDIA_DOCUMENT: the media is another type of document + * @GDATA_MEDIA_EXECUTABLE: the media is an executable file + * + * An enum representing the possible values of #GDataMediaContent:medium. + * + * Since: 0.4.0 + */ +typedef enum { + GDATA_MEDIA_UNKNOWN, + GDATA_MEDIA_IMAGE, + GDATA_MEDIA_AUDIO, + GDATA_MEDIA_VIDEO, + GDATA_MEDIA_DOCUMENT, + GDATA_MEDIA_EXECUTABLE +} GDataMediaMedium; + +#define GDATA_TYPE_MEDIA_CONTENT (gdata_media_content_get_type ()) +#define GDATA_MEDIA_CONTENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_MEDIA_CONTENT, GDataMediaContent)) +#define GDATA_MEDIA_CONTENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_MEDIA_CONTENT, GDataMediaContentClass)) +#define GDATA_IS_MEDIA_CONTENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_MEDIA_CONTENT)) +#define GDATA_IS_MEDIA_CONTENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_MEDIA_CONTENT)) +#define GDATA_MEDIA_CONTENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_MEDIA_CONTENT, GDataMediaContentClass)) + +typedef struct _GDataMediaContentPrivate GDataMediaContentPrivate; + +/** + * GDataMediaContent: + * + * All the fields in the #GDataMediaContent structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataMediaContentPrivate *priv; +} GDataMediaContent; + +/** + * GDataMediaContentClass: + * + * All the fields in the #GDataMediaContentClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataMediaContentClass; + +GType gdata_media_content_get_type (void) G_GNUC_CONST; + +const gchar *gdata_media_content_get_uri (GDataMediaContent *self) G_GNUC_PURE; +gsize gdata_media_content_get_filesize (GDataMediaContent *self) G_GNUC_PURE; +const gchar *gdata_media_content_get_content_type (GDataMediaContent *self) G_GNUC_PURE; +GDataMediaMedium gdata_media_content_get_medium (GDataMediaContent *self) G_GNUC_PURE; +gboolean gdata_media_content_is_default (GDataMediaContent *self) G_GNUC_PURE; +GDataMediaExpression gdata_media_content_get_expression (GDataMediaContent *self) G_GNUC_PURE; +gint64 gdata_media_content_get_duration (GDataMediaContent *self) G_GNUC_PURE; +guint gdata_media_content_get_height (GDataMediaContent *self) G_GNUC_PURE; +guint gdata_media_content_get_width (GDataMediaContent *self) G_GNUC_PURE; + +GDataDownloadStream *gdata_media_content_download (GDataMediaContent *self, GDataService *service, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_MEDIA_CONTENT_H */ diff --git a/gdata/media/gdata-media-credit.c b/gdata/media/gdata-media-credit.c new file mode 100644 index 0000000..de20677 --- /dev/null +++ b/gdata/media/gdata-media-credit.c @@ -0,0 +1,268 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-media-credit + * @short_description: Media RSS credit element + * @stability: Stable + * @include: gdata/media/gdata-media-credit.h + * + * #GDataMediaCredit represents a "credit" element from the + * Media RSS specification. + * + * The class only implements parsing, not XML output, at the moment. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-media-credit.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-types.h" + +static void gdata_media_credit_finalize (GObject *object); +static void gdata_media_credit_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataMediaCreditPrivate { + gchar *credit; + gchar *scheme; + gchar *role; +}; + +enum { + PROP_CREDIT = 1, + PROP_SCHEME, + PROP_ROLE +}; + +G_DEFINE_TYPE (GDataMediaCredit, gdata_media_credit, GDATA_TYPE_PARSABLE) + +static void +gdata_media_credit_class_init (GDataMediaCreditClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataMediaCreditPrivate)); + + gobject_class->get_property = gdata_media_credit_get_property; + gobject_class->finalize = gdata_media_credit_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "credit"; + parsable_class->element_namespace = "media"; + + /** + * GDataMediaCredit:credit: + * + * The credited entity's name. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_CREDIT, + g_param_spec_string ("credit", + "Credit", "The credited entity's name.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaCredit:scheme: + * + * A URI that identifies the role scheme. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_SCHEME, + g_param_spec_string ("scheme", + "Scheme", "A URI that identifies the role scheme.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaCredit:role: + * + * The role the credited entity played in the production of the media. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_ROLE, + g_param_spec_string ("role", + "Role", "The role the credited entity played in the production of the media.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_media_credit_init (GDataMediaCredit *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_MEDIA_CREDIT, GDataMediaCreditPrivate); +} + +static void +gdata_media_credit_finalize (GObject *object) +{ + GDataMediaCreditPrivate *priv = GDATA_MEDIA_CREDIT (object)->priv; + + g_free (priv->credit); + g_free (priv->scheme); + g_free (priv->role); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_media_credit_parent_class)->finalize (object); +} + +static void +gdata_media_credit_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataMediaCreditPrivate *priv = GDATA_MEDIA_CREDIT (object)->priv; + + switch (property_id) { + case PROP_CREDIT: + g_value_set_string (value, priv->credit); + break; + case PROP_SCHEME: + g_value_set_string (value, priv->scheme); + break; + case PROP_ROLE: + g_value_set_string (value, priv->role); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + GDataMediaCreditPrivate *priv = GDATA_MEDIA_CREDIT (parsable)->priv; + xmlChar *credit; + gchar *scheme; + guint i; + + credit = xmlNodeListGetString (doc, root_node->children, TRUE); + if (credit == NULL || *credit == '\0') { + xmlFree (credit); + return gdata_parser_error_required_content_missing (root_node, error); + } + + scheme = (gchar*) xmlGetProp (root_node, (xmlChar*) "scheme"); + if (scheme != NULL && *scheme == '\0') { + g_free (scheme); + xmlFree (credit); + return gdata_parser_error_required_property_missing (root_node, "scheme", error); + } else if (scheme == NULL) { + /* Default */ + scheme = g_strdup ("urn:ebu"); + } + + priv->credit = (gchar*) credit; + priv->scheme = scheme; + priv->role = (gchar*) xmlGetProp (root_node, (xmlChar*) "role"); + + /* Convert the role to lower case */ + if (priv->role != NULL) { + for (i = 0; priv->role[i] != '\0'; i++) + priv->role[i] = g_ascii_tolower (priv->role[i]); + } + + return TRUE; +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + /* Textual content's handled in pre_parse_xml */ + if (node->type != XML_ELEMENT_NODE) + return TRUE; + + return GDATA_PARSABLE_CLASS (gdata_media_credit_parent_class)->parse_xml (parsable, doc, node, user_data, error); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "media", (gchar*) "http://search.yahoo.com/mrss/"); +} + +/** + * gdata_media_credit_get_credit: + * @self: a #GDataMediaCredit + * + * Gets the #GDataMediaCredit:credit property. + * + * Return value: the name of the credited entity + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_credit_get_credit (GDataMediaCredit *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CREDIT (self), NULL); + return self->priv->credit; +} + +/** + * gdata_media_credit_get_scheme: + * @self: a #GDataMediaCredit + * + * Gets the #GDataMediaCredit:scheme property. + * + * Return value: the credit's role scheme, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_credit_get_scheme (GDataMediaCredit *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CREDIT (self), NULL); + return self->priv->scheme; +} + +/** + * gdata_media_credit_get_role: + * @self: a #GDataMediaCredit + * + * Gets the #GDataMediaCredit:role property. + * + * Return value: the credited entity's role, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_credit_get_role (GDataMediaCredit *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_CREDIT (self), NULL); + return self->priv->role; +} diff --git a/gdata/media/gdata-media-credit.h b/gdata/media/gdata-media-credit.h new file mode 100644 index 0000000..a8b054e --- /dev/null +++ b/gdata/media/gdata-media-credit.h @@ -0,0 +1,74 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_MEDIA_CREDIT_H +#define GDATA_MEDIA_CREDIT_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_MEDIA_CREDIT (gdata_media_credit_get_type ()) +#define GDATA_MEDIA_CREDIT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_MEDIA_CREDIT, GDataMediaCredit)) +#define GDATA_MEDIA_CREDIT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_MEDIA_CREDIT, GDataMediaCreditClass)) +#define GDATA_IS_MEDIA_CREDIT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_MEDIA_CREDIT)) +#define GDATA_IS_MEDIA_CREDIT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_MEDIA_CREDIT)) +#define GDATA_MEDIA_CREDIT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_MEDIA_CREDIT, GDataMediaCreditClass)) + +typedef struct _GDataMediaCreditPrivate GDataMediaCreditPrivate; + +/** + * GDataMediaCredit: + * + * All the fields in the #GDataMediaCredit structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataMediaCreditPrivate *priv; +} GDataMediaCredit; + +/** + * GDataMediaCreditClass: + * + * All the fields in the #GDataMediaCreditClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataMediaCreditClass; + +GType gdata_media_credit_get_type (void) G_GNUC_CONST; + +const gchar *gdata_media_credit_get_credit (GDataMediaCredit *self) G_GNUC_PURE; +const gchar *gdata_media_credit_get_scheme (GDataMediaCredit *self) G_GNUC_PURE; +const gchar *gdata_media_credit_get_role (GDataMediaCredit *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_MEDIA_CREDIT_H */ diff --git a/gdata/media/gdata-media-enums.c b/gdata/media/gdata-media-enums.c new file mode 100644 index 0000000..1116b95 --- /dev/null +++ b/gdata/media/gdata-media-enums.c @@ -0,0 +1,43 @@ + + + +#include "gdata-media-content.h" +#include "gdata-media-enums.h" + +/* enumerations from "/opt/gnome/source/libgdata/gdata/media/gdata-media-content.h" */ +GType +gdata_media_expression_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_MEDIA_EXPRESSION_SAMPLE, "GDATA_MEDIA_EXPRESSION_SAMPLE", "sample" }, + { GDATA_MEDIA_EXPRESSION_FULL, "GDATA_MEDIA_EXPRESSION_FULL", "full" }, + { GDATA_MEDIA_EXPRESSION_NONSTOP, "GDATA_MEDIA_EXPRESSION_NONSTOP", "nonstop" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataMediaExpression", values); + } + return etype; +} +GType +gdata_media_medium_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_MEDIA_UNKNOWN, "GDATA_MEDIA_UNKNOWN", "unknown" }, + { GDATA_MEDIA_IMAGE, "GDATA_MEDIA_IMAGE", "image" }, + { GDATA_MEDIA_AUDIO, "GDATA_MEDIA_AUDIO", "audio" }, + { GDATA_MEDIA_VIDEO, "GDATA_MEDIA_VIDEO", "video" }, + { GDATA_MEDIA_DOCUMENT, "GDATA_MEDIA_DOCUMENT", "document" }, + { GDATA_MEDIA_EXECUTABLE, "GDATA_MEDIA_EXECUTABLE", "executable" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataMediaMedium", values); + } + return etype; +} + + + diff --git a/gdata/media/gdata-media-enums.h b/gdata/media/gdata-media-enums.h new file mode 100644 index 0000000..77dc180 --- /dev/null +++ b/gdata/media/gdata-media-enums.h @@ -0,0 +1,20 @@ + + + +#ifndef GDATA_MEDIA_ENUMS_H +#define GDATA_MEDIA_ENUMS_H + +#include + +G_BEGIN_DECLS +/* enumerations from "/opt/gnome/source/libgdata/gdata/media/gdata-media-content.h" */ +GType gdata_media_expression_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_MEDIA_EXPRESSION (gdata_media_expression_get_type()) +GType gdata_media_medium_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_MEDIA_MEDIUM (gdata_media_medium_get_type()) +G_END_DECLS + +#endif /* !GDATA_MEDIA_ENUMS_H */ + + + diff --git a/gdata/media/gdata-media-group.c b/gdata/media/gdata-media-group.c new file mode 100644 index 0000000..1ab5be7 --- /dev/null +++ b/gdata/media/gdata-media-group.c @@ -0,0 +1,673 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/* + * SECTION:gdata-media-group + * @short_description: Media RSS group element + * @stability: Stable + * @include: gdata/media/gdata-media-group.h + * + * #GDataMediaGroup represents a "group" element from the + * Media RSS specification. + * + * It is private API, since implementing classes are likely to proxy the properties and functions + * of #GDataMediaGroup as appropriate; most entry types which implement #GDataMediaGroup have no use + * for most of its properties, and it would be unnecessary and confusing to expose #GDataMediaGroup itself. + * + * For this reason, properties have not been implemented on #GDataMediaGroup (yet). + */ + +#include +#include +#include + +#include "gdata-media-group.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-private.h" +#include "media/gdata-media-category.h" +#include "media/gdata-media-credit.h" +#include "media/gdata-media-thumbnail.h" + +static void gdata_media_group_dispose (GObject *object); +static void gdata_media_group_finalize (GObject *object); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataMediaGroupPrivate { + gchar **keywords; + gchar *player_uri; + GHashTable *restricted_countries; + gchar *simple_rating; + gchar *mpaa_rating; + gchar *v_chip_rating; + GList *thumbnails; /* GDataMediaThumbnail */ + gchar *title; + GDataMediaCategory *category; + GList *contents; /* GDataMediaContent */ + GDataMediaCredit *credit; + gchar *description; +}; + +G_DEFINE_TYPE (GDataMediaGroup, gdata_media_group, GDATA_TYPE_PARSABLE) + +static void +gdata_media_group_class_init (GDataMediaGroupClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataMediaGroupPrivate)); + + gobject_class->dispose = gdata_media_group_dispose; + gobject_class->finalize = gdata_media_group_finalize; + + parsable_class->parse_xml = parse_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->element_name = "group"; + parsable_class->element_namespace = "media"; +} + +static void +gdata_media_group_init (GDataMediaGroup *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_MEDIA_GROUP, GDataMediaGroupPrivate); + self->priv->restricted_countries = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); +} + +static void +gdata_media_group_dispose (GObject *object) +{ + GDataMediaGroupPrivate *priv = GDATA_MEDIA_GROUP (object)->priv; + + if (priv->category != NULL) + g_object_unref (priv->category); + priv->category = NULL; + + if (priv->credit != NULL) + g_object_unref (priv->credit); + priv->credit = NULL; + + if (priv->contents != NULL) { + g_list_foreach (priv->contents, (GFunc) g_object_unref, NULL); + g_list_free (priv->contents); + } + priv->contents = NULL; + + if (priv->thumbnails != NULL) { + g_list_foreach (priv->thumbnails, (GFunc) g_object_unref, NULL); + g_list_free (priv->thumbnails); + } + priv->thumbnails = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_media_group_parent_class)->dispose (object); +} + +static void +gdata_media_group_finalize (GObject *object) +{ + GDataMediaGroupPrivate *priv = GDATA_MEDIA_GROUP (object)->priv; + + g_strfreev (priv->keywords); + g_free (priv->player_uri); + g_free (priv->v_chip_rating); + g_free (priv->mpaa_rating); + g_free (priv->simple_rating); + g_hash_table_destroy (priv->restricted_countries); + g_free (priv->title); + g_free (priv->description); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_media_group_parent_class)->finalize (object); +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataMediaGroup *self = GDATA_MEDIA_GROUP (parsable); + + if (gdata_parser_is_namespace (node, "http://search.yahoo.com/mrss/") == TRUE) { + if (gdata_parser_string_from_element (node, "title", P_NONE, &(self->priv->title), &success, error) == TRUE || + gdata_parser_string_from_element (node, "description", P_NONE, &(self->priv->description), &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "category", P_REQUIRED, GDATA_TYPE_MEDIA_CATEGORY, + gdata_media_group_set_category, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "content", P_REQUIRED, GDATA_TYPE_MEDIA_CONTENT, + _gdata_media_group_add_content, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "thumbnail", P_REQUIRED, GDATA_TYPE_MEDIA_THUMBNAIL, + _gdata_media_group_add_thumbnail, self, &success, error) == TRUE || + gdata_parser_object_from_element (node, "credit", P_REQUIRED | P_NO_DUPES, GDATA_TYPE_MEDIA_CREDIT, + &(self->priv->credit), &success, error) == TRUE) { + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "keywords") == 0) { + /* media:keywords */ + guint i; + xmlChar *text = xmlNodeListGetString (node->doc, node->children, TRUE); + + g_strfreev (self->priv->keywords); + if (text == NULL) { + self->priv->keywords = NULL; + return TRUE; + } + + self->priv->keywords = g_strsplit ((gchar*) text, ",", -1); + xmlFree (text); + + for (i = 0; self->priv->keywords[i] != NULL; i++) { + gchar *comma, *start = self->priv->keywords[i]; + gchar *end = start + strlen (start); + + /* Strip any whitespace from the ends of the keyword */ + g_strstrip (start); + + /* Unescape any %2Cs in the keyword to commas in-place */ + while ((comma = g_strstr_len (start, -1, "%2C")) != NULL) { + /* Unescape the comma */ + *comma = ','; + + /* Move forwards, skipping the comma */ + comma++; + end -= 2; + + /* Shift the remainder of the string downwards */ + g_memmove (comma, comma + 2, end - comma); + *end = '\0'; + } + } + } else if (xmlStrcmp (node->name, (xmlChar*) "player") == 0) { + /* media:player */ + xmlChar *player_uri = xmlGetProp (node, (xmlChar*) "url"); + g_free (self->priv->player_uri); + self->priv->player_uri = (gchar*) player_uri; + } else if (xmlStrcmp (node->name, (xmlChar*) "rating") == 0) { + /* media:rating */ + xmlChar *scheme; + + /* The possible schemes are defined here: + * • http://video.search.yahoo.com/mrss + * • http://code.google.com/apis/youtube/2.0/reference.html#youtube_data_api_tag_media:rating + */ + scheme = xmlGetProp (node, (xmlChar*) "scheme"); + + if (scheme == NULL || xmlStrcmp (scheme, (xmlChar*) "urn:simple") == 0) { + /* Options: adult, nonadult */ + gdata_parser_string_from_element (node, "rating", P_REQUIRED | P_NON_EMPTY, &(self->priv->simple_rating), + &success, error); + } else if (xmlStrcmp (scheme, (xmlChar*) "urn:mpaa") == 0) { + /* Options: g, pg, pg-13, r, nc-17 */ + gdata_parser_string_from_element (node, "rating", P_REQUIRED | P_NON_EMPTY, &(self->priv->mpaa_rating), + &success, error); + } else if (xmlStrcmp (scheme, (xmlChar*) "urn:v-chip") == 0) { + /* Options: tv-y, tv-y7, tv-y7-fv, tv-g, tv-pg, tv-14, tv-ma */ + gdata_parser_string_from_element (node, "rating", P_REQUIRED | P_NON_EMPTY, &(self->priv->v_chip_rating), + &success, error); + } else if (xmlStrcmp (scheme, (xmlChar*) "http://gdata.youtube.com/schemas/2007#mediarating") == 0) { + /* No content, but we do get a list of countries. There's nothing like overloading the semantics of XML elements + * to brighten up one's day. */ + xmlChar *countries; + + countries = xmlGetProp (node, (xmlChar*) "country"); + + if (countries != NULL) { + gchar **country_list, **country; + + /* It's either a comma-separated list of countries, or the value "all" */ + country_list = g_strsplit ((const gchar*) countries, ",", -1); + xmlFree (countries); + + /* Add all the listed countries to the restricted countries table */ + for (country = country_list; *country != NULL; country++) { + g_hash_table_insert (self->priv->restricted_countries, *country, GUINT_TO_POINTER (TRUE)); + } + + g_free (country_list); + } else { + /* Assume it's restricted in all countries */ + g_hash_table_insert (self->priv->restricted_countries, g_strdup ("all"), GUINT_TO_POINTER (TRUE)); + } + + success = TRUE; + } else { + /* Error */ + gdata_parser_error_unknown_property_value (node, "scheme", (gchar*) scheme, error); + success = FALSE; + } + + xmlFree (scheme); + + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "restriction") == 0) { + /* media:restriction */ + xmlChar *type, *countries, *relationship; + gchar **country_list, **country; + gboolean relationship_bool; + + /* Check the type property is "country" */ + type = xmlGetProp (node, (xmlChar*) "type"); + if (xmlStrcmp (type, (xmlChar*) "country") != 0) { + gdata_parser_error_unknown_property_value (node, "type", (gchar*) type, error); + xmlFree (type); + return FALSE; + } + xmlFree (type); + + relationship = xmlGetProp (node, (xmlChar*) "relationship"); + if (xmlStrcmp (relationship, (xmlChar*) "allow") == 0) { + relationship_bool = FALSE; /* it's *not* a restricted country */ + } else if (xmlStrcmp (relationship, (xmlChar*) "deny") == 0) { + relationship_bool = TRUE; /* it *is* a restricted country */ + } else { + gdata_parser_error_unknown_property_value (node, "relationship", (gchar*) relationship, error); + xmlFree (relationship); + return FALSE; + } + xmlFree (relationship); + + countries = xmlNodeListGetString (doc, node->children, TRUE); + country_list = g_strsplit ((const gchar*) countries, " ", -1); + xmlFree (countries); + + /* Add "all" to the table, since it's an exception table */ + g_hash_table_insert (self->priv->restricted_countries, g_strdup ("all"), GUINT_TO_POINTER (!relationship_bool)); + + /* Add all the listed countries to the restricted countries table */ + for (country = country_list; *country != NULL; country++) + g_hash_table_insert (self->priv->restricted_countries, *country, GUINT_TO_POINTER (relationship_bool)); + g_free (country_list); + } else { + return GDATA_PARSABLE_CLASS (gdata_media_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else { + return GDATA_PARSABLE_CLASS (gdata_media_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataMediaGroupPrivate *priv = GDATA_MEDIA_GROUP (parsable)->priv; + + /* Media category */ + if (priv->category != NULL) + _gdata_parsable_get_xml (GDATA_PARSABLE (priv->category), xml_string, FALSE); + + if (priv->title != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->title, ""); + + if (priv->description != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->description, ""); + + if (priv->keywords != NULL) { + guint i; + + g_string_append (xml_string, ""); + + /* Add each keyword to the text content, comma-separated from the previous one */ + for (i = 0; priv->keywords[i] != NULL; i++) { + const gchar *comma, *start = priv->keywords[i]; + + /* Delimit the previous keyword */ + if (i != 0) + g_string_append_c (xml_string, ','); + + /* Escape any commas in the keyword to %2C */ + while ((comma = g_utf8_strchr (start, -1, ',')) != NULL) { + /* Copy the span */ + gchar *span = g_strndup (start, comma - start); + gdata_parser_string_append_escaped (xml_string, NULL, span, NULL); + g_free (span); + + /* Add an escaped comma */ + g_string_append (xml_string, "%2C"); + + /* Move forwards, skipping the comma */ + start = comma + 1; + } + + /* Append the rest of the string (the entire string if there were no commas) */ + gdata_parser_string_append_escaped (xml_string, NULL, start, NULL); + } + + g_string_append (xml_string, ""); + } +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "media", (gchar*) "http://search.yahoo.com/mrss/"); +} + +/** + * gdata_media_group_get_title: + * @self: a #GDataMediaGroup + * + * Gets the #GDataMediaGroup:title property. + * + * Return value: the group's title, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_group_get_title (GDataMediaGroup *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + return self->priv->title; +} + +/** + * gdata_media_group_set_title: + * @self: a #GDataMediaGroup + * @title: (allow-none): the group's new title, or %NULL + * + * Sets the #GDataMediaGroup:title property to @title. + * + * Set @title to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_media_group_set_title (GDataMediaGroup *self, const gchar *title) +{ + g_return_if_fail (GDATA_IS_MEDIA_GROUP (self)); + g_free (self->priv->title); + self->priv->title = g_strdup (title); +} + +/** + * gdata_media_group_get_description: + * @self: a #GDataMediaGroup + * + * Gets the #GDataMediaGroup:description property. + * + * Return value: the group's description, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_group_get_description (GDataMediaGroup *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + return self->priv->description; +} + +/** + * gdata_media_group_set_description: + * @self: a #GDataMediaGroup + * @description: (allow-none): the group's new description, or %NULL + * + * Sets the #GDataMediaGroup:description property to @description. + * + * Set @description to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_media_group_set_description (GDataMediaGroup *self, const gchar *description) +{ + g_return_if_fail (GDATA_IS_MEDIA_GROUP (self)); + g_free (self->priv->description); + self->priv->description = g_strdup (description); +} + +/** + * gdata_media_group_get_keywords: + * @self: a #GDataMediaGroup + * + * Gets the #GDataMediaGroup:keywords property. + * + * Return value: (array zero-terminated=1): a %NULL-terminated array of the group's keywords, or %NULL + * + * Since: 0.4.0 + */ +const gchar * const * +gdata_media_group_get_keywords (GDataMediaGroup *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + return (const gchar * const *) self->priv->keywords; +} + +/** + * gdata_media_group_set_keywords: + * @self: a #GDataMediaGroup + * @keywords: (array zero-terminated=1) (allow-none): a %NULL-terminated array of the group's new keywords, or %NULL + * + * Sets the #GDataMediaGroup:keywords property to @keywords. + * + * Set @keywords to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_media_group_set_keywords (GDataMediaGroup *self, const gchar * const *keywords) +{ + g_return_if_fail (GDATA_IS_MEDIA_GROUP (self)); + g_strfreev (self->priv->keywords); + self->priv->keywords = g_strdupv ((gchar**) keywords); +} + +/** + * gdata_media_group_get_category: + * @self: a #GDataMediaGroup + * + * Gets the #GDataMediaGroup:category property. + * + * Return value: a #GDataMediaCategory giving the group's category, or %NULL + */ +GDataMediaCategory * +gdata_media_group_get_category (GDataMediaGroup *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + return self->priv->category; +} + +/** + * gdata_media_group_set_category: + * @self: a #GDataMediaGroup + * @category: (allow-none): a new #GDataMediaCategory, or %NULL + * + * Sets the #GDataMediaGroup:category property to @category, and increments its reference count. + */ +void +gdata_media_group_set_category (GDataMediaGroup *self, GDataMediaCategory *category) +{ + g_return_if_fail (GDATA_IS_MEDIA_GROUP (self)); + g_return_if_fail (category == NULL || GDATA_IS_MEDIA_CATEGORY (category)); + + if (self->priv->category != NULL) + g_object_unref (self->priv->category); + self->priv->category = (category == NULL) ? NULL : g_object_ref (category); +} + +static gint +content_compare_cb (const GDataMediaContent *content, const gchar *type) +{ + return strcmp (gdata_media_content_get_content_type ((GDataMediaContent*) content), type); +} + +/** + * gdata_media_group_look_up_content: + * @self: a #GDataMediaGroup + * @type: the MIME type of the content desired + * + * Looks up a #GDataMediaContent from the group with the given MIME type. The group's list of contents is + * a list of URIs to various formats of the group content itself, such as the SWF URI or RTSP stream for a video. + * + * Return value: (transfer none): a #GDataMediaContent matching @type, or %NULL + */ +GDataMediaContent * +gdata_media_group_look_up_content (GDataMediaGroup *self, const gchar *type) +{ + GList *element; + + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + g_return_val_if_fail (type != NULL, NULL); + + /* TODO: If type is required, and is unique, the contents can be stored in a hash table rather than a linked list */ + element = g_list_find_custom (self->priv->contents, type, (GCompareFunc) content_compare_cb); + if (element == NULL) + return NULL; + return GDATA_MEDIA_CONTENT (element->data); +} + +/** + * gdata_media_group_get_contents: + * @self: a #GDataMediaGroup + * + * Returns a list of #GDataMediaContents, giving the content enclosed by the group. + * + * Return value: (element-type GData.MediaContent) (transfer none): a #GList of #GDataMediaContents, or %NULL + */ +GList * +gdata_media_group_get_contents (GDataMediaGroup *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + return self->priv->contents; +} + +void +_gdata_media_group_add_content (GDataMediaGroup *self, GDataMediaContent *content) +{ + g_return_if_fail (GDATA_IS_MEDIA_GROUP (self)); + g_return_if_fail (GDATA_IS_MEDIA_CONTENT (content)); + self->priv->contents = g_list_prepend (self->priv->contents, g_object_ref (content)); +} + +/** + * gdata_media_group_get_credit: + * @self: a #GDataMediaGroup + * + * Gets the #GDataMediaGroup:credit property. + * + * Return value: a #GDataMediaCredit giving information on whom to credit for the media group, or %NULL + */ +GDataMediaCredit * +gdata_media_group_get_credit (GDataMediaGroup *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + return self->priv->credit; +} + +void +_gdata_media_group_set_credit (GDataMediaGroup *self, GDataMediaCredit *credit) +{ + g_return_if_fail (GDATA_IS_MEDIA_GROUP (self)); + g_return_if_fail (credit == NULL ||GDATA_IS_MEDIA_CREDIT (credit)); + + if (self->priv->credit != NULL) + g_object_unref (self->priv->credit); + self->priv->credit = g_object_ref (credit); +} + +/** + * gdata_media_group_get_media_group: + * @self: a #GDataMediaGroup + * + * Gets the #GDataMediaGroup:player-uri property. + * + * Return value: a URI where the media group is playable in a web browser, or %NULL + */ +const gchar * +gdata_media_group_get_player_uri (GDataMediaGroup *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + return self->priv->player_uri; +} + +/** + * gdata_media_group_is_restricted_in_country: + * @self: a #GDataMediaGroup + * @country: an ISO 3166 two-letter country code to check + * + * Checks whether viewing of the media is restricted in @country, either by its content rating, or by the request of the producer. + * The return value from this function is purely informational, and no obligation is assumed. + * + * Return value: %TRUE if the media is restricted in @country, %FALSE otherwise + */ +gboolean +gdata_media_group_is_restricted_in_country (GDataMediaGroup *self, const gchar *country) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), FALSE); + g_return_val_if_fail (country != NULL && *country != '\0', FALSE); + + if (GPOINTER_TO_UINT (g_hash_table_lookup (self->priv->restricted_countries, country)) == TRUE) + return TRUE; + + return GPOINTER_TO_UINT (g_hash_table_lookup (self->priv->restricted_countries, "all")); +} + +/** + * gdata_media_group_get_media_rating: + * @self: a #GDataMediaGroup + * @rating_type: the type of rating to retrieve + * + * Returns the rating of the given type for the media, if one exists. For example, this could be a film rating awarded by the MPAA. + * The valid values for @rating_type are: simple, mpaa and + * v-chip. + * + * The rating values returned for each of these rating types are string as defined in the + * YouTube documentation and + * MRSS specification. + * + * Return value: rating for the given rating type, or %NULL if the media has no rating for that type (or the type is invalid) + */ +const gchar * +gdata_media_group_get_media_rating (GDataMediaGroup *self, const gchar *rating_type) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + g_return_val_if_fail (rating_type != NULL && *rating_type != '\0', NULL); + + if (strcmp (rating_type, "simple") == 0) { + return self->priv->simple_rating; + } else if (strcmp (rating_type, "mpaa") == 0) { + return self->priv->mpaa_rating; + } else if (strcmp (rating_type, "v-chip") == 0) { + return self->priv->v_chip_rating; + } + + return NULL; +} + +/** + * gdata_media_group_get_thumbnails: + * @self: a #GDataMediaGroup + * + * Gets a list of the thumbnails available for the group. + * + * Return value: (element-type GData.MediaThumbnail) (transfer none): a #GList of #GDataMediaThumbnails, or %NULL + */ +GList * +gdata_media_group_get_thumbnails (GDataMediaGroup *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_GROUP (self), NULL); + return self->priv->thumbnails; +} + +void +_gdata_media_group_add_thumbnail (GDataMediaGroup *self, GDataMediaThumbnail *thumbnail) +{ + g_return_if_fail (GDATA_IS_MEDIA_GROUP (self)); + g_return_if_fail (GDATA_IS_MEDIA_THUMBNAIL (thumbnail)); + self->priv->thumbnails = g_list_prepend (self->priv->thumbnails, g_object_ref (thumbnail)); +} diff --git a/gdata/media/gdata-media-group.h b/gdata/media/gdata-media-group.h new file mode 100644 index 0000000..0845ba1 --- /dev/null +++ b/gdata/media/gdata-media-group.h @@ -0,0 +1,93 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_MEDIA_GROUP_H +#define GDATA_MEDIA_GROUP_H + +#include +#include + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_MEDIA_GROUP (gdata_media_group_get_type ()) +#define GDATA_MEDIA_GROUP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_MEDIA_GROUP, GDataMediaGroup)) +#define GDATA_MEDIA_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_MEDIA_GROUP, GDataMediaGroupClass)) +#define GDATA_IS_MEDIA_GROUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_MEDIA_GROUP)) +#define GDATA_IS_MEDIA_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_MEDIA_GROUP)) +#define GDATA_MEDIA_GROUP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_MEDIA_GROUP, GDataMediaGroupClass)) + +typedef struct _GDataMediaGroupPrivate GDataMediaGroupPrivate; + +/** + * GDataMediaGroup: + * + * All the fields in the #GDataMediaGroup structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataMediaGroupPrivate *priv; +} GDataMediaGroup; + +/** + * GDataMediaGroupClass: + * + * All the fields in the #GDataMediaGroupClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataMediaGroupClass; + +GType gdata_media_group_get_type (void) G_GNUC_CONST; + +const gchar *gdata_media_group_get_title (GDataMediaGroup *self) G_GNUC_PURE; +void gdata_media_group_set_title (GDataMediaGroup *self, const gchar *title); +const gchar *gdata_media_group_get_description (GDataMediaGroup *self) G_GNUC_PURE; +void gdata_media_group_set_description (GDataMediaGroup *self, const gchar *description); +const gchar * const *gdata_media_group_get_keywords (GDataMediaGroup *self) G_GNUC_PURE; +void gdata_media_group_set_keywords (GDataMediaGroup *self, const gchar * const *keywords); +GDataMediaCategory *gdata_media_group_get_category (GDataMediaGroup *self) G_GNUC_PURE; +void gdata_media_group_set_category (GDataMediaGroup *self, GDataMediaCategory *category); +GDataMediaContent *gdata_media_group_look_up_content (GDataMediaGroup *self, const gchar *type) G_GNUC_PURE; +GList *gdata_media_group_get_contents (GDataMediaGroup *self) G_GNUC_PURE; +void _gdata_media_group_add_content (GDataMediaGroup *self, GDataMediaContent *content); +GDataMediaCredit *gdata_media_group_get_credit (GDataMediaGroup *self) G_GNUC_PURE; +void _gdata_media_group_set_credit (GDataMediaGroup *self, GDataMediaCredit *credit); +const gchar *gdata_media_group_get_player_uri (GDataMediaGroup *self) G_GNUC_PURE; +gboolean gdata_media_group_is_restricted_in_country (GDataMediaGroup *self, const gchar *country) G_GNUC_PURE; +const gchar *gdata_media_group_get_media_rating (GDataMediaGroup *self, const gchar *rating_type) G_GNUC_PURE; +GList *gdata_media_group_get_thumbnails (GDataMediaGroup *self) G_GNUC_PURE; +void _gdata_media_group_add_thumbnail (GDataMediaGroup *self, GDataMediaThumbnail *thumbnail); + +G_END_DECLS + +#endif /* !GDATA_MEDIA_GROUP_H */ diff --git a/gdata/media/gdata-media-thumbnail.c b/gdata/media/gdata-media-thumbnail.c new file mode 100644 index 0000000..e8b4806 --- /dev/null +++ b/gdata/media/gdata-media-thumbnail.c @@ -0,0 +1,434 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-media-thumbnail + * @short_description: Media RSS thumbnail element + * @stability: Stable + * @include: gdata/media/gdata-media-thumbnail.h + * + * #GDataMediaThumbnail represents a "thumbnail" element from the + * Media RSS specification. + * + * The class only implements parsing, not XML output, at the moment. + */ + +#include +#include +#include + +#include "gdata-media-thumbnail.h" +#include "gdata-download-stream.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_media_thumbnail_finalize (GObject *object); +static void gdata_media_thumbnail_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, + GError **error); + +struct _GDataMediaThumbnailPrivate { + gchar *uri; + guint height; + guint width; + gint64 time; +}; + +enum { + PROP_URI = 1, + PROP_HEIGHT, + PROP_WIDTH, + PROP_TIME +}; + +G_DEFINE_TYPE (GDataMediaThumbnail, gdata_media_thumbnail, GDATA_TYPE_PARSABLE) + +static void +gdata_media_thumbnail_class_init (GDataMediaThumbnailClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataMediaThumbnailPrivate)); + + gobject_class->get_property = gdata_media_thumbnail_get_property; + gobject_class->finalize = gdata_media_thumbnail_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->get_namespaces = get_namespaces; + parsable_class->parse_json = parse_json; + parsable_class->element_name = "thumbnail"; + parsable_class->element_namespace = "media"; + + /** + * GDataMediaThumbnail:uri: + * + * The URI of the thumbnail. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", + "URI", "The URI of the thumbnail.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaThumbnail:height: + * + * The height of the thumbnail, in pixels. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_HEIGHT, + g_param_spec_uint ("height", + "Height", "The height of the thumbnail, in pixels.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaThumbnail:width: + * + * The width of the thumbnail, in pixels. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_WIDTH, + g_param_spec_uint ("width", + "Width", "The width of the thumbnail, in pixels.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataMediaThumbnail:time: + * + * The time offset of the thumbnail in relation to the media object, in milliseconds. + * + * For more information, see the Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TIME, + g_param_spec_int64 ("time", + "Time", "The time offset of the thumbnail in relation to the media object, in ms.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_media_thumbnail_init (GDataMediaThumbnail *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_MEDIA_THUMBNAIL, GDataMediaThumbnailPrivate); +} + +static void +gdata_media_thumbnail_finalize (GObject *object) +{ + GDataMediaThumbnailPrivate *priv = GDATA_MEDIA_THUMBNAIL (object)->priv; + + g_free (priv->uri); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_media_thumbnail_parent_class)->finalize (object); +} + +static void +gdata_media_thumbnail_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataMediaThumbnailPrivate *priv = GDATA_MEDIA_THUMBNAIL (object)->priv; + + switch (property_id) { + case PROP_URI: + g_value_set_string (value, priv->uri); + break; + case PROP_HEIGHT: + g_value_set_uint (value, priv->height); + break; + case PROP_WIDTH: + g_value_set_uint (value, priv->width); + break; + case PROP_TIME: + g_value_set_int64 (value, priv->time); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/* + * gdata_media_thumbnail_parse_time: + * @time_string: a time string to parse + * + * Parses a time string in (a subset of) NTP format into a number of milliseconds since the start of a media stream. + * + * For more information about NTP format, see RFC 2326 3.6 Normal Play Time. + * + * To build an NTP-format string, see gdata_media_thumbnail_build_time(). + * + * Return value: number of milliseconds since the start of a media stream + */ +static gint64 +parse_time (const gchar *time_string) +{ + guint hours, minutes; + gdouble seconds; + gchar *end_pointer; + + g_return_val_if_fail (time_string != NULL, 0); + + hours = g_ascii_strtoull (time_string, &end_pointer, 10); + if (end_pointer != time_string + 2) + return -1; + + minutes = g_ascii_strtoull (time_string + 3, &end_pointer, 10); + if (end_pointer != time_string + 5) + return -1; + + seconds = g_ascii_strtod (time_string + 6, &end_pointer); + if (end_pointer != time_string + strlen (time_string)) + return -1; + + return (gint64) ((seconds + minutes * 60 + hours * 3600) * 1000); +} + +/* + * gdata_media_thumbnail_build_time: + * @_time: a number of milliseconds since the start of a media stream + * + * Builds an NTP-format time string describing @_time milliseconds since the start + * of a media stream. + * + * Return value: an NTP-format string describing @_time; free with g_free() + */ +/*static gchar * +build_time (gint64 _time) +{ + guint hours, minutes; + gfloat seconds; + + hours = _time % 3600000; + _time -= hours * 3600000; + + minutes = _time % 60000; + _time -= minutes * 60000; + + seconds = _time / 1000.0; + + return g_strdup_printf ("%02u:%02u:%02f", hours, minutes, seconds); +}*/ + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + GDataMediaThumbnailPrivate *priv = GDATA_MEDIA_THUMBNAIL (parsable)->priv; + xmlChar *uri, *width, *height, *_time; + guint width_uint, height_uint; + gint64 time_int64; + + /* Get the width and height */ + width = xmlGetProp (root_node, (xmlChar*) "width"); + width_uint = (width == NULL) ? 0 : g_ascii_strtoull ((gchar*) width, NULL, 10); + xmlFree (width); + + height = xmlGetProp (root_node, (xmlChar*) "height"); + height_uint = (height == NULL) ? 0 : g_ascii_strtoull ((gchar*) height, NULL, 10); + xmlFree (height); + + /* Get and parse the time */ + _time = xmlGetProp (root_node, (xmlChar*) "time"); + if (_time == NULL) { + time_int64 = -1; + } else { + time_int64 = parse_time ((gchar*) _time); + if (time_int64 == -1) { + gdata_parser_error_unknown_property_value (root_node, "time", (gchar*) _time, error); + xmlFree (_time); + return FALSE; + } + xmlFree (_time); + } + + /* Get the URI */ + uri = xmlGetProp (root_node, (xmlChar*) "url"); + if (uri == NULL || *uri == '\0') { + xmlFree (uri); + return gdata_parser_error_required_property_missing (root_node, "url", error); + } + + priv->uri = (gchar*) uri; + priv->height = height_uint; + priv->width = width_uint; + priv->time = time_int64; + + return TRUE; +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + g_hash_table_insert (namespaces, (gchar*) "media", (gchar*) "http://search.yahoo.com/mrss/"); +} + +/* Reference: + * https://developers.google.com/youtube/v3/docs/videos#snippet.thumbnails */ +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, + GError **error) +{ + gboolean success; + gint64 width, height; + GDataMediaThumbnail *self = GDATA_MEDIA_THUMBNAIL (parsable); + GDataMediaThumbnailPrivate *priv = self->priv; + + if (gdata_parser_string_from_json_member (reader, "url", P_DEFAULT, + &priv->uri, &success, + error)) { + return success; + } else if (gdata_parser_int_from_json_member (reader, "width", + P_DEFAULT, &width, + &success, error)) { + priv->width = width; + return success; + } else if (gdata_parser_int_from_json_member (reader, "height", + P_DEFAULT, &height, + &success, error)) { + priv->height = height; + return success; + } else { + return GDATA_PARSABLE_CLASS (gdata_media_thumbnail_parent_class)->parse_json (parsable, reader, user_data, error); + } +} + +/** + * gdata_media_thumbnail_get_uri: + * @self: a #GDataMediaThumbnail + * + * Gets the #GDataMediaThumbnail:uri property. + * + * Return value: the thumbnail's URI + * + * Since: 0.4.0 + */ +const gchar * +gdata_media_thumbnail_get_uri (GDataMediaThumbnail *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_THUMBNAIL (self), NULL); + return self->priv->uri; +} + +/** + * gdata_media_thumbnail_get_height: + * @self: a #GDataMediaThumbnail + * + * Gets the #GDataMediaThumbnail:height property. + * + * Return value: the thumbnail's height in pixels, or 0 + * + * Since: 0.4.0 + */ +guint +gdata_media_thumbnail_get_height (GDataMediaThumbnail *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_THUMBNAIL (self), 0); + return self->priv->height; +} + +/** + * gdata_media_thumbnail_get_width: + * @self: a #GDataMediaThumbnail + * + * Gets the #GDataMediaThumbnail:width property. + * + * Return value: the thumbnail's width in pixels, or 0 + * + * Since: 0.4.0 + */ +guint +gdata_media_thumbnail_get_width (GDataMediaThumbnail *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_THUMBNAIL (self), 0); + return self->priv->width; +} + +/** + * gdata_media_thumbnail_get_time: + * @self: a #GDataMediaThumbnail + * + * Gets the #GDataMediaThumbnail:time property. + * + * Return value: the thumbnail's time offset in the media, or -1 + * + * Since: 0.4.0 + */ +gint64 +gdata_media_thumbnail_get_time (GDataMediaThumbnail *self) +{ + g_return_val_if_fail (GDATA_IS_MEDIA_THUMBNAIL (self), -1); + return self->priv->time; +} + +/** + * gdata_media_thumbnail_download: + * @self: a #GDataMediaThumbnail + * @service: the #GDataService + * @cancellable: (allow-none): a #GCancellable for the entire download stream, or %NULL + * @error: a #GError, or %NULL + * + * Downloads and returns a #GDataDownloadStream allowing the thumbnail data represented by @self to be read. + * + * To get the content type of the downloaded data, gdata_download_stream_get_content_type() can be called on the returned #GDataDownloadStream. + * Calling gdata_download_stream_get_content_length() on the stream will not return a meaningful result, however, as the stream is encoded in chunks, + * rather than by content length. + * + * In order to cancel the download, a #GCancellable passed in to @cancellable must be cancelled using g_cancellable_cancel(). Cancelling the individual + * #GInputStream operations on the #GDataDownloadStream will not cancel the entire download; merely the read or close operation in question. See the + * #GDataDownloadStream:cancellable for more details. + * + * Return value: (transfer full): a #GDataDownloadStream to download the thumbnail with, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataDownloadStream * +gdata_media_thumbnail_download (GDataMediaThumbnail *self, GDataService *service, GCancellable *cancellable, GError **error) +{ + const gchar *src_uri; + + g_return_val_if_fail (GDATA_IS_MEDIA_THUMBNAIL (self), NULL); + g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* We keep a GError in the argument list so that we can add authentication errors, etc., in future if necessary */ + + /* Get the download URI and create a stream for it */ + src_uri = gdata_media_thumbnail_get_uri (self); + return GDATA_DOWNLOAD_STREAM (gdata_download_stream_new (service, NULL, src_uri, cancellable)); +} diff --git a/gdata/media/gdata-media-thumbnail.h b/gdata/media/gdata-media-thumbnail.h new file mode 100644 index 0000000..ee05c10 --- /dev/null +++ b/gdata/media/gdata-media-thumbnail.h @@ -0,0 +1,80 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_MEDIA_THUMBNAIL_H +#define GDATA_MEDIA_THUMBNAIL_H + +#include +#include + +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_MEDIA_THUMBNAIL (gdata_media_thumbnail_get_type ()) +#define GDATA_MEDIA_THUMBNAIL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_MEDIA_THUMBNAIL, GDataMediaThumbnail)) +#define GDATA_MEDIA_THUMBNAIL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_MEDIA_THUMBNAIL, GDataMediaThumbnailClass)) +#define GDATA_IS_MEDIA_THUMBNAIL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_MEDIA_THUMBNAIL)) +#define GDATA_IS_MEDIA_THUMBNAIL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_MEDIA_THUMBNAIL)) +#define GDATA_MEDIA_THUMBNAIL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_MEDIA_THUMBNAIL, GDataMediaThumbnailClass)) + +typedef struct _GDataMediaThumbnailPrivate GDataMediaThumbnailPrivate; + +/** + * GDataMediaThumbnail: + * + * All the fields in the #GDataMediaThumbnail structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataMediaThumbnailPrivate *priv; +} GDataMediaThumbnail; + +/** + * GDataMediaThumbnailClass: + * + * All the fields in the #GDataMediaThumbnailClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataMediaThumbnailClass; + +GType gdata_media_thumbnail_get_type (void) G_GNUC_CONST; + +const gchar *gdata_media_thumbnail_get_uri (GDataMediaThumbnail *self) G_GNUC_PURE; +guint gdata_media_thumbnail_get_height (GDataMediaThumbnail *self) G_GNUC_PURE; +guint gdata_media_thumbnail_get_width (GDataMediaThumbnail *self) G_GNUC_PURE; +gint64 gdata_media_thumbnail_get_time (GDataMediaThumbnail *self) G_GNUC_PURE; + +GDataDownloadStream *gdata_media_thumbnail_download (GDataMediaThumbnail *self, GDataService *service, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_MEDIA_THUMBNAIL_H */ diff --git a/gdata/services/calendar/gdata-calendar-access-rule.c b/gdata/services/calendar/gdata-calendar-access-rule.c new file mode 100644 index 0000000..98d6091 --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-access-rule.c @@ -0,0 +1,277 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-calendar-access-rule + * @short_description: GData Calendar access rule object + * @stability: Stable + * @include: gdata/services/calendar/gdata-calendar-access-rule.h + * + * #GDataCalendarAccessRule is a subclass of #GDataAccessRule to represent an + * access rule affecting users of a shared calendar in Google Calendar. + * + * Since: 0.17.2 + */ + +#include +#include +#include +#include + +#include "gdata-access-rule.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-private.h" +#include "gdata-calendar-access-rule.h" + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, + GError **error); +static gboolean +post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error); +static void +get_json (GDataParsable *parsable, JsonBuilder *builder); +static const gchar * +get_content_type (void); + +G_DEFINE_TYPE (GDataCalendarAccessRule, gdata_calendar_access_rule, + GDATA_TYPE_ACCESS_RULE) + +static void +gdata_calendar_access_rule_class_init (GDataCalendarAccessRuleClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + parsable_class->parse_json = parse_json; + parsable_class->post_parse_json = post_parse_json; + parsable_class->get_json = get_json; + parsable_class->get_content_type = get_content_type; + + entry_class->kind_term = "calendar#aclRule"; +} + +static void +gdata_calendar_access_rule_init (GDataCalendarAccessRule *self) +{ + /* Nothing to do here. */ +} + +/* V3 reference: + * https://developers.google.com/google-apps/calendar/v3/reference/acl#role + * V2 reference is no longer available. + */ +const struct { + const gchar *v3; + const gchar *v2; +} role_pairs[] = { + { "none", "none" }, + { "freeBusyReader", "http://schemas.google.com/gCal/2005#freebusy" }, + { "reader", "http://schemas.google.com/gCal/2005#read" }, + { "writer", "http://schemas.google.com/gCal/2005#editor" }, + { "owner", "http://schemas.google.com/gCal/2005#owner" }, +}; + +static const gchar * +role_v3_to_v2 (const gchar *v3_role) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (role_pairs); i++) { + if (g_strcmp0 (v3_role, role_pairs[i].v3) == 0) { + return role_pairs[i].v2; + } + } + + /* Fallback. */ + return v3_role; +} + +static const gchar * +role_v2_to_v3 (const gchar *v2_role) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (role_pairs); i++) { + if (g_strcmp0 (v2_role, role_pairs[i].v2) == 0) { + return role_pairs[i].v3; + } + } + + /* Fallback. */ + return v2_role; +} + +static const gchar * +scope_type_v3_to_v2 (const gchar *v3_scope_type) +{ + /* Surprisingly, they have not changed from v2 to v3. */ + return v3_scope_type; +} + +static const gchar * +scope_type_v2_to_v3 (const gchar *v2_scope_type) +{ + /* Surprisingly, they have not changed from v2 to v3. */ + return v2_scope_type; +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + gboolean success; + + if (g_strcmp0 (json_reader_get_member_name (reader), "role") == 0) { + gchar *role = NULL; /* owned */ + + g_assert (gdata_parser_string_from_json_member (reader, "role", + P_REQUIRED | + P_NON_EMPTY, + &role, &success, + error)); + + if (!success) { + return FALSE; + } + + gdata_access_rule_set_role (GDATA_ACCESS_RULE (parsable), + role_v3_to_v2 (role)); + g_free (role); + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), + "scope") == 0) { + const gchar *scope_type; + const gchar *scope_value; + + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, + error); + } + + json_reader_read_member (reader, "type"); + scope_type = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "value"); + scope_value = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + /* Scope type is required. */ + if (scope_type == NULL) { + return gdata_parser_error_required_json_content_missing (reader, + error); + } + + gdata_access_rule_set_scope (GDATA_ACCESS_RULE (parsable), + scope_type_v3_to_v2 (scope_type), + scope_value); + + return TRUE; + } + + return GDATA_PARSABLE_CLASS (gdata_calendar_access_rule_parent_class)->parse_json (parsable, reader, user_data, error); +} + +static gboolean +post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error) +{ + /* Do _not_ chain up. */ + return TRUE; +} + +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + GDataAccessRule *access_rule; + const gchar *id, *etag, *role, *scope_type, *scope_value; + + access_rule = GDATA_ACCESS_RULE (parsable); + + id = gdata_entry_get_id (GDATA_ENTRY (parsable)); + if (id != NULL) { + json_builder_set_member_name (builder, "id"); + json_builder_add_string_value (builder, id); + } + + json_builder_set_member_name (builder, "kind"); + json_builder_add_string_value (builder, "calendar#aclRule"); + + /* Add the ETag, if available. */ + etag = gdata_entry_get_etag (GDATA_ENTRY (parsable)); + if (etag != NULL) { + json_builder_set_member_name (builder, "etag"); + json_builder_add_string_value (builder, etag); + } + + role = gdata_access_rule_get_role (access_rule); + if (role != NULL) { + json_builder_set_member_name (builder, "role"); + json_builder_add_string_value (builder, role_v2_to_v3 (role)); + } + + gdata_access_rule_get_scope (access_rule, &scope_type, &scope_value); + if (scope_type != NULL || scope_value != NULL) { + json_builder_set_member_name (builder, "scope"); + json_builder_begin_object (builder); + + if (scope_type != NULL) { + json_builder_set_member_name (builder, "type"); + json_builder_add_string_value (builder, + scope_type_v2_to_v3 (scope_type)); + } + + if (scope_value != NULL) { + json_builder_set_member_name (builder, "value"); + json_builder_add_string_value (builder, scope_value); + } + + json_builder_end_object (builder); + } +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +/** + * gdata_calendar_access_rule_new: + * @id: the access rule's ID, or %NULL + * + * Creates a new #GDataCalendarAccessRule with the given ID and default + * properties. + * + * Return value: (transfer full): a new #GDataCalendarAccessRule; unref with + * g_object_unref() + * + * Since: 0.17.2 + */ +GDataCalendarAccessRule * +gdata_calendar_access_rule_new (const gchar *id) +{ + GObject *retval = NULL; /* owned */ + + retval = g_object_new (GDATA_TYPE_CALENDAR_ACCESS_RULE, + "id", id, + NULL); + return GDATA_CALENDAR_ACCESS_RULE (retval); +} diff --git a/gdata/services/calendar/gdata-calendar-access-rule.h b/gdata/services/calendar/gdata-calendar-access-rule.h new file mode 100644 index 0000000..e80ec84 --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-access-rule.h @@ -0,0 +1,125 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CALENDAR_ACCESS_RULE_H +#define GDATA_CALENDAR_ACCESS_RULE_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_CALENDAR_ACCESS_ROLE_READ: + * + * The users specified by the #GDataCalendarAccessRule have read-only access to + * the calendar. + * + * Since: 0.7.0 + */ +#define GDATA_CALENDAR_ACCESS_ROLE_READ "http://schemas.google.com/gCal/2005#read" + +/** + * GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY: + * + * The users specified by the #GDataCalendarAccessRule can only see the + * free/busy information on the calendar; not event details. + * + * Since: 0.7.0 + */ +#define GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY "http://schemas.google.com/gCal/2005#freebusy" + +/** + * GDATA_CALENDAR_ACCESS_ROLE_EDITOR: + * + * The users specified by the #GDataCalendarAccessRule have full edit access to + * the calendar, except they can’t change the calendar’s access rules. + * + * Since: 0.7.0 + */ +#define GDATA_CALENDAR_ACCESS_ROLE_EDITOR "http://schemas.google.com/gCal/2005#editor" + +/** + * GDATA_CALENDAR_ACCESS_ROLE_OWNER: + * + * The users specified by the #GDataCalendarAccessRule have full owner access + * to the calendar. + * + * Since: 0.7.0 + */ +#define GDATA_CALENDAR_ACCESS_ROLE_OWNER "http://schemas.google.com/gCal/2005#owner" + +/** + * GDATA_CALENDAR_ACCESS_ROLE_ROOT: + * + * The users specified by the #GDataCalendarAccessRule have full administrator + * access to the calendar server. This is only available in Google Apps For + * Your Domain. + * + * Since: 0.7.0 + */ +#define GDATA_CALENDAR_ACCESS_ROLE_ROOT "http://schemas.google.com/gCal/2005#root" + +#define GDATA_TYPE_CALENDAR_ACCESS_RULE (gdata_calendar_access_rule_get_type ()) +#define GDATA_CALENDAR_ACCESS_RULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CALENDAR_ACCESS_RULE, GDataCalendarAccessRule)) +#define GDATA_CALENDAR_ACCESS_RULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CALENDAR_ACCESS_RULE, GDataCalendarAccessRuleClass)) +#define GDATA_IS_CALENDAR_ACCESS_RULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CALENDAR_ACCESS_RULE)) +#define GDATA_IS_CALENDAR_ACCESS_RULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CALENDAR_ACCESS_RULE)) +#define GDATA_CALENDAR_ACCESS_RULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CALENDAR_ACCESS_RULE, GDataCalendarAccessRuleClass)) + +/** + * GDataCalendarAccessRule: + * + * All the fields in the #GDataCalendarAccessRule structure are private and + * should never be accessed directly. + * + * Since: 0.17.2 + */ +typedef struct { + GDataAccessRule parent; +} GDataCalendarAccessRule; + +/** + * GDataCalendarAccessRuleClass: + * + * All the fields in the #GDataCalendarAccessRuleClass structure are private + * and should never be accessed directly. + * + * Since: 0.17.2 + */ +typedef struct { + /*< private >*/ + GDataAccessRuleClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataCalendarAccessRuleClass; + +GType gdata_calendar_access_rule_get_type (void) G_GNUC_CONST; + +GDataCalendarAccessRule * +gdata_calendar_access_rule_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_CALENDAR_ACCESS_RULE_H */ diff --git a/gdata/services/calendar/gdata-calendar-calendar.c b/gdata/services/calendar/gdata-calendar-calendar.c new file mode 100644 index 0000000..c781558 --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-calendar.c @@ -0,0 +1,805 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2010, 2014, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-calendar-calendar + * @short_description: GData Calendar calendar object + * @stability: Stable + * @include: gdata/services/calendar/gdata-calendar-calendar.h + * + * #GDataCalendarCalendar is a subclass of #GDataEntry to represent a calendar from Google Calendar. + * + * #GDataCalendarCalendar implements #GDataAccessHandler, meaning the access rules to it can be modified using that interface. As well as the + * access roles defined for the base #GDataAccessRule (e.g. %GDATA_ACCESS_ROLE_NONE), #GDataCalendarCalendar has its own, such as + * %GDATA_CALENDAR_ACCESS_ROLE_EDITOR and %GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY. + * + * For more details of Google Calendar's GData API, see the + * online documentation. + * + * + * Listing Calendars + * + * GDataCalendarService *service; + * GDataFeed *feed; + * GList *i; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_calendar_service (); + * + * /* Query for all of the calendars the currently authenticated user has access to, including those which they have read-only + * * access to. */ + * feed = gdata_calendar_service_query_all_calendars (service, NULL, NULL, NULL, NULL, &error); + * + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error querying for calendars: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Iterate through the returned calendars and do something with them */ + * for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { + * const gchar *access_level; + * gboolean has_write_access; + * GDataCalendarCalendar *calendar = GDATA_CALENDAR_CALENDAR (i->data); + * + * /* Determine whether we have write access to the calendar, or just read-only or free/busy access. Note that the access levels + * * are more detailed than this; see the documentation for gdata_calendar_calendar_get_access_level() for more information. */ + * access_level = gdata_calendar_calendar_get_access_level (calendar); + * has_write_access = (access_level != NULL && strcmp (access_level, GDATA_CALENDAR_ACCESS_ROLE_EDITOR) == 0) ? TRUE : FALSE; + * + * /* Do something with the calendar here, such as insert it into a UI */ + * } + * + * g_object_unref (feed); + * + * + */ + +#include +#include +#include +#include + +#include "gdata-calendar-calendar.h" +#include "gdata-private.h" +#include "gdata-service.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-access-handler.h" +#include "gdata-calendar-service.h" +#include "gdata-calendar-access-rule.h" + +static void gdata_calendar_calendar_access_handler_init (GDataAccessHandlerIface *iface); +static void gdata_calendar_calendar_finalize (GObject *object); +static void gdata_calendar_calendar_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_calendar_calendar_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_json (GDataParsable *parsable, JsonBuilder *builder); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static const gchar *get_content_type (void); + +struct _GDataCalendarCalendarPrivate { + gchar *timezone; + gboolean is_hidden; + GDataColor colour; + gboolean is_selected; + gchar *access_level; +}; + +enum { + PROP_TIMEZONE = 1, + PROP_TIMES_CLEANED, + PROP_IS_HIDDEN, + PROP_COLOR, + PROP_IS_SELECTED, + PROP_ACCESS_LEVEL, + PROP_EDITED, + PROP_ETAG, +}; + +G_DEFINE_TYPE_WITH_CODE (GDataCalendarCalendar, gdata_calendar_calendar, GDATA_TYPE_ENTRY, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_ACCESS_HANDLER, gdata_calendar_calendar_access_handler_init)) + +static void +gdata_calendar_calendar_class_init (GDataCalendarCalendarClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataCalendarCalendarPrivate)); + + gobject_class->set_property = gdata_calendar_calendar_set_property; + gobject_class->get_property = gdata_calendar_calendar_get_property; + gobject_class->finalize = gdata_calendar_calendar_finalize; + + parsable_class->parse_json = parse_json; + parsable_class->get_json = get_json; + parsable_class->get_content_type = get_content_type; + + entry_class->kind_term = "calendar#calendarListEntry"; + + /** + * GDataCalendarCalendar:timezone: + * + * The timezone in which the calendar's times are given. This is a timezone name in tz database notation: reference. + */ + g_object_class_install_property (gobject_class, PROP_TIMEZONE, + g_param_spec_string ("timezone", + "Timezone", "The timezone in which the calendar's times are given.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarCalendar:times-cleaned: + * + * The number of times the calendar has been cleared of events. + * + * Deprecated: 0.17.2: Unsupported by the online API any more. There + * is no replacement; this will always return + * 0. + */ + g_object_class_install_property (gobject_class, PROP_TIMES_CLEANED, + g_param_spec_uint ("times-cleaned", + "Times cleaned", "The number of times the calendar has been cleared of events.", + 0, G_MAXUINT, 0, + G_PARAM_DEPRECATED | + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarCalendar:is-hidden: + * + * Indicates whether the calendar is visible. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_HIDDEN, + g_param_spec_boolean ("is-hidden", + "Hidden?", "Indicates whether the calendar is visible.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarCalendar:color: + * + * The background color used to highlight the calendar in the user’s + * browser. This used to be restricted to a limited set of colours, but + * since 0.17.2 may be any RGB colour. + */ + g_object_class_install_property (gobject_class, PROP_COLOR, + g_param_spec_boxed ("color", + "Color", "The background color used to highlight the calendar in the user's browser.", + GDATA_TYPE_COLOR, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarCalendar:is-selected: + * + * Indicates whether the calendar is selected. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_SELECTED, + g_param_spec_boolean ("is-selected", + "Selected?", "Indicates whether the calendar is selected.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarCalendar:access-level: + * + * Indicates the access level the current user has to the calendar. For example: %GDATA_CALENDAR_ACCESS_ROLE_READ or + * %GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY. The "current user" is the one authenticated against the service's #GDataService:authorizer, + * or the guest user. + */ + g_object_class_install_property (gobject_class, PROP_ACCESS_LEVEL, + g_param_spec_string ("access-level", + "Access level", "Indicates the access level the current user has to the calendar.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarCalendar:edited: + * + * The last time the calendar was edited. If the calendar has not been edited yet, the content indicates the time it was created. + * + * For more information, see the + * Atom Publishing Protocol specification. + * + * Deprecated: 0.17.2: Unsupported by the online API any more. There + * is no replacement; this will always return -1. + */ + g_object_class_install_property (gobject_class, PROP_EDITED, + g_param_spec_int64 ("edited", + "Edited", "The last time the calendar was edited.", + -1, G_MAXINT64, -1, + G_PARAM_DEPRECATED | + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /* Override the ETag property since ETags don't seem to be supported for calendars. */ + g_object_class_override_property (gobject_class, PROP_ETAG, "etag"); +} + +static gboolean +is_owner_rule (GDataAccessRule *rule) +{ + return (strcmp (gdata_access_rule_get_role (rule), GDATA_CALENDAR_ACCESS_ROLE_OWNER) == 0) ? TRUE : FALSE; +} + +static GDataAuthorizationDomain * +get_authorization_domain (GDataAccessHandler *self) +{ + return gdata_calendar_service_get_primary_authorization_domain (); +} + +static GDataFeed * +get_rules (GDataAccessHandler *self, + GDataService *service, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, + GError **error) +{ + GDataAccessHandlerIface *iface; + GDataAuthorizationDomain *domain = NULL; + GDataFeed *feed; + GDataLink *_link; + SoupMessage *message; + GList/**/ *rules, *i; + const gchar *calendar_id; + + _link = gdata_entry_look_up_link (GDATA_ENTRY (self), + GDATA_LINK_ACCESS_CONTROL_LIST); + g_assert (_link != NULL); + + iface = GDATA_ACCESS_HANDLER_GET_IFACE (self); + if (iface->get_authorization_domain != NULL) { + domain = iface->get_authorization_domain (self); + } + + message = _gdata_service_query (service, domain, + gdata_link_get_uri (_link), NULL, + cancellable, error); + if (message == NULL) { + return NULL; + } + + g_assert (message->response_body->data != NULL); + + feed = _gdata_feed_new_from_json (GDATA_TYPE_FEED, + message->response_body->data, + message->response_body->length, + GDATA_TYPE_CALENDAR_ACCESS_RULE, + progress_callback, progress_user_data, + error); + + /* Set the self link on all the ACL rules so they can be deleted. + * Sigh. */ + rules = gdata_feed_get_entries (feed); + calendar_id = gdata_entry_get_id (GDATA_ENTRY (self)); + + for (i = rules; i != NULL; i = i->next) { + const gchar *id; + gchar *uri = NULL; /* owned */ + + /* Set the self link, which is needed for + * gdata_service_delete_entry(). Unfortunately, it needs the + * ACL ID _and_ the calendar ID. */ + id = gdata_entry_get_id (GDATA_ENTRY (i->data)); + + if (id == NULL || calendar_id == NULL) { + continue; + } + + uri = g_strconcat ("https://www.googleapis.com" + "/calendar/v3/calendars/", + calendar_id, "/acl/", id, NULL); + _link = gdata_link_new (uri, GDATA_LINK_SELF); + gdata_entry_add_link (GDATA_ENTRY (i->data), _link); + g_object_unref (_link); + g_free (uri); + } + + g_object_unref (message); + + return feed; +} + +static void +gdata_calendar_calendar_access_handler_init (GDataAccessHandlerIface *iface) +{ + iface->is_owner_rule = is_owner_rule; + iface->get_authorization_domain = get_authorization_domain; + iface->get_rules = get_rules; +} + +static void +gdata_calendar_calendar_init (GDataCalendarCalendar *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_CALENDAR_CALENDAR, GDataCalendarCalendarPrivate); +} + +static void +gdata_calendar_calendar_finalize (GObject *object) +{ + GDataCalendarCalendarPrivate *priv = GDATA_CALENDAR_CALENDAR (object)->priv; + + g_free (priv->timezone); + g_free (priv->access_level); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_calendar_calendar_parent_class)->finalize (object); +} + +static void +gdata_calendar_calendar_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataCalendarCalendar *self = GDATA_CALENDAR_CALENDAR (object); + GDataCalendarCalendarPrivate *priv = self->priv; + + switch (property_id) { + case PROP_TIMEZONE: + g_value_set_string (value, priv->timezone); + break; + case PROP_TIMES_CLEANED: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_value_set_uint (value, gdata_calendar_calendar_get_times_cleaned (self)); + G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_IS_HIDDEN: + g_value_set_boolean (value, priv->is_hidden); + break; + case PROP_COLOR: + g_value_set_boxed (value, &(priv->colour)); + break; + case PROP_IS_SELECTED: + g_value_set_boolean (value, priv->is_selected); + break; + case PROP_ACCESS_LEVEL: + g_value_set_string (value, priv->access_level); + break; + case PROP_EDITED: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_value_set_int64 (value, + gdata_calendar_calendar_get_edited (self)); + G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_ETAG: + /* Never return an ETag */ + g_value_set_string (value, NULL); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_calendar_calendar_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataCalendarCalendar *self = GDATA_CALENDAR_CALENDAR (object); + + switch (property_id) { + case PROP_TIMEZONE: + gdata_calendar_calendar_set_timezone (self, g_value_get_string (value)); + break; + case PROP_IS_HIDDEN: + gdata_calendar_calendar_set_is_hidden (self, g_value_get_boolean (value)); + break; + case PROP_COLOR: + gdata_calendar_calendar_set_color (self, g_value_get_boxed (value)); + break; + case PROP_IS_SELECTED: + gdata_calendar_calendar_set_is_selected (self, g_value_get_boolean (value)); + break; + case PROP_ETAG: + /* Never set an ETag (note that this doesn't stop it being set in GDataEntry due to XML parsing) */ + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + gboolean success; + GDataCalendarCalendar *self = GDATA_CALENDAR_CALENDAR (parsable); + + /* FIXME: Unimplemented: + * - location + * - summaryOverride + * - colorId + * - foregroundColor + * - defaultReminders + * - notificationSettings + * - primary + * - deleted + */ + + if (gdata_parser_string_from_json_member (reader, "timeZone", P_DEFAULT, &self->priv->timezone, &success, error) || + gdata_parser_color_from_json_member (reader, "backgroundColor", P_DEFAULT, &self->priv->colour, &success, error) || + gdata_parser_boolean_from_json_member (reader, "hidden", P_DEFAULT, &self->priv->is_hidden, &success, error) || + gdata_parser_boolean_from_json_member (reader, "selected", P_DEFAULT, &self->priv->is_selected, &success, error)) { + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "summary") == 0) { + gchar *summary = NULL; + + g_assert (gdata_parser_string_from_json_member (reader, + "summary", + P_DEFAULT, + &summary, + &success, + error)); + + if (summary != NULL) { + gdata_entry_set_title (GDATA_ENTRY (parsable), summary); + } + + g_free (summary); + + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "description") == 0) { + gchar *description = NULL; + + g_assert (gdata_parser_string_from_json_member (reader, + "description", + P_DEFAULT, + &description, + &success, + error)); + + if (description != NULL) { + gdata_entry_set_summary (GDATA_ENTRY (parsable), + description); + } + + g_free (description); + + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "accessRole") == 0) { + gchar *access_role = NULL; + + g_assert (gdata_parser_string_from_json_member (reader, + "accessRole", + P_DEFAULT, + &access_role, + &success, + error)); + + if (access_role != NULL) { + const gchar *level; + + /* Convert from v3 format to v2. */ + if (g_strcmp0 (access_role, "freeBusyReader") == 0) { + level = GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY; + } else if (g_strcmp0 (access_role, "reader") == 0) { + level = GDATA_CALENDAR_ACCESS_ROLE_READ; + } else if (g_strcmp0 (access_role, "writer") == 0) { + level = GDATA_CALENDAR_ACCESS_ROLE_EDITOR; + } else if (g_strcmp0 (access_role, "owner") == 0) { + level = GDATA_CALENDAR_ACCESS_ROLE_OWNER; + } else { + level = access_role; + } + + self->priv->access_level = g_strdup (level); + } + + g_free (access_role); + + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "id") == 0) { + GDataLink *_link; + const gchar *id; + gchar *uri; + + id = json_reader_get_string_value (reader); + if (id != NULL && *id != '\0') { + /* Calendar entries don’t contain their own selfLink, + * so we have to add one manually. */ + uri = g_strconcat ("https://www.googleapis.com/calendar/v3/calendars/", id, NULL); + _link = gdata_link_new (uri, GDATA_LINK_SELF); + gdata_entry_add_link (GDATA_ENTRY (parsable), _link); + g_object_unref (_link); + g_free (uri); + + /* Similarly for the ACL link. */ + uri = g_strconcat ("https://www.googleapis.com" + "/calendar/v3/calendars/", id, + "/acl", NULL); + _link = gdata_link_new (uri, + GDATA_LINK_ACCESS_CONTROL_LIST); + gdata_entry_add_link (GDATA_ENTRY (parsable), _link); + g_object_unref (_link); + g_free (uri); + } + + return GDATA_PARSABLE_CLASS (gdata_calendar_calendar_parent_class)->parse_json (parsable, reader, user_data, error); + } else { + return GDATA_PARSABLE_CLASS (gdata_calendar_calendar_parent_class)->parse_json (parsable, reader, user_data, error); + } + + return TRUE; +} + +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + const gchar *id, *etag, *title, *description; + gchar *colour; + GDataCalendarCalendarPrivate *priv = GDATA_CALENDAR_CALENDAR (parsable)->priv; + + id = gdata_entry_get_id (GDATA_ENTRY (parsable)); + if (id != NULL) { + json_builder_set_member_name (builder, "id"); + json_builder_add_string_value (builder, id); + } + + json_builder_set_member_name (builder, "kind"); + json_builder_add_string_value (builder, "calendar#calendar"); + + /* Add the ETag, if available. */ + etag = gdata_entry_get_etag (GDATA_ENTRY (parsable)); + if (etag != NULL) { + json_builder_set_member_name (builder, "etag"); + json_builder_add_string_value (builder, etag); + } + + /* Calendar labels titles as ‘summary’. */ + title = gdata_entry_get_title (GDATA_ENTRY (parsable)); + if (title != NULL) { + json_builder_set_member_name (builder, "summary"); + json_builder_add_string_value (builder, title); + } + + description = gdata_entry_get_summary (GDATA_ENTRY (parsable)); + if (description != NULL) { + json_builder_set_member_name (builder, "description"); + json_builder_add_string_value (builder, description); + } + + /* Add all the calendar-specific JSON */ + if (priv->timezone != NULL) { + json_builder_set_member_name (builder, "timeZone"); + json_builder_add_string_value (builder, priv->timezone); + } + + json_builder_set_member_name (builder, "hidden"); + json_builder_add_boolean_value (builder, priv->is_hidden); + + colour = gdata_color_to_hexadecimal (&priv->colour); + json_builder_set_member_name (builder, "backgroundColor"); + json_builder_add_string_value (builder, colour); + g_free (colour); + + json_builder_set_member_name (builder, "selected"); + json_builder_add_boolean_value (builder, priv->is_selected); +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +/** + * gdata_calendar_calendar_new: + * @id: (allow-none): the calendar's ID, or %NULL + * + * Creates a new #GDataCalendarCalendar with the given ID and default properties. + * + * Return value: a new #GDataCalendarCalendar; unref with g_object_unref() + */ +GDataCalendarCalendar * +gdata_calendar_calendar_new (const gchar *id) +{ + return GDATA_CALENDAR_CALENDAR (g_object_new (GDATA_TYPE_CALENDAR_CALENDAR, "id", id, NULL)); +} + +/** + * gdata_calendar_calendar_get_timezone: + * @self: a #GDataCalendarCalendar + * + * Gets the #GDataCalendarCalendar:timezone property. + * + * Return value: the calendar's timezone, or %NULL + */ +const gchar * +gdata_calendar_calendar_get_timezone (GDataCalendarCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_CALENDAR (self), NULL); + return self->priv->timezone; +} + +/** + * gdata_calendar_calendar_set_timezone: + * @self: a #GDataCalendarCalendar + * @_timezone: (allow-none): a new timezone, or %NULL + * + * Sets the #GDataCalendarCalendar:timezone property to the new timezone, @_timezone. + * + * Set @_timezone to %NULL to unset the property in the calendar. + */ +void +gdata_calendar_calendar_set_timezone (GDataCalendarCalendar *self, const gchar *_timezone) +{ + /* Blame "timezone" in /usr/include/time.h:291 for the weird parameter naming */ + g_return_if_fail (GDATA_IS_CALENDAR_CALENDAR (self)); + + g_free (self->priv->timezone); + self->priv->timezone = g_strdup (_timezone); + g_object_notify (G_OBJECT (self), "timezone"); +} + +/** + * gdata_calendar_calendar_get_times_cleaned: + * @self: a #GDataCalendarCalendar + * + * Gets the #GDataCalendarCalendar:times-cleaned property. + * + * Return value: the number of times the calendar has been totally emptied + * Deprecated: 0.17.2: Unsupported by the online API any more. There is no + * replacement; this will always return 0. + */ +guint +gdata_calendar_calendar_get_times_cleaned (GDataCalendarCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_CALENDAR (self), 0); + return 0; +} + +/** + * gdata_calendar_calendar_is_hidden: + * @self: a #GDataCalendarCalendar + * + * Gets the #GDataCalendarCalendar:is-hidden property. + * + * Return value: %TRUE if the calendar is hidden, %FALSE otherwise + * + * Since: 0.2.0 + */ +gboolean +gdata_calendar_calendar_is_hidden (GDataCalendarCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_CALENDAR (self), 0); + return self->priv->is_hidden; +} + +/** + * gdata_calendar_calendar_set_is_hidden: + * @self: a #GDataCalendarCalendar + * @is_hidden: %TRUE to hide the calendar, %FALSE otherwise + * + * Sets the #GDataCalendarCalendar:is-hidden property to @is_hidden. + * + * Since: 0.2.0 + */ +void +gdata_calendar_calendar_set_is_hidden (GDataCalendarCalendar *self, gboolean is_hidden) +{ + g_return_if_fail (GDATA_IS_CALENDAR_CALENDAR (self)); + self->priv->is_hidden = is_hidden; + g_object_notify (G_OBJECT (self), "is-hidden"); +} + +/** + * gdata_calendar_calendar_get_color: + * @self: a #GDataCalendarCalendar + * @color: (out caller-allocates): a #GDataColor + * + * Gets the #GDataCalendarCalendar:color property and puts it in @color. + */ +void +gdata_calendar_calendar_get_color (GDataCalendarCalendar *self, GDataColor *color) +{ + g_return_if_fail (GDATA_IS_CALENDAR_CALENDAR (self)); + g_return_if_fail (color != NULL); + *color = self->priv->colour; +} + +/** + * gdata_calendar_calendar_set_color: + * @self: a #GDataCalendarCalendar + * @color: a new #GDataColor + * + * Sets the #GDataCalendarCalendar:color property to @color. + */ +void +gdata_calendar_calendar_set_color (GDataCalendarCalendar *self, const GDataColor *color) +{ + g_return_if_fail (GDATA_IS_CALENDAR_CALENDAR (self)); + g_return_if_fail (color != NULL); + self->priv->colour = *color; + g_object_notify (G_OBJECT (self), "color"); +} + +/** + * gdata_calendar_calendar_is_selected: + * @self: a #GDataCalendarCalendar + * + * Gets the #GDataCalendarCalendar:is-selected property. + * + * Return value: %TRUE if the calendar is selected, %FALSE otherwise + * + * Since: 0.2.0 + */ +gboolean +gdata_calendar_calendar_is_selected (GDataCalendarCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_CALENDAR (self), 0); + return self->priv->is_selected; +} + +/** + * gdata_calendar_calendar_set_is_selected: + * @self: a #GDataCalendarCalendar + * @is_selected: %TRUE to select the calendar, %FALSE otherwise + * + * Sets the #GDataCalendarCalendar:is-selected property to @is_selected. + * + * Since: 0.2.0 + */ +void +gdata_calendar_calendar_set_is_selected (GDataCalendarCalendar *self, gboolean is_selected) +{ + g_return_if_fail (GDATA_IS_CALENDAR_CALENDAR (self)); + self->priv->is_selected = is_selected; + g_object_notify (G_OBJECT (self), "is-selected"); +} + +/** + * gdata_calendar_calendar_get_access_level: + * @self: a #GDataCalendarCalendar + * + * Gets the #GDataCalendarCalendar:access-level property. + * + * Return value: the authenticated user's access level to the calendar, or %NULL + */ +const gchar * +gdata_calendar_calendar_get_access_level (GDataCalendarCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_CALENDAR (self), NULL); + return self->priv->access_level; +} + +/** + * gdata_calendar_calendar_get_edited: + * @self: a #GDataCalendarCalendar + * + * Gets the #GDataCalendarCalendar:edited property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the calendar was last edited, or -1 + * Deprecated: 0.17.2: Unsupported by the online API any more. There is no + * replacement; this will always return -1. + */ +gint64 +gdata_calendar_calendar_get_edited (GDataCalendarCalendar *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_CALENDAR (self), -1); + return -1; +} diff --git a/gdata/services/calendar/gdata-calendar-calendar.h b/gdata/services/calendar/gdata-calendar-calendar.h new file mode 100644 index 0000000..ecb61d4 --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-calendar.h @@ -0,0 +1,86 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CALENDAR_CALENDAR_H +#define GDATA_CALENDAR_CALENDAR_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_CALENDAR_CALENDAR (gdata_calendar_calendar_get_type ()) +#define GDATA_CALENDAR_CALENDAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CALENDAR_CALENDAR, GDataCalendarCalendar)) +#define GDATA_CALENDAR_CALENDAR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CALENDAR_CALENDAR, GDataCalendarCalendarClass)) +#define GDATA_IS_CALENDAR_CALENDAR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CALENDAR_CALENDAR)) +#define GDATA_IS_CALENDAR_CALENDAR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CALENDAR_CALENDAR)) +#define GDATA_CALENDAR_CALENDAR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CALENDAR_CALENDAR, GDataCalendarCalendarClass)) + +typedef struct _GDataCalendarCalendarPrivate GDataCalendarCalendarPrivate; + +/** + * GDataCalendarCalendar: + * + * All the fields in the #GDataCalendarCalendar structure are private and should never be accessed directly. + */ +typedef struct { + GDataEntry parent; + GDataCalendarCalendarPrivate *priv; +} GDataCalendarCalendar; + +/** + * GDataCalendarCalendarClass: + * + * All the fields in the #GDataCalendarCalendarClass structure are private and should never be accessed directly. + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataCalendarCalendarClass; + +GType gdata_calendar_calendar_get_type (void) G_GNUC_CONST; + +GDataCalendarCalendar *gdata_calendar_calendar_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_calendar_calendar_get_timezone (GDataCalendarCalendar *self) G_GNUC_PURE; +void gdata_calendar_calendar_set_timezone (GDataCalendarCalendar *self, const gchar *_timezone); +gboolean gdata_calendar_calendar_is_hidden (GDataCalendarCalendar *self) G_GNUC_PURE; +void gdata_calendar_calendar_set_is_hidden (GDataCalendarCalendar *self, gboolean is_hidden); +void gdata_calendar_calendar_get_color (GDataCalendarCalendar *self, GDataColor *color); +void gdata_calendar_calendar_set_color (GDataCalendarCalendar *self, const GDataColor *color); +gboolean gdata_calendar_calendar_is_selected (GDataCalendarCalendar *self) G_GNUC_PURE; +void gdata_calendar_calendar_set_is_selected (GDataCalendarCalendar *self, gboolean is_selected); +const gchar *gdata_calendar_calendar_get_access_level (GDataCalendarCalendar *self) G_GNUC_PURE; + +#ifndef LIBGDATA_DISABLE_DEPRECATED +guint gdata_calendar_calendar_get_times_cleaned (GDataCalendarCalendar *self) G_GNUC_PURE G_GNUC_DEPRECATED; +gint64 gdata_calendar_calendar_get_edited (GDataCalendarCalendar *self) G_GNUC_DEPRECATED; +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_CALENDAR_CALENDAR_H */ diff --git a/gdata/services/calendar/gdata-calendar-event.c b/gdata/services/calendar/gdata-calendar-event.c new file mode 100644 index 0000000..bd58a07 --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-event.c @@ -0,0 +1,1824 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2010, 2014, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-calendar-event + * @short_description: GData Calendar event object + * @stability: Stable + * @include: gdata/services/calendar/gdata-calendar-event.h + * + * #GDataCalendarEvent is a subclass of #GDataEntry to represent an event on a calendar from Google Calendar. + * + * For more details of Google Calendar's GData API, see the + * + * online documentation. + * + * + * Adding a New Event to the Default Calendar + * + * GDataCalendarService *service; + * GDataCalendarEvent *event, *new_event; + * GDataGDWhere *where; + * GDataGDWho *who; + * GDataGDWhen *when; + * GTimeVal current_time; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_calendar_service (); + * + * /* Create the new event */ + * event = gdata_calendar_event_new (NULL); + * + * gdata_entry_set_title (GDATA_ENTRY (event), "Event Title"); + * gdata_entry_set_content (GDATA_ENTRY (event), "Event description. This should be a few sentences long."); + * gdata_calendar_event_set_status (event, GDATA_GD_EVENT_STATUS_CONFIRMED); + * + * where = gdata_gd_where_new (NULL, "Description of the location", NULL); + * gdata_calendar_event_add_place (event, where); + * g_object_unref (where); + * + * who = gdata_gd_who_new (GDATA_GD_WHO_EVENT_ORGANIZER, "John Smith", "john.smith@gmail.com"); + * gdata_calendar_event_add_person (event, who); + * g_object_unref (who); + * + * g_get_current_time (¤t_time); + * when = gdata_gd_when_new (current_time.tv_sec, current_time.tv_sec + 3600, FALSE); + * gdata_calendar_event_add_time (event, when); + * g_object_unref (when); + * + * /* Insert the event in the calendar */ + * new_event = gdata_calendar_service_insert_event (service, event, NULL, &error); + * + * g_object_unref (event); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error inserting event: %s", error->message); + * g_error_free (error); + * return NULL; + * } + * + * /* Do something with the new_event here, such as return it to the user or store its ID for later usage */ + * + * g_object_unref (new_event); + * + * + */ + +#include +#include +#include +#include + +#include "gdata-calendar-event.h" +#include "gdata-private.h" +#include "gdata-service.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-comparable.h" + +static GObject *gdata_calendar_event_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); +static void gdata_calendar_event_dispose (GObject *object); +static void gdata_calendar_event_finalize (GObject *object); +static void gdata_calendar_event_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_calendar_event_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_json (GDataParsable *parsable, JsonBuilder *builder); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static gboolean post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error); +static const gchar *get_content_type (void); + +struct _GDataCalendarEventPrivate { + gint64 edited; + gchar *status; + gchar *visibility; + gchar *transparency; + gchar *uid; + gint64 sequence; + GList *times; /* GDataGDWhen */ + gboolean guests_can_modify; + gboolean guests_can_invite_others; + gboolean guests_can_see_guests; + gboolean anyone_can_add_self; + GList *people; /* GDataGDWho */ + GList *places; /* GDataGDWhere */ + gchar *recurrence; + gchar *original_event_id; + gchar *original_event_uri; + gchar *organiser_email; /* owned */ + + /* Parsing state. */ + struct { + gint64 start_time; + gint64 end_time; + gboolean seen_start; + gboolean seen_end; + gboolean start_is_date; + gboolean end_is_date; + } parser; +}; + +enum { + PROP_EDITED = 1, + PROP_STATUS, + PROP_VISIBILITY, + PROP_TRANSPARENCY, + PROP_UID, + PROP_SEQUENCE, + PROP_GUESTS_CAN_MODIFY, + PROP_GUESTS_CAN_INVITE_OTHERS, + PROP_GUESTS_CAN_SEE_GUESTS, + PROP_ANYONE_CAN_ADD_SELF, + PROP_RECURRENCE, + PROP_ORIGINAL_EVENT_ID, + PROP_ORIGINAL_EVENT_URI +}; + +G_DEFINE_TYPE (GDataCalendarEvent, gdata_calendar_event, GDATA_TYPE_ENTRY) + +static void +gdata_calendar_event_class_init (GDataCalendarEventClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataCalendarEventPrivate)); + + gobject_class->constructor = gdata_calendar_event_constructor; + gobject_class->get_property = gdata_calendar_event_get_property; + gobject_class->set_property = gdata_calendar_event_set_property; + gobject_class->dispose = gdata_calendar_event_dispose; + gobject_class->finalize = gdata_calendar_event_finalize; + + parsable_class->parse_json = parse_json; + parsable_class->post_parse_json = post_parse_json; + parsable_class->get_json = get_json; + parsable_class->get_content_type = get_content_type; + + entry_class->kind_term = "calendar#event"; + + /** + * GDataCalendarEvent:edited: + * + * The last time the event was edited. If the event has not been edited yet, the content indicates the time it was created. + * + * For more information, see the + * Atom Publishing Protocol specification. + */ + g_object_class_install_property (gobject_class, PROP_EDITED, + g_param_spec_int64 ("edited", + "Edited", "The last time the event was edited.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:status: + * + * The scheduling status of the event. For example: %GDATA_GD_EVENT_STATUS_CANCELED or %GDATA_GD_EVENT_STATUS_CONFIRMED. + * + * For more information, see the + * GData specification. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_STATUS, + g_param_spec_string ("status", + "Status", "The scheduling status of the event.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:visibility: + * + * The event's visibility to calendar users. For example: %GDATA_GD_EVENT_VISIBILITY_PUBLIC or %GDATA_GD_EVENT_VISIBILITY_DEFAULT. + * + * For more information, see the + * GData specification. + */ + g_object_class_install_property (gobject_class, PROP_VISIBILITY, + g_param_spec_string ("visibility", + "Visibility", "The event's visibility to calendar users.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:transparency: + * + * How the event is marked as consuming time on a calendar. For example: %GDATA_GD_EVENT_TRANSPARENCY_OPAQUE or + * %GDATA_GD_EVENT_TRANSPARENCY_TRANSPARENT. + * + * For more information, see the + * GData specification. + */ + g_object_class_install_property (gobject_class, PROP_TRANSPARENCY, + g_param_spec_string ("transparency", + "Transparency", "How the event is marked as consuming time on a calendar.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:uid: + * + * The globally unique identifier (UID) of the event as defined in Section 4.8.4.7 of RFC 2445. + */ + g_object_class_install_property (gobject_class, PROP_UID, + g_param_spec_string ("uid", + "UID", "The globally unique identifier (UID) of the event.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:sequence: + * + * The revision sequence number of the event as defined in Section 4.8.7.4 of RFC 2445. + */ + g_object_class_install_property (gobject_class, PROP_SEQUENCE, + g_param_spec_uint ("sequence", + "Sequence", "The revision sequence number of the event.", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:guests-can-modify: + * + * Indicates whether attendees may modify the original event, so that changes are visible to organizers and other attendees. + * Otherwise, any changes made by attendees will be restricted to that attendee's calendar. + * + * For more information, see the + * + * GData specification. + */ + g_object_class_install_property (gobject_class, PROP_GUESTS_CAN_MODIFY, + g_param_spec_boolean ("guests-can-modify", + "Guests can modify", "Indicates whether attendees may modify the original event.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:guests-can-invite-others: + * + * Indicates whether attendees may invite others to the event. + * + * For more information, see the GData specification. + */ + g_object_class_install_property (gobject_class, PROP_GUESTS_CAN_INVITE_OTHERS, + g_param_spec_boolean ("guests-can-invite-others", + "Guests can invite others", "Indicates whether attendees may invite others.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:guests-can-see-guests: + * + * Indicates whether attendees can see other people invited to the event. + * + * For more information, see the + * + * GData specification. + */ + g_object_class_install_property (gobject_class, PROP_GUESTS_CAN_SEE_GUESTS, + g_param_spec_boolean ("guests-can-see-guests", + "Guests can see guests", "Indicates whether attendees can see other people invited.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:anyone-can-add-self: + * + * Indicates whether anyone can invite themselves to the event, by adding themselves to the attendee list. + */ + g_object_class_install_property (gobject_class, PROP_ANYONE_CAN_ADD_SELF, + g_param_spec_boolean ("anyone-can-add-self", + "Anyone can add self", "Indicates whether anyone can invite themselves to the event.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:recurrence: + * + * Represents the dates and times when a recurring event takes place. The returned string is in iCal format, as a list of properties. + * + * For more information, see the + * GData specification. + * + * Note: gdata_calendar_event_add_time() and gdata_calendar_event_set_recurrence() are mutually + * exclusive. See the documentation for gdata_calendar_event_add_time() for details. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_RECURRENCE, + g_param_spec_string ("recurrence", + "Recurrence", "Represents the dates and times when a recurring event takes place.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:original-event-id: + * + * The event ID for the original event, if this event is an exception to a recurring event. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_ORIGINAL_EVENT_ID, + g_param_spec_string ("original-event-id", + "Original event ID", "The event ID for the original event.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarEvent:original-event-uri: + * + * The event URI for the original event, if this event is an exception to a recurring event. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_ORIGINAL_EVENT_URI, + g_param_spec_string ("original-event-uri", + "Original event URI", "The event URI for the original event.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_calendar_event_init (GDataCalendarEvent *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_CALENDAR_EVENT, GDataCalendarEventPrivate); + self->priv->edited = -1; +} + +static GObject * +gdata_calendar_event_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) +{ + GObject *object; + + /* Chain up to the parent class */ + object = G_OBJECT_CLASS (gdata_calendar_event_parent_class)->constructor (type, n_construct_params, construct_params); + + if (_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object)) == FALSE) { + GDataCalendarEventPrivate *priv = GDATA_CALENDAR_EVENT (object)->priv; + GTimeVal time_val; + + /* Set the edited property to the current time (creation time). We don't do this in *_init() since that would cause + * setting it from parse_xml() to fail (duplicate element). */ + g_get_current_time (&time_val); + priv->edited = time_val.tv_sec; + } + + return object; +} + +static void +gdata_calendar_event_dispose (GObject *object) +{ + GDataCalendarEventPrivate *priv = GDATA_CALENDAR_EVENT (object)->priv; + + if (priv->times != NULL) { + g_list_foreach (priv->times, (GFunc) g_object_unref, NULL); + g_list_free (priv->times); + } + priv->times = NULL; + + if (priv->people != NULL) { + g_list_foreach (priv->people, (GFunc) g_object_unref, NULL); + g_list_free (priv->people); + } + priv->people = NULL; + + if (priv->places != NULL) { + g_list_foreach (priv->places, (GFunc) g_object_unref, NULL); + g_list_free (priv->places); + } + priv->places = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_calendar_event_parent_class)->dispose (object); +} + +static void +gdata_calendar_event_finalize (GObject *object) +{ + GDataCalendarEventPrivate *priv = GDATA_CALENDAR_EVENT (object)->priv; + + g_free (priv->status); + g_free (priv->visibility); + g_free (priv->transparency); + g_free (priv->uid); + g_free (priv->recurrence); + g_free (priv->original_event_id); + g_free (priv->original_event_uri); + g_free (priv->organiser_email); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_calendar_event_parent_class)->finalize (object); +} + +static void +gdata_calendar_event_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataCalendarEventPrivate *priv = GDATA_CALENDAR_EVENT (object)->priv; + + switch (property_id) { + case PROP_EDITED: + g_value_set_int64 (value, priv->edited); + break; + case PROP_STATUS: + g_value_set_string (value, priv->status); + break; + case PROP_VISIBILITY: + g_value_set_string (value, priv->visibility); + break; + case PROP_TRANSPARENCY: + g_value_set_string (value, priv->transparency); + break; + case PROP_UID: + g_value_set_string (value, priv->uid); + break; + case PROP_SEQUENCE: + g_value_set_uint (value, CLAMP (priv->sequence, 0, G_MAXUINT)); + break; + case PROP_GUESTS_CAN_MODIFY: + g_value_set_boolean (value, priv->guests_can_modify); + break; + case PROP_GUESTS_CAN_INVITE_OTHERS: + g_value_set_boolean (value, priv->guests_can_invite_others); + break; + case PROP_GUESTS_CAN_SEE_GUESTS: + g_value_set_boolean (value, priv->guests_can_see_guests); + break; + case PROP_ANYONE_CAN_ADD_SELF: + g_value_set_boolean (value, priv->anyone_can_add_self); + break; + case PROP_RECURRENCE: + g_value_set_string (value, priv->recurrence); + break; + case PROP_ORIGINAL_EVENT_ID: + g_value_set_string (value, priv->original_event_id); + break; + case PROP_ORIGINAL_EVENT_URI: + g_value_set_string (value, priv->original_event_uri); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_calendar_event_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataCalendarEvent *self = GDATA_CALENDAR_EVENT (object); + + switch (property_id) { + case PROP_STATUS: + gdata_calendar_event_set_status (self, g_value_get_string (value)); + break; + case PROP_VISIBILITY: + gdata_calendar_event_set_visibility (self, g_value_get_string (value)); + break; + case PROP_TRANSPARENCY: + gdata_calendar_event_set_transparency (self, g_value_get_string (value)); + break; + case PROP_UID: + gdata_calendar_event_set_uid (self, g_value_get_string (value)); + break; + case PROP_SEQUENCE: + gdata_calendar_event_set_sequence (self, g_value_get_uint (value)); + break; + case PROP_GUESTS_CAN_MODIFY: + gdata_calendar_event_set_guests_can_modify (self, g_value_get_boolean (value)); + break; + case PROP_GUESTS_CAN_INVITE_OTHERS: + gdata_calendar_event_set_guests_can_invite_others (self, g_value_get_boolean (value)); + break; + case PROP_GUESTS_CAN_SEE_GUESTS: + gdata_calendar_event_set_guests_can_see_guests (self, g_value_get_boolean (value)); + break; + case PROP_ANYONE_CAN_ADD_SELF: + gdata_calendar_event_set_anyone_can_add_self (self, g_value_get_boolean (value)); + break; + case PROP_RECURRENCE: + gdata_calendar_event_set_recurrence (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +date_object_from_json (JsonReader *reader, + const gchar *member_name, + GDataParserOptions options, + gint64 *date_time_output, + gboolean *is_date_output, + gboolean *success, + GError **error) +{ + gint64 date_time; + gboolean is_date = FALSE; + gboolean found_member = FALSE; + + /* Check if there’s such an element */ + if (g_strcmp0 (json_reader_get_member_name (reader), member_name) != 0) { + return FALSE; + } + + /* Check that it’s an object. */ + if (!json_reader_is_object (reader)) { + const GError *child_error; + + /* Manufacture an error. */ + json_reader_read_member (reader, "dateTime"); + child_error = json_reader_get_error (reader); + g_assert (child_error != NULL); + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + json_reader_end_member (reader); + + return TRUE; + } + + /* Try to parse either the dateTime or date member. */ + if (json_reader_read_member (reader, "dateTime")) { + const gchar *date_string; + const GError *child_error; + GTimeVal time_val; + + date_string = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + json_reader_end_member (reader); + return TRUE; + } + + if (!g_time_val_from_iso8601 (date_string, &time_val)) { + *success = gdata_parser_error_not_iso8601_format_json (reader, date_string, error); + json_reader_end_member (reader); + return TRUE; + } + + date_time = time_val.tv_sec; + is_date = FALSE; + found_member = TRUE; + } + json_reader_end_member (reader); + + if (json_reader_read_member (reader, "date")) { + const gchar *date_string; + const GError *child_error; + + date_string = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + json_reader_end_member (reader); + return TRUE; + } + + if (!gdata_parser_int64_from_date (date_string, &date_time)) { + *success = gdata_parser_error_not_iso8601_format_json (reader, date_string, error); + json_reader_end_member (reader); + return TRUE; + } + + is_date = TRUE; + found_member = TRUE; + } + json_reader_end_member (reader); + + /* Ignore timeZone; it should be specified in dateTime. */ + if (!found_member) { + *success = gdata_parser_error_required_json_content_missing (reader, error); + return TRUE; + } + + *date_time_output = date_time; + *is_date_output = is_date; + *success = TRUE; + + return TRUE; +} + +/* Convert between v2 and v3 versions of various enum values. v2 uses a URI + * style with a constant prefix; v3 simply drops this prefix, and changes the + * spelling of ‘canceled’ to ‘cancelled’. */ +#define V2_PREFIX "http://schemas.google.com/g/2005#event." + +static gchar * +add_v2_prefix (const gchar *in) +{ + return g_strconcat (V2_PREFIX, in, NULL); +} + +static const gchar * +strip_v2_prefix (const gchar *uri) +{ + /* Convert to v3 format. */ + if (g_str_has_prefix (uri, V2_PREFIX)) { + return uri + strlen (V2_PREFIX); + } else { + return uri; + } +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + gboolean success; + GDataCalendarEvent *self = GDATA_CALENDAR_EVENT (parsable); + GDataCalendarEventPrivate *priv = self->priv; + + /* FIXME: Currently unsupported: + * - htmlLink + * - colorId + * - endTimeUnspecified + * - originalStartTime + * - attendeesOmitted + * - extendedProperties + * - hangoutLink + * - gadget + * - privateCopy + * - locked + * - reminders + * - source + */ + + if (g_strcmp0 (json_reader_get_member_name (reader), "start") == 0) { + self->priv->parser.seen_start = TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "end") == 0) { + self->priv->parser.seen_end = TRUE; + } + + if (gdata_parser_string_from_json_member (reader, "recurringEventId", P_DEFAULT, &self->priv->original_event_id, &success, error) || + gdata_parser_boolean_from_json_member (reader, "guestsCanModify", P_DEFAULT, &self->priv->guests_can_modify, &success, error) || + gdata_parser_boolean_from_json_member (reader, "guestsCanInviteOthers", P_DEFAULT, &self->priv->guests_can_invite_others, &success, error) || + gdata_parser_boolean_from_json_member (reader, "guestsCanSeeOtherGuests", P_DEFAULT, &self->priv->guests_can_see_guests, &success, error) || + gdata_parser_boolean_from_json_member (reader, "anyoneCanAddSelf", P_DEFAULT, &self->priv->anyone_can_add_self, &success, error) || + gdata_parser_string_from_json_member (reader, "iCalUID", P_DEFAULT, &self->priv->uid, &success, error) || + gdata_parser_int_from_json_member (reader, "sequence", P_DEFAULT, &self->priv->sequence, &success, error) || + gdata_parser_int64_time_from_json_member (reader, "updated", P_DEFAULT, &self->priv->edited, &success, error) || + date_object_from_json (reader, "start", P_DEFAULT, &self->priv->parser.start_time, &self->priv->parser.start_is_date, &success, error) || + date_object_from_json (reader, "end", P_DEFAULT, &self->priv->parser.end_time, &self->priv->parser.end_is_date, &success, error)) { + if (success) { + if (self->priv->edited != -1) { + _gdata_entry_set_updated (GDATA_ENTRY (parsable), + self->priv->edited); + } + + if (self->priv->original_event_id != NULL) { + g_free (self->priv->original_event_uri); + self->priv->original_event_uri = g_strconcat ("https://www.googleapis.com/calendar/v3/events/", + self->priv->original_event_id, NULL); + } + + if (self->priv->parser.seen_start && self->priv->parser.seen_end) { + GDataGDWhen *when; + + when = gdata_gd_when_new (self->priv->parser.start_time, + self->priv->parser.end_time, + self->priv->parser.start_is_date || + self->priv->parser.end_is_date); + self->priv->times = g_list_prepend (self->priv->times, when); /* transfer ownership */ + + self->priv->parser.seen_start = FALSE; + self->priv->parser.seen_end = FALSE; + } + } + + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "transparency") == 0) { + gchar *transparency = NULL; /* owned */ + + g_assert (gdata_parser_string_from_json_member (reader, + "transparency", + P_DEFAULT, + &transparency, + &success, + error)); + + if (success) { + priv->transparency = add_v2_prefix (transparency); + } + + g_free (transparency); + + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "visibility") == 0) { + gchar *visibility = NULL; /* owned */ + + g_assert (gdata_parser_string_from_json_member (reader, + "visibility", + P_DEFAULT, + &visibility, + &success, + error)); + + if (success) { + priv->visibility = add_v2_prefix (visibility); + } + + g_free (visibility); + + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "status") == 0) { + gchar *status = NULL; /* owned */ + + g_assert (gdata_parser_string_from_json_member (reader, + "status", + P_DEFAULT, + &status, + &success, + error)); + + if (success) { + if (g_strcmp0 (status, "cancelled") == 0) { + /* Those damned British Englishes. */ + priv->status = add_v2_prefix ("canceled"); + } else { + priv->status = add_v2_prefix (status); + } + } + + g_free (status); + + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "summary") == 0) { + const gchar *summary; + const GError *child_error = NULL; + + summary = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + gdata_parser_error_from_json_error (reader, + child_error, error); + return FALSE; + } + + gdata_entry_set_title (GDATA_ENTRY (parsable), summary); + } else if (g_strcmp0 (json_reader_get_member_name (reader), "description") == 0) { + const gchar *description; + const GError *child_error = NULL; + + description = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + gdata_parser_error_from_json_error (reader, + child_error, error); + return FALSE; + } + + gdata_entry_set_content (GDATA_ENTRY (parsable), description); + } else if (g_strcmp0 (json_reader_get_member_name (reader), "location") == 0) { + const gchar *location; + GDataGDWhere *where = NULL; /* owned */ + const GError *child_error = NULL; + + location = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + gdata_parser_error_from_json_error (reader, + child_error, error); + return FALSE; + } + + where = gdata_gd_where_new (GDATA_GD_WHERE_EVENT, + location, NULL); + priv->places = g_list_prepend (priv->places, where); /* transfer ownership */ + } else if (g_strcmp0 (json_reader_get_member_name (reader), "created") == 0) { + gint64 created; + + g_assert (gdata_parser_int64_time_from_json_member (reader, + "created", + P_DEFAULT, + &created, + &success, + error)); + + if (success) { + _gdata_entry_set_published (GDATA_ENTRY (parsable), + created); + } + + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "recurrence") == 0) { + guint i, j; + GString *recurrence = NULL; /* owned */ + + /* In the JSON API, the recurrence is given as an array of + * strings, each giving an RFC 2445 property such as RRULE, + * EXRULE, RDATE or EXDATE. Concatenate them all to form a + * recurrence string as used in v2 of the API. */ + if (self->priv->recurrence != NULL) { + return gdata_parser_error_duplicate_json_element (reader, + error); + } + + recurrence = g_string_new (""); + + for (i = 0, j = json_reader_count_elements (reader); i < j; i++) { + const gchar *line; + const GError *child_error; + + json_reader_read_element (reader, i); + + line = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + if (child_error != NULL) { + gdata_parser_error_from_json_error (reader, child_error, error); + json_reader_end_element (reader); + return FALSE; + } + + g_string_append (recurrence, line); + g_string_append (recurrence, "\n"); + + json_reader_end_element (reader); + } + + g_assert (self->priv->recurrence == NULL); + self->priv->recurrence = g_string_free (recurrence, FALSE); + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "attendees") == 0) { + guint i, j; + + if (priv->people != NULL) { + return gdata_parser_error_duplicate_json_element (reader, + error); + } + + for (i = 0, j = json_reader_count_elements (reader); i < j; i++) { + GDataGDWho *who = NULL; /* owned */ + const gchar *email_address, *value_string; + const gchar *relation_type; + gboolean is_organizer, is_resource; + const GError *child_error; + + json_reader_read_element (reader, i); + + json_reader_read_member (reader, "responseStatus"); + child_error = json_reader_get_error (reader); + if (child_error != NULL) { + gdata_parser_error_from_json_error (reader, + child_error, + error); + json_reader_end_member (reader); + return FALSE; + } + json_reader_end_member (reader); + + json_reader_read_member (reader, "email"); + email_address = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "displayName"); + value_string = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "organizer"); + is_organizer = json_reader_get_boolean_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "resource"); + is_resource = json_reader_get_boolean_value (reader); + json_reader_end_member (reader); + + /* FIXME: Currently unsupported: + * - id + * - self + * - optional (writeble) + * - responseStatus (writeble) + * - comment (writeble) + * - additionalGuests (writeble) + */ + + if (is_organizer) { + relation_type = GDATA_GD_WHO_EVENT_ORGANIZER; + } else if (!is_resource) { + relation_type = GDATA_GD_WHO_EVENT_ATTENDEE; + } else { + /* FIXME: Add support for resources. */ + relation_type = NULL; + } + + who = gdata_gd_who_new (relation_type, value_string, + email_address); + priv->people = g_list_prepend (priv->people, who); /* transfer ownership */ + + json_reader_end_element (reader); + } + } else if (g_strcmp0 (json_reader_get_member_name (reader), "organizer") == 0) { + /* This actually gives the parent calendar. Optional. */ + g_clear_pointer (&priv->organiser_email, g_free); + if (json_reader_read_member (reader, "email")) + priv->organiser_email = g_strdup (json_reader_get_string_value (reader)); + json_reader_end_member (reader); + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "creator") == 0) { + /* These are read-only and already handled as part of + * ‘attendees’, so ignore them. */ + return TRUE; + } else { + return GDATA_PARSABLE_CLASS (gdata_calendar_event_parent_class)->parse_json (parsable, reader, user_data, error); + } + + return TRUE; +} + +static gboolean +post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataLink *_link = NULL; /* owned */ + const gchar *id, *calendar_id; + gchar *uri = NULL; /* owned */ + GDataCalendarEventPrivate *priv; + + priv = GDATA_CALENDAR_EVENT (parsable)->priv; + + /* Set the self link, which is needed for gdata_service_delete_entry(). + * Unfortunately, it needs the event ID _and_ the calendar ID — which + * is perversely only available as the organiser e-mail address. */ + id = gdata_entry_get_id (GDATA_ENTRY (parsable)); + calendar_id = priv->organiser_email; + + if (id == NULL || calendar_id == NULL) { + return TRUE; + } + + uri = g_strconcat ("https://www.googleapis.com/calendar/v3/calendars/", + calendar_id, "/events/", id, NULL); + _link = gdata_link_new (uri, GDATA_LINK_SELF); + gdata_entry_add_link (GDATA_ENTRY (parsable), _link); + g_object_unref (_link); + g_free (uri); + + return TRUE; +} + +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + GList *l; + const gchar *id, *etag, *title, *description; + GDataGDWho *organiser_who = NULL; /* unowned */ + GDataCalendarEventPrivate *priv = GDATA_CALENDAR_EVENT (parsable)->priv; + + /* FIXME: Support: + * - colorId + * - attendeesOmitted + * - extendedProperties + * - gadget + * - reminders + * - source + */ + + id = gdata_entry_get_id (GDATA_ENTRY (parsable)); + if (id != NULL) { + json_builder_set_member_name (builder, "id"); + json_builder_add_string_value (builder, id); + } + + json_builder_set_member_name (builder, "kind"); + json_builder_add_string_value (builder, "calendar#event"); + + /* Add the ETag, if available. */ + etag = gdata_entry_get_etag (GDATA_ENTRY (parsable)); + if (etag != NULL) { + json_builder_set_member_name (builder, "etag"); + json_builder_add_string_value (builder, etag); + } + + /* Calendar labels titles as ‘summary’. */ + title = gdata_entry_get_title (GDATA_ENTRY (parsable)); + if (title != NULL) { + json_builder_set_member_name (builder, "summary"); + json_builder_add_string_value (builder, title); + } + + description = gdata_entry_get_content (GDATA_ENTRY (parsable)); + if (description != NULL) { + json_builder_set_member_name (builder, "description"); + json_builder_add_string_value (builder, description); + } + + /* Add all the calendar-specific JSON */ + json_builder_set_member_name (builder, "anyoneCanAddSelf"); + json_builder_add_boolean_value (builder, priv->anyone_can_add_self); + + json_builder_set_member_name (builder, "guestsCanInviteOthers"); + json_builder_add_boolean_value (builder, priv->guests_can_invite_others); + + json_builder_set_member_name (builder, "guestsCanModify"); + json_builder_add_boolean_value (builder, priv->guests_can_modify); + + json_builder_set_member_name (builder, "guestsCanSeeOtherGuests"); + json_builder_add_boolean_value (builder, priv->guests_can_see_guests); + + if (priv->transparency != NULL) { + json_builder_set_member_name (builder, "transparency"); + json_builder_add_string_value (builder, + strip_v2_prefix (priv->transparency)); + } + + if (priv->visibility != NULL) { + json_builder_set_member_name (builder, "visibility"); + json_builder_add_string_value (builder, + strip_v2_prefix (priv->visibility)); + } + + if (priv->uid != NULL) { + json_builder_set_member_name (builder, "iCalUID"); + json_builder_add_string_value (builder, priv->uid); + } + + if (priv->sequence > 0) { + json_builder_set_member_name (builder, "sequence"); + json_builder_add_int_value (builder, priv->sequence); + } + + if (priv->status != NULL) { + const gchar *status; + + /* Convert to v3 format. */ + status = strip_v2_prefix (priv->status); + if (g_strcmp0 (status, "canceled") == 0) { + status = "cancelled"; + } + + json_builder_set_member_name (builder, "status"); + json_builder_add_string_value (builder, status); + } + + if (priv->recurrence != NULL) { + gchar **parts; + guint i; + + json_builder_set_member_name (builder, "recurrence"); + json_builder_begin_array (builder); + + parts = g_strsplit (priv->recurrence, "\n", -1); + + for (i = 0; parts[i] != NULL; i++) { + json_builder_add_string_value (builder, parts[i]); + } + + g_strfreev (parts); + + json_builder_end_array (builder); + } + + if (priv->original_event_id != NULL) { + json_builder_set_member_name (builder, "recurringEventId"); + json_builder_add_string_value (builder, priv->original_event_id); + } + + /* Times. */ + for (l = priv->times; l != NULL; l = l->next) { + GDataGDWhen *when; /* unowned */ + gchar *val = NULL; /* owned */ + const gchar *member_name; + gint64 start_time, end_time; + + when = l->data; + + /* Start time. */ + start_time = gdata_gd_when_get_start_time (when); + json_builder_set_member_name (builder, "start"); + json_builder_begin_object (builder); + + if (gdata_gd_when_is_date (when)) { + member_name = "date"; + val = gdata_parser_date_from_int64 (start_time); + } else { + member_name = "dateTime"; + val = gdata_parser_int64_to_iso8601 (start_time); + } + + json_builder_set_member_name (builder, member_name); + json_builder_add_string_value (builder, val); + g_free (val); + + json_builder_set_member_name (builder, "timeZone"); + json_builder_add_string_value (builder, "UTC"); + + json_builder_end_object (builder); + + /* End time. */ + end_time = gdata_gd_when_get_end_time (when); + + if (end_time > -1) { + json_builder_set_member_name (builder, "end"); + json_builder_begin_object (builder); + + if (gdata_gd_when_is_date (when)) { + member_name = "date"; + val = gdata_parser_date_from_int64 (end_time); + } else { + member_name = "dateTime"; + val = gdata_parser_int64_to_iso8601 (end_time); + } + + json_builder_set_member_name (builder, member_name); + json_builder_add_string_value (builder, val); + g_free (val); + + json_builder_set_member_name (builder, "timeZone"); + json_builder_add_string_value (builder, "UTC"); + + json_builder_end_object (builder); + } else { + json_builder_set_member_name (builder, "endTimeUnspecified"); + json_builder_add_boolean_value (builder, TRUE); + } + + /* Only use the first time. :-( + * FIXME: There must be a better solution. */ + if (l->next != NULL) { + g_warning ("Ignoring secondary times; they are no " + "longer supported by the server-side API."); + break; + } + } + + /* Locations. */ + for (l = priv->places; l != NULL; l = l->next) { + GDataGDWhere *where; /* unowned */ + const gchar *location; + + where = l->data; + location = gdata_gd_where_get_value_string (where); + + json_builder_set_member_name (builder, "location"); + json_builder_add_string_value (builder, location); + + /* Only use the first location. :-( + * FIXME: There must be a better solution. */ + if (l->next != NULL) { + g_warning ("Ignoring secondary locations; they are no " + "longer supported by the server-side API."); + break; + } + } + + /* People. */ + json_builder_set_member_name (builder, "attendees"); + json_builder_begin_array (builder); + + for (l = priv->people; l != NULL; l = l->next) { + GDataGDWho *who; /* unowned */ + const gchar *display_name, *email_address; + + who = l->data; + + json_builder_begin_object (builder); + + display_name = gdata_gd_who_get_value_string (who); + if (display_name != NULL) { + json_builder_set_member_name (builder, "displayName"); + json_builder_add_string_value (builder, display_name); + } + + email_address = gdata_gd_who_get_email_address (who); + if (email_address != NULL) { + json_builder_set_member_name (builder, "email"); + json_builder_add_string_value (builder, email_address); + } + + if (g_strcmp0 (gdata_gd_who_get_relation_type (who), + GDATA_GD_WHO_EVENT_ORGANIZER) == 0) { + json_builder_set_member_name (builder, "organizer"); + json_builder_add_boolean_value (builder, TRUE); + + organiser_who = who; + } + + json_builder_end_object (builder); + } + + json_builder_end_array (builder); + + if (organiser_who != NULL) { + const gchar *display_name, *email_address; + + json_builder_set_member_name (builder, "organizer"); + json_builder_begin_object (builder); + + display_name = gdata_gd_who_get_value_string (organiser_who); + if (display_name != NULL) { + json_builder_set_member_name (builder, "displayName"); + json_builder_add_string_value (builder, display_name); + } + + email_address = gdata_gd_who_get_email_address (organiser_who); + if (email_address != NULL) { + json_builder_set_member_name (builder, "email"); + json_builder_add_string_value (builder, email_address); + } + + json_builder_end_object (builder); + } +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +/** + * gdata_calendar_event_new: + * @id: (allow-none): the event's ID, or %NULL + * + * Creates a new #GDataCalendarEvent with the given ID and default properties. + * + * Return value: a new #GDataCalendarEvent; unref with g_object_unref() + */ +GDataCalendarEvent * +gdata_calendar_event_new (const gchar *id) +{ + return GDATA_CALENDAR_EVENT (g_object_new (GDATA_TYPE_CALENDAR_EVENT, "id", id, NULL)); +} + +/** + * gdata_calendar_event_get_edited: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:edited property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the event was last edited, or -1 + */ +gint64 +gdata_calendar_event_get_edited (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), -1); + return self->priv->edited; +} + +/** + * gdata_calendar_event_get_status: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:status property. + * + * Return value: the event status, or %NULL + * + * Since: 0.2.0 + */ +const gchar * +gdata_calendar_event_get_status (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), NULL); + return self->priv->status; +} + +/** + * gdata_calendar_event_set_status: + * @self: a #GDataCalendarEvent + * @status: (allow-none): a new event status, or %NULL + * + * Sets the #GDataCalendarEvent:status property to the new status, @status. + * + * Set @status to %NULL to unset the property in the event. + * + * Since: 0.2.0 + */ +void +gdata_calendar_event_set_status (GDataCalendarEvent *self, const gchar *status) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + + g_free (self->priv->status); + self->priv->status = g_strdup (status); + g_object_notify (G_OBJECT (self), "status"); +} + +/** + * gdata_calendar_event_get_visibility: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:visibility property. + * + * Return value: the event visibility, or %NULL + */ +const gchar * +gdata_calendar_event_get_visibility (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), NULL); + return self->priv->visibility; +} + +/** + * gdata_calendar_event_set_visibility: + * @self: a #GDataCalendarEvent + * @visibility: (allow-none): a new event visibility, or %NULL + * + * Sets the #GDataCalendarEvent:visibility property to the new visibility, @visibility. + * + * Set @visibility to %NULL to unset the property in the event. + */ +void +gdata_calendar_event_set_visibility (GDataCalendarEvent *self, const gchar *visibility) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + + g_free (self->priv->visibility); + self->priv->visibility = g_strdup (visibility); + g_object_notify (G_OBJECT (self), "visibility"); +} + +/** + * gdata_calendar_event_get_transparency: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:transparency property. + * + * Return value: the event transparency, or %NULL + */ +const gchar * +gdata_calendar_event_get_transparency (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), NULL); + return self->priv->transparency; +} + +/** + * gdata_calendar_event_set_transparency: + * @self: a #GDataCalendarEvent + * @transparency: (allow-none): a new event transparency, or %NULL + * + * Sets the #GDataCalendarEvent:transparency property to the new transparency, @transparency. + * + * Set @transparency to %NULL to unset the property in the event. + */ +void +gdata_calendar_event_set_transparency (GDataCalendarEvent *self, const gchar *transparency) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + + g_free (self->priv->transparency); + self->priv->transparency = g_strdup (transparency); + g_object_notify (G_OBJECT (self), "transparency"); +} + +/** + * gdata_calendar_event_get_uid: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:uid property. + * + * Return value: the event's UID, or %NULL + */ +const gchar * +gdata_calendar_event_get_uid (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), NULL); + return self->priv->uid; +} + +/** + * gdata_calendar_event_set_uid: + * @self: a #GDataCalendarEvent + * @uid: (allow-none): a new event UID, or %NULL + * + * Sets the #GDataCalendarEvent:uid property to the new UID, @uid. + * + * Set @uid to %NULL to unset the property in the event. + */ +void +gdata_calendar_event_set_uid (GDataCalendarEvent *self, const gchar *uid) +{ + /* TODO: is modifying this allowed? */ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + + g_free (self->priv->uid); + self->priv->uid = g_strdup (uid); + g_object_notify (G_OBJECT (self), "uid"); +} + +/** + * gdata_calendar_event_get_sequence: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:sequence property. + * + * Return value: the event's sequence number + */ +guint +gdata_calendar_event_get_sequence (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), 0); + return CLAMP (self->priv->sequence, 0, G_MAXUINT); +} + +/** + * gdata_calendar_event_set_sequence: + * @self: a #GDataCalendarEvent + * @sequence: a new sequence number, or 0 + * + * Sets the #GDataCalendarEvent:sequence property to the new sequence number, @sequence. + */ +void +gdata_calendar_event_set_sequence (GDataCalendarEvent *self, guint sequence) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + self->priv->sequence = sequence; + g_object_notify (G_OBJECT (self), "sequence"); +} + +/** + * gdata_calendar_event_get_guests_can_modify: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:guests-can-modify property. + * + * Return value: %TRUE if attendees can modify the original event, %FALSE otherwise + */ +gboolean +gdata_calendar_event_get_guests_can_modify (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), FALSE); + return self->priv->guests_can_modify; +} + +/** + * gdata_calendar_event_set_guests_can_modify: + * @self: a #GDataCalendarEvent + * @guests_can_modify: %TRUE if attendees can modify the original event, %FALSE otherwise + * + * Sets the #GDataCalendarEvent:guests-can-modify property to @guests_can_modify. + */ +void +gdata_calendar_event_set_guests_can_modify (GDataCalendarEvent *self, gboolean guests_can_modify) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + self->priv->guests_can_modify = guests_can_modify; + g_object_notify (G_OBJECT (self), "guests-can-modify"); +} + +/** + * gdata_calendar_event_get_guests_can_invite_others: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:guests-can-invite-others property. + * + * Return value: %TRUE if attendees can invite others to the event, %FALSE otherwise + */ +gboolean +gdata_calendar_event_get_guests_can_invite_others (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), FALSE); + return self->priv->guests_can_invite_others; +} + +/** + * gdata_calendar_event_set_guests_can_invite_others: + * @self: a #GDataCalendarEvent + * @guests_can_invite_others: %TRUE if attendees can invite others to the event, %FALSE otherwise + * + * Sets the #GDataCalendarEvent:guests-can-invite-others property to @guests_can_invite_others. + */ +void +gdata_calendar_event_set_guests_can_invite_others (GDataCalendarEvent *self, gboolean guests_can_invite_others) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + self->priv->guests_can_invite_others = guests_can_invite_others; + g_object_notify (G_OBJECT (self), "guests-can-invite-others"); +} + +/** + * gdata_calendar_event_get_guests_can_see_guests: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:guests-can-see-guests property. + * + * Return value: %TRUE if attendees can see who's attending the event, %FALSE otherwise + */ +gboolean +gdata_calendar_event_get_guests_can_see_guests (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), FALSE); + return self->priv->guests_can_see_guests; +} + +/** + * gdata_calendar_event_set_guests_can_see_guests: + * @self: a #GDataCalendarEvent + * @guests_can_see_guests: %TRUE if attendees can see who's attending the event, %FALSE otherwise + * + * Sets the #GDataCalendarEvent:guests-can-see-guests property to @guests_can_see_guests. + */ +void +gdata_calendar_event_set_guests_can_see_guests (GDataCalendarEvent *self, gboolean guests_can_see_guests) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + self->priv->guests_can_see_guests = guests_can_see_guests; + g_object_notify (G_OBJECT (self), "guests-can-see-guests"); +} + +/** + * gdata_calendar_event_get_anyone_can_add_self: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:anyone-can-add-self property. + * + * Return value: %TRUE if anyone can add themselves as an attendee to the event, %FALSE otherwise + */ +gboolean +gdata_calendar_event_get_anyone_can_add_self (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), FALSE); + return self->priv->anyone_can_add_self; +} + +/** + * gdata_calendar_event_set_anyone_can_add_self: + * @self: a #GDataCalendarEvent + * @anyone_can_add_self: %TRUE if anyone can add themselves as an attendee to the event, %FALSE otherwise + * + * Sets the #GDataCalendarEvent:anyone-can-add-self property to @anyone_can_add_self. + */ +void +gdata_calendar_event_set_anyone_can_add_self (GDataCalendarEvent *self, gboolean anyone_can_add_self) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + self->priv->anyone_can_add_self = anyone_can_add_self; + g_object_notify (G_OBJECT (self), "anyone-can-add-self"); +} + +/** + * gdata_calendar_event_add_person: + * @self: a #GDataCalendarEvent + * @who: a #GDataGDWho to add + * + * Adds the person @who to the event as a guest (attendee, organiser, performer, etc.), and increments its reference count. + * + * Duplicate people will not be added to the list. + */ +void +gdata_calendar_event_add_person (GDataCalendarEvent *self, GDataGDWho *who) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + g_return_if_fail (GDATA_IS_GD_WHO (who)); + + if (g_list_find_custom (self->priv->people, who, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->people = g_list_append (self->priv->people, g_object_ref (who)); +} + +/** + * gdata_calendar_event_get_people: + * @self: a #GDataCalendarEvent + * + * Gets a list of the people attending the event. + * + * Return value: (element-type GData.GDWho) (transfer none): a #GList of #GDataGDWhos, or %NULL + * + * Since: 0.2.0 + */ +GList * +gdata_calendar_event_get_people (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), NULL); + return self->priv->people; +} + +/** + * gdata_calendar_event_add_place: + * @self: a #GDataCalendarEvent + * @where: a #GDataGDWhere to add + * + * Adds the place @where to the event as a location and increments its reference count. + * + * Duplicate places will not be added to the list. + */ +void +gdata_calendar_event_add_place (GDataCalendarEvent *self, GDataGDWhere *where) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + g_return_if_fail (GDATA_IS_GD_WHERE (where)); + + if (g_list_find_custom (self->priv->places, where, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->places = g_list_append (self->priv->places, g_object_ref (where)); +} + +/** + * gdata_calendar_event_get_places: + * @self: a #GDataCalendarEvent + * + * Gets a list of the locations associated with the event. + * + * Return value: (element-type GData.GDWhere) (transfer none): a #GList of #GDataGDWheres, or %NULL + * + * Since: 0.2.0 + */ +GList * +gdata_calendar_event_get_places (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), NULL); + return self->priv->places; +} + +/** + * gdata_calendar_event_add_time: + * @self: a #GDataCalendarEvent + * @when: a #GDataGDWhen to add + * + * Adds @when to the event as a time period when the event happens, and increments its reference count. + * + * Duplicate times will not be added to the list. + * + * Note: gdata_calendar_event_add_time() and gdata_calendar_event_set_recurrence() are mutually + * exclusive, as the server doesn't support positive exceptions to recurrence rules. If recurrences + * are required, use gdata_calendar_event_set_recurrence(). Note that this means reminders cannot + * be set for the event, as they are only supported by #GDataGDWhen. No checks are performed for + * these forbidden conditions, as to do so would break libgdata's API; if both a recurrence is set + * and a specific time is added, the server will return an error when the #GDataCalendarEvent is + * inserted using gdata_service_insert_entry(). + * + * Since: 0.2.0 + */ +void +gdata_calendar_event_add_time (GDataCalendarEvent *self, GDataGDWhen *when) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + g_return_if_fail (GDATA_IS_GD_WHEN (when)); + + if (g_list_find_custom (self->priv->times, when, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->times = g_list_append (self->priv->times, g_object_ref (when)); +} + +/** + * gdata_calendar_event_get_times: + * @self: a #GDataCalendarEvent + * + * Gets a list of the time periods associated with the event. + * + * Return value: (element-type GData.GDWhen) (transfer none): a #GList of #GDataGDWhens, or %NULL + * + * Since: 0.2.0 + */ +GList * +gdata_calendar_event_get_times (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), NULL); + return self->priv->times; +} + +/** + * gdata_calendar_event_get_primary_time: + * @self: a #GDataCalendarEvent + * @start_time: (out caller-allocates): a #gint64 for the start time, or %NULL + * @end_time: (out caller-allocates): a #gint64 for the end time, or %NULL + * @when: (out callee-allocates) (transfer none): a #GDataGDWhen for the primary time structure, or %NULL + * + * Gets the first time period associated with the event, conveniently returning just its start and + * end times if required. + * + * If there are no time periods, or more than one time period, associated with the event, %FALSE will + * be returned, and the parameters will remain unmodified. + * + * Return value: %TRUE if there is only one time period associated with the event, %FALSE otherwise + * + * Since: 0.2.0 + */ +gboolean +gdata_calendar_event_get_primary_time (GDataCalendarEvent *self, gint64 *start_time, gint64 *end_time, GDataGDWhen **when) +{ + GDataGDWhen *primary_when; + + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), FALSE); + + if (self->priv->times == NULL || self->priv->times->next != NULL) + return FALSE; + + primary_when = GDATA_GD_WHEN (self->priv->times->data); + if (start_time != NULL) + *start_time = gdata_gd_when_get_start_time (primary_when); + if (end_time != NULL) + *end_time = gdata_gd_when_get_end_time (primary_when); + if (when != NULL) + *when = primary_when; + + return TRUE; +} + +/** + * gdata_calendar_event_get_recurrence: + * @self: a #GDataCalendarEvent + * + * Gets the #GDataCalendarEvent:recurrence property. + * + * Return value: the event recurrence patterns, or %NULL + * + * Since: 0.3.0 + */ +const gchar * +gdata_calendar_event_get_recurrence (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), NULL); + return self->priv->recurrence; +} + +/** + * gdata_calendar_event_set_recurrence: + * @self: a #GDataCalendarEvent + * @recurrence: (allow-none): a new event recurrence, or %NULL + * + * Sets the #GDataCalendarEvent:recurrence property to the new recurrence, @recurrence. + * + * Set @recurrence to %NULL to unset the property in the event. + * + * Note: gdata_calendar_event_add_time() and gdata_calendar_event_set_recurrence() are mutually + * exclusive. See the documentation for gdata_calendar_event_add_time() for details. + * + * Since: 0.3.0 + */ +void +gdata_calendar_event_set_recurrence (GDataCalendarEvent *self, const gchar *recurrence) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + + g_free (self->priv->recurrence); + self->priv->recurrence = g_strdup (recurrence); + g_object_notify (G_OBJECT (self), "recurrence"); +} + +/** + * gdata_calendar_event_get_original_event_details: + * @self: a #GDataCalendarEvent + * @event_id: (out callee-allocates) (transfer full): return location for the original event's ID, or %NULL + * @event_uri: (out callee-allocates) (transfer full): return location for the original event's URI, or %NULL + * + * Gets details of the original event, if this event is an exception to a recurring event. The original + * event's ID and the URI of the event's XML are returned in @event_id and @event_uri, respectively. + * + * If this event is not an exception to a recurring event, @event_id and @event_uri will be set to %NULL. + * See gdata_calendar_event_is_exception() to determine more simply whether an event is an exception to a + * recurring event. + * + * If both @event_id and @event_uri are %NULL, this function is a no-op. Otherwise, they should both be + * freed with g_free(). + * + * Since: 0.3.0 + */ +void +gdata_calendar_event_get_original_event_details (GDataCalendarEvent *self, gchar **event_id, gchar **event_uri) +{ + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (self)); + + if (event_id != NULL) + *event_id = g_strdup (self->priv->original_event_id); + if (event_uri != NULL) + *event_uri = g_strdup (self->priv->original_event_uri); +} + +/** + * gdata_calendar_event_is_exception: + * @self: a #GDataCalendarEvent + * + * Determines whether the event is an exception to a recurring event. If it is, details of the original event + * can be retrieved using gdata_calendar_event_get_original_event_details(). + * + * Return value: %TRUE if the event is an exception, %FALSE otherwise + * + * Since: 0.3.0 + */ +gboolean +gdata_calendar_event_is_exception (GDataCalendarEvent *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (self), FALSE); + return (self->priv->original_event_id != NULL && self->priv->original_event_uri != NULL) ? TRUE : FALSE; +} diff --git a/gdata/services/calendar/gdata-calendar-event.h b/gdata/services/calendar/gdata-calendar-event.h new file mode 100644 index 0000000..c19ff50 --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-event.h @@ -0,0 +1,105 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CALENDAR_EVENT_H +#define GDATA_CALENDAR_EVENT_H + +#include +#include + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_CALENDAR_EVENT (gdata_calendar_event_get_type ()) +#define GDATA_CALENDAR_EVENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CALENDAR_EVENT, GDataCalendarEvent)) +#define GDATA_CALENDAR_EVENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CALENDAR_EVENT, GDataCalendarEventClass)) +#define GDATA_IS_CALENDAR_EVENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CALENDAR_EVENT)) +#define GDATA_IS_CALENDAR_EVENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CALENDAR_EVENT)) +#define GDATA_CALENDAR_EVENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CALENDAR_EVENT, GDataCalendarEventClass)) + +typedef struct _GDataCalendarEventPrivate GDataCalendarEventPrivate; + +/** + * GDataCalendarEvent: + * + * All the fields in the #GDataCalendarEvent structure are private and should never be accessed directly. + */ +typedef struct { + GDataEntry parent; + GDataCalendarEventPrivate *priv; +} GDataCalendarEvent; + +/** + * GDataCalendarEventClass: + * + * All the fields in the #GDataCalendarEventClass structure are private and should never be accessed directly. + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataCalendarEventClass; + +GType gdata_calendar_event_get_type (void) G_GNUC_CONST; + +GDataCalendarEvent *gdata_calendar_event_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gint64 gdata_calendar_event_get_edited (GDataCalendarEvent *self); +const gchar *gdata_calendar_event_get_status (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_status (GDataCalendarEvent *self, const gchar *status); +const gchar *gdata_calendar_event_get_visibility (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_visibility (GDataCalendarEvent *self, const gchar *visibility); +const gchar *gdata_calendar_event_get_transparency (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_transparency (GDataCalendarEvent *self, const gchar *transparency); +const gchar *gdata_calendar_event_get_uid (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_uid (GDataCalendarEvent *self, const gchar *uid); +guint gdata_calendar_event_get_sequence (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_sequence (GDataCalendarEvent *self, guint sequence); +gboolean gdata_calendar_event_get_guests_can_modify (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_guests_can_modify (GDataCalendarEvent *self, gboolean guests_can_modify); +gboolean gdata_calendar_event_get_guests_can_invite_others (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_guests_can_invite_others (GDataCalendarEvent *self, gboolean guests_can_invite_others); +gboolean gdata_calendar_event_get_guests_can_see_guests (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_guests_can_see_guests (GDataCalendarEvent *self, gboolean guests_can_see_guests); +gboolean gdata_calendar_event_get_anyone_can_add_self (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_anyone_can_add_self (GDataCalendarEvent *self, gboolean anyone_can_add_self); +void gdata_calendar_event_add_person (GDataCalendarEvent *self, GDataGDWho *who); +GList *gdata_calendar_event_get_people (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_add_place (GDataCalendarEvent *self, GDataGDWhere *where); +GList *gdata_calendar_event_get_places (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_add_time (GDataCalendarEvent *self, GDataGDWhen *when); +GList *gdata_calendar_event_get_times (GDataCalendarEvent *self) G_GNUC_PURE; +gboolean gdata_calendar_event_get_primary_time (GDataCalendarEvent *self, gint64 *start_time, gint64 *end_time, GDataGDWhen **when); +const gchar *gdata_calendar_event_get_recurrence (GDataCalendarEvent *self) G_GNUC_PURE; +void gdata_calendar_event_set_recurrence (GDataCalendarEvent *self, const gchar *recurrence); +void gdata_calendar_event_get_original_event_details (GDataCalendarEvent *self, gchar **event_id, gchar **event_uri); +gboolean gdata_calendar_event_is_exception (GDataCalendarEvent *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_CALENDAR_EVENT_H */ diff --git a/gdata/services/calendar/gdata-calendar-feed.c b/gdata/services/calendar/gdata-calendar-feed.c new file mode 100644 index 0000000..1a8ece3 --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-feed.c @@ -0,0 +1,158 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2010, 2014, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-calendar-feed + * @short_description: GData Calendar feed object + * @stability: Stable + * @include: gdata/services/calendar/gdata-calendar-feed.h + * + * #GDataCalendarFeed is a subclass of #GDataFeed to represent a results feed from Google Calendar. It adds a couple of + * properties which are specific to the Google Calendar API. + */ + +#include +#include + +#include "gdata-calendar-feed.h" +#include "gdata-feed.h" +#include "gdata-private.h" + +static void gdata_calendar_feed_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); + +enum { + PROP_TIMEZONE = 1, + PROP_TIMES_CLEANED +}; + +G_DEFINE_TYPE (GDataCalendarFeed, gdata_calendar_feed, GDATA_TYPE_FEED) + +static void +gdata_calendar_feed_class_init (GDataCalendarFeedClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gdata_calendar_feed_get_property; + + /** + * GDataCalendarFeed:timezone: + * + * The timezone in which the feed's times are given. This is a timezone name in tz database notation: reference. + * + * Since: 0.3.0 + * Deprecated: 0.17.2: Unsupported by the online API any more. There + * is no replacement; this will always return %NULL. + */ + g_object_class_install_property (gobject_class, PROP_TIMEZONE, + g_param_spec_string ("timezone", + "Timezone", "The timezone in which the feed's times are given.", + NULL, + G_PARAM_DEPRECATED | + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarFeed:times-cleaned: + * + * The number of times the feed has been completely cleared of entries. + * + * Since: 0.3.0 + * Deprecated: 0.17.2: Unsupported by the online API any more. There + * is no replacement; this will always return 0. + */ + g_object_class_install_property (gobject_class, PROP_TIMES_CLEANED, + g_param_spec_uint ("times-cleaned", + "Times cleaned", "The number of times the feed has been completely cleared of entries.", + 0, G_MAXUINT, 0, + G_PARAM_DEPRECATED | + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_calendar_feed_init (GDataCalendarFeed *self) +{ + /* Nothing to see here. */ +} + +static void +gdata_calendar_feed_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataCalendarFeed *self = GDATA_CALENDAR_FEED (object); + + switch (property_id) { + case PROP_TIMEZONE: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_value_set_string (value, + gdata_calendar_feed_get_timezone (self)); + G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_TIMES_CLEANED: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_value_set_uint (value, + gdata_calendar_feed_get_times_cleaned (self)); + G_GNUC_END_IGNORE_DEPRECATIONS + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/** + * gdata_calendar_feed_get_timezone: + * @self: a #GDataCalendarFeed + * + * Gets the #GDataCalendarFeed:timezone property. + * + * Return value: the feed's timezone, or %NULL + * + * Since: 0.3.0 + * Deprecated: 0.17.2: Unsupported by the online API any more. There is no + * replacement; this will always return %NULL. + */ +const gchar * +gdata_calendar_feed_get_timezone (GDataCalendarFeed *self) +{ + /* Not supported any more by version 3 of the API. */ + g_return_val_if_fail (GDATA_IS_CALENDAR_FEED (self), NULL); + return NULL; +} + +/** + * gdata_calendar_feed_get_times_cleaned: + * @self: a #GDataCalendarFeed + * + * Gets the #GDataCalendarFeed:times-cleaned property. + * + * Return value: the number of times the feed has been totally emptied + * + * Since: 0.3.0 + * Deprecated: 0.17.2: Unsupported by the online API any more. There is no + * replacement; this will always return %NULL. + */ +guint +gdata_calendar_feed_get_times_cleaned (GDataCalendarFeed *self) +{ + /* Not supported any more by version 3 of the API. */ + g_return_val_if_fail (GDATA_IS_CALENDAR_FEED (self), 0); + return 0; +} diff --git a/gdata/services/calendar/gdata-calendar-feed.h b/gdata/services/calendar/gdata-calendar-feed.h new file mode 100644 index 0000000..43b6452 --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-feed.h @@ -0,0 +1,78 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CALENDAR_FEED_H +#define GDATA_CALENDAR_FEED_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_CALENDAR_FEED (gdata_calendar_feed_get_type ()) +#define GDATA_CALENDAR_FEED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CALENDAR_FEED, GDataCalendarFeed)) +#define GDATA_CALENDAR_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CALENDAR_FEED, GDataCalendarFeedClass)) +#define GDATA_IS_CALENDAR_FEED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CALENDAR_FEED)) +#define GDATA_IS_CALENDAR_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CALENDAR_FEED)) +#define GDATA_CALENDAR_FEED_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CALENDAR_FEED, GDataCalendarFeedClass)) + +typedef struct _GDataCalendarFeedPrivate GDataCalendarFeedPrivate; + +/** + * GDataCalendarFeed: + * + * All the fields in the #GDataCalendarFeed structure are private and should never be accessed directly. + * + * Since: 0.3.0 + */ +typedef struct { + GDataFeed parent; + GDataCalendarFeedPrivate *priv; +} GDataCalendarFeed; + +/** + * GDataCalendarFeedClass: + * + * All the fields in the #GDataCalendarFeedClass structure are private and should never be accessed directly. + * + * Since: 0.3.0 + */ +typedef struct { + /*< private >*/ + GDataFeedClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataCalendarFeedClass; + +GType gdata_calendar_feed_get_type (void); + +#ifndef LIBGDATA_DISABLE_DEPRECATED +const gchar *gdata_calendar_feed_get_timezone (GDataCalendarFeed *self) G_GNUC_PURE G_GNUC_DEPRECATED; +guint gdata_calendar_feed_get_times_cleaned (GDataCalendarFeed *self) G_GNUC_PURE G_GNUC_DEPRECATED; +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_CALENDAR_FEED_H */ diff --git a/gdata/services/calendar/gdata-calendar-query.c b/gdata/services/calendar/gdata-calendar-query.c new file mode 100644 index 0000000..a64960c --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-query.c @@ -0,0 +1,974 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2010, 2017 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-calendar-query + * @short_description: GData Calendar query object + * @stability: Stable + * @include: gdata/services/calendar/gdata-calendar-query.h + * + * #GDataCalendarQuery represents a collection of query parameters specific to the Google Calendar service, which go above and beyond + * those catered for by #GDataQuery. + * + * For more information on the custom GData query parameters supported by #GDataCalendarQuery, see the online + * documentation. + * + * + * Querying for Events + * + * GDataCalendarService *service; + * GDataCalendarCalendar *calendar; + * GDataCalendarQuery *query; + * GDataFeed *feed; + * GTimeVal current_time; + * GList *i; + * GError *error = NULL; + * + * /* Create a service and find a calendar to query in */ + * service = create_calendar_service (); + * calendar = get_calendar (service); + * + * /* Create the query to use. We're going to query for events within the next week which match the search term "party", + * * ordered by last modification time (descending). */ + * g_get_current_time (¤t_time); + * query = gdata_calendar_query_new_with_limits ("party", current_time.tv_sec, current_time.tv_sec + 7 * 24 * 60 * 60); + * gdata_calendar_query_set_order_by (query, "lastmodified"); + * + * /* Execute the query */ + * feed = gdata_calendar_service_query_events (service, calendar, query, NULL, NULL, NULL, &error); + * + * g_object_unref (query); + * g_object_unref (calendar); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error querying for events: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Iterate through the returned events and do something with them */ + * for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { + * GDataCalendarEvent *event = GDATA_CALENDAR_EVENT (i->data); + * + * /* Do something with the event here, such as insert it into a UI */ + * } + * + * g_object_unref (feed); + * + * + */ + +#include +#include +#include +#include + +#include "gdata-calendar-query.h" +#include "gdata-query.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_calendar_query_finalize (GObject *object); +static void gdata_calendar_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_calendar_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +struct _GDataCalendarQueryPrivate { + gboolean future_events; + gchar *order_by; /* TODO: #defined values */ + gint64 recurrence_expansion_start; + gint64 recurrence_expansion_end; + gboolean single_events; + gchar *sort_order; /* TODO: #defined values */ + gint64 start_min; /* UNIX timestamp, seconds */ + gint64 start_max; /* UNIX timestamp, seconds */ + gchar *timezone; + guint max_attendees; + gboolean show_deleted; +}; + +enum { + PROP_FUTURE_EVENTS = 1, + PROP_ORDER_BY, + PROP_RECURRENCE_EXPANSION_START, + PROP_RECURRENCE_EXPANSION_END, + PROP_SINGLE_EVENTS, + PROP_SORT_ORDER, + PROP_START_MIN, + PROP_START_MAX, + PROP_TIMEZONE, + PROP_MAX_ATTENDEES, + PROP_SHOW_DELETED, +}; + +G_DEFINE_TYPE (GDataCalendarQuery, gdata_calendar_query, GDATA_TYPE_QUERY) + +static void +gdata_calendar_query_class_init (GDataCalendarQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataCalendarQueryPrivate)); + + gobject_class->set_property = gdata_calendar_query_set_property; + gobject_class->get_property = gdata_calendar_query_get_property; + gobject_class->finalize = gdata_calendar_query_finalize; + + query_class->get_query_uri = get_query_uri; + + /** + * GDataCalendarQuery:future-events: + * + * A shortcut to request all events scheduled for the future. Overrides the + * #GDataCalendarQuery:recurrence-expansion-start, #GDataCalendarQuery:recurrence-expansion-end, + * #GDataCalendarQuery:start-min and #GDataCalendarQuery:start-max properties. + */ + g_object_class_install_property (gobject_class, PROP_FUTURE_EVENTS, + g_param_spec_boolean ("future-events", + "Future events?", "A shortcut to request all events scheduled for the future.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarQuery:order-by: + * + * Specifies order of entries in a feed. Supported values are lastmodified and + * starttime. + */ + g_object_class_install_property (gobject_class, PROP_ORDER_BY, + g_param_spec_string ("order-by", + "Order by", "Specifies order of entries in a feed.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarQuery:recurrence-expansion-start: + * + * Specifies the beginning of the time period to expand recurring events for, inclusive. + * + * Deprecated: 0.17.7: Use #GDataCalendarQuery:single-events instead, as this is no longer supported on the server. + */ + g_object_class_install_property (gobject_class, PROP_RECURRENCE_EXPANSION_START, + g_param_spec_int64 ("recurrence-expansion-start", + "Recurrence expansion start", "Specifies start of period to expand recurrences for.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED)); + + /** + * GDataCalendarQuery:recurrence-expansion-end: + * + * Specifies the end of the time period to expand recurring events for, exclusive. + * + * Deprecated: 0.17.7: Use #GDataCalendarQuery:single-events instead, as this is no longer supported on the server. + */ + g_object_class_install_property (gobject_class, PROP_RECURRENCE_EXPANSION_END, + g_param_spec_int64 ("recurrence-expansion-end", + "Recurrence expansion end", "Specifies end of period to expand recurrences for.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED)); + + /** + * GDataCalendarQuery:single-events: + * + * Indicates whether recurring events should be expanded or represented as a single event. + */ + g_object_class_install_property (gobject_class, PROP_SINGLE_EVENTS, + g_param_spec_boolean ("single-events", + "Single events?", "Indicates whether recurring events should be expanded.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarQuery:sort-order: + * + * Specifies direction of sorting. Supported values are ascending and + * descending. + * + * By default, results are returned in ascending order. + * + * Deprecated: 0.17.7: Manually sort the results after retrieving them, as this is no longer supported on the server. + */ + g_object_class_install_property (gobject_class, PROP_SORT_ORDER, + g_param_spec_string ("sort-order", + "Sort order", "Specifies direction of sorting.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED)); + + /** + * GDataCalendarQuery:start-min: + * + * Together with #GDataCalendarQuery:start-max, creates a timespan such that only events within the timespan are returned. + * + * #GDataCalendarQuery:start-min is inclusive, while #GDataCalendarQuery:start-max is exclusive. Events that overlap the range are + * included. Both are specified in seconds since the UNIX epoch. + * + * If not specified, the default #GDataCalendarQuery:start-min is 1970-01-01. + */ + g_object_class_install_property (gobject_class, PROP_START_MIN, + g_param_spec_int64 ("start-min", + "Start min", "A timespan such that only events within the timespan are returned.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarQuery:start-max: + * + * Together with #GDataCalendarQuery:start-min, creates a timespan such that only events within the timespan are returned + * + * #GDataCalendarQuery:start-min is inclusive, while #GDataCalendarQuery:start-max is exclusive. Events that overlap the range are + * included. Both are specified in seconds since the UNIX epoch. + * + * If not specified, the default #GDataCalendarQuery:start-max is 2031-01-01. + */ + g_object_class_install_property (gobject_class, PROP_START_MAX, + g_param_spec_int64 ("start-max", + "Start max", "A timespan such that only events within the timespan are returned.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarQuery:timezone: + * + * The current timezone. If this is not specified, all times are returned in UTC. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_TIMEZONE, + g_param_spec_string ("timezone", + "Timezone", "The current timezone.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarQuery:max-attendees: + * + * Specifies the maximum number of attendees to list for an event. If the actual number of attendees for an event is greater than this value, + * only the current user and the event organiser are listed. + * + * Since: 0.9.1 + */ + g_object_class_install_property (gobject_class, PROP_MAX_ATTENDEES, + g_param_spec_uint ("max-attendees", + "Max attendee count", "Specifies the maximum number of attendees to list for an event.", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataCalendarQuery:show-deleted: + * + * Whether to include deleted/cancelled events in the query feed. Deleted events have their #GDataCalendarEvent:status property set to + * %GDATA_GD_EVENT_STATUS_CANCELED. They do not normally appear in query results. + * + * Since: 0.9.1 + */ + g_object_class_install_property (gobject_class, PROP_SHOW_DELETED, + g_param_spec_boolean ("show-deleted", + "Show deleted?", "Whether to include deleted/cancelled events in the query feed.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_calendar_query_init (GDataCalendarQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_CALENDAR_QUERY, GDataCalendarQueryPrivate); + self->priv->recurrence_expansion_start = -1; + self->priv->recurrence_expansion_end = -1; + self->priv->start_min = -1; + self->priv->start_max = -1; + + _gdata_query_set_pagination_type (GDATA_QUERY (self), + GDATA_QUERY_PAGINATION_TOKENS); +} + +static void +gdata_calendar_query_finalize (GObject *object) +{ + GDataCalendarQueryPrivate *priv = GDATA_CALENDAR_QUERY (object)->priv; + + g_free (priv->order_by); + g_free (priv->sort_order); + g_free (priv->timezone); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_calendar_query_parent_class)->finalize (object); +} + +static void +gdata_calendar_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataCalendarQueryPrivate *priv = GDATA_CALENDAR_QUERY (object)->priv; + + switch (property_id) { + case PROP_FUTURE_EVENTS: + g_value_set_boolean (value, priv->future_events); + break; + case PROP_ORDER_BY: + g_value_set_string (value, priv->order_by); + break; + case PROP_RECURRENCE_EXPANSION_START: + g_value_set_int64 (value, priv->recurrence_expansion_start); + break; + case PROP_RECURRENCE_EXPANSION_END: + g_value_set_int64 (value, priv->recurrence_expansion_end); + break; + case PROP_SINGLE_EVENTS: + g_value_set_boolean (value, priv->single_events); + break; + case PROP_SORT_ORDER: + g_value_set_string (value, priv->sort_order); + break; + case PROP_START_MIN: + g_value_set_int64 (value, priv->start_min); + break; + case PROP_START_MAX: + g_value_set_int64 (value, priv->start_max); + break; + case PROP_TIMEZONE: + g_value_set_string (value, priv->timezone); + break; + case PROP_MAX_ATTENDEES: + g_value_set_uint (value, priv->max_attendees); + break; + case PROP_SHOW_DELETED: + g_value_set_boolean (value, priv->show_deleted); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_calendar_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataCalendarQuery *self = GDATA_CALENDAR_QUERY (object); + + switch (property_id) { + case PROP_FUTURE_EVENTS: + gdata_calendar_query_set_future_events (self, g_value_get_boolean (value)); + break; + case PROP_ORDER_BY: + gdata_calendar_query_set_order_by (self, g_value_get_string (value)); + break; + case PROP_RECURRENCE_EXPANSION_START: +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + gdata_calendar_query_set_recurrence_expansion_start (self, g_value_get_int64 (value)); +G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_RECURRENCE_EXPANSION_END: +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + gdata_calendar_query_set_recurrence_expansion_end (self, g_value_get_int64 (value)); +G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_SINGLE_EVENTS: + gdata_calendar_query_set_single_events (self, g_value_get_boolean (value)); + break; + case PROP_SORT_ORDER: +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + gdata_calendar_query_set_sort_order (self, g_value_get_string (value)); +G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_START_MIN: + gdata_calendar_query_set_start_min (self, g_value_get_int64 (value)); + break; + case PROP_START_MAX: + gdata_calendar_query_set_start_max (self, g_value_get_int64 (value)); + break; + case PROP_TIMEZONE: + gdata_calendar_query_set_timezone (self, g_value_get_string (value)); + break; + case PROP_MAX_ATTENDEES: + gdata_calendar_query_set_max_attendees (self, g_value_get_uint (value)); + break; + case PROP_SHOW_DELETED: + gdata_calendar_query_set_show_deleted (self, g_value_get_boolean (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/* Convert the v2 order-by values to the v3 orderBy values: + * - https://developers.google.com/google-apps/calendar/v3/reference/events/list#orderBy + * - There is no reference for v2 any more. + */ +static const gchar * +order_by_to_v3 (const gchar *order_by) +{ + if (g_strcmp0 (order_by, "lastmodified") == 0) + return "updated"; + else if (g_strcmp0 (order_by, "starttime") == 0) + return "startTime"; + else + return order_by; +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataCalendarQueryPrivate *priv = GDATA_CALENDAR_QUERY (self)->priv; + + #define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + /* Chain up to the parent class */ + GDATA_QUERY_CLASS (gdata_calendar_query_parent_class)->get_query_uri (self, feed_uri, query_uri, params_started); + + if (gdata_query_get_max_results (GDATA_QUERY (self)) != 0) { + APPEND_SEP + g_string_append_printf (query_uri, "maxResults=%u", + gdata_query_get_max_results (GDATA_QUERY (self))); + } + + if (priv->order_by != NULL) { + APPEND_SEP + g_string_append (query_uri, "orderBy="); + g_string_append_uri_escaped (query_uri, + order_by_to_v3 (priv->order_by), NULL, FALSE); + } + + /* Convert the deprecated recurrence-expansion-* properties into single-events. */ + APPEND_SEP + if (priv->single_events == TRUE || + priv->recurrence_expansion_start >= 0 || + priv->recurrence_expansion_end >= 0) + g_string_append (query_uri, "singleEvents=true"); + else + g_string_append (query_uri, "singleEvents=false"); + + if (priv->start_min != -1) { + gchar *start_min; + gint64 start_min_time; + + if (priv->future_events) + start_min_time = g_get_real_time () / G_USEC_PER_SEC; + else + start_min_time = priv->start_min; + + APPEND_SEP + g_string_append (query_uri, "timeMin="); + start_min = gdata_parser_int64_to_iso8601 (start_min_time); + g_string_append (query_uri, start_min); + g_free (start_min); + } + + if (priv->start_max != -1 && !priv->future_events) { + gchar *start_max; + + APPEND_SEP + g_string_append (query_uri, "timeMax="); + start_max = gdata_parser_int64_to_iso8601 (priv->start_max); + g_string_append (query_uri, start_max); + g_free (start_max); + } + + if (priv->timezone != NULL) { + APPEND_SEP + g_string_append (query_uri, "timeZone="); + g_string_append_uri_escaped (query_uri, priv->timezone, NULL, FALSE); + } + + if (priv->max_attendees > 0) { + APPEND_SEP + g_string_append_printf (query_uri, "maxAttendees=%u", priv->max_attendees); + } + + APPEND_SEP + if (priv->show_deleted == TRUE) { + g_string_append (query_uri, "showDeleted=true"); + } else { + g_string_append (query_uri, "showDeleted=false"); + } +} + +/** + * gdata_calendar_query_new: + * @q: (allow-none): a query string, or %NULL + * + * Creates a new #GDataCalendarQuery with its #GDataQuery:q property set to @q. + * + * Return value: a new #GDataCalendarQuery + */ +GDataCalendarQuery * +gdata_calendar_query_new (const gchar *q) +{ + return g_object_new (GDATA_TYPE_CALENDAR_QUERY, "q", q, NULL); +} + +/** + * gdata_calendar_query_new_with_limits: + * @q: (allow-none): a query string, or %NULL + * @start_min: a starting time for the event period, or -1 + * @start_max: an ending time for the event period, or -1 + * + * Creates a new #GDataCalendarQuery with its #GDataQuery:q property set to @q, and the time limits @start_min and @start_max + * applied (both in seconds since the UNIX epoch). + * + * Return value: a new #GDataCalendarQuery + */ +GDataCalendarQuery * +gdata_calendar_query_new_with_limits (const gchar *q, gint64 start_min, gint64 start_max) +{ + return g_object_new (GDATA_TYPE_CALENDAR_QUERY, + "q", q, + "start-min", start_min, + "start-max", start_max, + NULL); +} + +/** + * gdata_calendar_query_get_future_events: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:future-events property. + * + * Return value: the future events property + */ +gboolean +gdata_calendar_query_get_future_events (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), FALSE); + return self->priv->future_events; +} + +/** + * gdata_calendar_query_set_future_events: + * @self: a #GDataCalendarQuery + * @future_events: %TRUE to unconditionally show future events, %FALSE otherwise + * + * Sets the #GDataCalendarQuery:future-events property of the #GDataCalendarQuery to @future_events. + */ +void +gdata_calendar_query_set_future_events (GDataCalendarQuery *self, gboolean future_events) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + self->priv->future_events = future_events; + g_object_notify (G_OBJECT (self), "future-events"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_get_order_by: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:order-by property. + * + * Return value: the order by property, or %NULL if it is unset + */ +const gchar * +gdata_calendar_query_get_order_by (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), NULL); + return self->priv->order_by; +} + +/** + * gdata_calendar_query_set_order_by: + * @self: a #GDataCalendarQuery + * @order_by: (allow-none): a new order by string, or %NULL + * + * Sets the #GDataCalendarQuery:order-by property of the #GDataCalendarQuery to the new order by string, @order_by. + * + * Set @order_by to %NULL to unset the property in the query URI. + */ +void +gdata_calendar_query_set_order_by (GDataCalendarQuery *self, const gchar *order_by) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + + g_free (self->priv->order_by); + self->priv->order_by = g_strdup (order_by); + g_object_notify (G_OBJECT (self), "order-by"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_get_recurrence_expansion_start: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:recurrence-expansion-start property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the recurrence-expansion-start property, or -1 + * Deprecated: 0.17.7: Use #GDataCalendarQuery:single-events instead, as this is no longer supported on the server. + */ +gint64 +gdata_calendar_query_get_recurrence_expansion_start (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), -1); + return self->priv->recurrence_expansion_start; +} + +/** + * gdata_calendar_query_set_recurrence_expansion_start: + * @self: a #GDataCalendarQuery + * @start: a new start time, or -1 + * + * Sets the #GDataCalendarQuery:recurrence-expansion-start property of the #GDataCalendarQuery + * to the new time/date, @start. + * + * Set @start to -1 to unset the property in the query URI. + * + * Deprecated: 0.17.7: Use #GDataCalendarQuery:single-events instead, as this is no longer supported on the server. + */ +void +gdata_calendar_query_set_recurrence_expansion_start (GDataCalendarQuery *self, gint64 start) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + g_return_if_fail (start >= -1); + + self->priv->recurrence_expansion_start = start; + g_object_notify (G_OBJECT (self), "recurrence-expansion-start"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_get_recurrence_expansion_end: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:recurrence-expansion-end property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the recurrence-expansion-end property, or -1 + * + * Deprecated: 0.17.7: Use #GDataCalendarQuery:single-events instead, as this is no longer supported on the server. + */ +gint64 +gdata_calendar_query_get_recurrence_expansion_end (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), -1 ); + return self->priv->recurrence_expansion_end; +} + +/** + * gdata_calendar_query_set_recurrence_expansion_end: + * @self: a #GDataCalendarQuery + * @end: a new end time, or -1 + * + * Sets the #GDataCalendarQuery:recurrence-expansion-end property of the #GDataCalendarQuery + * to the new time/date, @end. + * + * Set @end to -1 to unset the property in the query URI. + * + * Deprecated: 0.17.7: Use #GDataCalendarQuery:single-events instead, as this is no longer supported on the server. + */ +void +gdata_calendar_query_set_recurrence_expansion_end (GDataCalendarQuery *self, gint64 end) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + g_return_if_fail (end >= -1); + + self->priv->recurrence_expansion_end = end; + g_object_notify (G_OBJECT (self), "recurrence-expansion-end"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_get_single_events: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:single-events property. + * + * Return value: the single events property + */ +gboolean +gdata_calendar_query_get_single_events (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), FALSE); + return self->priv->single_events; +} + +/** + * gdata_calendar_query_set_single_events: + * @self: a #GDataCalendarQuery + * @single_events: %TRUE to show recurring events as single events, %FALSE otherwise + * + * Sets the #GDataCalendarQuery:single-events property of the #GDataCalendarQuery to @single_events. + */ +void +gdata_calendar_query_set_single_events (GDataCalendarQuery *self, gboolean single_events) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + self->priv->single_events = single_events; + g_object_notify (G_OBJECT (self), "single-events"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_get_sort_order: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:sort-order property. + * + * Return value: the sort order property, or %NULL if it is unset + * Deprecated: 0.17.7: Manually sort the results after retrieving them, as this is no longer supported on the server. + */ +const gchar * +gdata_calendar_query_get_sort_order (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), NULL); + return self->priv->sort_order; +} + +/** + * gdata_calendar_query_set_sort_order: + * @self: a #GDataCalendarQuery + * @sort_order: (allow-none): a new sort order string, or %NULL + * + * Sets the #GDataCalendarQuery:sort-order property of the #GDataCalendarQuery to the new sort order string, @sort_order. + * + * Set @sort_order to %NULL to unset the property in the query URI. + * + * Deprecated: 0.17.7: Manually sort the results after retrieving them, as this is no longer supported on the server. + */ +void +gdata_calendar_query_set_sort_order (GDataCalendarQuery *self, const gchar *sort_order) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + + g_free (self->priv->sort_order); + self->priv->sort_order = g_strdup (sort_order); + g_object_notify (G_OBJECT (self), "sort-order"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_get_start_min: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:start-min property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp (in seconds) for the start-min property, or -1 + */ +gint64 +gdata_calendar_query_get_start_min (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), -1); + return self->priv->start_min; +} + +/** + * gdata_calendar_query_set_start_min: + * @self: a #GDataCalendarQuery + * @start_min: a new minimum start time (in seconds since the UNIX epoch), or -1 + * + * Sets the #GDataCalendarQuery:start-min property of the #GDataCalendarQuery + * to the new time/date, @start_min. + * + * Set @start_min to -1 to unset the property in the query URI. + */ +void +gdata_calendar_query_set_start_min (GDataCalendarQuery *self, gint64 start_min) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + g_return_if_fail (start_min >= -1); + + self->priv->start_min = start_min; + g_object_notify (G_OBJECT (self), "start-min"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_get_start_max: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:start-max property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp (in seconds) for the start-max property, or -1 + */ +gint64 +gdata_calendar_query_get_start_max (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), -1); + return self->priv->start_max; +} + +/** + * gdata_calendar_query_set_start_max: + * @self: a #GDataCalendarQuery + * @start_max: a new maximum start time (in seconds since the UNIX epoch), or -1 + * + * Sets the #GDataCalendarQuery:start-max property of the #GDataCalendarQuery + * to the new time/date, @start_max. + * + * Set @start_max to -1 to unset the property in the query URI. + */ +void +gdata_calendar_query_set_start_max (GDataCalendarQuery *self, gint64 start_max) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + g_return_if_fail (start_max >= -1); + + self->priv->start_max = start_max; + g_object_notify (G_OBJECT (self), "start-max"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_get_timezone: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:timezone property. + * + * Return value: the timezone property, or %NULL if it is unset + * + * Since: 0.2.0 + */ +const gchar * +gdata_calendar_query_get_timezone (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), NULL); + return self->priv->timezone; +} + +/** + * gdata_calendar_query_set_timezone: + * @self: a #GDataCalendarQuery + * @_timezone: (allow-none): a new timezone string, or %NULL + * + * Sets the #GDataCalendarQuery:timezone property of the #GDataCalendarQuery to the new timezone string, @timezone. + * + * Set @timezone to %NULL to unset the property in the query URI. + * + * Since: 0.2.0 + */ +void +gdata_calendar_query_set_timezone (GDataCalendarQuery *self, const gchar *_timezone) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + + g_free (self->priv->timezone); + + /* Replace all spaces with underscores */ + if (_timezone != NULL) { + gchar *zone, *i; + + zone = g_strdup (_timezone); + for (i = zone; *i != '\0'; i++) { + if (*i == ' ') + *i = '_'; + } + self->priv->timezone = zone; + } else { + self->priv->timezone = NULL; + } + + g_object_notify (G_OBJECT (self), "timezone"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_get_max_attendees: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:max-attendees property. If the property is unset, 0 will be returned. + * + * Return value: the maximum number of attendees, or 0 + * + * Since: 0.9.1 + */ +guint +gdata_calendar_query_get_max_attendees (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), 0); + return self->priv->max_attendees; +} + +/** + * gdata_calendar_query_set_max_attendees: + * @self: a #GDataCalendarQuery + * @max_attendees: a new maximum attendee count, or 0 + * + * Sets the #GDataCalendarQuery:max-attendees property of the #GDataCalendarQuery to the new value, @max_attendees. + * + * Set @max_attendees to 0 to unset the property in the query URI. + * + * Since: 0.9.1 + */ +void +gdata_calendar_query_set_max_attendees (GDataCalendarQuery *self, guint max_attendees) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + + self->priv->max_attendees = max_attendees; + g_object_notify (G_OBJECT (self), "max-attendees"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_calendar_query_show_deleted: + * @self: a #GDataCalendarQuery + * + * Gets the #GDataCalendarQuery:show-deleted property. + * + * Return value: %TRUE if deleted/cancelled events should be shown, %FALSE otherwise + * + * Since: 0.9.1 + */ +gboolean +gdata_calendar_query_show_deleted (GDataCalendarQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CALENDAR_QUERY (self), FALSE); + return self->priv->show_deleted; +} + +/** + * gdata_calendar_query_set_show_deleted: + * @self: a #GDataCalendarQuery + * @show_deleted: %TRUE to show deleted events, %FALSE otherwise + * + * Sets the #GDataCalendarQuery:show-deleted property of the #GDataCalendarQuery. + * + * Since: 0.9.1 + */ +void +gdata_calendar_query_set_show_deleted (GDataCalendarQuery *self, gboolean show_deleted) +{ + g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); + + self->priv->show_deleted = show_deleted; + g_object_notify (G_OBJECT (self), "show-deleted"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} diff --git a/gdata/services/calendar/gdata-calendar-query.h b/gdata/services/calendar/gdata-calendar-query.h new file mode 100644 index 0000000..0f3b32e --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-query.h @@ -0,0 +1,99 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CALENDAR_QUERY_H +#define GDATA_CALENDAR_QUERY_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_CALENDAR_QUERY (gdata_calendar_query_get_type ()) +#define GDATA_CALENDAR_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CALENDAR_QUERY, GDataCalendarQuery)) +#define GDATA_CALENDAR_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CALENDAR_QUERY, GDataCalendarQueryClass)) +#define GDATA_IS_CALENDAR_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CALENDAR_QUERY)) +#define GDATA_IS_CALENDAR_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CALENDAR_QUERY)) +#define GDATA_CALENDAR_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CALENDAR_QUERY, GDataCalendarQueryClass)) + +typedef struct _GDataCalendarQueryPrivate GDataCalendarQueryPrivate; + +/** + * GDataCalendarQuery: + * + * All the fields in the #GDataCalendarQuery structure are private and should never be accessed directly. + */ +typedef struct { + GDataQuery parent; + GDataCalendarQueryPrivate *priv; +} GDataCalendarQuery; + +/** + * GDataCalendarQueryClass: + * + * All the fields in the #GDataCalendarQueryClass structure are private and should never be accessed directly. + */ +typedef struct { + /*< private >*/ + GDataQueryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataCalendarQueryClass; + +GType gdata_calendar_query_get_type (void) G_GNUC_CONST; + +GDataCalendarQuery *gdata_calendar_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataCalendarQuery *gdata_calendar_query_new_with_limits (const gchar *q, gint64 start_min, gint64 start_max) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gboolean gdata_calendar_query_get_future_events (GDataCalendarQuery *self) G_GNUC_PURE; +void gdata_calendar_query_set_future_events (GDataCalendarQuery *self, gboolean future_events); +const gchar *gdata_calendar_query_get_order_by (GDataCalendarQuery *self) G_GNUC_PURE; +void gdata_calendar_query_set_order_by (GDataCalendarQuery *self, const gchar *order_by); +gboolean gdata_calendar_query_get_single_events (GDataCalendarQuery *self) G_GNUC_PURE; +void gdata_calendar_query_set_single_events (GDataCalendarQuery *self, gboolean single_events); +gint64 gdata_calendar_query_get_start_min (GDataCalendarQuery *self); +void gdata_calendar_query_set_start_min (GDataCalendarQuery *self, gint64 start_min); +gint64 gdata_calendar_query_get_start_max (GDataCalendarQuery *self); +void gdata_calendar_query_set_start_max (GDataCalendarQuery *self, gint64 start_max); +const gchar *gdata_calendar_query_get_timezone (GDataCalendarQuery *self) G_GNUC_PURE; +void gdata_calendar_query_set_timezone (GDataCalendarQuery *self, const gchar *_timezone); +guint gdata_calendar_query_get_max_attendees (GDataCalendarQuery *self) G_GNUC_PURE; +void gdata_calendar_query_set_max_attendees (GDataCalendarQuery *self, guint max_attendees); +gboolean gdata_calendar_query_show_deleted (GDataCalendarQuery *self) G_GNUC_PURE; +void gdata_calendar_query_set_show_deleted (GDataCalendarQuery *self, gboolean show_deleted); + +#ifndef LIBGDATA_DISABLE_DEPRECATED +gint64 gdata_calendar_query_get_recurrence_expansion_start (GDataCalendarQuery *self) G_GNUC_DEPRECATED_FOR (gdata_calendar_query_get_single_events); +void gdata_calendar_query_set_recurrence_expansion_start (GDataCalendarQuery *self, gint64 start) G_GNUC_DEPRECATED_FOR (gdata_calendar_query_set_single_events); +gint64 gdata_calendar_query_get_recurrence_expansion_end (GDataCalendarQuery *self) G_GNUC_DEPRECATED_FOR (gdata_calendar_query_get_single_events); +void gdata_calendar_query_set_recurrence_expansion_end (GDataCalendarQuery *self, gint64 end) G_GNUC_DEPRECATED_FOR (gdata_calendar_query_set_single_events); + +const gchar *gdata_calendar_query_get_sort_order (GDataCalendarQuery *self) G_GNUC_PURE G_GNUC_DEPRECATED; +void gdata_calendar_query_set_sort_order (GDataCalendarQuery *self, const gchar *sort_order) G_GNUC_DEPRECATED_FOR (g_list_sort); +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_CALENDAR_QUERY_H */ diff --git a/gdata/services/calendar/gdata-calendar-service.c b/gdata/services/calendar/gdata-calendar-service.c new file mode 100644 index 0000000..6763262 --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-service.c @@ -0,0 +1,918 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2014, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-calendar-service + * @short_description: GData Calendar service object + * @stability: Stable + * @include: gdata/services/calendar/gdata-calendar-service.h + * + * #GDataCalendarService is a subclass of #GDataService for communicating with the GData API of Google Calendar. It supports querying + * for, inserting, editing and deleting events from calendars, as well as operations on the calendars themselves. + * + * For more details of Google Calendar's GData API, see the + * + * online documentation. + * + * Each calendar accessible through the service has an access control list (ACL) which defines the level of access to the calendar to each user, and + * which users the calendar is shared with. For more information about ACLs for calendars, see the + * online documentation on + * sharing calendars. + * + * + * Retrieving the Access Control List for a Calendar + * + * GDataCalendarService *service; + * GDataCalendarCalendar *calendar; + * GDataFeed *acl_feed; + * GDataAccessRule *rule, *new_rule; + * GDataLink *acl_link; + * GList *i; + * GError *error = NULL; + * + * /* Create a service and retrieve a calendar to work on */ + * service = create_calendar_service (); + * calendar = get_calendar (service); + * + * /* Query the service for the ACL for the given calendar */ + * acl_feed = gdata_access_handler_get_rules (GDATA_ACCESS_HANDLER (calendar), GDATA_SERVICE (service), NULL, NULL, NULL, &error); + * + * if (error != NULL) { + * g_error ("Error getting ACL feed for calendar: %s", error->message); + * g_error_free (error); + * g_object_unref (calendar); + * g_object_unref (service); + * return; + * } + * + * /* Iterate through the ACL */ + * for (i = gdata_feed_get_entries (acl_feed); i != NULL; i = i->next) { + * const gchar *scope_value; + * + * rule = GDATA_ACCESS_RULE (i->data); + * + * /* Do something with the access rule here. As an example, we update the rule applying to test@gmail.com and delete all + * * the other rules. We then insert another rule for example@gmail.com below. */ + * gdata_access_rule_get_scope (rule, NULL, &scope_value); + * if (scope_value != NULL && strcmp (scope_value, "test@gmail.com") == 0) { + * GDataAccessRule *updated_rule; + * + * /* Update the rule to make test@gmail.com an editor (full read/write access to the calendar, but they can't change + * * the ACL). */ + * gdata_access_rule_set_role (rule, GDATA_CALENDAR_ACCESS_ROLE_EDITOR); + * updated_rule = GDATA_ACCESS_RULE (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (rule), NULL, &error)); + * + * if (error != NULL) { + * g_error ("Error updating access rule for %s: %s", scope_value, error->message); + * g_error_free (error); + * g_object_unref (acl_feed); + * g_object_unref (calendar); + * g_object_unref (service); + * return; + * } + * + * g_object_unref (updated_rule); + * } else { + * /* Delete any rule which doesn't apply to test@gmail.com */ + * gdata_service_delete_entry (GDATA_SERVICE (service), GDATA_ENTRY (rule), NULL, &error); + * + * if (error != NULL) { + * g_error ("Error deleting access rule for %s: %s", scope_value, error->message); + * g_error_free (error); + * g_object_unref (acl_feed); + * g_object_unref (calendar); + * g_object_unref (service); + * return; + * } + * } + * } + * + * g_object_unref (acl_feed); + * + * /* Create and insert a new access rule for example@gmail.com which allows them to view free/busy information for events in the + * * calendar, but doesn't allow them to view the full event details. */ + * rule = gdata_access_rule_new (NULL); + * gdata_access_rule_set_role (rule, GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY); + * gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_USER, "example@gmail.com"); + * + * acl_link = gdata_entry_look_up_link (GDATA_ENTRY (calendar), GDATA_LINK_ACCESS_CONTROL_LIST); + * new_rule = GDATA_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), gdata_link_get_uri (acl_link), GDATA_ENTRY (rule), + * NULL, &error)); + * + * g_object_unref (rule); + * g_object_unref (calendar); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error inserting access rule: %s", error->message); + * g_error_free (error); + * return; + * } + * + * g_object_unref (acl_link); + * + * + * + * Before version 0.17.2, the Calendar service could be manipulated using + * batch operations. That is no longer supported, and any batch operations + * created on the calendar will fail. + */ + +#include +#include +#include +#include +#include + +#include "gdata-calendar-service.h" +#include "gdata-batchable.h" +#include "gdata-service.h" +#include "gdata-private.h" +#include "gdata-query.h" +#include "gdata-calendar-feed.h" + +/* Standards reference here: + * https://developers.google.com/google-apps/calendar/v3/reference/ */ + +static void +parse_error_response (GDataService *self, + GDataOperationType operation_type, + guint status, + const gchar *reason_phrase, + const gchar *response_body, + gint length, + GError **error); +static GList *get_authorization_domains (void); + +_GDATA_DEFINE_AUTHORIZATION_DOMAIN (calendar, "cl", "https://www.google.com/calendar/feeds/") +G_DEFINE_TYPE_WITH_CODE (GDataCalendarService, gdata_calendar_service, GDATA_TYPE_SERVICE, G_IMPLEMENT_INTERFACE (GDATA_TYPE_BATCHABLE, NULL)) + +static void +gdata_calendar_service_class_init (GDataCalendarServiceClass *klass) +{ + GDataServiceClass *service_class = GDATA_SERVICE_CLASS (klass); + service_class->feed_type = GDATA_TYPE_CALENDAR_FEED; + service_class->parse_error_response = parse_error_response; + service_class->get_authorization_domains = get_authorization_domains; +} + +static void +gdata_calendar_service_init (GDataCalendarService *self) +{ + /* Nothing to see here */ +} + +/* The error format used by the Google Calendar API doesn’t seem to be + * documented anywhere, which is a little frustrating. Here’s an example of it: + * { + * "error": { + * "errors": [ + * { + * "domain": "global", + * "reason": "parseError", + * "message": "Parse Error", + * } + * ], + * "code": 400, + * "message": "Parse Error" + * } + * } + * or: + * { + * "error": { + * "errors": [ + * { + * "domain": "global", + * "reason": "required", + * "message": "Missing end time." + * } + * ], + * "code": 400, + * "message": "Missing end time." + * } + * } + */ +static void +parse_error_response (GDataService *self, + GDataOperationType operation_type, + guint status, + const gchar *reason_phrase, + const gchar *response_body, + gint length, + GError **error) +{ + JsonParser *parser = NULL; /* owned */ + JsonReader *reader = NULL; /* owned */ + gint i; + GError *child_error = NULL; + + if (response_body == NULL) { + goto parent; + } + + if (length == -1) { + length = strlen (response_body); + } + + parser = json_parser_new (); + if (!json_parser_load_from_data (parser, response_body, length, + &child_error)) { + goto parent; + } + + reader = json_reader_new (json_parser_get_root (parser)); + + /* Check that the outermost node is an object. */ + if (!json_reader_is_object (reader)) { + goto parent; + } + + /* Grab the ‘error’ member, then its ‘errors’ member. */ + if (!json_reader_read_member (reader, "error") || + !json_reader_is_object (reader) || + !json_reader_read_member (reader, "errors") || + !json_reader_is_array (reader)) { + goto parent; + } + + /* Parse each of the errors. Return the first one, and print out any + * others. */ + for (i = 0; i < json_reader_count_elements (reader); i++) { + const gchar *domain, *reason, *message, *extended_help; + const gchar *location_type, *location; + + /* Parse the error. */ + if (!json_reader_read_element (reader, i) || + !json_reader_is_object (reader)) { + goto parent; + } + + json_reader_read_member (reader, "domain"); + domain = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "reason"); + reason = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "message"); + message = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "extendedHelp"); + extended_help = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "locationType"); + location_type = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "location"); + location = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + /* End the error element. */ + json_reader_end_element (reader); + + /* Create an error message, but only for the first error */ + if (error == NULL || *error == NULL) { + if (g_strcmp0 (domain, "usageLimits") == 0 && + g_strcmp0 (reason, + "dailyLimitExceededUnreg") == 0) { + /* Daily Limit for Unauthenticated Use + * Exceeded. */ + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED, + _("You have made too many API " + "calls recently. Please wait a " + "few minutes and try again.")); + } else if (g_strcmp0 (domain, "global") == 0 && + g_strcmp0 (reason, "notFound") == 0) { + /* Calendar not found. */ + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_NOT_FOUND, + /* Translators: the parameter is an + * error message returned by the + * server. */ + _("The requested resource was not found: %s"), + message); + } else if ((g_strcmp0 (domain, "global") == 0 && + g_strcmp0 (reason, "required") == 0) || + (g_strcmp0 (domain, "global") == 0 && + g_strcmp0 (reason, "conditionNotMet") == 0)) { + /* Client-side protocol error. */ + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an + * error message returned by the + * server. */ + _("Invalid request URI or header, " + "or unsupported nonstandard " + "parameter: %s"), message); + } else if (g_strcmp0 (domain, "global") == 0 && + (g_strcmp0 (reason, "authError") == 0 || + g_strcmp0 (reason, "required") == 0)) { + /* Authentication problem */ + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to " + "do this.")); + } else if (g_strcmp0 (domain, "global") == 0 && + g_strcmp0 (reason, "forbidden") == 0) { + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_FORBIDDEN, + _("Access was denied by the user " + "or server.")); + } else { + /* Unknown or validation (protocol) error. Fall + * back to working off the HTTP status code. */ + g_warning ("Unknown error code ‘%s’ in domain " + "‘%s’ received with location type " + "‘%s’, location ‘%s’, extended help " + "‘%s’ and message ‘%s’.", + reason, domain, location_type, + location, extended_help, message); + + goto parent; + } + } else { + /* For all errors after the first, log the error in the + * terminal. */ + g_debug ("Error message received in response: domain " + "‘%s’, reason ‘%s’, extended help ‘%s’, " + "message ‘%s’, location type ‘%s’, location " + "‘%s’.", + domain, reason, extended_help, message, + location_type, location); + } + } + + /* End the ‘errors’ and ‘error’ members. */ + json_reader_end_element (reader); + json_reader_end_element (reader); + + g_clear_object (&reader); + g_clear_object (&parser); + + /* Ensure we’ve actually set an error message. */ + g_assert (error == NULL || *error != NULL); + + return; + +parent: + g_clear_object (&reader); + g_clear_object (&parser); + + /* Chain up to the parent class */ + GDATA_SERVICE_CLASS (gdata_calendar_service_parent_class)->parse_error_response (self, operation_type, status, reason_phrase, + response_body, length, error); +} + +static GList * +get_authorization_domains (void) +{ + return g_list_prepend (NULL, get_calendar_authorization_domain ()); +} + +/** + * gdata_calendar_service_new: + * @authorizer: (allow-none): a #GDataAuthorizer to authorize the service's requests, or %NULL + * + * Creates a new #GDataCalendarService using the given #GDataAuthorizer. If @authorizer is %NULL, all requests are made as an unauthenticated user. + * + * Return value: a new #GDataCalendarService, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataCalendarService * +gdata_calendar_service_new (GDataAuthorizer *authorizer) +{ + g_return_val_if_fail (authorizer == NULL || GDATA_IS_AUTHORIZER (authorizer), NULL); + + return g_object_new (GDATA_TYPE_CALENDAR_SERVICE, + "authorizer", authorizer, + NULL); +} + +/** + * gdata_calendar_service_get_primary_authorization_domain: + * + * The primary #GDataAuthorizationDomain for interacting with Google Calendar. This will not normally need to be used, as it's used internally + * by the #GDataCalendarService methods. However, if using the plain #GDataService methods to implement custom queries or requests which libgdata + * does not support natively, then this domain may be needed to authorize the requests. + * + * The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. + * + * Return value: (transfer none): the service's authorization domain + * + * Since: 0.9.0 + */ +GDataAuthorizationDomain * +gdata_calendar_service_get_primary_authorization_domain (void) +{ + return get_calendar_authorization_domain (); +} + +/** + * gdata_calendar_service_query_all_calendars: + * @self: a #GDataCalendarService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service to return a list of all calendars from the authenticated account which match the given + * @query. It will return all calendars the user has read access to, including primary, secondary and imported + * calendars. + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + */ +GDataFeed * +gdata_calendar_service_query_all_calendars (GDataCalendarService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + GDataFeed *feed; + gchar *request_uri; + + g_return_val_if_fail (GDATA_IS_CALENDAR_SERVICE (self), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_calendar_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to query all calendars.")); + return NULL; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/calendar/v3/users/me/calendarList", NULL); + feed = gdata_service_query (GDATA_SERVICE (self), get_calendar_authorization_domain (), request_uri, query, GDATA_TYPE_CALENDAR_CALENDAR, + cancellable, progress_callback, progress_user_data, error); + g_free (request_uri); + + return feed; +} + +/** + * gdata_calendar_service_query_all_calendars_async: + * @self: a #GDataCalendarService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return a list of all calendars from the authenticated account which match the given + * @query. @self and @query are all reffed when this function is called, so can safely be unreffed after + * this function returns. + * + * For more details, see gdata_calendar_service_query_all_calendars(), which is the synchronous version of + * this function, and gdata_service_query_async(), which is the base asynchronous query function. + * + * Since: 0.9.1 + */ +void +gdata_calendar_service_query_all_calendars_async (GDataCalendarService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_CALENDAR_SERVICE (self)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_calendar_authorization_domain ()) == FALSE) { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", + _("You must be authenticated to query all calendars.")); + + return; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/calendar/v3/users/me/calendarList", NULL); + gdata_service_query_async (GDATA_SERVICE (self), get_calendar_authorization_domain (), request_uri, query, GDATA_TYPE_CALENDAR_CALENDAR, + cancellable, progress_callback, progress_user_data, destroy_progress_user_data, callback, user_data); + g_free (request_uri); +} + +/** + * gdata_calendar_service_query_own_calendars: + * @self: a #GDataCalendarService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service to return a list of calendars from the authenticated account which match the given + * @query, and the authenticated user owns. (i.e. They have full read/write access to the calendar, as well + * as the ability to set permissions on the calendar.) + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + */ +GDataFeed * +gdata_calendar_service_query_own_calendars (GDataCalendarService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + GDataFeed *feed; + gchar *request_uri; + + g_return_val_if_fail (GDATA_IS_CALENDAR_SERVICE (self), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_calendar_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to query your own calendars.")); + return NULL; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/calendar/v3/users/me/calendarList?minAccessRole=owner", NULL); + feed = gdata_service_query (GDATA_SERVICE (self), get_calendar_authorization_domain (), request_uri, query, GDATA_TYPE_CALENDAR_CALENDAR, + cancellable, progress_callback, progress_user_data, error); + g_free (request_uri); + + return feed; +} + +/** + * gdata_calendar_service_query_own_calendars_async: + * @self: a #GDataCalendarService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return a list of calendars from the authenticated account which match the given + * @query, and the authenticated user owns. @self and @query are all reffed when this function is called, + * so can safely be unreffed after this function returns. + * + * For more details, see gdata_calendar_service_query_own_calendars(), which is the synchronous version of + * this function, and gdata_service_query_async(), which is the base asynchronous query function. + * + * Since: 0.9.1 + */ +void +gdata_calendar_service_query_own_calendars_async (GDataCalendarService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_CALENDAR_SERVICE (self)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_calendar_authorization_domain ()) == FALSE) { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", + _("You must be authenticated to query your own calendars.")); + + return; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/calendar/v3/users/me/calendarList?minAccessRole=owner", NULL); + gdata_service_query_async (GDATA_SERVICE (self), get_calendar_authorization_domain (), request_uri, query, GDATA_TYPE_CALENDAR_CALENDAR, + cancellable, progress_callback, progress_user_data, destroy_progress_user_data, callback, user_data); + g_free (request_uri); +} + +static gchar * +build_events_uri (GDataCalendarCalendar *calendar) +{ + GString *uri; + const gchar *calendar_id; + + calendar_id = (calendar != NULL) ? gdata_entry_get_id (GDATA_ENTRY (calendar)) : "default"; + + uri = g_string_new (_gdata_service_get_scheme ()); + g_string_append (uri, "://www.googleapis.com/calendar/v3/calendars/"); + g_string_append_uri_escaped (uri, calendar_id, NULL, FALSE); + g_string_append (uri, "/events"); + + return g_string_free (uri, FALSE); +} + +/** + * gdata_calendar_service_query_events: + * @self: a #GDataCalendarService + * @calendar: a #GDataCalendarCalendar + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service to return a list of events in the given @calendar, which match @query. + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + */ +GDataFeed * +gdata_calendar_service_query_events (GDataCalendarService *self, GDataCalendarCalendar *calendar, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + gchar *request_uri; + GDataFeed *feed; + + g_return_val_if_fail (GDATA_IS_CALENDAR_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_CALENDAR_CALENDAR (calendar), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_calendar_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to query your own calendars.")); + return NULL; + } + + /* Execute the query. */ + request_uri = build_events_uri (calendar); + feed = gdata_service_query (GDATA_SERVICE (self), + get_calendar_authorization_domain (), + request_uri, query, + GDATA_TYPE_CALENDAR_EVENT, cancellable, + progress_callback, progress_user_data, + error); + g_free (request_uri); + + return feed; +} + +/** + * gdata_calendar_service_query_events_async: + * @self: a #GDataCalendarService + * @calendar: a #GDataCalendarCalendar + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return a list of events in the given @calendar, which match @query. @self, @calendar and @query are all reffed when this + * function is called, so can safely be unreffed after this function returns. + * + * Get the results of the query using gdata_service_query_finish() in the @callback. + * + * For more details, see gdata_calendar_service_query_events(), which is the synchronous version of this function, and gdata_service_query_async(), + * which is the base asynchronous query function. + * + * Since: 0.9.1 + */ +void +gdata_calendar_service_query_events_async (GDataCalendarService *self, GDataCalendarCalendar *calendar, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_CALENDAR_SERVICE (self)); + g_return_if_fail (GDATA_IS_CALENDAR_CALENDAR (calendar)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_calendar_authorization_domain ()) == FALSE) { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", + _("You must be authenticated to query your own calendars.")); + + return; + } + + /* Execute the query. */ + request_uri = build_events_uri (calendar); + gdata_service_query_async (GDATA_SERVICE (self), + get_calendar_authorization_domain (), + request_uri, query, + GDATA_TYPE_CALENDAR_EVENT, cancellable, + progress_callback, progress_user_data, + destroy_progress_user_data, callback, + user_data); + g_free (request_uri); +} + +/** + * gdata_calendar_service_insert_event: + * @self: a #GDataCalendarService + * @event: the #GDataCalendarEvent to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Inserts @event by uploading it to the online calendar service. + * + * For more details, see gdata_service_insert_entry(). + * + * Return value: (transfer full): an updated #GDataCalendarEvent, or %NULL; unref with g_object_unref() + * + * Since: 0.2.0 + * Deprecated: 0.17.2: Use gdata_calendar_service_insert_calendar_event() + * instead to be able to specify the calendar to add the event to; otherwise + * the default calendar will be used. + */ +GDataCalendarEvent * +gdata_calendar_service_insert_event (GDataCalendarService *self, GDataCalendarEvent *event, GCancellable *cancellable, GError **error) +{ + gchar *uri; + GDataEntry *entry; + + g_return_val_if_fail (GDATA_IS_CALENDAR_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (event), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + uri = build_events_uri (NULL); + entry = gdata_service_insert_entry (GDATA_SERVICE (self), get_calendar_authorization_domain (), uri, GDATA_ENTRY (event), cancellable, error); + g_free (uri); + + return GDATA_CALENDAR_EVENT (entry); +} + +/** + * gdata_calendar_service_insert_calendar_event: + * @self: a #GDataCalendarService + * @calendar: the #GDataCalendarCalendar to insert the event into + * @event: the #GDataCalendarEvent to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Inserts @event by uploading it to the online calendar service, adding it to + * the specified @calendar. + * + * For more details, see gdata_service_insert_entry(). + * + * Return value: (transfer full): an updated #GDataCalendarEvent, or %NULL; + * unref with g_object_unref() + * + * Since: 0.17.2 + */ +GDataCalendarEvent * +gdata_calendar_service_insert_calendar_event (GDataCalendarService *self, + GDataCalendarCalendar *calendar, + GDataCalendarEvent *event, + GCancellable *cancellable, + GError **error) +{ + gchar *uri; + GDataEntry *entry; + + g_return_val_if_fail (GDATA_IS_CALENDAR_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_CALENDAR_CALENDAR (calendar), NULL); + g_return_val_if_fail (GDATA_IS_CALENDAR_EVENT (event), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + uri = build_events_uri (calendar); + entry = gdata_service_insert_entry (GDATA_SERVICE (self), + get_calendar_authorization_domain (), + uri, GDATA_ENTRY (event), + cancellable, error); + g_free (uri); + + return GDATA_CALENDAR_EVENT (entry); +} + +/** + * gdata_calendar_service_insert_event_async: + * @self: a #GDataCalendarService + * @event: the #GDataCalendarEvent to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Inserts @event by uploading it to the online calendar service. @self and @event are both reffed when this function is called, so can safely be + * unreffed after this function returns. + * + * @callback should call gdata_service_insert_entry_finish() to obtain a #GDataCalendarEvent representing the inserted event and to check for possible + * errors. + * + * For more details, see gdata_calendar_service_insert_event(), which is the synchronous version of this function, and + * gdata_service_insert_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.8.0 + * Deprecated: 0.17.2: Use + * gdata_calendar_service_insert_calendar_event_async() instead to be able to + * specify the calendar to add the event to; otherwise the default calendar + * will be used. + */ +void +gdata_calendar_service_insert_event_async (GDataCalendarService *self, GDataCalendarEvent *event, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *uri; + + g_return_if_fail (GDATA_IS_CALENDAR_SERVICE (self)); + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (event)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + uri = build_events_uri (NULL); + gdata_service_insert_entry_async (GDATA_SERVICE (self), get_calendar_authorization_domain (), uri, GDATA_ENTRY (event), cancellable, + callback, user_data); + g_free (uri); +} + +/** + * gdata_calendar_service_insert_calendar_event_async: + * @self: a #GDataCalendarService + * @calendar: the #GDataCalendarCalendar to insert the event into + * @event: the #GDataCalendarEvent to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Inserts @event by uploading it to the online calendar service, adding it to + * the specified @calendar. @self and @event are both reffed when this function + * is called, so can safely be unreffed after this function returns. + * + * @callback should call gdata_service_insert_entry_finish() to obtain a + * #GDataCalendarEvent representing the inserted event and to check for possible + * errors. + * + * For more details, see gdata_calendar_service_insert_event(), which is the + * synchronous version of this function, and gdata_service_insert_entry_async(), + * which is the base asynchronous insertion function. + * + * Since: 0.17.2 + */ +void +gdata_calendar_service_insert_calendar_event_async (GDataCalendarService *self, + GDataCalendarCalendar *calendar, + GDataCalendarEvent *event, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + gchar *uri; + + g_return_if_fail (GDATA_IS_CALENDAR_SERVICE (self)); + g_return_if_fail (GDATA_IS_CALENDAR_EVENT (event)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + uri = build_events_uri (calendar); + gdata_service_insert_entry_async (GDATA_SERVICE (self), + get_calendar_authorization_domain (), + uri, GDATA_ENTRY (event), cancellable, + callback, user_data); + g_free (uri); +} diff --git a/gdata/services/calendar/gdata-calendar-service.h b/gdata/services/calendar/gdata-calendar-service.h new file mode 100644 index 0000000..7cb397d --- /dev/null +++ b/gdata/services/calendar/gdata-calendar-service.h @@ -0,0 +1,129 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CALENDAR_SERVICE_H +#define GDATA_CALENDAR_SERVICE_H + +#include +#include + +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_CALENDAR_SERVICE (gdata_calendar_service_get_type ()) +#define GDATA_CALENDAR_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CALENDAR_SERVICE, GDataCalendarService)) +#define GDATA_CALENDAR_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CALENDAR_SERVICE, GDataCalendarServiceClass)) +#define GDATA_IS_CALENDAR_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CALENDAR_SERVICE)) +#define GDATA_IS_CALENDAR_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CALENDAR_SERVICE)) +#define GDATA_CALENDAR_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CALENDAR_SERVICE, GDataCalendarServiceClass)) + +typedef struct _GDataCalendarServicePrivate GDataCalendarServicePrivate; + +/** + * GDataCalendarService: + * + * All the fields in the #GDataCalendarService structure are private and should never be accessed directly. + */ +typedef struct { + GDataService parent; +} GDataCalendarService; + +/** + * GDataCalendarServiceClass: + * + * All the fields in the #GDataCalendarServiceClass structure are private and should never be accessed directly. + */ +typedef struct { + /*< private >*/ + GDataServiceClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataCalendarServiceClass; + +GType gdata_calendar_service_get_type (void) G_GNUC_CONST; + +GDataCalendarService *gdata_calendar_service_new (GDataAuthorizer *authorizer) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataAuthorizationDomain *gdata_calendar_service_get_primary_authorization_domain (void) G_GNUC_CONST; + +GDataFeed *gdata_calendar_service_query_all_calendars (GDataCalendarService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_calendar_service_query_all_calendars_async (GDataCalendarService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data); + +GDataFeed *gdata_calendar_service_query_own_calendars (GDataCalendarService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_calendar_service_query_own_calendars_async (GDataCalendarService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data); + +GDataFeed *gdata_calendar_service_query_events (GDataCalendarService *self, GDataCalendarCalendar *calendar, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_calendar_service_query_events_async (GDataCalendarService *self, GDataCalendarCalendar *calendar, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data); + +#include + +#ifndef LIBGDATA_DISABLE_DEPRECATED +GDataCalendarEvent * +gdata_calendar_service_insert_event (GDataCalendarService *self, + GDataCalendarEvent *event, + GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED_FOR(gdata_calendar_service_insert_calendar_event); +void +gdata_calendar_service_insert_event_async (GDataCalendarService *self, + GDataCalendarEvent *event, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) + G_GNUC_DEPRECATED_FOR (gdata_calendar_service_insert_calendar_event_async); +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +GDataCalendarEvent * +gdata_calendar_service_insert_calendar_event (GDataCalendarService *self, + GDataCalendarCalendar *calendar, + GDataCalendarEvent *event, + GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void +gdata_calendar_service_insert_calendar_event_async (GDataCalendarService *self, + GDataCalendarCalendar *calendar, + GDataCalendarEvent *event, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +G_END_DECLS + +#endif /* !GDATA_CALENDAR_SERVICE_H */ diff --git a/gdata/services/contacts/gdata-contacts-contact.c b/gdata/services/contacts/gdata-contacts-contact.c new file mode 100644 index 0000000..7320802 --- /dev/null +++ b/gdata/services/contacts/gdata-contacts-contact.c @@ -0,0 +1,3529 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2010, 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-contacts-contact + * @short_description: GData Contacts contact object + * @stability: Stable + * @include: gdata/services/contacts/gdata-contacts-contact.h + * + * #GDataContactsContact is a subclass of #GDataEntry to represent a contact from a Google address book. + * + * For more details of Google Contacts' GData API, see the + * online documentation. + * + * In addition to all the standard properties available for a contact, #GDataContactsContact supports two kinds of additional property: extended + * properties and user-defined fields. Extended properties, set with gdata_contacts_contact_set_extended_property() and retrieved with + * gdata_contacts_contact_get_extended_property(), are provided as a method of storing client-specific data which shouldn't be seen or be editable + * by the user, such as IDs and cache times. User-defined fields, set with gdata_contacts_contact_set_user_defined_field() and retrieved with + * gdata_contacts_contact_get_user_defined_field(), store fields defined by the user, and editable by them in the interface (both the interface of + * the appliation using libgdata, and the Google Contacts web interface). + * + * + * Getting a Contact's Photo + * + * GDataContactsService *service; + * GDataContactsContact *contact; + * guint8 *data; + * gchar *content_type = NULL; + * gsize length = 0; + * GError *error = NULL; + * + * /* Create a service and return the contact whose photo we're getting. */ + * service = create_contacts_service (); + * contact = query_user_for_contact (service); + * + * /* Get the photo. This should almost always be done asynchronously. */ + * data = gdata_contacts_contact_get_photo (contact, service, &length, &content_type, NULL, &error); + * + * g_object_unref (contact); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error getting a contact's photo: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Do something with the photo, stored in data, length and content_type. */ + * + * g_free (content_type); + * g_free (data); + * + * + * + * + * Setting a Contact's Photo + * + * GDataContactsService *service; + * GDataContactsContact *contact; + * guint8 *data; + * gchar *content_type = NULL; + * gsize length = 0; + * GError *error = NULL; + * + * /* Create a service and return the contact whose photo we're getting, as well as the details of the new photo. */ + * service = create_contacts_service (); + * contact = query_user_for_contact (service); + * data = query_user_for_new_photo (contact, &content_type, &length); + * + * /* Set the photo. This should almost always be done asynchronously. To delete the photo, just pass NULL as the photo data. */ + * gdata_contacts_contact_set_photo (contact, service, data, length, content_type, NULL, &error); + * + * g_free (data); + * g_free (content_type); + * g_object_unref (contact); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error setting a contact's photo: %s", error->message); + * g_error_free (error); + * return; + * } + * + * + * + * + * Updating a Contact's Details + * + * GDataContactsService *service; + * GDataContactsContact *contact, *updated_contact; + * GDataGDEmailAddress *email_address; + * GDataGDIMAddress *im_address; + * GError *error = NULL; + * + * /* Create a service and return the contact whose details we're updating. */ + * service = create_contacts_service (); + * contact = query_user_for_contact (service); + * + * /* Update the contact's details. We set their nickname to "Fat Tony", add a new e-mail address, and replace all their existing IM + * * addresses with a single new one. */ + * gdata_contacts_contact_set_nickname (contact, "Fat Tony"); + * + * email_address = gdata_gd_email_address_new ("tony@gmail.com", GDATA_GD_EMAIL_ADDRESS_HOME, NULL, FALSE); + * gdata_contacts_contact_add_email_address (contact, email_address); + * g_object_unref (email_address); + * + * gdata_contacts_contact_remove_all_im_addresses (contact); + * im_address = gdata_gd_im_address_new ("tony.work@gmail.com", GDATA_GD_IM_PROTOCOL_GOOGLE_TALK, GDATA_GD_IM_ADDRESS_WORK, NULL, TRUE); + * gdata_contacts_contact_add_im_address (contact, im_address); + * g_object_unref (im_address); + * + * /* Send the updated contact to the server */ + * updated_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (contact), NULL, &error)); + * + * g_object_unref (contact); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error updating a contact's details: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Do something with the updated contact, such as update them in the UI, or store their ID for future use. */ + * + * g_object_unref (updated_contact); + * + * + * + * Since: 0.2.0 + */ + +#include +#include +#include +#include +#include + +#include "gdata-contacts-contact.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-private.h" +#include "gdata-comparable.h" + +/* The maximum number of extended properties the server allows us. See + * http://code.google.com/apis/contacts/docs/2.0/reference.html#ProjectionsAndExtended. + * When updating this, make sure to update the API documentation for gdata_contacts_contact_get_extended_property() + * and gdata_contacts_contact_set_extended_property(). */ +#define MAX_N_EXTENDED_PROPERTIES 10 + +static GObject *gdata_contacts_contact_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); +static void gdata_contacts_contact_dispose (GObject *object); +static void gdata_contacts_contact_finalize (GObject *object); +static void gdata_contacts_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_contacts_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); +static gchar *get_entry_uri (const gchar *id) G_GNUC_WARN_UNUSED_RESULT; + +struct _GDataContactsContactPrivate { + gint64 edited; + GDataGDName *name; + GList *email_addresses; /* GDataGDEmailAddress */ + GList *im_addresses; /* GDataGDIMAddress */ + GList *phone_numbers; /* GDataGDPhoneNumber */ + GList *postal_addresses; /* GDataGDPostalAddress */ + GList *organizations; /* GDataGDOrganization */ + GHashTable *extended_properties; + GHashTable *user_defined_fields; + GHashTable *groups; + gboolean deleted; + gchar *photo_etag; + GList *jots; /* GDataGContactJot */ + gchar *nickname; + gchar *file_as; + GDate birthday; + gboolean birthday_has_year; /* contacts can choose to just give the month and day of their birth */ + GList *relations; /* GDataGContactRelation */ + GList *websites; /* GDataGContactWebsite */ + GList *events; /* GDataGContactEvent */ + GList *calendars; /* GDataGContactCalendar */ + GList *external_ids; /* GDataGContactExternalID */ + gchar *billing_information; + gchar *directory_server; + gchar *gender; + gchar *initials; + gchar *maiden_name; + gchar *mileage; + gchar *occupation; + gchar *priority; + gchar *sensitivity; + gchar *short_name; + gchar *subject; + GList *hobbies; /* gchar* */ + GList *languages; /* GDataGContactLanguage */ +}; + +enum { + PROP_EDITED = 1, + PROP_DELETED, + PROP_NAME, + PROP_NICKNAME, + PROP_BIRTHDAY, + PROP_BIRTHDAY_HAS_YEAR, + PROP_BILLING_INFORMATION, + PROP_DIRECTORY_SERVER, + PROP_GENDER, + PROP_INITIALS, + PROP_MAIDEN_NAME, + PROP_MILEAGE, + PROP_OCCUPATION, + PROP_PRIORITY, + PROP_SENSITIVITY, + PROP_SHORT_NAME, + PROP_SUBJECT, + PROP_PHOTO_ETAG, + PROP_FILE_AS, +}; + +G_DEFINE_TYPE (GDataContactsContact, gdata_contacts_contact, GDATA_TYPE_ENTRY) + +static void +gdata_contacts_contact_class_init (GDataContactsContactClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataContactsContactPrivate)); + + gobject_class->constructor = gdata_contacts_contact_constructor; + gobject_class->get_property = gdata_contacts_contact_get_property; + gobject_class->set_property = gdata_contacts_contact_set_property; + gobject_class->dispose = gdata_contacts_contact_dispose; + gobject_class->finalize = gdata_contacts_contact_finalize; + + parsable_class->parse_xml = parse_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + + entry_class->get_entry_uri = get_entry_uri; + entry_class->kind_term = "http://schemas.google.com/contact/2008#contact"; + + /** + * GDataContactsContact:edited: + * + * The last time the contact was edited. If the contact has not been edited yet, the content indicates the time it was created. + * + * For more information, see the + * Atom Publishing Protocol specification. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_EDITED, + g_param_spec_int64 ("edited", + "Edited", "The last time the contact was edited.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:deleted: + * + * Whether the entry has been deleted. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_DELETED, + g_param_spec_boolean ("deleted", + "Deleted", "Whether the entry has been deleted.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:photo-etag: + * + * The ETag of the contact's photo, if the contact has a photo; %NULL otherwise. + * + * Since: 0.9.0 + */ + g_object_class_install_property (gobject_class, PROP_PHOTO_ETAG, + g_param_spec_string ("photo-etag", + "Photo ETag", "The ETag of the contact's photo.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:name: + * + * The contact's name in a structured representation. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_NAME, + g_param_spec_object ("name", + "Name", "The contact's name in a structured representation.", + GDATA_TYPE_GD_NAME, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:nickname: + * + * The contact's chosen nickname. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_NICKNAME, + g_param_spec_string ("nickname", + "Nickname", "The contact's chosen nickname.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:file-as: + * + * The name to file the contact under for sorting purposes. + * + * Since: 0.11.0 + */ + g_object_class_install_property (gobject_class, PROP_FILE_AS, + g_param_spec_string ("file-as", + "File As", "The name to file the contact under for sorting purposes.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:birthday: + * + * The contact's birthday. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_BIRTHDAY, + g_param_spec_boxed ("birthday", + "Birthday", "The contact's birthday.", + G_TYPE_DATE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:birthday-has-year: + * + * Whether the contact's birthday includes their year of birth. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_BIRTHDAY_HAS_YEAR, + g_param_spec_boolean ("birthday-has-year", + "Birthday has year?", "Whether the contact's birthday includes their year of birth.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:billing-information: + * + * Billing information for the contact, such as their billing name and address. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_BILLING_INFORMATION, + g_param_spec_string ("billing-information", + "Billing information", "Billing information for the contact.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:directory-server: + * + * The name or address of a directory server associated with the contact. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_DIRECTORY_SERVER, + g_param_spec_string ("directory-server", + "Directory server", "The name or address of an associated directory server.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:gender: + * + * The gender of the contact. For example: %GDATA_CONTACTS_GENDER_MALE or %GDATA_CONTACTS_GENDER_FEMALE. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_GENDER, + g_param_spec_string ("gender", + "Gender", "The gender of the contact.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:initials: + * + * The initials of the contact. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_INITIALS, + g_param_spec_string ("initials", + "Initials", "The initials of the contact.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:maiden-name: + * + * The maiden name of the contact. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_MAIDEN_NAME, + g_param_spec_string ("maiden-name", + "Maiden name", "The maiden name of the contact.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:mileage: + * + * A mileage associated with the contact, such as one for reimbursement purposes. It can be in any format. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_MILEAGE, + g_param_spec_string ("mileage", + "Mileage", "A mileage associated with the contact.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:occupation: + * + * The contact's occupation. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_OCCUPATION, + g_param_spec_string ("occupation", + "Occupation", "The contact's occupation.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:priority: + * + * The contact's importance. For example: %GDATA_CONTACTS_PRIORITY_NORMAL or %GDATA_CONTACTS_PRIORITY_HIGH. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_PRIORITY, + g_param_spec_string ("priority", + "Priority", "The contact's importance.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:sensitivity: + * + * The sensitivity of the contact's data. For example: %GDATA_CONTACTS_SENSITIVITY_NORMAL or %GDATA_CONTACTS_SENSITIVITY_PRIVATE. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_SENSITIVITY, + g_param_spec_string ("sensitivity", + "Sensitivity", "The sensitivity of the contact's data.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:short-name: + * + * A short name for the contact. This should be used for contracted versions of the contact's actual name, + * whereas #GDataContactsContact:nickname should be used for nicknames. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_SHORT_NAME, + g_param_spec_string ("short-name", + "Short name", "A short name for the contact.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsContact:subject: + * + * The subject of the contact. (i.e. The contact's relevance to the address book.) + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_SUBJECT, + g_param_spec_string ("subject", + "Subject", "The subject of the contact.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void notify_full_name_cb (GObject *gobject, GParamSpec *pspec, GDataContactsContact *self); + +static void +notify_title_cb (GObject *gobject, GParamSpec *pspec, GDataContactsContact *self) +{ + /* Update GDataGDName:full-name */ + g_signal_handlers_block_by_func (self->priv->name, notify_full_name_cb, self); + gdata_gd_name_set_full_name (self->priv->name, gdata_entry_get_title (GDATA_ENTRY (self))); + g_signal_handlers_unblock_by_func (self->priv->name, notify_full_name_cb, self); +} + +static void +notify_full_name_cb (GObject *gobject, GParamSpec *pspec, GDataContactsContact *self) +{ + /* Update GDataEntry:title */ + g_signal_handlers_block_by_func (self, notify_title_cb, self); + gdata_entry_set_title (GDATA_ENTRY (self), gdata_gd_name_get_full_name (self->priv->name)); + g_signal_handlers_unblock_by_func (self, notify_title_cb, self); +} + +static void +gdata_contacts_contact_init (GDataContactsContact *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_CONTACTS_CONTACT, GDataContactsContactPrivate); + self->priv->extended_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + self->priv->user_defined_fields = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + self->priv->groups = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + self->priv->edited = -1; + + /* Create a default name, so the name's properties can be set for a blank contact */ + self->priv->name = gdata_gd_name_new (NULL, NULL); + + /* Listen to change notifications for the entry's title, since it's linked to GDataGDName:full-name */ + g_signal_connect (self, "notify::title", (GCallback) notify_title_cb, self); + g_signal_connect (self->priv->name, "notify::full-name", (GCallback) notify_full_name_cb, self); + + /* Initialise the contact's birthday to a sane but invalid date */ + g_date_clear (&(self->priv->birthday), 1); +} + +static GObject * +gdata_contacts_contact_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) +{ + GObject *object; + guint i; + + /* Find the "id" property and ensure it's sane */ + for (i = 0; i < n_construct_params; i++) { + GParamSpec *pspec = construct_params[i].pspec; + GValue *value = construct_params[i].value; + + if (strcmp (g_param_spec_get_name (pspec), "id") == 0) { + gchar *base, *id; + + id = g_value_dup_string (value); + + /* Fix the ID to refer to the full projection, rather than the base projection. */ + if (id != NULL) { + base = strstr (id, "/base/"); + if (base != NULL) + memcpy (base, "/full/", 6); + } + + g_value_take_string (value, id); + + break; + } + } + + /* Chain up to the parent class */ + object = G_OBJECT_CLASS (gdata_contacts_contact_parent_class)->constructor (type, n_construct_params, construct_params); + + if (_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object)) == FALSE) { + GDataContactsContactPrivate *priv = GDATA_CONTACTS_CONTACT (object)->priv; + GTimeVal time_val; + + /* Set the edited property to the current time (creation time). We don't do this in *_init() since that would cause + * setting it from parse_xml() to fail (duplicate element). */ + g_get_current_time (&time_val); + priv->edited = time_val.tv_sec; + } + + return object; +} + +static void +gdata_contacts_contact_dispose (GObject *object) +{ + GDataContactsContact *self = GDATA_CONTACTS_CONTACT (object); + + if (self->priv->name != NULL) + g_object_unref (self->priv->name); + self->priv->name = NULL; + + gdata_contacts_contact_remove_all_organizations (self); + gdata_contacts_contact_remove_all_email_addresses (self); + gdata_contacts_contact_remove_all_im_addresses (self); + gdata_contacts_contact_remove_all_postal_addresses (self); + gdata_contacts_contact_remove_all_phone_numbers (self); + gdata_contacts_contact_remove_all_jots (self); + gdata_contacts_contact_remove_all_relations (self); + gdata_contacts_contact_remove_all_websites (self); + gdata_contacts_contact_remove_all_events (self); + gdata_contacts_contact_remove_all_calendars (self); + gdata_contacts_contact_remove_all_external_ids (self); + gdata_contacts_contact_remove_all_languages (self); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_contacts_contact_parent_class)->dispose (object); +} + +static void +gdata_contacts_contact_finalize (GObject *object) +{ + GDataContactsContactPrivate *priv = GDATA_CONTACTS_CONTACT (object)->priv; + + g_hash_table_destroy (priv->extended_properties); + g_hash_table_destroy (priv->user_defined_fields); + g_hash_table_destroy (priv->groups); + g_free (priv->photo_etag); + g_free (priv->nickname); + g_free (priv->file_as); + g_free (priv->billing_information); + g_free (priv->directory_server); + g_free (priv->gender); + g_free (priv->initials); + g_free (priv->maiden_name); + g_free (priv->mileage); + g_free (priv->occupation); + g_free (priv->priority); + g_free (priv->sensitivity); + g_free (priv->short_name); + g_free (priv->subject); + + if (priv->hobbies != NULL) { + g_list_foreach (priv->hobbies, (GFunc) g_free, NULL); + g_list_free (priv->hobbies); + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_contacts_contact_parent_class)->finalize (object); +} + +static void +gdata_contacts_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataContactsContactPrivate *priv = GDATA_CONTACTS_CONTACT (object)->priv; + + switch (property_id) { + case PROP_EDITED: + g_value_set_int64 (value, priv->edited); + break; + case PROP_DELETED: + g_value_set_boolean (value, priv->deleted); + break; + case PROP_PHOTO_ETAG: + g_value_set_string (value, priv->photo_etag); + break; + case PROP_NAME: + g_value_set_object (value, priv->name); + break; + case PROP_NICKNAME: + g_value_set_string (value, priv->nickname); + break; + case PROP_FILE_AS: + g_value_set_string (value, priv->file_as); + break; + case PROP_BIRTHDAY: + g_value_set_boxed (value, &(priv->birthday)); + break; + case PROP_BIRTHDAY_HAS_YEAR: + g_value_set_boolean (value, priv->birthday_has_year); + break; + case PROP_BILLING_INFORMATION: + g_value_set_string (value, priv->billing_information); + break; + case PROP_DIRECTORY_SERVER: + g_value_set_string (value, priv->directory_server); + break; + case PROP_GENDER: + g_value_set_string (value, priv->gender); + break; + case PROP_INITIALS: + g_value_set_string (value, priv->initials); + break; + case PROP_MAIDEN_NAME: + g_value_set_string (value, priv->maiden_name); + break; + case PROP_MILEAGE: + g_value_set_string (value, priv->mileage); + break; + case PROP_OCCUPATION: + g_value_set_string (value, priv->occupation); + break; + case PROP_PRIORITY: + g_value_set_string (value, priv->priority); + break; + case PROP_SENSITIVITY: + g_value_set_string (value, priv->sensitivity); + break; + case PROP_SHORT_NAME: + g_value_set_string (value, priv->short_name); + break; + case PROP_SUBJECT: + g_value_set_string (value, priv->subject); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_contacts_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataContactsContact *self = GDATA_CONTACTS_CONTACT (object); + + switch (property_id) { + case PROP_NAME: + gdata_contacts_contact_set_name (self, g_value_get_object (value)); + break; + case PROP_NICKNAME: + gdata_contacts_contact_set_nickname (self, g_value_get_string (value)); + break; + case PROP_FILE_AS: + gdata_contacts_contact_set_file_as (self, g_value_get_string (value)); + break; + case PROP_BIRTHDAY: + gdata_contacts_contact_set_birthday (self, g_value_get_boxed (value), self->priv->birthday_has_year); + break; + case PROP_BIRTHDAY_HAS_YEAR: + gdata_contacts_contact_set_birthday (self, &(self->priv->birthday), g_value_get_boolean (value)); + break; + case PROP_BILLING_INFORMATION: + gdata_contacts_contact_set_billing_information (self, g_value_get_string (value)); + break; + case PROP_DIRECTORY_SERVER: + gdata_contacts_contact_set_directory_server (self, g_value_get_string (value)); + break; + case PROP_GENDER: + gdata_contacts_contact_set_gender (self, g_value_get_string (value)); + break; + case PROP_INITIALS: + gdata_contacts_contact_set_initials (self, g_value_get_string (value)); + break; + case PROP_MAIDEN_NAME: + gdata_contacts_contact_set_maiden_name (self, g_value_get_string (value)); + break; + case PROP_MILEAGE: + gdata_contacts_contact_set_mileage (self, g_value_get_string (value)); + break; + case PROP_OCCUPATION: + gdata_contacts_contact_set_occupation (self, g_value_get_string (value)); + break; + case PROP_PRIORITY: + gdata_contacts_contact_set_priority (self, g_value_get_string (value)); + break; + case PROP_SENSITIVITY: + gdata_contacts_contact_set_sensitivity (self, g_value_get_string (value)); + break; + case PROP_SHORT_NAME: + gdata_contacts_contact_set_short_name (self, g_value_get_string (value)); + break; + case PROP_SUBJECT: + gdata_contacts_contact_set_subject (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataContactsContact *self = GDATA_CONTACTS_CONTACT (parsable); + + if (gdata_parser_is_namespace (node, "http://www.w3.org/2007/app") == TRUE && + gdata_parser_int64_time_from_element (node, "edited", P_REQUIRED | P_NO_DUPES, &(self->priv->edited), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://www.w3.org/2005/Atom") == TRUE && xmlStrcmp (node->name, (xmlChar*) "id") == 0) { + /* We have to override parsing to fix the projection. Modify it in-place so that the parser in GDataEntry will pick up + * the changes. This fixes bugs caused by referring to contacts by the base projection, rather than the full projection; + * such as http://code.google.com/p/gdata-issues/issues/detail?id=2129. */ + gchar *base; + gchar *id = (gchar*) xmlNodeListGetString (doc, node->children, TRUE); + + if (id != NULL) { + base = strstr (id, "/base/"); + if (base != NULL) { + memcpy (base, "/full/", 6); + xmlNodeSetContent (node, (xmlChar*) id); + } + } + + xmlFree (id); + + return GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/g/2005") == TRUE) { + if (gdata_parser_object_from_element_setter (node, "im", P_REQUIRED, GDATA_TYPE_GD_IM_ADDRESS, + gdata_contacts_contact_add_im_address, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "phoneNumber", P_REQUIRED, GDATA_TYPE_GD_PHONE_NUMBER, + gdata_contacts_contact_add_phone_number, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "structuredPostalAddress", P_REQUIRED, GDATA_TYPE_GD_POSTAL_ADDRESS, + gdata_contacts_contact_add_postal_address, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "organization", P_REQUIRED, GDATA_TYPE_GD_ORGANIZATION, + gdata_contacts_contact_add_organization, self, &success, error) == TRUE || + gdata_parser_object_from_element (node, "name", P_REQUIRED, GDATA_TYPE_GD_NAME, &(self->priv->name), &success, error) == TRUE) { + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "email") == 0) { + /* gd:email */ + GDataParsable *_parsable; + xmlChar *address; + + /* Check its address attribute is non-empty. Empty address attributes are apparently allowed, and make the + * gd:email element a no-op. See: https://bugzilla.gnome.org/show_bug.cgi?id=734863 */ + address = xmlGetProp (node, (xmlChar *) "address"); + if (address == NULL) { + return gdata_parser_error_required_property_missing (node, "address", error); + } else if (*address == '\0') { + xmlFree (address); + success = TRUE; + return TRUE; + } + + xmlFree (address); + + /* Parse the e-mail address. */ + _parsable = _gdata_parsable_new_from_xml_node (GDATA_TYPE_GD_EMAIL_ADDRESS, node->doc, node, NULL, error); + if (_parsable == NULL) { + /* The error has already been set by _gdata_parsable_new_from_xml_node() */ + success = FALSE; + return TRUE; + } + + /* Success! */ + gdata_contacts_contact_add_email_address (self, GDATA_GD_EMAIL_ADDRESS (_parsable)); + g_object_unref (_parsable); + success = TRUE; + + return TRUE; + } else if (xmlStrcmp (node->name, (xmlChar*) "extendedProperty") == 0) { + /* gd:extendedProperty */ + xmlChar *name, *value; + xmlBuffer *buffer = NULL; + + name = xmlGetProp (node, (xmlChar*) "name"); + if (name == NULL) + return gdata_parser_error_required_property_missing (node, "name", error); + + /* Get either the value property, or the element's content */ + value = xmlGetProp (node, (xmlChar*) "value"); + if (value == NULL) { + xmlNode *child_node; + + /* Use the element's content instead (arbitrary XML) */ + buffer = xmlBufferCreate (); + for (child_node = node->children; child_node != NULL; child_node = child_node->next) + xmlNodeDump (buffer, doc, child_node, 0, 0); + value = (xmlChar*) xmlBufferContent (buffer); + } + + gdata_contacts_contact_set_extended_property (self, (gchar*) name, (gchar*) value); + + xmlFree (name); + if (buffer != NULL) + xmlBufferFree (buffer); + else + xmlFree (value); + } else if (xmlStrcmp (node->name, (xmlChar*) "deleted") == 0) { + /* gd:deleted */ + self->priv->deleted = TRUE; + } else { + return GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/contact/2008") == TRUE) { + if (gdata_parser_object_from_element_setter (node, "jot", P_REQUIRED, GDATA_TYPE_GCONTACT_JOT, + gdata_contacts_contact_add_jot, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "relation", P_REQUIRED, GDATA_TYPE_GCONTACT_RELATION, + gdata_contacts_contact_add_relation, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "event", P_REQUIRED, GDATA_TYPE_GCONTACT_EVENT, + gdata_contacts_contact_add_event, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "website", P_REQUIRED, GDATA_TYPE_GCONTACT_WEBSITE, + gdata_contacts_contact_add_website, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "calendarLink", P_REQUIRED, GDATA_TYPE_GCONTACT_CALENDAR, + gdata_contacts_contact_add_calendar, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "externalId", P_REQUIRED, GDATA_TYPE_GCONTACT_EXTERNAL_ID, + gdata_contacts_contact_add_external_id, self, &success, error) == TRUE || + gdata_parser_object_from_element_setter (node, "language", P_REQUIRED, GDATA_TYPE_GCONTACT_LANGUAGE, + gdata_contacts_contact_add_language, self, &success, error) == TRUE || + gdata_parser_string_from_element (node, "nickname", P_REQUIRED | P_NO_DUPES, &(self->priv->nickname), &success, error) == TRUE || + gdata_parser_string_from_element (node, "fileAs", P_REQUIRED | P_NO_DUPES, &(self->priv->file_as), &success, error) == TRUE || + gdata_parser_string_from_element (node, "billingInformation", P_REQUIRED | P_NO_DUPES | P_NON_EMPTY, + &(self->priv->billing_information), &success, error) == TRUE || + gdata_parser_string_from_element (node, "directoryServer", P_REQUIRED | P_NO_DUPES | P_NON_EMPTY, + &(self->priv->directory_server), &success, error) == TRUE || + gdata_parser_string_from_element (node, "initials", P_REQUIRED | P_NO_DUPES, &(self->priv->initials), &success, error) == TRUE || + gdata_parser_string_from_element (node, "maidenName", P_REQUIRED | P_NO_DUPES, + &(self->priv->maiden_name), &success, error) == TRUE || + gdata_parser_string_from_element (node, "mileage", P_REQUIRED | P_NO_DUPES, &(self->priv->mileage), &success, error) == TRUE || + gdata_parser_string_from_element (node, "occupation", P_REQUIRED | P_NO_DUPES, + &(self->priv->occupation), &success, error) == TRUE || + gdata_parser_string_from_element (node, "shortName", P_REQUIRED | P_NO_DUPES, + &(self->priv->short_name), &success, error) == TRUE || + gdata_parser_string_from_element (node, "subject", P_REQUIRED | P_NO_DUPES, &(self->priv->subject), &success, error) == TRUE) { + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "gender") == 0) { + /* gContact:gender */ + xmlChar *value; + + if (self->priv->gender != NULL) + return gdata_parser_error_duplicate_element (node, error); + + value = xmlGetProp (node, (xmlChar*) "value"); + if (value == NULL || *value == '\0') { + xmlFree (value); + return gdata_parser_error_required_content_missing (node, error); + } + + self->priv->gender = (gchar*) value; + } else if (xmlStrcmp (node->name, (xmlChar*) "hobby") == 0) { + /* gContact:hobby */ + xmlChar *hobby; + + hobby = xmlNodeListGetString (doc, node->children, TRUE); + if (hobby == NULL || *hobby == '\0') { + xmlFree (hobby); + return gdata_parser_error_required_content_missing (node, error); + } + + gdata_contacts_contact_add_hobby (self, (gchar*) hobby); + xmlFree (hobby); + } else if (xmlStrcmp (node->name, (xmlChar*) "userDefinedField") == 0) { + /* gContact:userDefinedField */ + xmlChar *name, *value; + + /* Note that while we require the property to be present, we don't require it to be non-empty. See bgo#648058 */ + name = xmlGetProp (node, (xmlChar*) "key"); + if (name == NULL) { + return gdata_parser_error_required_property_missing (node, "key", error); + } + + /* Get either the value property, or the element's content */ + value = xmlGetProp (node, (xmlChar*) "value"); + if (value == NULL) { + xmlFree (name); + return gdata_parser_error_required_property_missing (node, "value", error); + } + + gdata_contacts_contact_set_user_defined_field (self, (gchar*) name, (gchar*) value); + + xmlFree (name); + xmlFree (value); + } else if (xmlStrcmp (node->name, (xmlChar*) "priority") == 0) { + /* gContact:priority */ + xmlChar *rel; + + if (self->priv->priority != NULL) + return gdata_parser_error_duplicate_element (node, error); + + rel = xmlGetProp (node, (xmlChar*) "rel"); + if (rel == NULL || *rel == '\0') { + xmlFree (rel); + return gdata_parser_error_required_content_missing (node, error); + } + + self->priv->priority = (gchar*) rel; + } else if (xmlStrcmp (node->name, (xmlChar*) "sensitivity") == 0) { + /* gContact:sensitivity */ + xmlChar *rel; + + if (self->priv->sensitivity != NULL) + return gdata_parser_error_duplicate_element (node, error); + + rel = xmlGetProp (node, (xmlChar*) "rel"); + if (rel == NULL || *rel == '\0') { + xmlFree (rel); + return gdata_parser_error_required_content_missing (node, error); + } + + self->priv->sensitivity = (gchar*) rel; + } else if (xmlStrcmp (node->name, (xmlChar*) "groupMembershipInfo") == 0) { + /* gContact:groupMembershipInfo */ + xmlChar *href; + gboolean deleted_bool; + + href = xmlGetProp (node, (xmlChar*) "href"); + if (href == NULL) + return gdata_parser_error_required_property_missing (node, "href", error); + + /* Has it been deleted? */ + if (gdata_parser_boolean_from_property (node, "deleted", &deleted_bool, 0, error) == FALSE) { + xmlFree (href); + return FALSE; + } + + /* Insert it into the hash table */ + g_hash_table_insert (self->priv->groups, (gchar*) href, GUINT_TO_POINTER (deleted_bool)); + } else if (xmlStrcmp (node->name, (xmlChar*) "birthday") == 0) { + /* gContact:birthday */ + xmlChar *birthday; + guint length = 0, year = 666, month, day; + + if (g_date_valid (&(self->priv->birthday)) == TRUE) + return gdata_parser_error_duplicate_element (node, error); + + birthday = xmlGetProp (node, (xmlChar*) "when"); + if (birthday == NULL) + return gdata_parser_error_required_property_missing (node, "when", error); + length = strlen ((char*) birthday); + + /* Try parsing the two possible formats: YYYY-MM-DD and --MM-DD */ + if (((length == 10 && sscanf ((char*) birthday, "%4u-%2u-%2u", &year, &month, &day) == 3) || + (length == 7 && sscanf ((char*) birthday, "--%2u-%2u", &month, &day) == 2)) && + g_date_valid_dmy (day, month, year) == TRUE) { + /* Store the values in the GDate */ + g_date_set_dmy (&(self->priv->birthday), day, month, year); + self->priv->birthday_has_year = (length == 10) ? TRUE : FALSE; + xmlFree (birthday); + } else { + /* Parsing failed */ + gdata_parser_error_not_iso8601_format (node, (gchar*) birthday, error); + xmlFree (birthday); + return FALSE; + } + } else { + return GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else { + /* If we haven't yet found a photo, check to see if it's a photo element */ + if (self->priv->photo_etag == NULL && xmlStrcmp (node->name, (xmlChar*) "link") == 0) { + xmlChar *rel = xmlGetProp (node, (xmlChar*) "rel"); + if (xmlStrcmp (rel, (xmlChar*) "http://schemas.google.com/contacts/2008/rel#photo") == 0) { + /* It's the photo link (http://code.google.com/apis/contacts/docs/2.0/reference.html#Photos), whose ETag we should + * note down, then pass onto the parent class to parse properly */ + self->priv->photo_etag = (gchar*) xmlGetProp (node, (xmlChar*) "etag"); + } + xmlFree (rel); + } + + return GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static void +get_child_xml (GList *list, GString *xml_string) +{ + GList *i; + + for (i = list; i != NULL; i = i->next) + _gdata_parsable_get_xml (GDATA_PARSABLE (i->data), xml_string, FALSE); +} + +static void +get_extended_property_xml_cb (const gchar *name, const gchar *value, GString *xml_string) +{ + /* Note that the value *isn't* escaped (see http://code.google.com/apis/gdata/docs/2.0/elements.html#gdExtendedProperty) */ + gdata_parser_string_append_escaped (xml_string, ""); + g_string_append_printf (xml_string, "%s", value); +} + +static void +get_user_defined_field_xml_cb (const gchar *name, const gchar *value, GString *xml_string) +{ + gdata_parser_string_append_escaped (xml_string, ""); +} + +static void +get_group_xml_cb (const gchar *href, gpointer deleted, GString *xml_string) +{ + gchar *full_pos, *uri = g_strdup (href); + + /* The service API sometimes stubbornly insists on using the "full" view instead of the "base" view, which we have + * to fix, or it complains about an invalid group ID. */ + full_pos = strstr (uri, "/full/"); + if (full_pos != NULL) + memcpy ((char*) full_pos, "/base/", 6); + + gdata_parser_string_append_escaped (xml_string, ""); + + g_free (uri); +} + +static void +get_hobby_xml_cb (const gchar *hobby, GString *xml_string) +{ + gdata_parser_string_append_escaped (xml_string, "", hobby, ""); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataContactsContactPrivate *priv = GDATA_CONTACTS_CONTACT (parsable)->priv; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->get_xml (parsable, xml_string); + + /* Name */ + _gdata_parsable_get_xml (GDATA_PARSABLE (priv->name), xml_string, FALSE); + + /* Lists of stuff */ + get_child_xml (priv->email_addresses, xml_string); + get_child_xml (priv->im_addresses, xml_string); + get_child_xml (priv->phone_numbers, xml_string); + get_child_xml (priv->postal_addresses, xml_string); + get_child_xml (priv->organizations, xml_string); + get_child_xml (priv->jots, xml_string); + get_child_xml (priv->relations, xml_string); + get_child_xml (priv->websites, xml_string); + get_child_xml (priv->events, xml_string); + get_child_xml (priv->calendars, xml_string); + get_child_xml (priv->external_ids, xml_string); + get_child_xml (priv->languages, xml_string); + + /* Extended properties */ + g_hash_table_foreach (priv->extended_properties, (GHFunc) get_extended_property_xml_cb, xml_string); + + /* User defined fields */ + g_hash_table_foreach (priv->user_defined_fields, (GHFunc) get_user_defined_field_xml_cb, xml_string); + + /* Group membership info */ + g_hash_table_foreach (priv->groups, (GHFunc) get_group_xml_cb, xml_string); + + /* Hobbies */ + g_list_foreach (priv->hobbies, (GFunc) get_hobby_xml_cb, xml_string); + + /* gContact:nickname */ + if (priv->nickname != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->nickname, ""); + + /* gContact:fileAs */ + if (priv->file_as != NULL) { + gdata_parser_string_append_escaped (xml_string, "", priv->file_as, ""); + } + + /* gContact:birthday */ + if (g_date_valid (&(priv->birthday)) == TRUE) { + if (priv->birthday_has_year == TRUE) { + g_string_append_printf (xml_string, "", + g_date_get_year (&(priv->birthday)), + g_date_get_month (&(priv->birthday)), + g_date_get_day (&(priv->birthday))); + } else { + g_string_append_printf (xml_string, "", + g_date_get_month (&(priv->birthday)), + g_date_get_day (&(priv->birthday))); + } + } + + /* gContact:billingInformation */ + if (priv->billing_information != NULL) { + gdata_parser_string_append_escaped (xml_string, + "", priv->billing_information, ""); + } + + /* gContact:directoryServer */ + if (priv->directory_server != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->directory_server, ""); + + /* gContact:gender */ + if (priv->gender != NULL) + gdata_parser_string_append_escaped (xml_string, ""); + + /* gContact:initials */ + if (priv->initials != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->initials, ""); + + /* gContact:maidenName */ + if (priv->maiden_name != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->maiden_name, ""); + + /* gContact:mileage */ + if (priv->mileage != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->mileage, ""); + + /* gContact:occupation */ + if (priv->occupation != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->occupation, ""); + + /* gContact:priority */ + if (priv->priority != NULL) + gdata_parser_string_append_escaped (xml_string, ""); + + /* gContact:sensitivity */ + if (priv->sensitivity != NULL) + gdata_parser_string_append_escaped (xml_string, ""); + + /* gContact:shortName */ + if (priv->short_name != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->short_name, ""); + + /* gContact:subject */ + if (priv->subject != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->subject, ""); + + /* TODO: + * - Finish supporting all tags + */ +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); + g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); + g_hash_table_insert (namespaces, (gchar*) "app", (gchar*) "http://www.w3.org/2007/app"); +} + +static gchar * +get_entry_uri (const gchar *id) +{ + const gchar *base_pos; + gchar *uri; + + /* Ensure it uses the HTTPS protocol */ + if (g_str_has_prefix (id, "http://") == TRUE) { + guint id_length = strlen (id); + + uri = g_malloc (id_length + 2); + strcpy (uri, "https://"); + strcpy (uri + strlen ("https://"), id + strlen ("http://")); + } else { + uri = g_strdup (id); + } + + /* The service API sometimes stubbornly insists on using the "base" view instead of the "full" view, which we have + * to fix, or our extended attributes are never visible */ + base_pos = strstr (uri, "/base/"); + if (base_pos != NULL) + memcpy ((char*) base_pos, "/full/", 6); + + return uri; +} + +/** + * gdata_contacts_contact_new: + * @id: (allow-none): the contact's ID, or %NULL + * + * Creates a new #GDataContactsContact with the given ID and default properties. + * + * Return value: a new #GDataContactsContact; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataContactsContact * +gdata_contacts_contact_new (const gchar *id) +{ + return GDATA_CONTACTS_CONTACT (g_object_new (GDATA_TYPE_CONTACTS_CONTACT, "id", id, NULL)); +} + +/** + * gdata_contacts_contact_get_edited: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:edited property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the contact was last edited, or -1 + * + * Since: 0.2.0 + */ +gint64 +gdata_contacts_contact_get_edited (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), -1); + return self->priv->edited; +} + +/** + * gdata_contacts_contact_get_name: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:name property. + * + * Return value: (transfer none): the contact's name, or %NULL + * + * Since: 0.5.0 + */ +GDataGDName * +gdata_contacts_contact_get_name (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->name; +} + +/** + * gdata_contacts_contact_set_name: + * @self: a #GDataContactsContact + * @name: the new #GDataGDName + * + * Sets the #GDataContactsContact:name property to @name, and increments its reference count. + * + * @name must not be %NULL, though all its properties may be %NULL. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_name (GDataContactsContact *self, GDataGDName *name) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GD_NAME (name)); + + if (self->priv->name != NULL) + g_object_unref (self->priv->name); + self->priv->name = g_object_ref (name); + g_object_notify (G_OBJECT (self), "name"); + + /* Notify the change in #GDataGDName:full-name explicitly, so that our #GDataEntry:title gets updated */ + notify_full_name_cb (G_OBJECT (name), NULL, self); +} + +/** + * gdata_contacts_contact_get_nickname: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:nickname property. + * + * Return value: the contact's nickname, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_nickname (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->nickname; +} + +/** + * gdata_contacts_contact_set_nickname: + * @self: a #GDataContactsContact + * @nickname: (allow-none): the new nickname, or %NULL + * + * Sets the #GDataContactsContact:nickname property to @nickname. + * + * If @nickname is %NULL, the contact's nickname will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_nickname (GDataContactsContact *self, const gchar *nickname) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + g_free (self->priv->nickname); + self->priv->nickname = g_strdup (nickname); + g_object_notify (G_OBJECT (self), "nickname"); +} + +/** + * gdata_contacts_contact_get_file_as: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:file-as property. + * + * Return value: the name the contact's filed under, or %NULL + * + * Since: 0.11.0 + */ +const gchar * +gdata_contacts_contact_get_file_as (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->file_as; +} + +/** + * gdata_contacts_contact_set_file_as: + * @self: a #GDataContactsContact + * @file_as: (allow-none): the new name to file the contact under, or %NULL + * + * Sets the #GDataContactsContact:file-as property to @file_as. + * + * If @file_as is %NULL, the contact will be filed under their full name. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_file_as (GDataContactsContact *self, const gchar *file_as) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + g_free (self->priv->file_as); + self->priv->file_as = g_strdup (file_as); + g_object_notify (G_OBJECT (self), "file-as"); +} + +/** + * gdata_contacts_contact_get_birthday: + * @self: a #GDataContactsContact + * @birthday: (allow-none) (out caller-allocates): return location for the birthday, or %NULL + * + * Gets the #GDataContactsContact:birthday and #GDataContactsContact:birthday-has-year properties. If @birthday is non-%NULL, + * #GDataContactsContact:birthday is returned in it. The function returns the value of #GDataContactsContact:birthday-has-year, + * which specifies whether the year in @birthday is meaningful. Contacts may not have the year of their birth set, in which + * case, the function would return %FALSE, and the year in @birthday should be ignored. + * + * Return value: whether the contact's birthday has the year set + * + * Since: 0.7.0 + */ +gboolean +gdata_contacts_contact_get_birthday (GDataContactsContact *self, GDate *birthday) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); + + if (birthday != NULL) + *birthday = self->priv->birthday; + return self->priv->birthday_has_year; +} + +/** + * gdata_contacts_contact_set_birthday: + * @self: a #GDataContactsContact + * @birthday: (allow-none): the new birthday, or %NULL + * @birthday_has_year: %TRUE if @birthday's year is relevant, %FALSE otherwise + * + * Sets the #GDataContactsContact:birthday property to @birthday and the #GDataContactsContact:birthday-has-year property to @birthday_has_year. + * See gdata_contacts_contact_get_birthday() for an explanation of the interation between these two properties. + * + * If @birthday is %NULL, the contact's birthday will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_birthday (GDataContactsContact *self, GDate *birthday, gboolean birthday_has_year) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (birthday == NULL || g_date_valid (birthday)); + + if (birthday != NULL) + self->priv->birthday = *birthday; + else + g_date_clear (&(self->priv->birthday), 1); + + self->priv->birthday_has_year = birthday_has_year; + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "birthday"); + g_object_notify (G_OBJECT (self), "birthday-has-year"); + g_object_thaw_notify (G_OBJECT (self)); +} + +/** + * gdata_contacts_contact_get_billing_information: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:billing-information property. + * + * Return value: the contact's billing information, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_billing_information (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->billing_information; +} + +/** + * gdata_contacts_contact_set_billing_information: + * @self: a #GDataContactsContact + * @billing_information: (allow-none): the new billing information for the contact, or %NULL + * + * Sets the #GDataContactsContact:billing-information property to @billing_information. + * + * If @billing_information is %NULL, the contact's billing information will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_billing_information (GDataContactsContact *self, const gchar *billing_information) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (billing_information == NULL || *billing_information != '\0'); + + g_free (self->priv->billing_information); + self->priv->billing_information = g_strdup (billing_information); + g_object_notify (G_OBJECT (self), "billing-information"); +} + +/** + * gdata_contacts_contact_get_directory_server: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:directory-server property. + * + * Return value: the name or address of a directory server associated with the contact, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_directory_server (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->directory_server; +} + +/** + * gdata_contacts_contact_set_directory_server: + * @self: a #GDataContactsContact + * @directory_server: (allow-none): the new name or address of a directory server associated with the contact, or %NULL + * + * Sets the #GDataContactsContact:directory-server property to @directory_server. + * + * If @directory_server is %NULL, the contact's directory server will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_directory_server (GDataContactsContact *self, const gchar *directory_server) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (directory_server == NULL || *directory_server != '\0'); + + g_free (self->priv->directory_server); + self->priv->directory_server = g_strdup (directory_server); + g_object_notify (G_OBJECT (self), "directory-server"); +} + +/** + * gdata_contacts_contact_get_gender: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:gender property. + * + * Return value: the gender of the contact, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_gender (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->gender; +} + +/** + * gdata_contacts_contact_set_gender: + * @self: a #GDataContactsContact + * @gender: (allow-none): the new gender of the contact, or %NULL + * + * Sets the #GDataContactsContact:gender property to @gender. + * + * If @gender is %NULL, the contact's gender will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_gender (GDataContactsContact *self, const gchar *gender) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (gender == NULL || *gender != '\0'); + + g_free (self->priv->gender); + self->priv->gender = g_strdup (gender); + g_object_notify (G_OBJECT (self), "gender"); +} + +/** + * gdata_contacts_contact_get_initials: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:initials property. + * + * Return value: the initials of the contact, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_initials (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->initials; +} + +/** + * gdata_contacts_contact_set_initials: + * @self: a #GDataContactsContact + * @initials: (allow-none): the new initials of the contact, or %NULL + * + * Sets the #GDataContactsContact:initials property to @initials. + * + * If @initials is %NULL, the contact's initials will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_initials (GDataContactsContact *self, const gchar *initials) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + g_free (self->priv->initials); + self->priv->initials = g_strdup (initials); + g_object_notify (G_OBJECT (self), "initials"); +} + +/** + * gdata_contacts_contact_get_maiden_name: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:maiden-name property. + * + * Return value: the maiden name of the contact, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_maiden_name (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->maiden_name; +} + +/** + * gdata_contacts_contact_set_maiden_name: + * @self: a #GDataContactsContact + * @maiden_name: (allow-none): the new maiden name of the contact, or %NULL + * + * Sets the #GDataContactsContact:maiden-name property to @maiden_name. + * + * If @maiden_name is %NULL, the contact's maiden name will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_maiden_name (GDataContactsContact *self, const gchar *maiden_name) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + g_free (self->priv->maiden_name); + self->priv->maiden_name = g_strdup (maiden_name); + g_object_notify (G_OBJECT (self), "maiden-name"); +} + +/** + * gdata_contacts_contact_get_mileage: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:mileage property. + * + * Return value: a mileage associated with the contact, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_mileage (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->mileage; +} + +/** + * gdata_contacts_contact_set_mileage: + * @self: a #GDataContactsContact + * @mileage: (allow-none): the new mileage associated with the contact, or %NULL + * + * Sets the #GDataContactsContact:mileage property to @mileage. + * + * If @mileage is %NULL, the contact's mileage will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_mileage (GDataContactsContact *self, const gchar *mileage) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + g_free (self->priv->mileage); + self->priv->mileage = g_strdup (mileage); + g_object_notify (G_OBJECT (self), "mileage"); +} + +/** + * gdata_contacts_contact_get_occupation: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:occupation property. + * + * Return value: the contact's occupation, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_occupation (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->occupation; +} + +/** + * gdata_contacts_contact_set_occupation: + * @self: a #GDataContactsContact + * @occupation: (allow-none): the contact's new occupation, or %NULL + * + * Sets the #GDataContactsContact:occupation property to @occupation. + * + * If @occupation is %NULL, the contact's occupation will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_occupation (GDataContactsContact *self, const gchar *occupation) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + g_free (self->priv->occupation); + self->priv->occupation = g_strdup (occupation); + g_object_notify (G_OBJECT (self), "occupation"); +} + +/** + * gdata_contacts_contact_get_priority: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:priority property. + * + * Return value: the contact's priority, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_priority (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->priority; +} + +/** + * gdata_contacts_contact_set_priority: + * @self: a #GDataContactsContact + * @priority: (allow-none): the contact's new priority, or %NULL + * + * Sets the #GDataContactsContact:priority property to @priority. + * + * If @priority is %NULL, the contact's priority will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_priority (GDataContactsContact *self, const gchar *priority) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (priority == NULL || *priority != '\0'); + + g_free (self->priv->priority); + self->priv->priority = g_strdup (priority); + g_object_notify (G_OBJECT (self), "priority"); +} + +/** + * gdata_contacts_contact_get_sensitivity: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:sensitivity property. + * + * Return value: the contact's sensitivity, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_sensitivity (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->sensitivity; +} + +/** + * gdata_contacts_contact_set_sensitivity: + * @self: a #GDataContactsContact + * @sensitivity: (allow-none): the contact's new sensitivity, or %NULL + * + * Sets the #GDataContactsContact:sensitivity property to @sensitivity. + * + * If @sensitivity is %NULL, the contact's sensitivity will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_sensitivity (GDataContactsContact *self, const gchar *sensitivity) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (sensitivity == NULL || *sensitivity != '\0'); + + g_free (self->priv->sensitivity); + self->priv->sensitivity = g_strdup (sensitivity); + g_object_notify (G_OBJECT (self), "sensitivity"); +} + +/** + * gdata_contacts_contact_get_short_name: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:short-name property. + * + * Return value: the contact's short name, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_short_name (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->short_name; +} + +/** + * gdata_contacts_contact_set_short_name: + * @self: a #GDataContactsContact + * @short_name: (allow-none): the contact's new short name, or %NULL + * + * Sets the #GDataContactsContact:short-name property to @short_name. + * + * If @short_name is %NULL, the contact's short name will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_short_name (GDataContactsContact *self, const gchar *short_name) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + g_free (self->priv->short_name); + self->priv->short_name = g_strdup (short_name); + g_object_notify (G_OBJECT (self), "short-name"); +} + +/** + * gdata_contacts_contact_get_subject: + * @self: a #GDataContactsContact + * + * Gets the #GDataContactsContact:subject property. + * + * Return value: the contact's subject, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_subject (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->subject; +} + +/** + * gdata_contacts_contact_set_subject: + * @self: a #GDataContactsContact + * @subject: (allow-none): the contact's new subject, or %NULL + * + * Sets the #GDataContactsContact:subject property to @subject. + * + * If @subject is %NULL, the contact's subject will be removed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_subject (GDataContactsContact *self, const gchar *subject) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + g_free (self->priv->subject); + self->priv->subject = g_strdup (subject); + g_object_notify (G_OBJECT (self), "subject"); +} + +/** + * gdata_contacts_contact_add_email_address: + * @self: a #GDataContactsContact + * @email_address: a #GDataGDEmailAddress to add + * + * Adds an e-mail address to the contact's list of e-mail addresses and increments its reference count. + * + * Note that only one e-mail address per contact may be marked as "primary". Insertion and update operations + * (with gdata_contacts_service_insert_contact()) will return an error if more than one e-mail address + * is marked as primary. + * + * Duplicate e-mail addresses will not be added to the list. + * + * Since: 0.2.0 + */ +void +gdata_contacts_contact_add_email_address (GDataContactsContact *self, GDataGDEmailAddress *email_address) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (email_address)); + + if (g_list_find_custom (self->priv->email_addresses, email_address, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->email_addresses = g_list_append (self->priv->email_addresses, g_object_ref (email_address)); +} + +/** + * gdata_contacts_contact_get_email_addresses: + * @self: a #GDataContactsContact + * + * Gets a list of the e-mail addresses owned by the contact. + * + * Return value: (element-type GData.GDEmailAddress) (transfer none): a #GList of #GDataGDEmailAddresses, or %NULL + * + * Since: 0.2.0 + */ +GList * +gdata_contacts_contact_get_email_addresses (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->email_addresses; +} + +/** + * gdata_contacts_contact_get_primary_email_address: + * @self: a #GDataContactsContact + * + * Gets the contact's primary e-mail address, if one exists. + * + * Return value: (transfer none): a #GDataGDEmailAddress, or %NULL + * + * Since: 0.2.0 + */ +GDataGDEmailAddress * +gdata_contacts_contact_get_primary_email_address (GDataContactsContact *self) +{ + GList *i; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + + for (i = self->priv->email_addresses; i != NULL; i = i->next) { + if (gdata_gd_email_address_is_primary (GDATA_GD_EMAIL_ADDRESS (i->data)) == TRUE) + return GDATA_GD_EMAIL_ADDRESS (i->data); + } + + return NULL; +} + +/** + * gdata_contacts_contact_remove_all_email_addresses: + * @self: a #GDataContactsContact + * + * Removes all e-mail addresses from the contact. + * + * Since: 0.4.0 + */ +void +gdata_contacts_contact_remove_all_email_addresses (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->email_addresses != NULL) { + g_list_foreach (priv->email_addresses, (GFunc) g_object_unref, NULL); + g_list_free (priv->email_addresses); + } + priv->email_addresses = NULL; +} + +/** + * gdata_contacts_contact_add_im_address: + * @self: a #GDataContactsContact + * @im_address: a #GDataGDIMAddress to add + * + * Adds an IM (instant messaging) address to the contact's list of IM addresses and increments its reference count. + * + * Note that only one IM address per contact may be marked as "primary". Insertion and update operations + * (with gdata_contacts_service_insert_contact()) will return an error if more than one IM address + * is marked as primary. + * + * Duplicate IM addresses will not be added to the list. + * + * Since: 0.2.0 + */ +void +gdata_contacts_contact_add_im_address (GDataContactsContact *self, GDataGDIMAddress *im_address) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GD_IM_ADDRESS (im_address)); + + if (g_list_find_custom (self->priv->im_addresses, im_address, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->im_addresses = g_list_append (self->priv->im_addresses, g_object_ref (im_address)); +} + +/** + * gdata_contacts_contact_get_im_addresses: + * @self: a #GDataContactsContact + * + * Gets a list of the IM addresses owned by the contact. + * + * Return value: (element-type GData.GDIMAddress) (transfer none): a #GList of #GDataGDIMAddresses, or %NULL + * + * Since: 0.2.0 + */ +GList * +gdata_contacts_contact_get_im_addresses (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->im_addresses; +} + +/** + * gdata_contacts_contact_get_primary_im_address: + * @self: a #GDataContactsContact + * + * Gets the contact's primary IM address, if one exists. + * + * Return value: (transfer none): a #GDataGDIMAddress, or %NULL + * + * Since: 0.2.0 + */ +GDataGDIMAddress * +gdata_contacts_contact_get_primary_im_address (GDataContactsContact *self) +{ + GList *i; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + + for (i = self->priv->im_addresses; i != NULL; i = i->next) { + if (gdata_gd_im_address_is_primary (GDATA_GD_IM_ADDRESS (i->data)) == TRUE) + return GDATA_GD_IM_ADDRESS (i->data); + } + + return NULL; +} + +/** + * gdata_contacts_contact_remove_all_im_addresses: + * @self: a #GDataContactsContact + * + * Removes all IM addresses from the contact. + * + * Since: 0.4.0 + */ +void +gdata_contacts_contact_remove_all_im_addresses (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->im_addresses != NULL) { + g_list_foreach (priv->im_addresses, (GFunc) g_object_unref, NULL); + g_list_free (priv->im_addresses); + } + priv->im_addresses = NULL; +} + +/** + * gdata_contacts_contact_add_phone_number: + * @self: a #GDataContactsContact + * @phone_number: a #GDataGDPhoneNumber to add + * + * Adds a phone number to the contact's list of phone numbers and increments its reference count + * + * Note that only one phone number per contact may be marked as "primary". Insertion and update operations + * (with gdata_contacts_service_insert_contact()) will return an error if more than one phone number + * is marked as primary. + * + * Duplicate phone numbers will not be added to the list. + * + * Since: 0.2.0 + */ +void +gdata_contacts_contact_add_phone_number (GDataContactsContact *self, GDataGDPhoneNumber *phone_number) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GD_PHONE_NUMBER (phone_number)); + + if (g_list_find_custom (self->priv->phone_numbers, phone_number, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->phone_numbers = g_list_append (self->priv->phone_numbers, g_object_ref (phone_number)); +} + +/** + * gdata_contacts_contact_get_phone_numbers: + * @self: a #GDataContactsContact + * + * Gets a list of the phone numbers owned by the contact. + * + * Return value: (element-type GData.GDPhoneNumber) (transfer none): a #GList of #GDataGDPhoneNumbers, or %NULL + * + * Since: 0.2.0 + */ +GList * +gdata_contacts_contact_get_phone_numbers (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->phone_numbers; +} + +/** + * gdata_contacts_contact_get_primary_phone_number: + * @self: a #GDataContactsContact + * + * Gets the contact's primary phone number, if one exists. + * + * Return value: (transfer none): a #GDataGDPhoneNumber, or %NULL + * + * Since: 0.2.0 + */ +GDataGDPhoneNumber * +gdata_contacts_contact_get_primary_phone_number (GDataContactsContact *self) +{ + GList *i; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + + for (i = self->priv->phone_numbers; i != NULL; i = i->next) { + if (gdata_gd_phone_number_is_primary (GDATA_GD_PHONE_NUMBER (i->data)) == TRUE) + return GDATA_GD_PHONE_NUMBER (i->data); + } + + return NULL; +} + +/** + * gdata_contacts_contact_remove_all_phone_numbers: + * @self: a #GDataContactsContact + * + * Removes all phone numbers from the contact. + * + * Since: 0.4.0 + */ +void +gdata_contacts_contact_remove_all_phone_numbers (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->phone_numbers != NULL) { + g_list_foreach (priv->phone_numbers, (GFunc) g_object_unref, NULL); + g_list_free (priv->phone_numbers); + } + priv->phone_numbers = NULL; +} + +/** + * gdata_contacts_contact_add_postal_address: + * @self: a #GDataContactsContact + * @postal_address: a #GDataGDPostalAddress to add + * + * Adds a postal address to the contact's list of postal addresses and increments its reference count. + * + * Note that only one postal address per contact may be marked as "primary". Insertion and update operations + * (with gdata_contacts_service_insert_contact()) will return an error if more than one postal address + * is marked as primary. + * + * Duplicate postal addresses will not be added to the list. + * + * Since: 0.2.0 + */ +void +gdata_contacts_contact_add_postal_address (GDataContactsContact *self, GDataGDPostalAddress *postal_address) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (postal_address)); + + if (g_list_find_custom (self->priv->postal_addresses, postal_address, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->postal_addresses = g_list_append (self->priv->postal_addresses, g_object_ref (postal_address)); +} + +/** + * gdata_contacts_contact_get_postal_addresses: + * @self: a #GDataContactsContact + * + * Gets a list of the postal addresses owned by the contact. + * + * Return value: (element-type GData.GDPostalAddress) (transfer none): a #GList of #GDataGDPostalAddresses, or %NULL + * + * Since: 0.2.0 + */ +GList * +gdata_contacts_contact_get_postal_addresses (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->postal_addresses; +} + +/** + * gdata_contacts_contact_get_primary_postal_address: + * @self: a #GDataContactsContact + * + * Gets the contact's primary postal address, if one exists. + * + * Return value: (transfer none): a #GDataGDPostalAddress, or %NULL + * + * Since: 0.2.0 + */ +GDataGDPostalAddress * +gdata_contacts_contact_get_primary_postal_address (GDataContactsContact *self) +{ + GList *i; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + + for (i = self->priv->postal_addresses; i != NULL; i = i->next) { + if (gdata_gd_postal_address_is_primary (GDATA_GD_POSTAL_ADDRESS (i->data)) == TRUE) + return GDATA_GD_POSTAL_ADDRESS (i->data); + } + + return NULL; +} + +/** + * gdata_contacts_contact_remove_all_postal_addresses: + * @self: a #GDataContactsContact + * + * Removes all postal addresses from the contact. + * + * Since: 0.4.0 + */ +void +gdata_contacts_contact_remove_all_postal_addresses (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->postal_addresses != NULL) { + g_list_foreach (priv->postal_addresses, (GFunc) g_object_unref, NULL); + g_list_free (priv->postal_addresses); + } + priv->postal_addresses = NULL; +} + +/** + * gdata_contacts_contact_add_organization: + * @self: a #GDataContactsContact + * @organization: a #GDataGDOrganization to add + * + * Adds an organization to the contact's list of organizations (e.g. employers) and increments its reference count. + * + * Note that only one organization per contact may be marked as "primary". Insertion and update operations + * (with gdata_contacts_service_insert_contact()) will return an error if more than one organization + * is marked as primary. + * + * Duplicate organizations will not be added to the list. + * + * Since: 0.2.0 + */ +void +gdata_contacts_contact_add_organization (GDataContactsContact *self, GDataGDOrganization *organization) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (organization != NULL); + + if (g_list_find_custom (self->priv->organizations, organization, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->organizations = g_list_append (self->priv->organizations, g_object_ref (organization)); +} + +/** + * gdata_contacts_contact_get_organizations: + * @self: a #GDataContactsContact + * + * Gets a list of the organizations to which the contact belongs. + * + * Return value: (element-type GData.GDOrganization) (transfer none): a #GList of #GDataGDOrganizations, or %NULL + * + * Since: 0.2.0 + */ +GList * +gdata_contacts_contact_get_organizations (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->organizations; +} + +/** + * gdata_contacts_contact_get_primary_organization: + * @self: a #GDataContactsContact + * + * Gets the contact's primary organization, if one exists. + * + * Return value: (transfer none): a #GDataGDOrganization, or %NULL + * + * Since: 0.2.0 + */ +GDataGDOrganization * +gdata_contacts_contact_get_primary_organization (GDataContactsContact *self) +{ + GList *i; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + + for (i = self->priv->organizations; i != NULL; i = i->next) { + if (gdata_gd_organization_is_primary (GDATA_GD_ORGANIZATION (i->data)) == TRUE) + return GDATA_GD_ORGANIZATION (i->data); + } + + return NULL; +} + +/** + * gdata_contacts_contact_remove_all_organizations: + * @self: a #GDataContactsContact + * + * Removes all organizations from the contact. + * + * Since: 0.4.0 + */ +void +gdata_contacts_contact_remove_all_organizations (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->organizations != NULL) { + g_list_foreach (priv->organizations, (GFunc) g_object_unref, NULL); + g_list_free (priv->organizations); + } + priv->organizations = NULL; +} + +/** + * gdata_contacts_contact_add_jot: + * @self: a #GDataContactsContact + * @jot: a #GDataGContactJot to add + * + * Adds a jot to the contact's list of jots and increments its reference count. + * + * Duplicate jots will be added to the list, and multiple jots with the same relation type can be added to a single contact. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_add_jot (GDataContactsContact *self, GDataGContactJot *jot) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GCONTACT_JOT (jot)); + + self->priv->jots = g_list_append (self->priv->jots, g_object_ref (jot)); +} + +/** + * gdata_contacts_contact_get_jots: + * @self: a #GDataContactsContact + * + * Gets a list of the jots attached to the contact. + * + * Return value: (element-type GData.GContactJot) (transfer none): a #GList of #GDataGContactJots, or %NULL + * + * Since: 0.7.0 + */ +GList * +gdata_contacts_contact_get_jots (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->jots; +} + +/** + * gdata_contacts_contact_remove_all_jots: + * @self: a #GDataContactsContact + * + * Removes all jots from the contact. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_remove_all_jots (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->jots != NULL) { + g_list_foreach (priv->jots, (GFunc) g_object_unref, NULL); + g_list_free (priv->jots); + } + priv->jots = NULL; +} + +/** + * gdata_contacts_contact_add_relation: + * @self: a #GDataContactsContact + * @relation: a #GDataGContactRelation to add + * + * Adds a relation to the contact's list of relations and increments its reference count. + * + * Duplicate relations will be added to the list, and multiple relations with the same relation type can be added to a single contact. + * Though it may not make sense for some relation types to be repeated, adding them is allowed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_add_relation (GDataContactsContact *self, GDataGContactRelation *relation) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GCONTACT_RELATION (relation)); + + self->priv->relations = g_list_append (self->priv->relations, g_object_ref (relation)); +} + +/** + * gdata_contacts_contact_get_relations: + * @self: a #GDataContactsContact + * + * Gets a list of the relations of the contact. + * + * Return value: (element-type GData.GContactRelation) (transfer none): a #GList of #GDataGContactRelations, or %NULL + * + * Since: 0.7.0 + */ +GList * +gdata_contacts_contact_get_relations (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->relations; +} + +/** + * gdata_contacts_contact_remove_all_relations: + * @self: a #GDataContactsContact + * + * Removes all relations from the contact. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_remove_all_relations (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->relations != NULL) { + g_list_foreach (priv->relations, (GFunc) g_object_unref, NULL); + g_list_free (priv->relations); + } + priv->relations = NULL; +} + +/** + * gdata_contacts_contact_add_website: + * @self: a #GDataContactsContact + * @website: a #GDataGContactWebsite to add + * + * Adds a website to the contact's list of websites and increments its reference count. + * + * Duplicate websites will not be added to the list, though the same URI may appear in several #GDataGContactWebsites with different + * relation types or labels. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_add_website (GDataContactsContact *self, GDataGContactWebsite *website) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GCONTACT_WEBSITE (website)); + + if (g_list_find_custom (self->priv->websites, website, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->websites = g_list_append (self->priv->websites, g_object_ref (website)); +} + +/** + * gdata_contacts_contact_get_websites: + * @self: a #GDataContactsContact + * + * Gets a list of the websites of the contact. + * + * Return value: (element-type GData.GContactWebsite) (transfer none): a #GList of #GDataGContactWebsites, or %NULL + * + * Since: 0.7.0 + */ +GList * +gdata_contacts_contact_get_websites (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->websites; +} + +/** + * gdata_contacts_contact_get_primary_website: + * @self: a #GDataContactsContact + * + * Gets the contact's primary website, if one exists. + * + * Return value: (transfer none): a #GDataGContactWebsite, or %NULL + * + * Since: 0.7.0 + */ +GDataGContactWebsite * +gdata_contacts_contact_get_primary_website (GDataContactsContact *self) +{ + GList *i; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + + for (i = self->priv->websites; i != NULL; i = i->next) { + if (gdata_gcontact_website_is_primary (GDATA_GCONTACT_WEBSITE (i->data)) == TRUE) + return GDATA_GCONTACT_WEBSITE (i->data); + } + + return NULL; +} + +/** + * gdata_contacts_contact_remove_all_websites: + * @self: a #GDataContactsContact + * + * Removes all websites from the contact. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_remove_all_websites (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->websites != NULL) { + g_list_foreach (priv->websites, (GFunc) g_object_unref, NULL); + g_list_free (priv->websites); + } + priv->websites = NULL; +} + +/** + * gdata_contacts_contact_add_event: + * @self: a #GDataContactsContact + * @event: a #GDataGContactEvent to add + * + * Adds an event to the contact's list of events and increments its reference count. + * + * Duplicate events will be added to the list, and multiple events with the same event type can be added to a single contact. + * Though it may not make sense for some event types to be repeated, adding them is allowed. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_add_event (GDataContactsContact *self, GDataGContactEvent *event) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GCONTACT_EVENT (event)); + + self->priv->events = g_list_append (self->priv->events, g_object_ref (event)); +} + +/** + * gdata_contacts_contact_get_events: + * @self: a #GDataContactsContact + * + * Gets a list of the events of the contact. + * + * Return value: (element-type GData.GContactEvent) (transfer none): a #GList of #GDataGContactEvents, or %NULL + * + * Since: 0.7.0 + */ +GList * +gdata_contacts_contact_get_events (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->events; +} + +/** + * gdata_contacts_contact_remove_all_events: + * @self: a #GDataContactsContact + * + * Removes all events from the contact. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_remove_all_events (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->events != NULL) { + g_list_foreach (priv->events, (GFunc) g_object_unref, NULL); + g_list_free (priv->events); + } + priv->events = NULL; +} + +/** + * gdata_contacts_contact_add_calendar: + * @self: a #GDataContactsContact + * @calendar: a #GDataGContactCalendar to add + * + * Adds a calendar to the contact's list of calendars and increments its reference count. + * + * Duplicate calendars will not be added to the list, though the same URI may appear in several #GDataGContactCalendars with different + * relation types or labels. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_add_calendar (GDataContactsContact *self, GDataGContactCalendar *calendar) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GCONTACT_CALENDAR (calendar)); + + if (g_list_find_custom (self->priv->calendars, calendar, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->calendars = g_list_append (self->priv->calendars, g_object_ref (calendar)); +} + +/** + * gdata_contacts_contact_get_calendars: + * @self: a #GDataContactsContact + * + * Gets a list of the calendars of the contact. + * + * Return value: (element-type GData.GContactCalendar) (transfer none): a #GList of #GDataGContactCalendars, or %NULL + * + * Since: 0.7.0 + */ +GList * +gdata_contacts_contact_get_calendars (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->calendars; +} + +/** + * gdata_contacts_contact_get_primary_calendar: + * @self: a #GDataContactsContact + * + * Gets the contact's primary calendar, if one exists. + * + * Return value: (transfer none): a #GDataGContactCalendar, or %NULL + * + * Since: 0.7.0 + */ +GDataGContactCalendar * +gdata_contacts_contact_get_primary_calendar (GDataContactsContact *self) +{ + GList *i; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + + for (i = self->priv->calendars; i != NULL; i = i->next) { + if (gdata_gcontact_calendar_is_primary (GDATA_GCONTACT_CALENDAR (i->data)) == TRUE) + return GDATA_GCONTACT_CALENDAR (i->data); + } + + return NULL; +} + +/** + * gdata_contacts_contact_remove_all_calendars: + * @self: a #GDataContactsContact + * + * Removes all calendars from the contact. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_remove_all_calendars (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->calendars != NULL) { + g_list_foreach (priv->calendars, (GFunc) g_object_unref, NULL); + g_list_free (priv->calendars); + } + priv->calendars = NULL; +} + +/** + * gdata_contacts_contact_add_external_id: + * @self: a #GDataContactsContact + * @external_id: a #GDataGContactExternalID to add + * + * Adds an external ID to the contact's list of external IDs and increments its reference count. + * + * Duplicate IDs will not be added to the list. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_add_external_id (GDataContactsContact *self, GDataGContactExternalID *external_id) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GCONTACT_EXTERNAL_ID (external_id)); + + if (g_list_find_custom (self->priv->external_ids, external_id, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->external_ids = g_list_append (self->priv->external_ids, g_object_ref (external_id)); +} + +/** + * gdata_contacts_contact_get_external_ids: + * @self: a #GDataContactsContact + * + * Gets a list of the external IDs of the contact. + * + * Return value: (element-type GData.GContactExternalID) (transfer none): a #GList of #GDataGContactExternalIDs, or %NULL + * + * Since: 0.7.0 + */ +GList * +gdata_contacts_contact_get_external_ids (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->external_ids; +} + +/** + * gdata_contacts_contact_remove_all_external_ids: + * @self: a #GDataContactsContact + * + * Removes all external IDs from the contact. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_remove_all_external_ids (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->external_ids != NULL) { + g_list_foreach (priv->external_ids, (GFunc) g_object_unref, NULL); + g_list_free (priv->external_ids); + } + priv->external_ids = NULL; +} + +/** + * gdata_contacts_contact_add_hobby: + * @self: a #GDataContactsContact + * @hobby: a hobby to add + * + * Adds a hobby to the contact's list of hobbies, copying it in the process. + * + * Duplicate hobbies will not be added to the list. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_add_hobby (GDataContactsContact *self, const gchar *hobby) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (hobby != NULL && *hobby != '\0'); + + if (g_list_find_custom (self->priv->hobbies, hobby, (GCompareFunc) g_strcmp0) == NULL) + self->priv->hobbies = g_list_append (self->priv->hobbies, g_strdup (hobby)); +} + +/** + * gdata_contacts_contact_get_hobbies: + * @self: a #GDataContactsContact + * + * Gets a list of the hobbies of the contact. + * + * Return value: (element-type utf8) (transfer none): a #GList of hobby strings, or %NULL + * + * Since: 0.7.0 + */ +GList * +gdata_contacts_contact_get_hobbies (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->hobbies; +} + +/** + * gdata_contacts_contact_remove_all_hobbies: + * @self: a #GDataContactsContact + * + * Removes all hobbies from the contact. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_remove_all_hobbies (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->hobbies != NULL) { + g_list_foreach (priv->hobbies, (GFunc) g_free, NULL); + g_list_free (priv->hobbies); + } + priv->hobbies = NULL; +} + +/** + * gdata_contacts_contact_add_language: + * @self: a #GDataContactsContact + * @language: a #GDataGContactLanguage to add + * + * Adds a language to the contact's list of languages and increments its reference count. + * + * Duplicate languages will not be added to the list. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_add_language (GDataContactsContact *self, GDataGContactLanguage *language) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_GCONTACT_LANGUAGE (language)); + + if (g_list_find_custom (self->priv->languages, language, (GCompareFunc) gdata_comparable_compare) == NULL) + self->priv->languages = g_list_append (self->priv->languages, g_object_ref (language)); +} + +/** + * gdata_contacts_contact_get_languages: + * @self: a #GDataContactsContact + * + * Gets a list of the languages of the contact. + * + * Return value: (element-type GData.GContactLanguage) (transfer none): a #GList of #GDataGContactLanguages, or %NULL + * + * Since: 0.7.0 + */ +GList * +gdata_contacts_contact_get_languages (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->languages; +} + +/** + * gdata_contacts_contact_remove_all_languages: + * @self: a #GDataContactsContact + * + * Removes all languages from the contact. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_remove_all_languages (GDataContactsContact *self) +{ + GDataContactsContactPrivate *priv = self->priv; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + + if (priv->languages != NULL) { + g_list_foreach (priv->languages, (GFunc) g_object_unref, NULL); + g_list_free (priv->languages); + } + priv->languages = NULL; +} + +/** + * gdata_contacts_contact_get_extended_property: + * @self: a #GDataContactsContact + * @name: the property name; an arbitrary, unique string + * + * Gets the value of an extended property of the contact. Each contact can have up to 10 client-set extended + * properties to store data of the client's choosing. + * + * Return value: the property's value, or %NULL + * + * Since: 0.2.0 + */ +const gchar * +gdata_contacts_contact_get_extended_property (GDataContactsContact *self, const gchar *name) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + g_return_val_if_fail (name != NULL && *name != '\0', NULL); + return g_hash_table_lookup (self->priv->extended_properties, name); +} + +/** + * gdata_contacts_contact_get_extended_properties: + * @self: a #GDataContactsContact + * + * Gets the full list of extended properties of the contact; a hash table mapping property name to value. + * + * Return value: (transfer none): a #GHashTable of extended properties + * + * Since: 0.4.0 + */ +GHashTable * +gdata_contacts_contact_get_extended_properties (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->extended_properties; +} + +/** + * gdata_contacts_contact_set_extended_property: + * @self: a #GDataContactsContact + * @name: the property name; an arbitrary, unique string + * @value: (allow-none): the property value, or %NULL + * + * Sets the value of a contact's extended property. Extended property names are unique (but of the client's choosing), + * and reusing the same property name will result in the old value of that property being overwritten. + * + * To unset a property, set @value to %NULL or an empty string. + * + * A contact may have up to 10 extended properties, and each should be reasonably small (i.e. not a photo or ringtone). + * For more information, see the online documentation. + * %FALSE will be returned if you attempt to add more than 10 extended properties. + * + * Return value: %TRUE if the property was updated or deleted successfully, %FALSE otherwise + * + * Since: 0.2.0 + */ +gboolean +gdata_contacts_contact_set_extended_property (GDataContactsContact *self, const gchar *name, const gchar *value) +{ + GHashTable *extended_properties = self->priv->extended_properties; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); + g_return_val_if_fail (name != NULL && *name != '\0', FALSE); + + if (value == NULL || *value == '\0') { + /* Removing a property */ + g_hash_table_remove (extended_properties, name); + return TRUE; + } + + /* We can't add more than MAX_N_EXTENDED_PROPERTIES */ + if (g_hash_table_lookup (extended_properties, name) == NULL && + g_hash_table_size (extended_properties) >= MAX_N_EXTENDED_PROPERTIES) + return FALSE; + + /* Updating an existing property or adding a new one */ + g_hash_table_insert (extended_properties, g_strdup (name), g_strdup (value)); + + return TRUE; +} + +/** + * gdata_contacts_contact_get_user_defined_field: + * @self: a #GDataContactsContact + * @name: the field name; an arbitrary, case-sensitive, unique string + * + * Gets the value of a user-defined field of the contact. User-defined fields are settable by the user through the Google Contacts web interface, + * in contrast to extended properties, which are visible and settable only through the GData interface. + * + * The @name of the field may not be %NULL, but may be an empty string. + * + * Return value: the field's value, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_contact_get_user_defined_field (GDataContactsContact *self, const gchar *name) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + g_return_val_if_fail (name != NULL, NULL); + return g_hash_table_lookup (self->priv->user_defined_fields, name); +} + +/** + * gdata_contacts_contact_get_user_defined_fields: + * @self: a #GDataContactsContact + * + * Gets the full list of user-defined fields of the contact; a hash table mapping field name to value. + * + * Return value: (transfer none): a #GHashTable of user-defined fields + * + * Since: 0.7.0 + */ +GHashTable * +gdata_contacts_contact_get_user_defined_fields (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->user_defined_fields; +} + +/** + * gdata_contacts_contact_set_user_defined_field: + * @self: a #GDataContactsContact + * @name: the field name; an arbitrary, case-sensitive, unique string + * @value: (allow-none): the field value, or %NULL + * + * Sets the value of a contact's user-defined field. User-defined field names are unique (but of the client's choosing), + * and reusing the same field name will result in the old value of that field being overwritten. + * + * The @name of the field may not be %NULL, but may be an empty string. + * + * To unset a field, set @value to %NULL. + * + * Since: 0.7.0 + */ +void +gdata_contacts_contact_set_user_defined_field (GDataContactsContact *self, const gchar *name, const gchar *value) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (name != NULL); + + if (value == NULL) { + /* Removing a field */ + g_hash_table_remove (self->priv->user_defined_fields, name); + } else { + /* Updating an existing field or adding a new one */ + g_hash_table_insert (self->priv->user_defined_fields, g_strdup (name), g_strdup (value)); + } +} + +/** + * gdata_contacts_contact_add_group: + * @self: a #GDataContactsContact + * @href: the group's ID URI + * + * Adds the contact to the given group. @href should be a URI. + * + * Since: 0.2.0 + */ +void +gdata_contacts_contact_add_group (GDataContactsContact *self, const gchar *href) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (href != NULL); + g_hash_table_insert (self->priv->groups, g_strdup (href), GUINT_TO_POINTER (FALSE)); +} + +/** + * gdata_contacts_contact_remove_group: + * @self: a #GDataContactsContact + * @href: the group's ID URI + * + * Removes the contact from the given group. @href should be a URI. + * + * Since: 0.2.0 + */ +void +gdata_contacts_contact_remove_group (GDataContactsContact *self, const gchar *href) +{ + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (href != NULL); + g_hash_table_remove (self->priv->groups, href); +} + +/** + * gdata_contacts_contact_is_group_deleted: + * @self: a #GDataContactsContact + * @href: the group's ID URI + * + * Returns whether the contact has recently been removed from the given group on the server. This + * will always return %FALSE unless #GDataContactsQuery:show-deleted has been set to + * %TRUE for the query which returned the contact. + * + * If you've just removed a contact from a group locally using gdata_contacts_contact_remove_group(), %FALSE will still be returned by this function, + * as the change hasn't been sent to the server. + * + * Return value: %TRUE if the contact has recently been removed from the group, %FALSE otherwise + * + * Since: 0.2.0 + */ +gboolean +gdata_contacts_contact_is_group_deleted (GDataContactsContact *self, const gchar *href) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); + g_return_val_if_fail (href != NULL, FALSE); + return GPOINTER_TO_UINT (g_hash_table_lookup (self->priv->groups, href)); +} + +/** + * gdata_contacts_contact_get_groups: + * @self: a #GDataContactsContact + * + * Gets a list of the groups to which the contact belongs. + * + * Return value: (element-type utf8) (transfer container): a #GList of constant group ID URIs, or %NULL; free with g_list_free() + * + * Since: 0.2.0 + */ +GList * +gdata_contacts_contact_get_groups (GDataContactsContact *self) +{ + GHashTableIter iter; + const gchar *href; + gpointer value; + GList *groups = NULL; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + + g_hash_table_iter_init (&iter, self->priv->groups); + while (g_hash_table_iter_next (&iter, (gpointer*) &href, &value) == TRUE) { + /* Add the group to the list as long as it hasn't been deleted */ + if (GPOINTER_TO_UINT (value) == FALSE) + groups = g_list_prepend (groups, (gpointer) href); + } + + return g_list_reverse (groups); +} + +/** + * gdata_contacts_contact_is_deleted: + * @self: a #GDataContactsContact + * + * Returns whether the contact has recently been deleted. This will always return + * %FALSE unless #GDataContactsQuery:show-deleted has been set to + * %TRUE for the query which returned the contact; then this function will return + * %TRUE only if the contact has been deleted. + * + * If a contact has been deleted, no other information is available about it. This + * is designed to allow contacts to be deleted from local address books using + * incremental updates from the server (e.g. with #GDataQuery:updated-min and + * #GDataContactsQuery:show-deleted). + * + * Return value: %TRUE if the contact has been deleted, %FALSE otherwise + * + * Since: 0.2.0 + */ +gboolean +gdata_contacts_contact_is_deleted (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); + return self->priv->deleted; +} + +/** + * gdata_contacts_contact_get_photo_etag: + * @self: a #GDataContactsContact + * + * Returns the ETag for the contact's attached photo, if it exists. If it does exist, the contact's photo can be retrieved using + * gdata_contacts_contact_get_photo(). If it doesn't exist, %NULL will be returned, and the contact doesn't have a photo (so calling + * gdata_contacts_contact_get_photo() will also return %NULL) + * + * Return value: the contact's photo's ETag if it exists, %NULL otherwise + * + * Since: 0.9.0 + */ +const gchar * +gdata_contacts_contact_get_photo_etag (GDataContactsContact *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + return self->priv->photo_etag; +} + +/** + * gdata_contacts_contact_get_photo: + * @self: a #GDataContactsContact + * @service: a #GDataContactsService + * @length: (out caller-allocates): return location for the image length, in bytes + * @content_type: (out callee-allocates) (transfer full) (allow-none): return location for the image's content type, or %NULL; free with g_free() + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Downloads and returns the contact's photo, if they have one. If the contact doesn't + * have a photo (i.e. gdata_contacts_contact_get_photo_etag() returns %NULL), %NULL is returned, but + * no error is set in @error. + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. + * + * If there is an error getting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. + * + * Return value: (transfer full) (array length=length): the image data, or %NULL; free with g_free() + * + * Since: 0.8.0 + */ +guint8 * +gdata_contacts_contact_get_photo (GDataContactsContact *self, GDataContactsService *service, gsize *length, gchar **content_type, + GCancellable *cancellable, GError **error) +{ + GDataLink *_link; + SoupMessage *message; + guint status; + guint8 *data; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (service), NULL); + g_return_val_if_fail (length != NULL, NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Return if there is no photo */ + if (gdata_contacts_contact_get_photo_etag (self) == NULL) + return NULL; + + /* Get the photo URI */ + /* TODO: ETag support */ + _link = gdata_entry_look_up_link (GDATA_ENTRY (self), "http://schemas.google.com/contacts/2008/rel#photo"); + g_assert (_link != NULL); + message = _gdata_service_build_message (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + SOUP_METHOD_GET, gdata_link_get_uri (_link), NULL, FALSE); + + /* Send the message */ + status = _gdata_service_send_message (GDATA_SERVICE (service), message, cancellable, error); + + if (status == SOUP_STATUS_NONE || status == SOUP_STATUS_CANCELLED) { + /* Redirect error or cancelled */ + g_object_unref (message); + return NULL; + } else if (status != SOUP_STATUS_OK) { + /* Error */ + GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (service); + g_assert (klass->parse_error_response != NULL); + klass->parse_error_response (GDATA_SERVICE (service), GDATA_OPERATION_DOWNLOAD, status, message->reason_phrase, + message->response_body->data, message->response_body->length, error); + g_object_unref (message); + return NULL; + } + + g_assert (message->response_body->data != NULL); + + /* Sort out the return values */ + if (content_type != NULL) + *content_type = g_strdup (soup_message_headers_get_content_type (message->response_headers, NULL)); + *length = message->response_body->length; + data = g_memdup (message->response_body->data, message->response_body->length); + + /* Update the stored photo ETag */ + g_free (self->priv->photo_etag); + self->priv->photo_etag = g_strdup (soup_message_headers_get_one (message->response_headers, "ETag")); + g_object_unref (message); + + return data; +} + +typedef struct { + GDataContactsService *service; + guint8 *data; + gsize length; + gchar *content_type; +} PhotoData; + +static void +photo_data_free (PhotoData *data) +{ + if (data->service != NULL) + g_object_unref (data->service); + g_free (data->data); + g_free (data->content_type); + g_slice_free (PhotoData, data); +} + +G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotoData, photo_data_free) + +static void +get_photo_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (source_object); + GDataContactsService *service = GDATA_CONTACTS_SERVICE (task_data); + g_autoptr(PhotoData) data = NULL; + g_autoptr(GError) error = NULL; + + /* Input and output */ + data = g_slice_new0 (PhotoData); + + /* Get the photo */ + data->data = gdata_contacts_contact_get_photo (contact, service, &(data->length), &(data->content_type), cancellable, &error); + if (error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&data), (GDestroyNotify) photo_data_free); +} + +/** + * gdata_contacts_contact_get_photo_async: + * @self: a #GDataContactsContact + * @service: a #GDataContactsService + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the photo has been retrieved, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Downloads and returns the contact's photo, if they have one, asynchronously. @self and @service are both reffed when this function is called, so + * can safely be unreffed after this function returns. + * + * When the operation is finished, @callback will be called. You can then call gdata_contacts_contact_get_photo_finish() to get the results of the + * operation. + * + * For more details, see gdata_contacts_contact_get_photo(), which is the synchronous version of this function. + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned by gdata_contacts_contact_get_photo_finish(). + * + * If there is an error getting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned by gdata_contacts_contact_get_photo_finish(). + * + * Since: 0.8.0 + */ +void +gdata_contacts_contact_get_photo_async (GDataContactsContact *self, GDataContactsService *service, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (service)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_contacts_contact_get_photo_async); + g_task_set_task_data (task, g_object_ref (service), (GDestroyNotify) g_object_unref); + g_task_run_in_thread (task, get_photo_thread); +} + +/** + * gdata_contacts_contact_get_photo_finish: + * @self: a #GDataContactsContact + * @async_result: a #GAsyncResult + * @length: (out caller-allocates): return location for the image length, in bytes + * @content_type: (out callee-allocates) (transfer full) (allow-none): return location for the image's content type, or %NULL; free with g_free() + * @error: a #GError, or %NULL + * + * Finishes an asynchronous contact photo retrieval operation started with gdata_contacts_contact_get_photo_async(). If the contact doesn't have a + * photo (i.e. gdata_contacts_contact_get_photo_etag() returns %NULL), %NULL is returned, but no error is set in @error. + * + * If there is an error getting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. @length will be set to + * 0 and @content_type will be set to %NULL. + * + * Return value: (transfer full) (array length=length): the image data, or %NULL; free with g_free() + * + * Since: 0.8.0 + */ +guint8 * +gdata_contacts_contact_get_photo_finish (GDataContactsContact *self, GAsyncResult *async_result, gsize *length, gchar **content_type, GError **error) +{ + g_autoptr(PhotoData) data = NULL; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (length != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_contacts_contact_get_photo_async), NULL); + + data = g_task_propagate_pointer (G_TASK (async_result), error); + if (data == NULL) { + /* Error */ + *length = 0; + + if (content_type != NULL) { + *content_type = NULL; + } + + return NULL; + } + + /* Return the photo (steal the data from the PhotoData struct so we don't have to copy it again) */ + *length = data->length; + if (content_type != NULL) + *content_type = g_steal_pointer (&data->content_type); + + return g_steal_pointer (&data->data); +} + +/** + * gdata_contacts_contact_set_photo: + * @self: a #GDataContactsContact + * @service: a #GDataContactsService + * @data: (allow-none): the image data, or %NULL + * @length: the image length, in bytes + * @content_type: (allow-none): the content type of the image, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Sets the contact's photo to @data or, if @data is %NULL, deletes the contact's photo. @content_type must be specified if @data is non-%NULL. + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. + * + * If there is an error setting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.8.0 + */ +gboolean +gdata_contacts_contact_set_photo (GDataContactsContact *self, GDataContactsService *service, const guint8 *data, gsize length, + const gchar *content_type, GCancellable *cancellable, GError **error) +{ + GDataLink *_link; + SoupMessage *message; + guint status; + gboolean deleting_photo = FALSE; + const gchar *etag; + + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); + g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (service), FALSE); + g_return_val_if_fail (data == NULL || content_type != NULL, FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + if (self->priv->photo_etag != NULL && data == NULL) + deleting_photo = TRUE; + + /* Get the photo URI */ + _link = gdata_entry_look_up_link (GDATA_ENTRY (self), "http://schemas.google.com/contacts/2008/rel#photo"); + g_assert (_link != NULL); + + /* We always have to set an If-Match header. */ + etag = self->priv->photo_etag; + if (etag == NULL || *etag == '\0') { + etag = "*"; + } + + message = _gdata_service_build_message (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + (deleting_photo == TRUE) ? SOUP_METHOD_DELETE : SOUP_METHOD_PUT, + gdata_link_get_uri (_link), etag, TRUE); + + /* Append the data */ + if (deleting_photo == FALSE) + soup_message_set_request (message, content_type, SOUP_MEMORY_STATIC, (gchar*) data, length); + + /* Send the message */ + status = _gdata_service_send_message (GDATA_SERVICE (service), message, cancellable, error); + + if (status == SOUP_STATUS_NONE || status == SOUP_STATUS_CANCELLED) { + /* Redirect error or cancelled */ + g_object_unref (message); + return FALSE; + } else if (status != SOUP_STATUS_OK) { + /* Error */ + GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (service); + g_assert (klass->parse_error_response != NULL); + klass->parse_error_response (GDATA_SERVICE (service), GDATA_OPERATION_UPLOAD, status, message->reason_phrase, + message->response_body->data, message->response_body->length, error); + g_object_unref (message); + return FALSE; + } + + /* Update the stored photo ETag */ + g_free (self->priv->photo_etag); + self->priv->photo_etag = g_strdup (soup_message_headers_get_one (message->response_headers, "ETag")); + g_object_notify (G_OBJECT (self), "photo-etag"); + + g_object_unref (message); + + return TRUE; +} + +static void +set_photo_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (source_object); + PhotoData *data = task_data; + g_autoptr(GError) error = NULL; + + /* Set the photo */ + if (!gdata_contacts_contact_set_photo (contact, data->service, data->data, data->length, data->content_type, cancellable, &error)) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_boolean (task, TRUE); +} + +/** + * gdata_contacts_contact_set_photo_async: + * @self: a #GDataContactsContact + * @service: a #GDataContactsService + * @data: (allow-none): the image data, or %NULL + * @length: the image length, in bytes + * @content_type: (allow-none): the content type of the image, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the photo has been set, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Sets the contact's photo to @data or, if @data is %NULL, deletes the contact's photo. @content_type must be specified if @data is non-%NULL. @self, + * @service, @data and @content_type are all reffed and copied when this function is called, so can safely be unreffed after this function returns. + * + * When the operation is finished, @callback will be called. You can then call gdata_contacts_contact_set_photo_finish() to get the results of the + * operation. + * + * For more details, see gdata_contacts_contact_set_photo(), which is the synchronous version of this function. + * + * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. + * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned by gdata_contacts_contact_set_photo_finish(). + * + * If there is an error setting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned by gdata_contacts_contact_set_photo_finish(). + * + * Since: 0.8.0 + */ +void +gdata_contacts_contact_set_photo_async (GDataContactsContact *self, GDataContactsService *service, const guint8 *data, gsize length, + const gchar *content_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + g_autoptr(PhotoData) photo_data = NULL; + + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); + g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (service)); + g_return_if_fail (data == NULL || content_type != NULL); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + /* Prepare the data to be passed to the thread */ + photo_data = g_slice_new (PhotoData); + photo_data->service = g_object_ref (service); + photo_data->data = g_memdup (data, length); + photo_data->length = length; + photo_data->content_type = g_strdup (content_type); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_contacts_contact_set_photo_async); + g_task_set_task_data (task, g_steal_pointer (&photo_data), (GDestroyNotify) photo_data_free); + g_task_run_in_thread (task, set_photo_thread); +} + +/** + * gdata_contacts_contact_set_photo_finish: + * @self: a #GDataContactsContact + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous contact photo setting operation started with gdata_contacts_contact_set_photo_async(). + * + * If there is an error setting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.8.0 + */ +gboolean +gdata_contacts_contact_set_photo_finish (GDataContactsContact *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_return_val_if_fail (g_task_is_valid (async_result, self), FALSE); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_contacts_contact_set_photo_async), FALSE); + + return g_task_propagate_boolean (G_TASK (async_result), error); +} diff --git a/gdata/services/contacts/gdata-contacts-contact.h b/gdata/services/contacts/gdata-contacts-contact.h new file mode 100644 index 0000000..b84daa7 --- /dev/null +++ b/gdata/services/contacts/gdata-contacts-contact.h @@ -0,0 +1,305 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2010, 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CONTACTS_CONTACT_H +#define GDATA_CONTACTS_CONTACT_H + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_CONTACTS_GENDER_MALE: + * + * The contact is male. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_GENDER_MALE "male" + +/** + * GDATA_CONTACTS_GENDER_FEMALE: + * + * The contact is female. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_GENDER_FEMALE "female" + +/** + * GDATA_CONTACTS_PRIORITY_LOW: + * + * The contact is of low importance. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_PRIORITY_LOW "low" + +/** + * GDATA_CONTACTS_PRIORITY_NORMAL: + * + * The contact is of normal importance. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_PRIORITY_NORMAL "normal" + +/** + * GDATA_CONTACTS_PRIORITY_HIGH: + * + * The contact is of high importance. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_PRIORITY_HIGH "high" + +/** + * GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL: + * + * The contact's data is confidential. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL "confidential" + +/** + * GDATA_CONTACTS_SENSITIVITY_NORMAL: + * + * The contact's data is of normal sensitivity. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_SENSITIVITY_NORMAL "normal" + +/** + * GDATA_CONTACTS_SENSITIVITY_PERSONAL: + * + * The contact's data is personal. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_SENSITIVITY_PERSONAL "personal" + +/** + * GDATA_CONTACTS_SENSITIVITY_PRIVATE: + * + * The contact's data is private. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_SENSITIVITY_PRIVATE "private" + +#define GDATA_TYPE_CONTACTS_CONTACT (gdata_contacts_contact_get_type ()) +#define GDATA_CONTACTS_CONTACT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CONTACTS_CONTACT, GDataContactsContact)) +#define GDATA_CONTACTS_CONTACT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CONTACTS_CONTACT, GDataContactsContactClass)) +#define GDATA_IS_CONTACTS_CONTACT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CONTACTS_CONTACT)) +#define GDATA_IS_CONTACTS_CONTACT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CONTACTS_CONTACT)) +#define GDATA_CONTACTS_CONTACT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CONTACTS_CONTACT, GDataContactsContactClass)) + +typedef struct _GDataContactsContactPrivate GDataContactsContactPrivate; + +/** + * GDataContactsContact: + * + * All the fields in the #GDataContactsContact structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataEntry parent; + GDataContactsContactPrivate *priv; +} GDataContactsContact; + +/** + * GDataContactsContactClass: + * + * All the fields in the #GDataContactsContactClass structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataContactsContactClass; + +GType gdata_contacts_contact_get_type (void) G_GNUC_CONST; + +GDataContactsContact *gdata_contacts_contact_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gint64 gdata_contacts_contact_get_edited (GDataContactsContact *self); +gboolean gdata_contacts_contact_is_deleted (GDataContactsContact *self) G_GNUC_PURE; + +GDataGDName *gdata_contacts_contact_get_name (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_name (GDataContactsContact *self, GDataGDName *name); + +const gchar *gdata_contacts_contact_get_nickname (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_nickname (GDataContactsContact *self, const gchar *nickname); + +const gchar *gdata_contacts_contact_get_file_as (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_file_as (GDataContactsContact *self, const gchar *file_as); + +gboolean gdata_contacts_contact_get_birthday (GDataContactsContact *self, GDate *birthday) G_GNUC_PURE; +void gdata_contacts_contact_set_birthday (GDataContactsContact *self, GDate *birthday, gboolean birthday_has_year); + +const gchar *gdata_contacts_contact_get_billing_information (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_billing_information (GDataContactsContact *self, const gchar *billing_information); + +const gchar *gdata_contacts_contact_get_directory_server (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_directory_server (GDataContactsContact *self, const gchar *directory_server); + +const gchar *gdata_contacts_contact_get_gender (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_gender (GDataContactsContact *self, const gchar *gender); + +const gchar *gdata_contacts_contact_get_initials (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_initials (GDataContactsContact *self, const gchar *initials); + +const gchar *gdata_contacts_contact_get_maiden_name (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_maiden_name (GDataContactsContact *self, const gchar *maiden_name); + +const gchar *gdata_contacts_contact_get_mileage (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_mileage (GDataContactsContact *self, const gchar *mileage); + +const gchar *gdata_contacts_contact_get_occupation (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_occupation (GDataContactsContact *self, const gchar *occupation); + +const gchar *gdata_contacts_contact_get_priority (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_priority (GDataContactsContact *self, const gchar *priority); + +const gchar *gdata_contacts_contact_get_sensitivity (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_sensitivity (GDataContactsContact *self, const gchar *sensitivity); + +const gchar *gdata_contacts_contact_get_short_name (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_short_name (GDataContactsContact *self, const gchar *short_name); + +const gchar *gdata_contacts_contact_get_subject (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_subject (GDataContactsContact *self, const gchar *subject); + +void gdata_contacts_contact_add_email_address (GDataContactsContact *self, GDataGDEmailAddress *email_address); +GList *gdata_contacts_contact_get_email_addresses (GDataContactsContact *self) G_GNUC_PURE; +GDataGDEmailAddress *gdata_contacts_contact_get_primary_email_address (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_email_addresses (GDataContactsContact *self); + +void gdata_contacts_contact_add_im_address (GDataContactsContact *self, GDataGDIMAddress *im_address); +GList *gdata_contacts_contact_get_im_addresses (GDataContactsContact *self) G_GNUC_PURE; +GDataGDIMAddress *gdata_contacts_contact_get_primary_im_address (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_im_addresses (GDataContactsContact *self); + +void gdata_contacts_contact_add_phone_number (GDataContactsContact *self, GDataGDPhoneNumber *phone_number); +GList *gdata_contacts_contact_get_phone_numbers (GDataContactsContact *self) G_GNUC_PURE; +GDataGDPhoneNumber *gdata_contacts_contact_get_primary_phone_number (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_phone_numbers (GDataContactsContact *self); + +void gdata_contacts_contact_add_postal_address (GDataContactsContact *self, GDataGDPostalAddress *postal_address); +GList *gdata_contacts_contact_get_postal_addresses (GDataContactsContact *self) G_GNUC_PURE; +GDataGDPostalAddress *gdata_contacts_contact_get_primary_postal_address (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_postal_addresses (GDataContactsContact *self); + +void gdata_contacts_contact_add_organization (GDataContactsContact *self, GDataGDOrganization *organization); +GList *gdata_contacts_contact_get_organizations (GDataContactsContact *self) G_GNUC_PURE; +GDataGDOrganization *gdata_contacts_contact_get_primary_organization (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_organizations (GDataContactsContact *self); + +void gdata_contacts_contact_add_jot (GDataContactsContact *self, GDataGContactJot *jot); +GList *gdata_contacts_contact_get_jots (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_jots (GDataContactsContact *self); + +void gdata_contacts_contact_add_relation (GDataContactsContact *self, GDataGContactRelation *relation); +GList *gdata_contacts_contact_get_relations (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_relations (GDataContactsContact *self); + +void gdata_contacts_contact_add_website (GDataContactsContact *self, GDataGContactWebsite *website); +GList *gdata_contacts_contact_get_websites (GDataContactsContact *self) G_GNUC_PURE; +GDataGContactWebsite *gdata_contacts_contact_get_primary_website (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_websites (GDataContactsContact *self); + +void gdata_contacts_contact_add_event (GDataContactsContact *self, GDataGContactEvent *event); +GList *gdata_contacts_contact_get_events (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_events (GDataContactsContact *self); + +void gdata_contacts_contact_add_calendar (GDataContactsContact *self, GDataGContactCalendar *calendar); +GList *gdata_contacts_contact_get_calendars (GDataContactsContact *self) G_GNUC_PURE; +GDataGContactCalendar *gdata_contacts_contact_get_primary_calendar (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_calendars (GDataContactsContact *self); + +void gdata_contacts_contact_add_external_id (GDataContactsContact *self, GDataGContactExternalID *external_id); +GList *gdata_contacts_contact_get_external_ids (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_external_ids (GDataContactsContact *self); + +void gdata_contacts_contact_add_hobby (GDataContactsContact *self, const gchar *hobby); +GList *gdata_contacts_contact_get_hobbies (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_hobbies (GDataContactsContact *self); + +void gdata_contacts_contact_add_language (GDataContactsContact *self, GDataGContactLanguage *language); +GList *gdata_contacts_contact_get_languages (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_remove_all_languages (GDataContactsContact *self); + +const gchar *gdata_contacts_contact_get_extended_property (GDataContactsContact *self, const gchar *name) G_GNUC_PURE; +GHashTable *gdata_contacts_contact_get_extended_properties (GDataContactsContact *self) G_GNUC_PURE; +gboolean gdata_contacts_contact_set_extended_property (GDataContactsContact *self, const gchar *name, const gchar *value); + +const gchar *gdata_contacts_contact_get_user_defined_field (GDataContactsContact *self, const gchar *name) G_GNUC_PURE; +GHashTable *gdata_contacts_contact_get_user_defined_fields (GDataContactsContact *self) G_GNUC_PURE; +void gdata_contacts_contact_set_user_defined_field (GDataContactsContact *self, const gchar *name, const gchar *value); + +void gdata_contacts_contact_add_group (GDataContactsContact *self, const gchar *href); +void gdata_contacts_contact_remove_group (GDataContactsContact *self, const gchar *href); +gboolean gdata_contacts_contact_is_group_deleted (GDataContactsContact *self, const gchar *href) G_GNUC_PURE; +GList *gdata_contacts_contact_get_groups (GDataContactsContact *self) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +#include + +const gchar *gdata_contacts_contact_get_photo_etag (GDataContactsContact *self) G_GNUC_PURE; + +guint8 *gdata_contacts_contact_get_photo (GDataContactsContact *self, GDataContactsService *service, gsize *length, gchar **content_type, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_contacts_contact_get_photo_async (GDataContactsContact *self, GDataContactsService *service, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +guint8 *gdata_contacts_contact_get_photo_finish (GDataContactsContact *self, GAsyncResult *async_result, gsize *length, gchar **content_type, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gboolean gdata_contacts_contact_set_photo (GDataContactsContact *self, GDataContactsService *service, const guint8 *data, gsize length, + const gchar *content_type, GCancellable *cancellable, GError **error); +void gdata_contacts_contact_set_photo_async (GDataContactsContact *self, GDataContactsService *service, const guint8 *data, gsize length, + const gchar *content_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +gboolean gdata_contacts_contact_set_photo_finish (GDataContactsContact *self, GAsyncResult *async_result, GError **error); + +G_END_DECLS + +#endif /* !GDATA_CONTACTS_CONTACT_H */ diff --git a/gdata/services/contacts/gdata-contacts-group.c b/gdata/services/contacts/gdata-contacts-group.c new file mode 100644 index 0000000..d8ab4a4 --- /dev/null +++ b/gdata/services/contacts/gdata-contacts-group.c @@ -0,0 +1,601 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-contacts-group + * @short_description: GData Contacts group object + * @stability: Stable + * @include: gdata/services/contacts/gdata-contacts-group.h + * + * #GDataContactsGroup is a subclass of #GDataEntry to represent a group from a Google address book. + * + * For more details of Google Contacts' GData API, see the + * online documentation. + * + * The user-set name of the group is stored in the #GDataEntry:title property, retrievable using gdata_entry_get_title(). Note that for system groups + * (see #GDataContactsGroup:system-group-id), this group name is provided by Google, and is not localised. Clients should provide their own localised + * group names for the system groups. + * + * In addition to all the standard properties available for a group, #GDataContactsGroup supports an additional kind of property: extended + * properties. Extended properties, set with gdata_contacts_group_set_extended_property() and retrieved with + * gdata_contacts_group_get_extended_property(), are provided as a method of storing client-specific data which shouldn't be seen or be editable + * by the user, such as IDs and cache times. + * + * + * Adding a New Group + * + * GDataContactsService *service; + * GDataContactsGroup *group, *updated_group; + * GDataContactsContact *contact, *updated_contact; + * GError *error = NULL; + * + * /* Create a service and return a contact to add to the new group. */ + * service = create_contacts_service (); + * contact = query_user_for_contact (service); + * + * /* Create the new group */ + * group = gdata_contacts_group_new (NULL); + * gdata_entry_set_title (GDATA_ENTRY (group), "Group Name"); + * + * /* Insert the group on the server */ + * updated_group = gdata_contacts_service_insert_group (service, group, NULL, &error); + * + * g_object_unref (group); + * + * if (error != NULL) { + * g_error ("Error adding a group: %s", error->message); + * g_error_free (error); + * g_object_unref (contact); + * g_object_unref (service); + * return; + * } + * + * /* Add the contact to the new group. */ + * gdata_contacts_contact_add_group (contact, gdata_entry_get_id (GDATA_ENTRY (updated_group))); + * + * g_object_unref (updated_group); + * + * /* Update the contact on the server */ + * updated_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (contact), NULL, &error)); + * + * g_object_unref (contact); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error updating contact: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Do something with the updated contact, such as update them in the UI, or store their ID for future use. */ + * + * g_object_unref (updated_contact); + * + * + * + * Since: 0.7.0 + */ + +#include +#include +#include +#include +#include + +#include "gdata-contacts-group.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-private.h" + +/* The maximum number of extended properties the server allows us. See + * http://code.google.com/apis/contacts/docs/3.0/reference.html#ProjectionsAndExtended. + * When updating this, make sure to update the API documentation for gdata_contacts_group_get_extended_property() and + * gdata_contacts_group_set_extended_property(). */ +#define MAX_N_EXTENDED_PROPERTIES 10 + +static GObject *gdata_contacts_group_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); +static void gdata_contacts_group_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_contacts_group_finalize (GObject *object); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); +static gchar *get_entry_uri (const gchar *id) G_GNUC_WARN_UNUSED_RESULT; + +struct _GDataContactsGroupPrivate { + gint64 edited; + GHashTable *extended_properties; + gboolean deleted; + gchar *system_group_id; +}; + +enum { + PROP_EDITED = 1, + PROP_DELETED, + PROP_SYSTEM_GROUP_ID +}; + +G_DEFINE_TYPE (GDataContactsGroup, gdata_contacts_group, GDATA_TYPE_ENTRY) + +static void +gdata_contacts_group_class_init (GDataContactsGroupClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataContactsGroupPrivate)); + + gobject_class->constructor = gdata_contacts_group_constructor; + gobject_class->get_property = gdata_contacts_group_get_property; + gobject_class->finalize = gdata_contacts_group_finalize; + + parsable_class->parse_xml = parse_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + + entry_class->get_entry_uri = get_entry_uri; + entry_class->kind_term = "http://schemas.google.com/contact/2008#group"; + + /** + * GDataContactsGroup:edited: + * + * The last time the group was edited. If the group has not been edited yet, the content indicates the time it was created. + * + * For more information, see the + * Atom Publishing Protocol specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_EDITED, + g_param_spec_int64 ("edited", + "Edited", "The last time the group was edited.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsGroup:deleted: + * + * Whether the entry has been deleted. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_DELETED, + g_param_spec_boolean ("deleted", + "Deleted", "Whether the entry has been deleted.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsGroup:system-group-id: + * + * The system group ID for this group, if it's a system group. If the group is not a system group, this is %NULL. Otherwise, it is one of the + * four system group IDs: %GDATA_CONTACTS_GROUP_CONTACTS, %GDATA_CONTACTS_GROUP_FRIENDS, %GDATA_CONTACTS_GROUP_FAMILY and + * %GDATA_CONTACTS_GROUP_COWORKERS. + * + * If this is non-%NULL, the group name stored in #GDataEntry:title will not be localised, so clients should provide localised group names of + * their own for each of the system groups. Whether a group is a system group should be detected solely on the basis of the value of this + * property, not by comparing the group name (#GDataEntry:title) or entry ID (#GDataEntry:id). The entry ID is not the same as the system + * group ID. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_SYSTEM_GROUP_ID, + g_param_spec_string ("system-group-id", + "System group ID", "The system group ID for this group, if it's a system group.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void notify_content_cb (GObject *gobject, GParamSpec *pspec, GDataContactsGroup *self); + +static void +notify_title_cb (GObject *gobject, GParamSpec *pspec, GDataContactsGroup *self) +{ + /* Update GDataEntry:content */ + g_signal_handlers_block_by_func (self, notify_content_cb, self); + gdata_entry_set_content (GDATA_ENTRY (self), gdata_entry_get_title (GDATA_ENTRY (self))); + g_signal_handlers_unblock_by_func (self, notify_content_cb, self); +} + +static void +notify_content_cb (GObject *gobject, GParamSpec *pspec, GDataContactsGroup *self) +{ + /* Update GDataEntry:title */ + g_signal_handlers_block_by_func (self, notify_title_cb, self); + gdata_entry_set_title (GDATA_ENTRY (self), gdata_entry_get_content (GDATA_ENTRY (self))); + g_signal_handlers_unblock_by_func (self, notify_title_cb, self); +} + +static void +gdata_contacts_group_init (GDataContactsGroup *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_CONTACTS_GROUP, GDataContactsGroupPrivate); + self->priv->extended_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + self->priv->edited = -1; + + /* Listen to change notifications for the entry's title and content, since they're linked */ + g_signal_connect (self, "notify::title", (GCallback) notify_title_cb, self); + g_signal_connect (self, "notify::content", (GCallback) notify_content_cb, self); +} + +static GObject * +gdata_contacts_group_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) +{ + GObject *object; + guint i; + + /* Find the "id" property and ensure it's sane */ + for (i = 0; i < n_construct_params; i++) { + GParamSpec *pspec = construct_params[i].pspec; + GValue *value = construct_params[i].value; + + if (strcmp (g_param_spec_get_name (pspec), "id") == 0) { + gchar *base, *id; + + id = g_value_dup_string (value); + + /* Fix the ID to refer to the full projection, rather than the base projection. */ + if (id != NULL) { + base = strstr (id, "/base/"); + if (base != NULL) + memcpy (base, "/full/", 6); + } + + g_value_take_string (value, id); + + break; + } + } + + /* Chain up to the parent class */ + object = G_OBJECT_CLASS (gdata_contacts_group_parent_class)->constructor (type, n_construct_params, construct_params); + + if (_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object)) == FALSE) { + GDataContactsGroupPrivate *priv = GDATA_CONTACTS_GROUP (object)->priv; + GTimeVal time_val; + + /* Set the edited property to the current time (creation time). We don't do this in *_init() since that would cause setting it from + * parse_xml() to fail (duplicate element). */ + g_get_current_time (&time_val); + priv->edited = time_val.tv_sec; + } + + return object; +} + +static void +gdata_contacts_group_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataContactsGroupPrivate *priv = GDATA_CONTACTS_GROUP (object)->priv; + + switch (property_id) { + case PROP_EDITED: + g_value_set_int64 (value, priv->edited); + break; + case PROP_DELETED: + g_value_set_boolean (value, priv->deleted); + break; + case PROP_SYSTEM_GROUP_ID: + g_value_set_string (value, priv->system_group_id); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_contacts_group_finalize (GObject *object) +{ + GDataContactsGroupPrivate *priv = GDATA_CONTACTS_GROUP (object)->priv; + + g_hash_table_destroy (priv->extended_properties); + g_free (priv->system_group_id); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_contacts_group_parent_class)->finalize (object); +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataContactsGroup *self = GDATA_CONTACTS_GROUP (parsable); + + if (gdata_parser_is_namespace (node, "http://www.w3.org/2007/app") == TRUE && + gdata_parser_int64_time_from_element (node, "edited", P_REQUIRED | P_NO_DUPES, &(self->priv->edited), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://www.w3.org/2005/Atom") == TRUE && xmlStrcmp (node->name, (xmlChar*) "id") == 0) { + /* We have to override parsing to fix the projection. Modify it in-place so that the parser in GDataEntry will pick up the + * changes. This fixes bugs caused by referring to contacts by the base projection, rather than the full projection; such as + * http://code.google.com/p/gdata-issues/issues/detail?id=2129. */ + gchar *base; + gchar *id = (gchar*) xmlNodeListGetString (doc, node->children, TRUE); + + if (id != NULL) { + base = strstr (id, "/base/"); + if (base != NULL) { + memcpy (base, "/full/", 6); + xmlNodeSetContent (node, (xmlChar*) id); + } + } + + xmlFree (id); + + return GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/g/2005") == TRUE) { + if (xmlStrcmp (node->name, (xmlChar*) "extendedProperty") == 0) { + /* gd:extendedProperty */ + xmlChar *name, *value; + xmlBuffer *buffer = NULL; + + name = xmlGetProp (node, (xmlChar*) "name"); + if (name == NULL) + return gdata_parser_error_required_property_missing (node, "name", error); + + /* Get either the value property, or the element's content */ + value = xmlGetProp (node, (xmlChar*) "value"); + if (value == NULL) { + xmlNode *child_node; + + /* Use the element's content instead (arbitrary XML) */ + buffer = xmlBufferCreate (); + for (child_node = node->children; child_node != NULL; child_node = child_node->next) + xmlNodeDump (buffer, doc, child_node, 0, 0); + value = (xmlChar*) xmlBufferContent (buffer); + } + + gdata_contacts_group_set_extended_property (self, (gchar*) name, (gchar*) value); + + xmlFree (name); + if (buffer != NULL) + xmlBufferFree (buffer); + else + xmlFree (value); + } else if (xmlStrcmp (node->name, (xmlChar*) "deleted") == 0) { + /* gd:deleted */ + if (self->priv->deleted == TRUE) + return gdata_parser_error_duplicate_element (node, error); + + self->priv->deleted = TRUE; + } else { + return GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/contact/2008") == TRUE) { + if (xmlStrcmp (node->name, (xmlChar*) "systemGroup") == 0) { + /* gContact:systemGroup */ + xmlChar *value; + + if (self->priv->system_group_id != NULL) + return gdata_parser_error_duplicate_element (node, error); + + value = xmlGetProp (node, (xmlChar*) "id"); + if (value == NULL || *value == '\0') { + xmlFree (value); + return gdata_parser_error_required_property_missing (node, "id", error); + } + + self->priv->system_group_id = (gchar*) value; + } else { + return GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else { + return GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static void +get_extended_property_xml_cb (const gchar *name, const gchar *value, GString *xml_string) +{ + /* Note that the value *isn't* escaped (see http://code.google.com/apis/gdata/docs/2.0/elements.html#gdExtendedProperty) */ + gdata_parser_string_append_escaped (xml_string, ""); + g_string_append_printf (xml_string, "%s", value); +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataContactsGroupPrivate *priv = GDATA_CONTACTS_GROUP (parsable)->priv; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->get_xml (parsable, xml_string); + + /* Extended properties */ + g_hash_table_foreach (priv->extended_properties, (GHFunc) get_extended_property_xml_cb, xml_string); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); + g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); + g_hash_table_insert (namespaces, (gchar*) "app", (gchar*) "http://www.w3.org/2007/app"); +} + +static gchar * +get_entry_uri (const gchar *id) +{ + const gchar *base_pos; + gchar *uri = g_strdup (id); + + /* The service API sometimes stubbornly insists on using the "base" view instead of the "full" view, which we have to fix, or our extended + * attributes are never visible */ + base_pos = strstr (uri, "/base/"); + if (base_pos != NULL) + memcpy ((char*) base_pos, "/full/", 6); + + return uri; +} + +/** + * gdata_contacts_group_new: + * @id: (allow-none): the group's ID, or %NULL + * + * Creates a new #GDataContactsGroup with the given ID and default properties. + * + * Return value: a new #GDataContactsGroup; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataContactsGroup * +gdata_contacts_group_new (const gchar *id) +{ + return GDATA_CONTACTS_GROUP (g_object_new (GDATA_TYPE_CONTACTS_GROUP, "id", id, NULL)); +} + +/** + * gdata_contacts_group_get_edited: + * @self: a #GDataContactsGroup + * + * Gets the #GDataContactsGroup:edited property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the file was last edited, or -1 + * + * Since: 0.7.0 + */ +gint64 +gdata_contacts_group_get_edited (GDataContactsGroup *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), -1); + return self->priv->edited; +} + +/** + * gdata_contacts_group_get_system_group_id: + * @self: a #GDataContactsGroup + * + * Gets the #GDataContactsGroup:system-group-id property. If the group is not a system group, %NULL will be returned. + * + * Return value: the group's system group ID, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_group_get_system_group_id (GDataContactsGroup *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), NULL); + return self->priv->system_group_id; +} + +/** + * gdata_contacts_group_get_extended_property: + * @self: a #GDataContactsGroup + * @name: the property name; an arbitrary, unique string + * + * Gets the value of an extended property of the group. Each group can have up to 10 client-set extended properties to store data of the client's + * choosing. + * + * Return value: the property's value, or %NULL + * + * Since: 0.7.0 + */ +const gchar * +gdata_contacts_group_get_extended_property (GDataContactsGroup *self, const gchar *name) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), NULL); + g_return_val_if_fail (name != NULL && *name != '\0', NULL); + return g_hash_table_lookup (self->priv->extended_properties, name); +} + +/** + * gdata_contacts_group_get_extended_properties: + * @self: a #GDataContactsGroup + * + * Gets the full list of extended properties of the group; a hash table mapping property name to value. + * + * Return value: (transfer none): a #GHashTable of extended properties + * + * Since: 0.7.0 + */ +GHashTable * +gdata_contacts_group_get_extended_properties (GDataContactsGroup *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), NULL); + return self->priv->extended_properties; +} + +/** + * gdata_contacts_group_set_extended_property: + * @self: a #GDataContactsGroup + * @name: the property name; an arbitrary, unique string + * @value: (allow-none): the property value, or %NULL + * + * Sets the value of a group's extended property. Extended property names are unique (but of the client's choosing), and reusing the same property + * name will result in the old value of that property being overwritten. + * + * To unset a property, set @value to %NULL or an empty string. + * + * A group may have up to 10 extended properties, and each should be reasonably small (i.e. not a photo or ringtone). For more information, see the + * online documentation. + * %FALSE will be returned if you attempt to add more than 10 extended properties. + * + * Return value: %TRUE if the property was updated or deleted successfully, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_contacts_group_set_extended_property (GDataContactsGroup *self, const gchar *name, const gchar *value) +{ + GHashTable *extended_properties = self->priv->extended_properties; + + g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), FALSE); + g_return_val_if_fail (name != NULL && *name != '\0', FALSE); + + if (value == NULL || *value == '\0') { + /* Removing a property */ + g_hash_table_remove (extended_properties, name); + return TRUE; + } + + /* We can't add more than MAX_N_EXTENDED_PROPERTIES */ + if (g_hash_table_lookup (extended_properties, name) == NULL && g_hash_table_size (extended_properties) >= MAX_N_EXTENDED_PROPERTIES) + return FALSE; + + /* Updating an existing property or adding a new one */ + g_hash_table_insert (extended_properties, g_strdup (name), g_strdup (value)); + + return TRUE; +} + +/** + * gdata_contacts_group_is_deleted: + * @self: a #GDataContactsGroup + * + * Returns whether the group has recently been deleted. This will always return %FALSE unless #GDataContactsQuery:show-deleted has been set to %TRUE + * for the query which returned the group; then this function will return %TRUE only if the group has been deleted. + * + * If a group has been deleted, no other information is available about it. This is designed to allow groups to be deleted from local address + * books using incremental updates from the server (e.g. with #GDataQuery:updated-min and #GDataContactsQuery:show-deleted). + * + * Return value: %TRUE if the group has been deleted, %FALSE otherwise + * + * Since: 0.7.0 + */ +gboolean +gdata_contacts_group_is_deleted (GDataContactsGroup *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), FALSE); + return self->priv->deleted; +} diff --git a/gdata/services/contacts/gdata-contacts-group.h b/gdata/services/contacts/gdata-contacts-group.h new file mode 100644 index 0000000..b8deaed --- /dev/null +++ b/gdata/services/contacts/gdata-contacts-group.h @@ -0,0 +1,118 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CONTACTS_GROUP_H +#define GDATA_CONTACTS_GROUP_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_CONTACTS_GROUP_CONTACTS: + * + * The system group ID for the "My Contacts" system group. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_GROUP_CONTACTS "Contacts" + +/** + * GDATA_CONTACTS_GROUP_FRIENDS: + * + * The system group ID for the "Friends" system group. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_GROUP_FRIENDS "Friends" + +/** + * GDATA_CONTACTS_GROUP_FAMILY: + * + * The system group ID for the "Family" system group. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_GROUP_FAMILY "Family" + +/** + * GDATA_CONTACTS_GROUP_COWORKERS: + * + * The system group ID for the "Coworkers" system group. + * + * Since: 0.7.0 + */ +#define GDATA_CONTACTS_GROUP_COWORKERS "Coworkers" + +#define GDATA_TYPE_CONTACTS_GROUP (gdata_contacts_group_get_type ()) +#define GDATA_CONTACTS_GROUP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CONTACTS_GROUP, GDataContactsGroup)) +#define GDATA_CONTACTS_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CONTACTS_GROUP, GDataContactsGroupClass)) +#define GDATA_IS_CONTACTS_GROUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CONTACTS_GROUP)) +#define GDATA_IS_CONTACTS_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CONTACTS_GROUP)) +#define GDATA_CONTACTS_GROUP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CONTACTS_GROUP, GDataContactsGroupClass)) + +typedef struct _GDataContactsGroupPrivate GDataContactsGroupPrivate; + +/** + * GDataContactsGroup: + * + * All the fields in the #GDataContactsGroup structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataEntry parent; + GDataContactsGroupPrivate *priv; +} GDataContactsGroup; + +/** + * GDataContactsGroupClass: + * + * All the fields in the #GDataContactsGroupClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataContactsGroupClass; + +GType gdata_contacts_group_get_type (void) G_GNUC_CONST; + +GDataContactsGroup *gdata_contacts_group_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gint64 gdata_contacts_group_get_edited (GDataContactsGroup *self); +gboolean gdata_contacts_group_is_deleted (GDataContactsGroup *self) G_GNUC_PURE; +const gchar *gdata_contacts_group_get_system_group_id (GDataContactsGroup *self) G_GNUC_PURE; + +const gchar *gdata_contacts_group_get_extended_property (GDataContactsGroup *self, const gchar *name) G_GNUC_PURE; +GHashTable *gdata_contacts_group_get_extended_properties (GDataContactsGroup *self) G_GNUC_PURE; +gboolean gdata_contacts_group_set_extended_property (GDataContactsGroup *self, const gchar *name, const gchar *value); + +G_END_DECLS + +#endif /* !GDATA_CONTACTS_GROUP_H */ diff --git a/gdata/services/contacts/gdata-contacts-query.c b/gdata/services/contacts/gdata-contacts-query.c new file mode 100644 index 0000000..69c8b0b --- /dev/null +++ b/gdata/services/contacts/gdata-contacts-query.c @@ -0,0 +1,485 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-contacts-query + * @short_description: GData Contacts query object + * @stability: Stable + * @include: gdata/services/contacts/gdata-contacts-query.h + * + * #GDataContactsQuery represents a collection of query parameters specific to the Google Contacts service, which go above and beyond + * those catered for by #GDataQuery. + * + * For more information on the custom GData query parameters supported by #GDataContactsQuery, see the online documentation. + * + * + * Querying for Contacts + * + * GDataContactsService *service; + * gchar *group_id; + * GDataContactsQuery *query; + * GDataFeed *feed; + * GList *i; + * GError *error = NULL; + * + * /* Create a service and return the group we're querying within. */ + * service = create_contacts_service (); + * group_id = query_user_for_group (service); + * + * /* Create the query to use. We're going to query for contacts which match the search term "John" within a given group, + * * including deleted contacts. The group is specified by its ID. */ + * query = gdata_contacts_query_new ("John"); + * gdata_contacts_query_set_show_deleted (query, TRUE); + * gdata_contacts_query_set_group (query, group_id); + * + * g_free (group_id); + * + * /* Execute the query */ + * feed = gdata_contacts_service_query_contacts (service, query, NULL, NULL, NULL, &error); + * + * g_object_unref (query); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error querying for contacts: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Iterate through the returned contacts and do something with them */ + * for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { + * GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (i->data); + * + * /* Do something with the contact here, such as insert it into a UI */ + * } + * + * g_object_unref (feed); + * + * + * + * Since: 0.2.0 + */ + +#include +#include +#include +#include + +#include "gdata-contacts-query.h" +#include "gdata-query.h" +#include "gdata-private.h" + +static void gdata_contacts_query_finalize (GObject *object); +static void gdata_contacts_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_contacts_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +struct _GDataContactsQueryPrivate { + gchar *order_by; /* TODO: #defined values */ + gboolean show_deleted; + gchar *sort_order; /* TODO: #defined values */ + gchar *group; +}; + +enum { + PROP_ORDER_BY = 1, + PROP_SHOW_DELETED, + PROP_SORT_ORDER, + PROP_GROUP +}; + +G_DEFINE_TYPE (GDataContactsQuery, gdata_contacts_query, GDATA_TYPE_QUERY) + +static void +gdata_contacts_query_class_init (GDataContactsQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataContactsQueryPrivate)); + + gobject_class->set_property = gdata_contacts_query_set_property; + gobject_class->get_property = gdata_contacts_query_get_property; + gobject_class->finalize = gdata_contacts_query_finalize; + + query_class->get_query_uri = get_query_uri; + + /** + * GDataContactsQuery:order-by: + * + * Sorting criterion. The only supported value is lastmodified. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_ORDER_BY, + g_param_spec_string ("order-by", + "Order by", "Sorting criterion.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsQuery:show-deleted: + * + * Whether to include deleted contacts in the query feed. Deleted contacts return %TRUE + * from gdata_contacts_contact_is_deleted(), and have no other information. They do not + * normally appear in query results. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_SHOW_DELETED, + g_param_spec_boolean ("show-deleted", + "Show deleted?", "Whether to include deleted contacts in the query feed.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsQuery:sort-order: + * + * Sorting order direction. Can be either ascending or descending. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_SORT_ORDER, + g_param_spec_string ("sort-order", + "Sort order", "Sorting order direction.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataContactsQuery:group: + * + * Constrains the results to only those belonging to the group specified. The value of this parameter + * should be a group ID URI. + * + * Since: 0.2.0 + */ + g_object_class_install_property (gobject_class, PROP_GROUP, + g_param_spec_string ("group", + "Group", "Constrains the results to only those belonging to the group specified.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_contacts_query_init (GDataContactsQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_CONTACTS_QUERY, GDataContactsQueryPrivate); + + /* https://developers.google.com/google-apps/contacts/v3/reference#contacts-query-parameters-reference */ + _gdata_query_set_pagination_type (GDATA_QUERY (self), + GDATA_QUERY_PAGINATION_INDEXED); +} + +static void +gdata_contacts_query_finalize (GObject *object) +{ + GDataContactsQueryPrivate *priv = GDATA_CONTACTS_QUERY (object)->priv; + + g_free (priv->order_by); + g_free (priv->sort_order); + g_free (priv->group); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_contacts_query_parent_class)->finalize (object); +} + +static void +gdata_contacts_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataContactsQueryPrivate *priv = GDATA_CONTACTS_QUERY (object)->priv; + + switch (property_id) { + case PROP_ORDER_BY: + g_value_set_string (value, priv->order_by); + break; + case PROP_SHOW_DELETED: + g_value_set_boolean (value, priv->show_deleted); + break; + case PROP_SORT_ORDER: + g_value_set_string (value, priv->sort_order); + break; + case PROP_GROUP: + g_value_set_string (value, priv->group); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_contacts_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataContactsQuery *self = GDATA_CONTACTS_QUERY (object); + + switch (property_id) { + case PROP_ORDER_BY: + gdata_contacts_query_set_order_by (self, g_value_get_string (value)); + break; + case PROP_SHOW_DELETED: + gdata_contacts_query_set_show_deleted (self, g_value_get_boolean (value)); + break; + case PROP_SORT_ORDER: + gdata_contacts_query_set_sort_order (self, g_value_get_string (value)); + break; + case PROP_GROUP: + gdata_contacts_query_set_group (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataContactsQueryPrivate *priv = GDATA_CONTACTS_QUERY (self)->priv; + + #define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + /* Chain up to the parent class */ + GDATA_QUERY_CLASS (gdata_contacts_query_parent_class)->get_query_uri (self, feed_uri, query_uri, params_started); + + if (priv->order_by != NULL) { + APPEND_SEP + g_string_append (query_uri, "orderby="); + g_string_append_uri_escaped (query_uri, priv->order_by, NULL, FALSE); + } + + APPEND_SEP + if (priv->show_deleted == TRUE) + g_string_append (query_uri, "showdeleted=true"); + else + g_string_append (query_uri, "showdeleted=false"); + + if (priv->sort_order != NULL) { + APPEND_SEP + g_string_append (query_uri, "sortorder="); + g_string_append_uri_escaped (query_uri, priv->sort_order, NULL, FALSE); + } + + if (priv->group != NULL) { + APPEND_SEP + g_string_append (query_uri, "group="); + g_string_append_uri_escaped (query_uri, priv->group, NULL, FALSE); + } +} + +/** + * gdata_contacts_query_new: + * @q: (allow-none): a query string, or %NULL + * + * Creates a new #GDataContactsQuery with its #GDataQuery:q property set to @q. + * + * Return value: a new #GDataContactsQuery + * + * Since: 0.2.0 + */ +GDataContactsQuery * +gdata_contacts_query_new (const gchar *q) +{ + return g_object_new (GDATA_TYPE_CONTACTS_QUERY, "q", q, NULL); +} + +/** + * gdata_contacts_query_new_with_limits: + * @q: (allow-none): a query string, or %NULL + * @start_index: a one-based start index for the results, or 0 + * @max_results: the maximum number of results to return, or 0 + * + * Creates a new #GDataContactsQuery with its #GDataQuery:q property set to @q, and the limits @start_index and @max_results + * applied. + * + * Return value: a new #GDataContactsQuery + * + * Since: 0.2.0 + */ +GDataContactsQuery * +gdata_contacts_query_new_with_limits (const gchar *q, guint start_index, guint max_results) +{ + return g_object_new (GDATA_TYPE_CONTACTS_QUERY, + "q", q, + "start-index", start_index, + "max-results", max_results, + NULL); +} + +/** + * gdata_contacts_query_get_order_by: + * @self: a #GDataContactsQuery + * + * Gets the #GDataContactsQuery:order-by property. + * + * Return value: the order by property, or %NULL if it is unset + * + * Since: 0.2.0 + */ +const gchar * +gdata_contacts_query_get_order_by (GDataContactsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_QUERY (self), NULL); + return self->priv->order_by; +} + +/** + * gdata_contacts_query_set_order_by: + * @self: a #GDataContactsQuery + * @order_by: (allow-none): a new order by string, or %NULL + * + * Sets the #GDataContactsQuery:order-by property of the #GDataContactsQuery to the new order by string, @order_by. + * + * Set @order_by to %NULL to unset the property in the query URI. + * + * Since: 0.2.0 + */ +void +gdata_contacts_query_set_order_by (GDataContactsQuery *self, const gchar *order_by) +{ + g_return_if_fail (GDATA_IS_CONTACTS_QUERY (self)); + + g_free (self->priv->order_by); + self->priv->order_by = g_strdup (order_by); + g_object_notify (G_OBJECT (self), "order-by"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_contacts_query_show_deleted: + * @self: a #GDataContactsQuery + * + * Gets the #GDataContactsQuery:show-deleted property. + * + * Return value: %TRUE if deleted contacts should be shown, %FALSE otherwise + * + * Since: 0.2.0 + */ +gboolean +gdata_contacts_query_show_deleted (GDataContactsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_QUERY (self), FALSE); + return self->priv->show_deleted; +} + +/** + * gdata_contacts_query_set_show_deleted: + * @self: a #GDataContactsQuery + * @show_deleted: %TRUE to show deleted contacts, %FALSE otherwise + * + * Sets the #GDataContactsQuery:show-deleted property of the #GDataContactsQuery. + * + * Since: 0.2.0 + */ +void +gdata_contacts_query_set_show_deleted (GDataContactsQuery *self, gboolean show_deleted) +{ + g_return_if_fail (GDATA_IS_CONTACTS_QUERY (self)); + self->priv->show_deleted = show_deleted; + g_object_notify (G_OBJECT (self), "show-deleted"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_contacts_query_get_sort_order: + * @self: a #GDataContactsQuery + * + * Gets the #GDataContactsQuery:sort-order property. + * + * Return value: the sort order property, or %NULL if it is unset + * + * Since: 0.2.0 + */ +const gchar * +gdata_contacts_query_get_sort_order (GDataContactsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_QUERY (self), NULL); + return self->priv->sort_order; +} + +/** + * gdata_contacts_query_set_sort_order: + * @self: a #GDataContactsQuery + * @sort_order: (allow-none): a new sort order string, or %NULL + * + * Sets the #GDataContactsQuery:sort-order property of the #GDataContactsQuery to the new sort order string, @sort_order. + * + * Set @sort_order to %NULL to unset the property in the query URI. + * + * Since: 0.2.0 + */ +void +gdata_contacts_query_set_sort_order (GDataContactsQuery *self, const gchar *sort_order) +{ + g_return_if_fail (GDATA_IS_CONTACTS_QUERY (self)); + + g_free (self->priv->sort_order); + self->priv->sort_order = g_strdup (sort_order); + g_object_notify (G_OBJECT (self), "sort-order"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_contacts_query_get_group: + * @self: a #GDataContactsQuery + * + * Gets the #GDataContactsQuery:group property. + * + * Return value: the group property, or %NULL if it is unset + * + * Since: 0.2.0 + */ +const gchar * +gdata_contacts_query_get_group (GDataContactsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_CONTACTS_QUERY (self), NULL); + return self->priv->group; +} + +/** + * gdata_contacts_query_set_group: + * @self: a #GDataContactsQuery + * @group: (allow-none): a new group ID URI, or %NULL + * + * Sets the #GDataContactsQuery:group property of the #GDataContactsQuery to the new group ID URI, @group. + * + * Set @group to %NULL to unset the property in the query URI. + * + * Since: 0.2.0 + */ +void +gdata_contacts_query_set_group (GDataContactsQuery *self, const gchar *group) +{ + g_return_if_fail (GDATA_IS_CONTACTS_QUERY (self)); + + g_free (self->priv->group); + self->priv->group = g_strdup (group); + g_object_notify (G_OBJECT (self), "group"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} diff --git a/gdata/services/contacts/gdata-contacts-query.h b/gdata/services/contacts/gdata-contacts-query.h new file mode 100644 index 0000000..f215645 --- /dev/null +++ b/gdata/services/contacts/gdata-contacts-query.h @@ -0,0 +1,85 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CONTACTS_QUERY_H +#define GDATA_CONTACTS_QUERY_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_CONTACTS_QUERY (gdata_contacts_query_get_type ()) +#define GDATA_CONTACTS_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CONTACTS_QUERY, GDataContactsQuery)) +#define GDATA_CONTACTS_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CONTACTS_QUERY, GDataContactsQueryClass)) +#define GDATA_IS_CONTACTS_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CONTACTS_QUERY)) +#define GDATA_IS_CONTACTS_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CONTACTS_QUERY)) +#define GDATA_CONTACTS_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CONTACTS_QUERY, GDataContactsQueryClass)) + +typedef struct _GDataContactsQueryPrivate GDataContactsQueryPrivate; + +/** + * GDataContactsQuery: + * + * All the fields in the #GDataContactsQuery structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataQuery parent; + GDataContactsQueryPrivate *priv; +} GDataContactsQuery; + +/** + * GDataContactsQueryClass: + * + * All the fields in the #GDataContactsQueryClass structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + /*< private >*/ + GDataQueryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataContactsQueryClass; + +GType gdata_contacts_query_get_type (void) G_GNUC_CONST; + +GDataContactsQuery *gdata_contacts_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataContactsQuery *gdata_contacts_query_new_with_limits (const gchar *q, guint start_index, + guint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_contacts_query_get_order_by (GDataContactsQuery *self) G_GNUC_PURE; +void gdata_contacts_query_set_order_by (GDataContactsQuery *self, const gchar *order_by); +gboolean gdata_contacts_query_show_deleted (GDataContactsQuery *self) G_GNUC_PURE; +void gdata_contacts_query_set_show_deleted (GDataContactsQuery *self, gboolean show_deleted); +const gchar *gdata_contacts_query_get_sort_order (GDataContactsQuery *self) G_GNUC_PURE; +void gdata_contacts_query_set_sort_order (GDataContactsQuery *self, const gchar *sort_order); +const gchar *gdata_contacts_query_get_group (GDataContactsQuery *self) G_GNUC_PURE; +void gdata_contacts_query_set_group (GDataContactsQuery *self, const gchar *group); + +G_END_DECLS + +#endif /* !GDATA_CONTACTS_QUERY_H */ diff --git a/gdata/services/contacts/gdata-contacts-service.c b/gdata/services/contacts/gdata-contacts-service.c new file mode 100644 index 0000000..62d7c32 --- /dev/null +++ b/gdata/services/contacts/gdata-contacts-service.c @@ -0,0 +1,568 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-contacts-service + * @short_description: GData Contacts service object + * @stability: Stable + * @include: gdata/services/contacts/gdata-contacts-service.h + * + * #GDataContactsService is a subclass of #GDataService for communicating with the GData API of Google Contacts. It supports querying + * for, inserting, editing and deleting contacts from a Google address book. + * + * For more details of Google Contacts' GData API, see the + * online documentation. + * + * + * Querying for Groups + * + * GDataContactsService *service; + * GDataFeed *feed; + * GList *i; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_contacts_service (); + * + * /* Query for groups */ + * feed = gdata_contacts_service_query_groups (service, NULL, NULL, NULL, NULL, &error); + * + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error querying for groups: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Iterate through the returned groups and do something with them */ + * for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { + * const gchar *system_group_id, *group_name; + * gboolean is_system_group; + * GDataContactsGroup *group = GDATA_CONTACTS_GROUP (i->data); + * + * /* Determine whether the group's a system group. If so, you should use the system group ID to provide your application's own + * * translations of the group name, as it's not translated. */ + * system_group_id = gdata_contacts_group_get_system_group_id (group); + * is_system_group = (system_group_id != NULL) ? TRUE : FALSE; + * group_name = (is_system_group == TRUE) ? get_group_name_for_system_group_id (system_group_id) + * : gdata_entry_get_title (GDATA_ENTRY (group)); + * + * /* Do something with the group here, such as insert it into a UI. Note that system groups are not allowed to be deleted, + * * so you may want to make certain parts of your UI insensitive accordingly if the group is a system group. */ + * } + * + * g_object_unref (feed); + * + * + * + * The Contacts service can be manipulated using batch operations, too. See the + * online documentation on batch + * operations for more information. + * + * + * Performing a Batch Operation on Contacts + * + * GDataContactsService *service; + * GDataBatchOperation *operation; + * GDataFeed *feed; + * GDataLink *batch_link; + * GList *i; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_contacts_service (); + * + * /* Create the batch operation; this requires that we have done a query first so that we can get the batch link */ + * feed = do_some_query (service); + * batch_link = gdata_feed_look_up_link (feed, GDATA_LINK_BATCH); + * operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_link_get_uri (batch_link)); + * g_object_unref (feed); + * + * gdata_batch_operation_add_query (operation, contact_entry_id_to_query, GDATA_TYPE_CONTACTS_CONTACT, + * (GDataBatchOperationCallback) batch_query_cb, user_data); + * gdata_batch_operation_add_insertion (operation, new_entry, (GDataBatchOperationCallback) batch_insertion_cb, user_data); + * gdata_batch_operation_add_update (operation, old_entry, (GDataBatchOperationCallback) batch_update_cb, user_data); + * gdata_batch_operation_add_deletion (operation, entry_to_delete, (GDataBatchOperationCallback) batch_deletion_cb, user_data); + * + * /* Run the batch operation and handle the results in the various callbacks */ + * gdata_test_batch_operation_run (operation, NULL, &error); + * + * g_object_unref (operation); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error running batch operation: %s", error->message); + * g_error_free (error); + * return; + * } + * + * static void + * batch_query_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_type == GDATA_BATCH_OPERATION_QUERY */ + * /* Reference and do something with the returned entry. */ + * } + * + * static void + * batch_insertion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_type == GDATA_BATCH_OPERATION_INSERTION */ + * /* Reference and do something with the returned entry. */ + * } + * + * static void + * batch_update_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_type == GDATA_BATCH_OPERATION_UPDATE */ + * /* Reference and do something with the returned entry. */ + * } + * + * static void + * batch_deletion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_type == GDATA_BATCH_OPERATION_DELETION, entry == NULL */ + * } + * + * + * + * Since: 0.2.0 + */ + +#include +#include +#include +#include +#include + +#include "gdata-contacts-service.h" +#include "gdata-batchable.h" +#include "gdata-service.h" +#include "gdata-private.h" +#include "gdata-query.h" + +static GList *get_authorization_domains (void); + +_GDATA_DEFINE_AUTHORIZATION_DOMAIN (contacts, "cp", "https://www.google.com/m8/feeds/") +G_DEFINE_TYPE_WITH_CODE (GDataContactsService, gdata_contacts_service, GDATA_TYPE_SERVICE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_BATCHABLE, NULL)) + +static void +gdata_contacts_service_class_init (GDataContactsServiceClass *klass) +{ + GDataServiceClass *service_class = GDATA_SERVICE_CLASS (klass); + service_class->api_version = "3"; + service_class->get_authorization_domains = get_authorization_domains; +} + +static void +gdata_contacts_service_init (GDataContactsService *self) +{ + /* Nothing to see here */ +} + +static GList * +get_authorization_domains (void) +{ + return g_list_prepend (NULL, get_contacts_authorization_domain ()); +} + +/** + * gdata_contacts_service_new: + * @authorizer: (allow-none): a #GDataAuthorizer to authorize the service's requests, or %NULL + * + * Creates a new #GDataContactsService using the given #GDataAuthorizer. If @authorizer is %NULL, all requests are made as an unauthenticated user. + * + * Return value: a new #GDataContactsService, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataContactsService * +gdata_contacts_service_new (GDataAuthorizer *authorizer) +{ + g_return_val_if_fail (authorizer == NULL || GDATA_IS_AUTHORIZER (authorizer), NULL); + + return g_object_new (GDATA_TYPE_CONTACTS_SERVICE, + "authorizer", authorizer, + NULL); +} + +/** + * gdata_contacts_service_get_primary_authorization_domain: + * + * The primary #GDataAuthorizationDomain for interacting with Google Contacts. This will not normally need to be used, as it's used internally + * by the #GDataContactsService methods. However, if using the plain #GDataService methods to implement custom queries or requests which libgdata + * does not support natively, then this domain may be needed to authorize the requests. + * + * The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. + * + * Return value: (transfer none): the service's authorization domain + * + * Since: 0.9.0 + */ +GDataAuthorizationDomain * +gdata_contacts_service_get_primary_authorization_domain (void) +{ + return get_contacts_authorization_domain (); +} + +/** + * gdata_contacts_service_query_contacts: + * @self: a #GDataContactsService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service to return a list of contacts matching the given @query. + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataFeed * +gdata_contacts_service_query_contacts (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + GDataFeed *feed; + gchar *request_uri; + + g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (self), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_contacts_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to query contacts.")); + return NULL; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/contacts/default/full", NULL); + feed = gdata_service_query (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_QUERY (query), + GDATA_TYPE_CONTACTS_CONTACT, cancellable, progress_callback, progress_user_data, error); + g_free (request_uri); + + return feed; +} + +/** + * gdata_contacts_service_query_contacts_async: + * @self: a #GDataContactsService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return a list of contacts matching the given @query. @self and + * @query are all reffed when this function is called, so can safely be unreffed after this function returns. + * + * For more details, see gdata_contacts_service_query_contacts(), which is the synchronous version of this function, + * and gdata_service_query_async(), which is the base asynchronous query function. + * + * Since: 0.9.1 + */ +void +gdata_contacts_service_query_contacts_async (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (self)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_contacts_authorization_domain ()) == FALSE) { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", + _("You must be authenticated to query contacts.")); + + return; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/contacts/default/full", NULL); + gdata_service_query_async (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_QUERY (query), + GDATA_TYPE_CONTACTS_CONTACT, cancellable, progress_callback, progress_user_data, + destroy_progress_user_data, callback, user_data); + g_free (request_uri); +} + +/** + * gdata_contacts_service_insert_contact: + * @self: a #GDataContactsService + * @contact: the #GDataContactsContact to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Inserts @contact by uploading it to the online contacts service. + * + * For more details, see gdata_service_insert_entry(). + * + * Return value: (transfer full): an updated #GDataContactsContact, or %NULL; unref with g_object_unref() + * + * Since: 0.2.0 + */ +GDataContactsContact * +gdata_contacts_service_insert_contact (GDataContactsService *self, GDataContactsContact *contact, GCancellable *cancellable, GError **error) +{ + gchar *uri; + GDataEntry *entry; + + g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (contact), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/contacts/default/full", NULL); + entry = gdata_service_insert_entry (GDATA_SERVICE (self), get_contacts_authorization_domain (), uri, GDATA_ENTRY (contact), cancellable, + error); + g_free (uri); + + return GDATA_CONTACTS_CONTACT (entry); +} + +/** + * gdata_contacts_service_insert_contact_async: + * @self: a #GDataContactsService + * @contact: the #GDataContactsContact to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Inserts @contact by uploading it to the online contacts service. @self and @contact are both reffed when this function is called, so can safely be + * unreffed after this function returns. + * + * @callback should call gdata_service_insert_entry_finish() to obtain a #GDataContactsContact representing the inserted contact and to check for + * possible errors. + * + * For more details, see gdata_contacts_service_insert_contact(), which is the synchronous version of this function, + * and gdata_service_insert_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.7.0 + */ +void +gdata_contacts_service_insert_contact_async (GDataContactsService *self, GDataContactsContact *contact, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *uri; + + g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (self)); + g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (contact)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/contacts/default/full", NULL); + gdata_service_insert_entry_async (GDATA_SERVICE (self), get_contacts_authorization_domain (), uri, GDATA_ENTRY (contact), cancellable, + callback, user_data); + g_free (uri); +} + +/** + * gdata_contacts_service_query_groups: + * @self: a #GDataContactsService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service to return a list of groups matching the given @query. + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataFeed * +gdata_contacts_service_query_groups (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + GDataFeed *feed; + gchar *request_uri; + + g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (self), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_contacts_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to query contact groups.")); + return NULL; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/groups/default/full", NULL); + feed = gdata_service_query (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_QUERY (query), + GDATA_TYPE_CONTACTS_GROUP, cancellable, progress_callback, progress_user_data, error); + g_free (request_uri); + + return feed; +} + +/** + * gdata_contacts_service_query_groups_async: + * @self: a #GDataContactsService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return a list of groups matching the given @query. @self and @query are all reffed when this function is called, so can + * safely be unreffed after this function returns. + * + * For more details, see gdata_contacts_service_query_groups(), which is the synchronous version of this function, and gdata_service_query_async(), + * which is the base asynchronous query function. + * + * Since: 0.9.1 + */ +void +gdata_contacts_service_query_groups_async (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (self)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_contacts_authorization_domain ()) == FALSE) { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", + _("You must be authenticated to query contact groups.")); + + return; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/groups/default/full", NULL); + gdata_service_query_async (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_QUERY (query), + GDATA_TYPE_CONTACTS_GROUP, cancellable, progress_callback, progress_user_data, + destroy_progress_user_data, callback, user_data); + g_free (request_uri); +} + +/** + * gdata_contacts_service_insert_group: + * @self: a #GDataContactsService + * @group: a #GDataContactsGroup to create on the server + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Inserts a new contact group described by @group. The user must be authenticated to use this function. + * + * Return value: (transfer full): the inserted #GDataContactsGroup; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataContactsGroup * +gdata_contacts_service_insert_group (GDataContactsService *self, GDataContactsGroup *group, GCancellable *cancellable, GError **error) +{ + gchar *request_uri; + GDataEntry *new_group; + + g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (group), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (gdata_entry_is_inserted (GDATA_ENTRY (group)) == TRUE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED, + _("The group has already been inserted.")); + return NULL; + } + + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_contacts_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to insert a group.")); + return NULL; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/groups/default/full", NULL); + new_group = gdata_service_insert_entry (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_ENTRY (group), + cancellable, error); + g_free (request_uri); + + return GDATA_CONTACTS_GROUP (new_group); +} + +/** + * gdata_contacts_service_insert_group_async: + * @self: a #GDataContactsService + * @group: the #GDataContactsGroup to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Inserts a new contact group described by @group. The user must be authenticated to use this function. @self and @group are both reffed when this + * function is called, so can safely be unreffed after this function returns. + * + * @callback should call gdata_service_insert_entry_finish() to obtain a #GDataContactsGroup representing the inserted group and to check for possible + * errors. + * + * For more details, see gdata_contacts_service_insert_group(), which is the synchronous version of this function, and + * gdata_service_insert_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.7.0 + */ +void +gdata_contacts_service_insert_group_async (GDataContactsService *self, GDataContactsGroup *group, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (self)); + g_return_if_fail (GDATA_IS_CONTACTS_GROUP (group)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/groups/default/full", NULL); + gdata_service_insert_entry_async (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_ENTRY (group), cancellable, + callback, user_data); + g_free (request_uri); +} diff --git a/gdata/services/contacts/gdata-contacts-service.h b/gdata/services/contacts/gdata-contacts-service.h new file mode 100644 index 0000000..100e38d --- /dev/null +++ b/gdata/services/contacts/gdata-contacts-service.h @@ -0,0 +1,110 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_CONTACTS_SERVICE_H +#define GDATA_CONTACTS_SERVICE_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_CONTACTS_SERVICE (gdata_contacts_service_get_type ()) +#define GDATA_CONTACTS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CONTACTS_SERVICE, GDataContactsService)) +#define GDATA_CONTACTS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CONTACTS_SERVICE, GDataContactsServiceClass)) +#define GDATA_IS_CONTACTS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CONTACTS_SERVICE)) +#define GDATA_IS_CONTACTS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CONTACTS_SERVICE)) +#define GDATA_CONTACTS_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CONTACTS_SERVICE, GDataContactsServiceClass)) + +typedef struct _GDataContactsServicePrivate GDataContactsServicePrivate; + +/** + * GDataContactsService: + * + * All the fields in the #GDataContactsService structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + GDataService parent; +} GDataContactsService; + +/** + * GDataContactsServiceClass: + * + * All the fields in the #GDataContactsServiceClass structure are private and should never be accessed directly. + * + * Since: 0.2.0 + */ +typedef struct { + /*< private >*/ + GDataServiceClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataContactsServiceClass; + +GType gdata_contacts_service_get_type (void) G_GNUC_CONST; + +GDataContactsService *gdata_contacts_service_new (GDataAuthorizer *authorizer) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataAuthorizationDomain *gdata_contacts_service_get_primary_authorization_domain (void) G_GNUC_CONST; + +GDataFeed *gdata_contacts_service_query_contacts (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_contacts_service_query_contacts_async (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); + +#include + +GDataContactsContact *gdata_contacts_service_insert_contact (GDataContactsService *self, GDataContactsContact *contact, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_contacts_service_insert_contact_async (GDataContactsService *self, GDataContactsContact *contact, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); + +#include + +GDataFeed *gdata_contacts_service_query_groups (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_contacts_service_query_groups_async (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); + +GDataContactsGroup *gdata_contacts_service_insert_group (GDataContactsService *self, GDataContactsGroup *group, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_contacts_service_insert_group_async (GDataContactsService *self, GDataContactsGroup *group, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); + +G_END_DECLS + +#endif /* !GDATA_CONTACTS_SERVICE_H */ diff --git a/gdata/services/documents/gdata-documents-access-rule.c b/gdata/services/documents/gdata-documents-access-rule.c new file mode 100644 index 0000000..ba5398b --- /dev/null +++ b/gdata/services/documents/gdata-documents-access-rule.c @@ -0,0 +1,230 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Red Hat, Inc. 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-access-rule + * @short_description: GData Documents access rule object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-access-rule.h + * + * #GDataDocumentsAccessRule is a subclass of #GDataAccessRule to represent an + * access rule affecting users of a Google Documents entry. + * + * Since: 0.17.2 + */ + +#include +#include +#include + +#include "gdata-documents-access-rule.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_documents_access_rule_finalize (GObject *object); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static gboolean post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error); +static const gchar *get_content_type (void); +static void get_json (GDataParsable *parsable, JsonBuilder *builder); + +typedef struct { + gchar *domain; + gchar *email; + gchar *scope_type; +} GDataDocumentsAccessRulePrivate; + +G_DEFINE_TYPE_WITH_PRIVATE (GDataDocumentsAccessRule, gdata_documents_access_rule, GDATA_TYPE_ACCESS_RULE) + +static void +gdata_documents_access_rule_class_init (GDataDocumentsAccessRuleClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + gobject_class->finalize = gdata_documents_access_rule_finalize; + parsable_class->parse_json = parse_json; + parsable_class->post_parse_json = post_parse_json; + parsable_class->get_content_type = get_content_type; + parsable_class->get_json = get_json; +} + +static void +gdata_documents_access_rule_init (GDataDocumentsAccessRule *self) +{ + /* Nothing to do here. */ +} + +static void +gdata_documents_access_rule_finalize (GObject *object) +{ + GDataDocumentsAccessRulePrivate *priv; + + priv = gdata_documents_access_rule_get_instance_private (GDATA_DOCUMENTS_ACCESS_RULE (object)); + + g_free (priv->domain); + g_free (priv->email); + g_free (priv->scope_type); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_documents_access_rule_parent_class)->finalize (object); +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataDocumentsAccessRulePrivate *priv; + gboolean success; + gchar *key = NULL; + gchar *role = NULL; + gchar *scope_type = NULL; + + priv = gdata_documents_access_rule_get_instance_private (GDATA_DOCUMENTS_ACCESS_RULE (parsable)); + + /* JSON format: https://developers.google.com/drive/v2/reference/permissions */ + + if (gdata_parser_string_from_json_member (reader, "emailAddress", P_REQUIRED | P_NON_EMPTY, &(priv->email), &success, error) == TRUE || + gdata_parser_string_from_json_member (reader, "domain", P_REQUIRED | P_NON_EMPTY, &(priv->domain), &success, error) == TRUE) { + return success; + } else if (gdata_parser_string_from_json_member (reader, "authKey", P_REQUIRED | P_NON_EMPTY, &key, &success, error) == TRUE) { + if (success && key != NULL && key[0] != '\0') + _gdata_access_rule_set_key (GDATA_ACCESS_RULE (parsable), key); + + g_free (key); + return success; + } else if (gdata_parser_string_from_json_member (reader, "role", P_REQUIRED | P_NON_EMPTY, &role, &success, error) == TRUE) { + if (success && role != NULL && role[0] != '\0') + gdata_access_rule_set_role (GDATA_ACCESS_RULE (parsable), role); + + g_free (role); + return success; + } else if (gdata_parser_string_from_json_member (reader, "type", P_REQUIRED | P_NON_EMPTY, &scope_type, &success, error) == TRUE) { + if (g_strcmp0 (scope_type, "anyone") == 0) { + priv->scope_type = g_strdup (GDATA_ACCESS_SCOPE_DEFAULT); + } else { + priv->scope_type = scope_type; + scope_type = NULL; + } + + g_free (scope_type); + return success; + } + + return GDATA_PARSABLE_CLASS (gdata_documents_access_rule_parent_class)->parse_json (parsable, reader, user_data, error); +} + +static gboolean +post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataDocumentsAccessRulePrivate *priv; + + priv = gdata_documents_access_rule_get_instance_private (GDATA_DOCUMENTS_ACCESS_RULE (parsable)); + + if (g_strcmp0 (priv->scope_type, GDATA_ACCESS_SCOPE_DEFAULT) == 0) { + gdata_access_rule_set_scope (GDATA_ACCESS_RULE (parsable), priv->scope_type, NULL); + } else if (g_strcmp0 (priv->scope_type, "group") == 0 || g_strcmp0 (priv->scope_type, GDATA_ACCESS_SCOPE_USER) == 0) { + if (priv->email == NULL || priv->email[0] == '\0') { + g_set_error (error, GDATA_PARSER_ERROR, GDATA_PARSER_ERROR_PARSING_STRING, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Permission type ‘group’ or ‘user’ needs an ‘emailAddress’ property."); + return FALSE; + } else { + gdata_access_rule_set_scope (GDATA_ACCESS_RULE (parsable), priv->scope_type, priv->email); + } + } else if (g_strcmp0 (priv->scope_type, GDATA_ACCESS_SCOPE_DOMAIN) == 0) { + if (priv->domain == NULL || priv->domain[0] == '\0') { + g_set_error (error, GDATA_PARSER_ERROR, GDATA_PARSER_ERROR_PARSING_STRING, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Permission type ‘domain’ needs a ‘domain’ property."); + return FALSE; + } else { + gdata_access_rule_set_scope (GDATA_ACCESS_RULE (parsable), priv->scope_type, priv->domain); + } + } + + return TRUE; +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + const gchar *key; + const gchar *role; + const gchar *scope_type; + const gchar *scope_value; + + GDATA_PARSABLE_CLASS (gdata_documents_access_rule_parent_class)->get_json (parsable, builder); + + key = gdata_access_rule_get_key (GDATA_ACCESS_RULE (parsable)); + if (key != NULL && key[0] != '\0') { + json_builder_set_member_name (builder, "authKey"); + json_builder_add_string_value (builder, key); + } + + role = gdata_access_rule_get_role (GDATA_ACCESS_RULE (parsable)); + if (role != NULL && role[0] != '\0') { + json_builder_set_member_name (builder, "role"); + json_builder_add_string_value (builder, role); + } + + gdata_access_rule_get_scope (GDATA_ACCESS_RULE (parsable), &scope_type, &scope_value); + + if (scope_type != NULL && scope_type[0] != '\0') { + if (g_strcmp0 (scope_type, GDATA_ACCESS_SCOPE_DEFAULT) == 0) + scope_type = "anyone"; + + json_builder_set_member_name (builder, "type"); + json_builder_add_string_value (builder, scope_type); + } + + if (scope_value != NULL && scope_value[0] != '\0') { + json_builder_set_member_name (builder, "value"); + json_builder_add_string_value (builder, scope_value); + } +} + +/** + * gdata_documents_access_rule_new: + * @id: the access rule's ID, or %NULL + * + * Creates a new #GDataDocumentsAccessRule with the given ID and default + * properties. + * + * Return value: (transfer full): a new #GDataDocumentsAccessRule; unref with + * g_object_unref() + * + * Since: 0.17.2 + */ +GDataDocumentsAccessRule * +gdata_documents_access_rule_new (const gchar *id) +{ + GObject *retval = NULL; /* owned */ + + retval = g_object_new (GDATA_TYPE_DOCUMENTS_ACCESS_RULE, + "id", id, + NULL); + return GDATA_DOCUMENTS_ACCESS_RULE (retval); +} diff --git a/gdata/services/documents/gdata-documents-access-rule.h b/gdata/services/documents/gdata-documents-access-rule.h new file mode 100644 index 0000000..fc78e95 --- /dev/null +++ b/gdata/services/documents/gdata-documents-access-rule.h @@ -0,0 +1,75 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Red Hat, Inc. 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_ACCESS_RULE_H +#define GDATA_DOCUMENTS_ACCESS_RULE_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_DOCUMENTS_ACCESS_RULE (gdata_documents_access_rule_get_type ()) +#define GDATA_DOCUMENTS_ACCESS_RULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_ACCESS_RULE, GDataDocumentsAccessRule)) +#define GDATA_DOCUMENTS_ACCESS_RULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_ACCESS_RULE, GDataDocumentsAccessRuleClass)) +#define GDATA_IS_DOCUMENTS_ACCESS_RULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_ACCESS_RULE)) +#define GDATA_IS_DOCUMENTS_ACCESS_RULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_ACCESS_RULE)) +#define GDATA_DOCUMENTS_ACCESS_RULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_ACCESS_RULE, GDataDocumentsAccessRuleClass)) + +/** + * GDataDocumentsAccessRule: + * + * All the fields in the #GDataDocumentsAccessRule structure are private and + * should never be accessed directly. + * + * Since: 0.17.2 + */ +typedef struct { + GDataAccessRule parent; +} GDataDocumentsAccessRule; + +/** + * GDataDocumentsAccessRuleClass: + * + * All the fields in the #GDataDocumentsAccessRuleClass structure are private + * and should never be accessed directly. + * + * Since: 0.17.2 + */ +typedef struct { + /*< private >*/ + GDataAccessRuleClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsAccessRuleClass; + +GType gdata_documents_access_rule_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsAccessRule, g_object_unref) + +GDataDocumentsAccessRule * +gdata_documents_access_rule_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_ACCESS_RULE_H */ diff --git a/gdata/services/documents/gdata-documents-document.c b/gdata/services/documents/gdata-documents-document.c new file mode 100644 index 0000000..4a42f41 --- /dev/null +++ b/gdata/services/documents/gdata-documents-document.c @@ -0,0 +1,536 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Red Hat, Inc. 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-document + * @short_description: GData documents document object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-document.h + * + * #GDataDocumentsDocument is a subclass of #GDataDocumentsEntry to represent an arbitrary Google Drive document (i.e. an arbitrary file which + * isn't a Google Documents presentation, text document, PDF, drawing or spreadsheet). It is subclassed by #GDataDocumentsPresentation, #GDataDocumentsText, + * #GDataDocumentsPdf, #GDataDocumentsDrawing and #GDataDocumentsSpreadsheet, which represent those specific types of Google Document, respectively. + * + * #GDataDocumentsDocument used to be abstract, but was made instantiable in version 0.13.0 to allow for arbitrary file uploads. This can be achieved + * by setting #GDataDocumentsUploadQuery:convert to %FALSE when making an upload using gdata_documents_service_upload_document_resumable(). See the + * documentation for #GDataDocumentsUploadQuery for an example. + * + * It should be noted that #GDataDocumentsDocument should only be used to represent arbitrary files; its subclasses should be used any time a standard + * Google Document (spreadsheet, text document, presentation, etc.) is to be represented. + * + * For more details of Google Drive’s GData API, see the + * online documentation. + * + * + * Downloading a Document + * + * GDataDocumentsService *service; + * GDataDocumentsDocument *document; + * GFile *destination_file; + * const gchar *download_format; + * GDataDownloadStream *download_stream; + * GFileOutputStream *output_stream; + * GError *error = NULL; + * + * /* Create a service and retrieve the document to download and the file and format to save the download in */ + * service = create_youtube_service (); + * document = get_document_to_download (service); + * destination_file = query_user_for_destination_file (document); + * download_format = query_user_for_download_format (document); + * + * /* Create the download stream */ + * download_stream = gdata_documents_document_download (document, service, download_format, NULL, &error); + * + * g_object_unref (document); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error creating download stream: %s", error->message); + * g_error_free (error); + * g_object_unref (destination_file); + * return; + * } + * + * /* Create the file output stream */ + * output_stream = g_file_replace (destination_file, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, NULL, &error); + * + * g_object_unref (destination_file); + * + * if (error != NULL) { + * g_error ("Error creating destination file: %s", error->message); + * g_error_free (error); + * g_object_unref (download_stream); + * return; + * } + * + * /* Download the document. This should almost always be done asynchronously. */ + * g_output_stream_splice (G_OUTPUT_STREAM (output_stream), G_INPUT_STREAM (download_stream), + * G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error); + * + * g_object_unref (output_stream); + * g_object_unref (download_stream); + * + * if (error != NULL) { + * g_error ("Error downloading document: %s", error->message); + * g_error_free (error); + * return; + * } + * + * + * + * Each document accessible through the service has an access control list (ACL) which defines the level of access to the document to each user, and + * which users the document is shared with. For more information about ACLs for documents, see the online + * documentation on sharing documents. + * + * + * Retrieving the Access Control List for a Document + * + * GDataDocumentsService *service; + * GDataDocumentsDocument *document; + * GDataFeed *acl_feed; + * GDataAccessRule *rule, *new_rule; + * GDataLink *acl_link; + * GList *i; + * GError *error = NULL; + * + * /* Create a service and retrieve a document to work on */ + * service = create_documents_service (); + * document = get_document (service); + * + * /* Query the service for the ACL for the given document */ + * acl_feed = gdata_access_handler_get_rules (GDATA_ACCESS_HANDLER (document), GDATA_SERVICE (service), NULL, NULL, NULL, &error); + * + * if (error != NULL) { + * g_error ("Error getting ACL feed for document: %s", error->message); + * g_error_free (error); + * g_object_unref (document); + * g_object_unref (service); + * return; + * } + * + * /* Iterate through the ACL */ + * for (i = gdata_feed_get_entries (acl_feed); i != NULL; i = i->next) { + * const gchar *scope_value; + * + * rule = GDATA_ACCESS_RULE (i->data); + * + * /* Do something with the access rule here. As an example, we update the rule applying to test@gmail.com and delete all + * * the other rules. We then insert another rule for example@gmail.com below. */ + * gdata_access_rule_get_scope (rule, NULL, &scope_value); + * if (scope_value != NULL && strcmp (scope_value, "test@gmail.com") == 0) { + * GDataAccessRule *updated_rule; + * + * /* Update the rule to make test@gmail.com a writer (full read/write access to the document, but they can't change + * * the ACL or delete the document). */ + * gdata_access_rule_set_role (rule, GDATA_DOCUMENTS_ACCESS_ROLE_WRITER); + * updated_rule = GDATA_ACCESS_RULE (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (rule), NULL, &error)); + * + * if (error != NULL) { + * g_error ("Error updating access rule for %s: %s", scope_value, error->message); + * g_error_free (error); + * g_object_unref (acl_feed); + * g_object_unref (document); + * g_object_unref (service); + * return; + * } + * + * g_object_unref (updated_rule); + * } else { + * /* Delete any rule which doesn't apply to test@gmail.com */ + * gdata_service_delete_entry (GDATA_SERVICE (service), GDATA_ENTRY (rule), NULL, &error); + * + * if (error != NULL) { + * g_error ("Error deleting access rule for %s: %s", scope_value, error->message); + * g_error_free (error); + * g_object_unref (acl_feed); + * g_object_unref (document); + * g_object_unref (service); + * return; + * } + * } + * } + * + * g_object_unref (acl_feed); + * + * /* Create and insert a new access rule for example@gmail.com which allows them read-only access to the document. */ + * rule = gdata_access_rule_new (NULL); + * gdata_access_rule_set_role (rule, GDATA_DOCUMENTS_ACCESS_ROLE_READER); + * gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_USER, "example@gmail.com"); + * + * acl_link = gdata_entry_look_up_link (GDATA_ENTRY (document), GDATA_LINK_ACCESS_CONTROL_LIST); + * new_rule = GDATA_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), gdata_link_get_uri (acl_link), GDATA_ENTRY (rule), + * NULL, &error)); + * + * g_object_unref (rule); + * g_object_unref (document); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error inserting access rule: %s", error->message); + * g_error_free (error); + * return; + * } + * + * g_object_unref (acl_link); + * + * + * + * Since: 0.7.0 + */ + +#include +#include +#include + +#include "gdata-documents-document.h" +#include "gdata-documents-drawing.h" +#include "gdata-documents-entry.h" +#include "gdata-documents-presentation.h" +#include "gdata-documents-spreadsheet.h" +#include "gdata-documents-text.h" +#include "gdata-documents-utils.h" +#include "gdata-download-stream.h" +#include "gdata-private.h" +#include "gdata-service.h" + +static void gdata_documents_document_finalize (GObject *object); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); + +struct _GDataDocumentsDocumentPrivate { + GHashTable *export_links; /* owned string → owned string */ +}; + +G_DEFINE_TYPE (GDataDocumentsDocument, gdata_documents_document, GDATA_TYPE_DOCUMENTS_ENTRY) + +static void +gdata_documents_document_class_init (GDataDocumentsDocumentClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataDocumentsDocumentPrivate)); + + gobject_class->finalize = gdata_documents_document_finalize; + parsable_class->parse_json = parse_json; + entry_class->kind_term = "http://schemas.google.com/docs/2007#file"; +} + +static void +gdata_documents_document_init (GDataDocumentsDocument *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_DOCUMENTS_DOCUMENT, GDataDocumentsDocumentPrivate); + self->priv->export_links = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); +} + +static void +gdata_documents_document_finalize (GObject *object) +{ + GDataDocumentsDocumentPrivate *priv = GDATA_DOCUMENTS_DOCUMENT (object)->priv; + + g_hash_table_unref (priv->export_links); + + G_OBJECT_CLASS (gdata_documents_document_parent_class)->finalize (object); +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataDocumentsDocumentPrivate *priv = GDATA_DOCUMENTS_DOCUMENT (parsable)->priv; + gboolean success; + gchar *content_uri = NULL; + gchar *thumbnail_uri = NULL; + + /* JSON format: https://developers.google.com/drive/v2/reference/files */ + + if (gdata_parser_string_from_json_member (reader, "downloadUrl", P_DEFAULT, &content_uri, &success, error) == TRUE) { + if (success && content_uri != NULL && content_uri[0] != '\0') + gdata_entry_set_content_uri (GDATA_ENTRY (parsable), content_uri); + g_free (content_uri); + return success; + } else if (gdata_parser_string_from_json_member (reader, "thumbnailLink", P_DEFAULT, &thumbnail_uri, &success, error) == TRUE) { + if (success && thumbnail_uri != NULL && thumbnail_uri[0] != '\0') { + GDataLink *_link; + + _link = gdata_link_new (thumbnail_uri, "http://schemas.google.com/docs/2007/thumbnail"); + gdata_entry_add_link (GDATA_ENTRY (parsable), _link); + g_object_unref (_link); + } + + g_free (thumbnail_uri); + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "exportLinks") == 0) { + guint i, members; + + if (json_reader_is_object (reader) == FALSE) { + g_set_error (error, GDATA_PARSER_ERROR, GDATA_PARSER_ERROR_PARSING_STRING, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "JSON node ‘exportLinks’ is not an object."); + return FALSE; + } + + for (i = 0, members = (guint) json_reader_count_members (reader); i < members; i++) { + const gchar *format; + gchar *uri = NULL; + + json_reader_read_element (reader, i); + + format = json_reader_get_member_name (reader); + + g_assert (gdata_parser_string_from_json_member (reader, format, P_REQUIRED | P_NON_EMPTY, &uri, &success, NULL)); + if (success) { + g_hash_table_insert (priv->export_links, g_strdup (format), uri); + uri = NULL; + } + + json_reader_end_element (reader); + g_free (uri); + } + + return TRUE; + } + + return GDATA_PARSABLE_CLASS (gdata_documents_document_parent_class)->parse_json (parsable, reader, user_data, error); +} + +/** + * gdata_documents_document_new: + * @id: (allow-none): the entry's ID (not the document ID), or %NULL + * + * Creates a new #GDataDocumentsDocument with the given entry ID (#GDataEntry:id). + * + * Return value: (transfer full): a new #GDataDocumentsDocument, or %NULL; unref with g_object_unref() + * + * Since: 0.13.0 + */ +GDataDocumentsDocument * +gdata_documents_document_new (const gchar *id) +{ + return GDATA_DOCUMENTS_DOCUMENT (g_object_new (GDATA_TYPE_DOCUMENTS_DOCUMENT, "id", id, NULL)); +} + +/** + * gdata_documents_document_download: + * @self: a #GDataDocumentsDocument + * @service: a #GDataDocumentsService + * @export_format: the format in which the document should be exported + * @cancellable: (allow-none): a #GCancellable for the entire download stream, or %NULL + * @error: a #GError, or %NULL + * + * Downloads and returns the document file represented by the #GDataDocumentsDocument. If the document doesn't exist, %NULL is returned, but no error + * is set in @error. + * + * @export_format should be the file extension of the desired output format for the document, from the list accepted by Google Documents. For example: + * %GDATA_DOCUMENTS_PRESENTATION_PDF, %GDATA_DOCUMENTS_SPREADSHEET_ODS or %GDATA_DOCUMENTS_TEXT_ODT. + * + * If @self is a #GDataDocumentsSpreadsheet, only the first grid, or sheet, in the spreadsheet will be downloaded for some export formats. To download + * a specific a specific grid, use gdata_documents_spreadsheet_get_download_uri() with #GDataDownloadStream to download the grid manually. See the + * GData protocol + * specification for more information. + * + * To get the content type of the downloaded file, gdata_download_stream_get_content_type() can be called on the returned #GDataDownloadStream. + * Calling gdata_download_stream_get_content_length() on the stream will not return a meaningful result, however, as the stream is encoded in chunks, + * rather than by content length. + * + * In order to cancel the download, a #GCancellable passed in to @cancellable must be cancelled using g_cancellable_cancel(). Cancelling the individual + * #GInputStream operations on the #GDataDownloadStream will not cancel the entire download; merely the read or close operation in question. See the + * #GDataDownloadStream:cancellable for more details. + * + * If the given @export_format is unrecognised or not supported for this document, %GDATA_SERVICE_ERROR_NOT_FOUND will be returned. + * + * If @service isn't authenticated, a %GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED will be returned. + * + * If there is an error getting the document, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. + * + * Return value: (transfer full): a #GDataDownloadStream to download the document with, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataDownloadStream * +gdata_documents_document_download (GDataDocumentsDocument *self, GDataDocumentsService *service, const gchar *export_format, GCancellable *cancellable, + GError **error) +{ + gchar *download_uri; + GDataAuthorizationDomain *domain; + GDataDownloadStream *download_stream; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_DOCUMENT (self), NULL); + g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL); + g_return_val_if_fail (export_format != NULL && *export_format != '\0', NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* If we're downloading a spreadsheet we have to use a different authorization domain. */ + if (GDATA_IS_DOCUMENTS_SPREADSHEET (self)) { + domain = gdata_documents_service_get_spreadsheet_authorization_domain (); + } else { + domain = gdata_documents_service_get_primary_authorization_domain (); + } + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (service)), domain) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to download documents.")); + return NULL; + } + + /* Get the download URI and create a stream for it */ + download_uri = gdata_documents_document_get_download_uri (self, export_format); + + if (download_uri == NULL) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NOT_FOUND, + _("Unknown or unsupported document export format ‘%s’."), export_format); + return NULL; + } + + download_stream = GDATA_DOWNLOAD_STREAM (gdata_download_stream_new (GDATA_SERVICE (service), domain, download_uri, cancellable)); + g_free (download_uri); + + return download_stream; +} + +/** + * gdata_documents_document_get_download_uri: + * @self: a #GDataDocumentsDocument + * @export_format: the format in which the document should be exported when downloaded + * + * Builds and returns the download URI for the given #GDataDocumentsDocument in the desired format. Note that directly downloading the document using + * this URI isn't possible, as authentication is required. You should instead use gdata_download_stream_new() with the URI, and use the resulting + * #GInputStream. + * + * @export_format should be the file extension of the desired output format for the document, from the list accepted by Google Documents. For example: + * %GDATA_DOCUMENTS_PRESENTATION_PDF, %GDATA_DOCUMENTS_SPREADSHEET_ODS or %GDATA_DOCUMENTS_TEXT_ODT. + * + * If the @export_format is not recognised or not supported for this document, %NULL is returned. + * + * Return value: (nullable): the download URI, or %NULL; free with g_free() + * + * Since: 0.7.0 + */ +gchar * +gdata_documents_document_get_download_uri (GDataDocumentsDocument *self, const gchar *export_format) +{ + const gchar *format; + const gchar *mime_type; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_DOCUMENT (self), NULL); + g_return_val_if_fail (export_format != NULL && *export_format != '\0', NULL); + + if (g_strcmp0 (export_format, "html") == 0) + format = "text/html"; + else if (g_strcmp0 (export_format, "jpeg") == 0) + format = "image/jpeg"; + else if (g_strcmp0 (export_format, "pdf") == 0) + format = "application/pdf"; + else if (g_strcmp0 (export_format, "png") == 0) + format = "image/png"; + else if (g_strcmp0 (export_format, "txt") == 0) + format = "text/plain"; + else if (g_strcmp0 (export_format, GDATA_DOCUMENTS_DRAWING_SVG) == 0) + format = "image/svg+xml"; + else if (g_strcmp0 (export_format, GDATA_DOCUMENTS_PRESENTATION_PPT) == 0) + format = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; + else if (g_strcmp0 (export_format, GDATA_DOCUMENTS_SPREADSHEET_CSV) == 0) + format = "text/csv"; + else if (g_strcmp0 (export_format, GDATA_DOCUMENTS_SPREADSHEET_ODS) == 0) + format = "application/x-vnd.oasis.opendocument.spreadsheet"; + else if (g_strcmp0 (export_format, GDATA_DOCUMENTS_SPREADSHEET_XLS) == 0) + format = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + else if (g_strcmp0 (export_format, GDATA_DOCUMENTS_TEXT_ODT) == 0) + format = "application/vnd.oasis.opendocument.text"; + else if (g_strcmp0 (export_format, GDATA_DOCUMENTS_TEXT_RTF) == 0) + format = "application/rtf"; + else + format = export_format; + + /* We use the exportLinks JSON member to do the format conversion during download. Unfortunately, there + * won't be any hits if the export format matches the original MIME type. We resort to downloadUrl in + * those cases. + */ + mime_type = gdata_documents_utils_get_content_type (GDATA_DOCUMENTS_ENTRY (self)); + if (g_content_type_equals (mime_type, format)) + return g_strdup (gdata_entry_get_content_uri (GDATA_ENTRY (self))); + + return g_strdup (g_hash_table_lookup (self->priv->export_links, format)); +} + +/** + * gdata_documents_document_get_thumbnail_uri: + * @self: a #GDataDocumentsDocument + * + * Gets the URI of the thumbnail for the #GDataDocumentsDocument. If no thumbnail exists for the document, %NULL will be returned. + * + * The thumbnail may then be downloaded using a #GDataDownloadStream. + * + * + * Downloading a Document Thumbnail + * + * GDataDocumentsService *service; + * const gchar *thumbnail_uri; + * GCancellable *cancellable; + * GdkPixbuf *pixbuf; + * GError *error = NULL; + * + * service = get_my_documents_service (); + * thumbnail_uri = gdata_documents_document_get_thumbnail_uri (my_document); + * cancellable = g_cancellable_new (); + * + * /* Prepare a download stream */ + * download_stream = GDATA_DOWNLOAD_STREAM (gdata_download_stream_new (GDATA_SERVICE (service), NULL, thumbnail_uri, cancellable)); + * + * /* Download into a new GdkPixbuf. This can be cancelled using 'cancellable'. */ + * pixbuf = gdk_pixbuf_new_from_stream (G_INPUT_STREAM (download_stream), NULL, &error); + * + * if (error != NULL) { + * /* Handle the error. */ + * g_error_free (error); + * } + * + * g_object_unref (download_stream); + * g_object_unref (cancellable); + * + * /* Do something with the GdkPixbuf. */ + * + * g_object_unref (pixbuf); + * + * + * + * Return value: (allow-none): the URI of the document's thumbnail, or %NULL + * + * Since: 0.13.1 + */ +const gchar * +gdata_documents_document_get_thumbnail_uri (GDataDocumentsDocument *self) +{ + GDataLink *thumbnail_link; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_DOCUMENT (self), NULL); + + /* Get the thumbnail URI (if it exists). */ + thumbnail_link = gdata_entry_look_up_link (GDATA_ENTRY (self), "http://schemas.google.com/docs/2007/thumbnail"); + + if (thumbnail_link == NULL) { + return NULL; + } + + return gdata_link_get_uri (thumbnail_link); +} diff --git a/gdata/services/documents/gdata-documents-document.h b/gdata/services/documents/gdata-documents-document.h new file mode 100644 index 0000000..675d56d --- /dev/null +++ b/gdata/services/documents/gdata-documents-document.h @@ -0,0 +1,84 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_DOCUMENT_H +#define GDATA_DOCUMENTS_DOCUMENT_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_DOCUMENTS_DOCUMENT (gdata_documents_document_get_type ()) +#define GDATA_DOCUMENTS_DOCUMENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_DOCUMENT, GDataDocumentsDocument)) +#define GDATA_DOCUMENTS_DOCUMENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_DOCUMENT, GDataDocumentsDocumentClass)) +#define GDATA_IS_DOCUMENTS_DOCUMENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_DOCUMENT)) +#define GDATA_IS_DOCUMENTS_DOCUMENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_DOCUMENT)) +#define GDATA_DOCUMENTS_DOCUMENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_DOCUMENT, GDataDocumentsDocumentClass)) + +typedef struct _GDataDocumentsDocumentPrivate GDataDocumentsDocumentPrivate; + +/** + * GDataDocumentsDocument: + * + * All the fields in the #GDataDocumentsDocument structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataDocumentsEntry parent; + GDataDocumentsDocumentPrivate *priv; +} GDataDocumentsDocument; + +/** + * GDataDocumentsDocumentClass: + * + * All the fields in the #GDataDocumentsDocumentClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataDocumentsEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsDocumentClass; + +GType gdata_documents_document_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsDocument, g_object_unref) + +GDataDocumentsDocument *gdata_documents_document_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +#include + +GDataDownloadStream *gdata_documents_document_download (GDataDocumentsDocument *self, GDataDocumentsService *service, const gchar *export_format, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +gchar *gdata_documents_document_get_download_uri (GDataDocumentsDocument *self, const gchar *export_format) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_documents_document_get_thumbnail_uri (GDataDocumentsDocument *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_DOCUMENT_H */ diff --git a/gdata/services/documents/gdata-documents-drawing.c b/gdata/services/documents/gdata-documents-drawing.c new file mode 100644 index 0000000..4e0423d --- /dev/null +++ b/gdata/services/documents/gdata-documents-drawing.c @@ -0,0 +1,88 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Cosimo Cecchi 2012 + * Copyright (C) Red Hat, Inc. 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-drawing + * @short_description: GData Documents drawing object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-drawing.h + * + * #GDataDocumentsDrawing is a subclass of #GDataDocumentsDocument to represent a drawing document from Google Documents. + * + * For more details of Google Drive's GData API, see the + * online documentation. + * + * Since: 0.13.1 + */ + +#include +#include + +#include "gdata-documents-drawing.h" +#include "gdata-documents-utils.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_documents_drawing_constructed (GObject *object); + +G_DEFINE_TYPE (GDataDocumentsDrawing, gdata_documents_drawing, GDATA_TYPE_DOCUMENTS_DOCUMENT) + +static void +gdata_documents_drawing_class_init (GDataDocumentsDrawingClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + gobject_class->constructed = gdata_documents_drawing_constructed; + entry_class->kind_term = "http://schemas.google.com/docs/2007#drawing"; +} + +static void +gdata_documents_drawing_init (GDataDocumentsDrawing *self) +{ + /* Why am I writing it? */ +} + +static void +gdata_documents_drawing_constructed (GObject *object) +{ + G_OBJECT_CLASS (gdata_documents_drawing_parent_class)->constructed (object); + + if (!_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object))) + gdata_documents_utils_add_content_type (GDATA_DOCUMENTS_ENTRY (object), "application/vnd.google-apps.drawing"); +} + +/** + * gdata_documents_drawing_new: + * @id: (allow-none): the entry's ID (not the document ID of the drawing document), or %NULL + * + * Creates a new #GDataDocumentsDrawing with the given entry ID (#GDataEntry:id). + * + * Return value: (transfer full): a new #GDataDocumentsDrawing, or %NULL; unref with g_object_unref() + * + * Since: 0.13.1 + */ +GDataDocumentsDrawing * +gdata_documents_drawing_new (const gchar *id) +{ + return GDATA_DOCUMENTS_DRAWING (g_object_new (GDATA_TYPE_DOCUMENTS_DRAWING, "id", id, NULL)); +} diff --git a/gdata/services/documents/gdata-documents-drawing.h b/gdata/services/documents/gdata-documents-drawing.h new file mode 100644 index 0000000..d3e2014 --- /dev/null +++ b/gdata/services/documents/gdata-documents-drawing.h @@ -0,0 +1,130 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Cosimo Cecchi 2012 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_DRAWING_H +#define GDATA_DOCUMENTS_DRAWING_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_DOCUMENTS_DRAWING_JPEG: + * + * The export format for JPEG image format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.13.1 + */ +#define GDATA_DOCUMENTS_DRAWING_JPEG "jpeg" + +/** + * GDATA_DOCUMENTS_DRAWING_PDF: + * + * The export format for Portable Document Format (PDF). + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.13.1 + */ +#define GDATA_DOCUMENTS_DRAWING_PDF "pdf" + +/** + * GDATA_DOCUMENTS_DRAWING_PNG: + * + * The export format for Portable Network Graphics (PNG) image format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.13.1 + */ +#define GDATA_DOCUMENTS_DRAWING_PNG "png" + +/** + * GDATA_DOCUMENTS_DRAWING_SVG: + * + * The export format for Scalable Vector Graphics (SVG) image format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.13.1 + */ +#define GDATA_DOCUMENTS_DRAWING_SVG "svg" + + +#define GDATA_TYPE_DOCUMENTS_DRAWING (gdata_documents_drawing_get_type ()) +#define GDATA_DOCUMENTS_DRAWING(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_DRAWING, GDataDocumentsDrawing)) +#define GDATA_DOCUMENTS_DRAWING_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_DRAWING, GDataDocumentsDrawingClass)) +#define GDATA_IS_DOCUMENTS_DRAWING(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_DRAWING)) +#define GDATA_IS_DOCUMENTS_DRAWING_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_DRAWING)) +#define GDATA_DOCUMENTS_DRAWING_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_DRAWING, GDataDocumentsDrawingClass)) + +typedef struct _GDataDocumentsDrawingPrivate GDataDocumentsDrawingPrivate; + +/** + * GDataDocumentsDrawing: + * + * All the fields in the #GDataDocumentsDrawing structure are private and should never be accessed directly. + * + * Since: 0.13.1 + */ +typedef struct { + GDataDocumentsDocument parent; + GDataDocumentsDrawingPrivate *priv; +} GDataDocumentsDrawing; + +/** + * GDataDocumentsDrawingClass: + * + * All the fields in the #GDataDocumentsDrawingClass structure are private and should never be accessed directly. + * + * Since: 0.13.1 + */ +typedef struct { + /*< private >*/ + GDataDocumentsDocumentClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsDrawingClass; + +GType gdata_documents_drawing_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsDrawing, g_object_unref) + +GDataDocumentsDrawing *gdata_documents_drawing_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_DRAWING_H */ diff --git a/gdata/services/documents/gdata-documents-entry.c b/gdata/services/documents/gdata-documents-entry.c new file mode 100644 index 0000000..5b10964 --- /dev/null +++ b/gdata/services/documents/gdata-documents-entry.c @@ -0,0 +1,1147 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Red Hat, Inc. 2015, 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-entry + * @short_description: GData document object abstract class + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-entry.h + * + * #GDataDocumentsEntry is a subclass of #GDataEntry to represent a Google Drive entry, which is then further subclassed + * to give specific document types. + * + * #GDataDocumentsEntry implements #GDataAccessHandler, meaning the access rules to it can be modified using that interface. As well as the + * access roles defined for the base #GDataAccessRule (e.g. %GDATA_ACCESS_ROLE_NONE), #GDataDocumentsEntry has its own, such as + * %GDATA_DOCUMENTS_ACCESS_ROLE_OWNER and %GDATA_DOCUMENTS_ACCESS_ROLE_READER. + * + * Documents can (confusingly) be referenced by three different types of IDs: their entry ID, their resource ID and their document ID (untyped resource + * ID). Each is a substring of the previous ones (i.e. the entry ID contains the resource ID, which in turn contains the document ID). The resource ID + * and document ID should almost always be considered as internal, and thus entry IDs (#GDataEntry:id) should normally be used to uniquely identify + * documents. For more information, see #GDataDocumentsEntry:resource-id. + * + * For more details of Google Drive's GData API, see the + * online documentation. + * + * + * Moving an Entry Between Folders + * + * GDataDocumentsService *service; + * GDataDocumentsEntry *entry, *intermediate_entry, *updated_entry; + * GDataDocumentsFolder *old_folder, *new_folder; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_documents_service (); + * + * /* Get the entry, the folder it's being moved out of, and the folder it's being moved into. The entry can either be a document or + * * another folder, allowing hierarchies of folders to be constructed. */ + * entry = query_user_for_entry (service); + * old_folder = query_user_for_old_folder (service); + * new_folder = query_user_for_new_folder (service); + * + * /* Add the entry to the new folder */ + * intermediate_entry = gdata_documents_service_add_entry_to_folder (service, entry, new_folder, NULL, &error); + * + * g_object_unref (entry); + * g_object_unref (new_folder); + * + * if (error != NULL) { + * g_error ("Error adding entry to new folder: %s", error->message); + * g_error_free (error); + * g_object_unref (old_folder); + * g_object_unref (service); + * return; + * } + * + * /* Remove the entry from the old folder */ + * updated_entry = gdata_documents_service_remove_entry_from_folder (service, intermediate_entry, old_folder, NULL, &error); + * + * g_object_unref (intermediate_entry); + * g_object_unref (old_folder); + * g_object_unref (service); + * + * if (error != NULL) { + * /* Note that you might want to attempt to remove the intermediate_entry from the new_folder in this error case, so that + * * the operation is aborted cleanly. */ + * g_error ("Error removing entry from previous folder: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Do something with the updated entry */ + * + * g_object_unref (updated_entry); + * + * + * + * Since: 0.4.0 + */ + +#include +#include +#include + +#include "gdata-documents-entry.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-private.h" +#include "gdata-access-handler.h" +#include "gdata-documents-access-rule.h" +#include "gdata-documents-service.h" + +#include "gdata-documents-spreadsheet.h" +#include "gdata-documents-presentation.h" +#include "gdata-documents-text.h" +#include "gdata-documents-folder.h" +#include "gdata-documents-utils.h" + +static void gdata_documents_entry_access_handler_init (GDataAccessHandlerIface *iface); +static void gdata_documents_entry_finalize (GObject *object); +static void gdata_entry_dispose (GObject *object); +static const gchar *get_content_type (void); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); +static void gdata_documents_entry_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_documents_entry_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static gboolean post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error); +static void get_json (GDataParsable *parsable, JsonBuilder *builder); +static gchar *get_entry_uri (const gchar *id); + +struct _GDataDocumentsEntryPrivate { + gint64 last_viewed; + gchar *resource_id; + gboolean writers_can_invite; + gboolean is_deleted; + GDataAuthor *last_modified_by; + goffset quota_used; /* bytes */ + goffset file_size; /* bytes */ +}; + +enum { + PROP_EDITED = 1, + PROP_LAST_VIEWED, + PROP_DOCUMENT_ID, + PROP_LAST_MODIFIED_BY, + PROP_IS_DELETED, + PROP_WRITERS_CAN_INVITE, + PROP_RESOURCE_ID, + PROP_QUOTA_USED, + PROP_FILE_SIZE, +}; + +G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GDataDocumentsEntry, gdata_documents_entry, GDATA_TYPE_ENTRY, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_ACCESS_HANDLER, gdata_documents_entry_access_handler_init)) + +static void +gdata_documents_entry_class_init (GDataDocumentsEntryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataDocumentsEntryPrivate)); + + gobject_class->get_property = gdata_documents_entry_get_property; + gobject_class->set_property = gdata_documents_entry_set_property; + gobject_class->finalize = gdata_documents_entry_finalize; + gobject_class->dispose = gdata_entry_dispose; + + parsable_class->parse_json = parse_json; + parsable_class->post_parse_json = post_parse_json; + parsable_class->get_content_type = get_content_type; + parsable_class->get_json = get_json; + parsable_class->get_namespaces = get_namespaces; + + entry_class->get_entry_uri = get_entry_uri; + + /** + * GDataDocumentsEntry:edited: + * + * The last time the document was edited. If the document has not been edited yet, the content indicates the time it was created. + * + * Since: 0.4.0 + * Deprecated: 0.17.0: This is identical to #GDataEntry:updated. + */ + g_object_class_install_property (gobject_class, PROP_EDITED, + g_param_spec_int64 ("edited", + "Edited", "The last time the document was edited.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED)); + + /** + * GDataDocumentsEntry:last-viewed: + * + * The last time the document was viewed. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LAST_VIEWED, + g_param_spec_int64 ("last-viewed", + "Last viewed", "The last time the document was viewed.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsEntry:writers-can-invite: + * + * Indicates whether the document entry writers can invite others to edit the document. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_WRITERS_CAN_INVITE, + g_param_spec_boolean ("writers-can-invite", + "Writers can invite?", "Indicates whether writers can invite others to edit.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsEntry:is-deleted: + * + * Indicates whether the document entry has been deleted (moved to the trash). Deleted documents will only + * appear in query results if the #GDataDocumentsQuery:show-deleted property is %TRUE. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_DELETED, + g_param_spec_boolean ("is-deleted", + "Deleted?", "Indicates whether the document entry has been deleted.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsEntry:resource-id: + * + * The resource ID of the document. This should not normally need to be used in client code, and is mostly for internal use. To uniquely + * identify a given document or folder, use its #GDataEntry:id. + * + * Resource IDs have the form: + * document|drawing|pdf|spreadsheet|presentation|folder:untyped resource ID; whereas + * entry IDs have the form: + * https://docs.google.com/feeds/id/resource ID in version 3 of the API. + * + * For more information, see the + * Google Documents + * API reference. + * + * Since: 0.11.0 + */ + g_object_class_install_property (gobject_class, PROP_RESOURCE_ID, + g_param_spec_string ("resource-id", + "Resource ID", "The resource ID of the document.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsEntry:document-id: + * + * The document ID of the document, which is different from its entry ID (GDataEntry:id). The + * online GData + * Documentation refers to these as “untyped resource IDs”. + * + * Since: 0.4.0 + * Deprecated: 0.11.0: This a substring of the #GDataDocumentsEntry:resource-id, which is more general and should be used instead. + */ + g_object_class_install_property (gobject_class, PROP_DOCUMENT_ID, + g_param_spec_string ("document-id", + "Document ID", "The document ID of the document.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED)); + + /** + * GDataDocumentsEntry:last-modified-by: + * + * Indicates the author of the last modification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LAST_MODIFIED_BY, + g_param_spec_object ("last-modified-by", + "Last modified by", "Indicates the author of the last modification.", + GDATA_TYPE_AUTHOR, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsEntry:quota-used: + * + * The amount of user quota the document is occupying. Currently, only arbitrary files consume file space quota (whereas standard document + * formats, such as #GDataDocumentsText, #GDataDocumentsSpreadsheet and #GDataDocumentsFolder don't). Measured in bytes. + * + * This property will be 0 for documents which aren't consuming any quota. + * + * Since: 0.13.0 + */ + g_object_class_install_property (gobject_class, PROP_QUOTA_USED, + g_param_spec_int64 ("quota-used", + "Quota used", "The amount of user quota the document is occupying.", + 0, G_MAXINT64, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsEntry:file-size: + * + * The size of the document. This is only set for non-document files. + * Standard formats, such as #GDataDocumentsText, + * #GDataDocumentsSpreadsheet and #GDataDocumentsFolder are not binary + * data and so have no size. Measured in bytes. + * + * Since: 0.17.7 + */ + g_object_class_install_property (gobject_class, PROP_FILE_SIZE, + g_param_spec_int64 ("file-size", + "File size", "The size of the document.", + 0, G_MAXINT64, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static gboolean +is_owner_rule (GDataAccessRule *rule) +{ + return (strcmp (gdata_access_rule_get_role (rule), GDATA_DOCUMENTS_ACCESS_ROLE_OWNER) == 0) ? TRUE : FALSE; +} + +static GDataAuthorizationDomain * +get_authorization_domain (GDataAccessHandler *self) +{ + return gdata_documents_service_get_primary_authorization_domain (); +} + +static GDataFeed * +get_rules (GDataAccessHandler *self, + GDataService *service, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, + gpointer progress_user_data, + GError **error) +{ + GDataAccessHandlerIface *iface; + GDataAuthorizationDomain *domain = NULL; + GDataFeed *feed; + GDataLink *_link; + SoupMessage *message; + + _link = gdata_entry_look_up_link (GDATA_ENTRY (self), GDATA_LINK_ACCESS_CONTROL_LIST); + g_assert (_link != NULL); + + iface = GDATA_ACCESS_HANDLER_GET_IFACE (self); + if (iface->get_authorization_domain != NULL) { + domain = iface->get_authorization_domain (self); + } + + message = _gdata_service_query (service, domain, gdata_link_get_uri (_link), NULL, cancellable, error); + if (message == NULL) { + return NULL; + } + + g_assert (message->response_body->data != NULL); + + feed = _gdata_feed_new_from_json (GDATA_TYPE_FEED, message->response_body->data, message->response_body->length, GDATA_TYPE_DOCUMENTS_ACCESS_RULE, + progress_callback, progress_user_data, error); + + g_object_unref (message); + + return feed; +} + +static void +gdata_documents_entry_access_handler_init (GDataAccessHandlerIface *iface) +{ + iface->is_owner_rule = is_owner_rule; + iface->get_authorization_domain = get_authorization_domain; + iface->get_rules = get_rules; +} + +static void +gdata_documents_entry_init (GDataDocumentsEntry *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_DOCUMENTS_ENTRY, GDataDocumentsEntryPrivate); + self->priv->last_viewed = -1; +} + +static void +gdata_entry_dispose (GObject *object) +{ + GDataDocumentsEntryPrivate *priv = GDATA_DOCUMENTS_ENTRY (object)->priv; + + if (priv->last_modified_by != NULL) + g_object_unref (priv->last_modified_by); + priv->last_modified_by = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_documents_entry_parent_class)->dispose (object); +} + +static void +gdata_documents_entry_finalize (GObject *object) +{ + GDataDocumentsEntryPrivate *priv = GDATA_DOCUMENTS_ENTRY (object)->priv; + + g_free (priv->resource_id); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_documents_entry_parent_class)->finalize (object); +} + +static void +gdata_documents_entry_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataDocumentsEntryPrivate *priv = GDATA_DOCUMENTS_ENTRY (object)->priv; + + switch (property_id) { + case PROP_RESOURCE_ID: + g_value_set_string (value, priv->resource_id); + break; + case PROP_DOCUMENT_ID: + g_value_set_string (value, gdata_entry_get_id (GDATA_ENTRY (object))); + break; + case PROP_WRITERS_CAN_INVITE: + g_value_set_boolean (value, priv->writers_can_invite); + break; + case PROP_IS_DELETED: + g_value_set_boolean (value, priv->is_deleted); + break; + case PROP_EDITED: + g_value_set_int64 (value, gdata_entry_get_updated (GDATA_ENTRY (object))); + break; + case PROP_LAST_VIEWED: + g_value_set_int64 (value, priv->last_viewed); + break; + case PROP_LAST_MODIFIED_BY: + g_value_set_object (value, priv->last_modified_by); + break; + case PROP_QUOTA_USED: + g_value_set_int64 (value, priv->quota_used); + break; + case PROP_FILE_SIZE: + g_value_set_int64 (value, priv->file_size); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_documents_entry_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataDocumentsEntry *self = GDATA_DOCUMENTS_ENTRY (object); + + switch (property_id) { + case PROP_WRITERS_CAN_INVITE: + gdata_documents_entry_set_writers_can_invite (self, g_value_get_boolean (value)); + break; + case PROP_QUOTA_USED: + case PROP_FILE_SIZE: + /* Read only. */ + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +get_kind_email_and_name (JsonReader *reader, gchar **out_kind, gchar **out_email, gchar **out_name, GError **error) +{ + GError *child_error = NULL; + gboolean success; + gchar *email = NULL; + gchar *kind = NULL; + gchar *name = NULL; + guint i, members; + + for (i = 0, members = (guint) json_reader_count_members (reader); i < members; i++) { + json_reader_read_element (reader, i); + + if (gdata_parser_string_from_json_member (reader, "kind", P_REQUIRED | P_NON_EMPTY, &kind, &success, &child_error) == TRUE) { + if (!success && child_error != NULL) { + g_propagate_prefixed_error (error, child_error, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Failed to find ‘kind’."); + json_reader_end_element (reader); + goto out; + } + } + + if (gdata_parser_string_from_json_member (reader, "displayName", P_REQUIRED | P_NON_EMPTY, &name, &success, &child_error) == TRUE) { + if (!success && child_error != NULL) { + g_propagate_prefixed_error (error, child_error, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Failed to find ‘displayName’."); + json_reader_end_element (reader); + goto out; + } + } + + if (gdata_parser_string_from_json_member (reader, "emailAddress", P_DEFAULT, &email, &success, &child_error) == TRUE) { + if (!success && child_error != NULL) { + g_propagate_prefixed_error (error, child_error, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Failed to find ‘emailAddress’."); + json_reader_end_element (reader); + goto out; + } + } + + json_reader_end_element (reader); + } + + if (out_kind != NULL) { + *out_kind = kind; + kind = NULL; + } + + if (out_email != NULL) { + *out_email = email; + email = NULL; + } + + if (out_name != NULL) { + *out_name = name; + name = NULL; + } + + out: + g_free (kind); + g_free (email); + g_free (name); +} + +static void +get_kind_and_parent_link (JsonReader *reader, gchar **out_kind, gchar **out_parent_link, GError **error) +{ + GError *child_error = NULL; + gboolean success; + gchar *kind = NULL; + gchar *parent_link = NULL; + guint i, members; + + for (i = 0, members = (guint) json_reader_count_members (reader); i < members; i++) { + json_reader_read_element (reader, i); + + if (gdata_parser_string_from_json_member (reader, "kind", P_REQUIRED | P_NON_EMPTY, &kind, &success, &child_error) == TRUE) { + if (!success && child_error != NULL) { + g_propagate_prefixed_error (error, child_error, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Failed to find ‘kind’."); + json_reader_end_element (reader); + goto out; + } + } + + if (gdata_parser_string_from_json_member (reader, "parentLink", P_REQUIRED | P_NON_EMPTY, &parent_link, &success, &child_error) == TRUE) { + if (!success && child_error != NULL) { + g_propagate_prefixed_error (error, child_error, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Failed to find ‘parentLink’."); + json_reader_end_element (reader); + goto out; + } + } + + json_reader_end_element (reader); + } + + if (out_kind != NULL) { + *out_kind = kind; + kind = NULL; + } + + if (out_parent_link != NULL) { + *out_parent_link = parent_link; + parent_link = NULL; + } + + out: + g_free (kind); + g_free (parent_link); +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataDocumentsEntryPrivate *priv = GDATA_DOCUMENTS_ENTRY (parsable)->priv; + GDataCategory *category; + GError *child_error = NULL; + gboolean shared; + gboolean success = TRUE; + gchar *alternate_uri = NULL; + gchar *kind = NULL; + gchar *mime_type = NULL; + gchar *quota_used = NULL; + gchar *file_size = NULL; + gint64 published; + gint64 updated; + + /* JSON format: https://developers.google.com/drive/v2/reference/files */ + + if (gdata_parser_string_from_json_member (reader, "alternateLink", P_DEFAULT, &alternate_uri, &success, error) == TRUE) { + if (success && alternate_uri != NULL && alternate_uri[0] != '\0') { + GDataLink *_link; + + _link = gdata_link_new (alternate_uri, GDATA_LINK_ALTERNATE); + gdata_entry_add_link (GDATA_ENTRY (parsable), _link); + g_object_unref (_link); + } + + g_free (alternate_uri); + return success; + } else if (gdata_parser_string_from_json_member (reader, "mimeType", P_DEFAULT, &mime_type, &success, error) == TRUE) { + if (success) + gdata_documents_utils_add_content_type (GDATA_DOCUMENTS_ENTRY (parsable), mime_type); + g_free (mime_type); + return success; + } else if (gdata_parser_int64_time_from_json_member (reader, "lastViewedByMeDate", P_DEFAULT, &(priv->last_viewed), &success, error) == TRUE || + gdata_parser_string_from_json_member (reader, "kind", P_REQUIRED | P_NON_EMPTY, &kind, &success, error) == TRUE) { + g_free (kind); + return success; + } else if (gdata_parser_int64_time_from_json_member (reader, "createdDate", P_DEFAULT, &published, &success, error) == TRUE) { + if (success) + _gdata_entry_set_published (GDATA_ENTRY (parsable), published); + return success; + } else if (gdata_parser_int64_time_from_json_member (reader, "modifiedDate", P_DEFAULT, &updated, &success, error) == TRUE) { + if (success) + _gdata_entry_set_updated (GDATA_ENTRY (parsable), updated); + return success; + } else if (gdata_parser_string_from_json_member (reader, "quotaBytesUsed", P_DEFAULT, "a_used, &success, error) == TRUE) { + gchar *end_ptr; + guint64 val; + + /* Even though ‘quotaBytesUsed’ is documented as long, + * it is actually a string in the JSON. + */ + val = g_ascii_strtoull (quota_used, &end_ptr, 10); + if (*end_ptr == '\0') + priv->quota_used = (goffset) val; + g_free (quota_used); + return success; + } else if (gdata_parser_string_from_json_member (reader, "fileSize", P_DEFAULT, &file_size, &success, error) == TRUE) { + gchar *end_ptr; + guint64 val; + + /* like 'quotaBytesUsed', 'fileSize' is also a string + * in the JSON. + */ + val = g_ascii_strtoull (file_size, &end_ptr, 10); + if (*end_ptr == '\0') + priv->file_size = (goffset) val; + g_free (file_size); + return success; + } else if (gdata_parser_boolean_from_json_member (reader, "shared", P_DEFAULT, &shared, &success, error) == TRUE) { + if (success && shared) { + category = gdata_category_new ("http://schemas.google.com/g/2005/labels#shared", GDATA_CATEGORY_SCHEMA_LABELS, "shared"); + gdata_entry_add_category (GDATA_ENTRY (parsable), category); + g_object_unref (category); + } + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "labels") == 0) { + guint i, members; + + if (json_reader_is_object (reader) == FALSE) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "JSON node ‘labels’ is not an object."); + return FALSE; + } + + for (i = 0, members = (guint) json_reader_count_members (reader); i < members; i++) { + gboolean starred; + gboolean viewed; + + json_reader_read_element (reader, i); + + gdata_parser_boolean_from_json_member (reader, "starred", P_DEFAULT, &starred, &success, NULL); + if (success && starred) { + category = gdata_category_new (GDATA_CATEGORY_SCHEMA_LABELS_STARRED, GDATA_CATEGORY_SCHEMA_LABELS, "starred"); + gdata_entry_add_category (GDATA_ENTRY (parsable), category); + g_object_unref (category); + } + + gdata_parser_boolean_from_json_member (reader, "viewed", P_DEFAULT, &viewed, &success, NULL); + if (success && viewed) { + category = gdata_category_new ("http://schemas.google.com/g/2005/labels#viewed", GDATA_CATEGORY_SCHEMA_LABELS, "viewed"); + gdata_entry_add_category (GDATA_ENTRY (parsable), category); + g_object_unref (category); + } + + json_reader_end_element (reader); + } + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "owners") == 0) { + guint i, elements; + + if (json_reader_is_array (reader) == FALSE) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "JSON node ‘owners’ is not an array."); + return FALSE; + } + + /* Loop through the elements array. */ + for (i = 0, elements = json_reader_count_elements (reader); success && i < elements; i++) { + gchar *email = NULL; + gchar *name = NULL; + + json_reader_read_element (reader, i); + + if (json_reader_is_object (reader) == FALSE) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "JSON node inside ‘owners’ is not an object."); + success = FALSE; + goto continue_owners; + } + + get_kind_email_and_name (reader, &kind, &email, &name, &child_error); + if (child_error != NULL) { + g_propagate_error (error, child_error); + success = FALSE; + goto continue_owners; + } + if (name == NULL || name[0] == '\0') { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Failed to find ‘displayName’."); + success = FALSE; + goto continue_owners; + } + + if (g_strcmp0 (kind, "drive#user") == 0) { + GDataAuthor *author; + + author = gdata_author_new (name, NULL, email); + gdata_entry_add_author (GDATA_ENTRY (parsable), author); + g_object_unref (author); + } else { + g_warning ("%s authors are not handled yet", kind); + } + + continue_owners: + g_free (email); + g_free (kind); + g_free (name); + json_reader_end_element (reader); + } + + return success; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "parents") == 0) { + guint i, elements; + + if (json_reader_is_array (reader) == FALSE) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "JSON node ‘parents’ is not an array."); + return FALSE; + } + + /* Loop through the elements array. */ + for (i = 0, elements = (guint) json_reader_count_elements (reader); success && i < elements; i++) { + GDataLink *_link = NULL; + const gchar *relation_type = NULL; + gchar *uri = NULL; + + json_reader_read_element (reader, i); + + if (json_reader_is_object (reader) == FALSE) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "JSON node inside ‘parents’ is not an object."); + success = FALSE; + goto continue_parents; + } + + get_kind_and_parent_link (reader, &kind, &uri, &child_error); + if (child_error != NULL) { + g_propagate_error (error, child_error); + success = FALSE; + goto continue_parents; + } + + if (g_strcmp0 (kind, "drive#parentReference") == 0) { + relation_type = GDATA_LINK_PARENT; + } else { + g_warning ("%s parents are not handled yet", kind); + } + + if (relation_type == NULL) + goto continue_parents; + + _link = gdata_link_new (uri, relation_type); + gdata_entry_add_link (GDATA_ENTRY (parsable), _link); + + continue_parents: + g_clear_object (&_link); + g_free (kind); + g_free (uri); + json_reader_end_element (reader); + } + + return success; + } + + return GDATA_PARSABLE_CLASS (gdata_documents_entry_parent_class)->parse_json (parsable, reader, user_data, error); +} + +static gboolean +post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataDocumentsEntryPrivate *priv = GDATA_DOCUMENTS_ENTRY (parsable)->priv; + GDataLink *_link; + const gchar *id; + gchar *uri; + + id = gdata_entry_get_id (GDATA_ENTRY (parsable)); + + /* gdata_access_handler_get_rules requires the presence of a GDATA_LINK_ACCESS_CONTROL_LIST link with the + * right URI. */ + uri = g_strconcat ("https://www.googleapis.com/drive/v2/files/", id, "/permissions", NULL); + _link = gdata_link_new (uri, GDATA_LINK_ACCESS_CONTROL_LIST); + gdata_entry_add_link (GDATA_ENTRY (parsable), _link); + g_free (uri); + g_object_unref (_link); + + /* Since the document-id is identical to GDataEntry:id, which is parsed by the parent class, we can't + * create the resource-id while parsing. */ + priv->resource_id = g_strconcat ("document:", id, NULL); + + return TRUE; +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + GList *i; + GList *parent_folders_list; + const gchar *mime_type; + + GDATA_PARSABLE_CLASS (gdata_documents_entry_parent_class)->get_json (parsable, builder); + + /* Inserting files: https://developers.google.com/drive/v2/reference/files/insert */ + + mime_type = gdata_documents_utils_get_content_type (GDATA_DOCUMENTS_ENTRY (parsable)); + if (mime_type != NULL) { + json_builder_set_member_name (builder, "mimeType"); + json_builder_add_string_value (builder, mime_type); + } + + /* Upload to a folder: https://developers.google.com/drive/v2/web/folder */ + + json_builder_set_member_name (builder, "parents"); + json_builder_begin_array (builder); + + parent_folders_list = gdata_entry_look_up_links (GDATA_ENTRY (parsable), GDATA_LINK_PARENT); + for (i = parent_folders_list; i != NULL; i = i->next) { + GDataLink *_link = GDATA_LINK (i->data); + const gchar *id; + + id = gdata_documents_utils_get_id_from_link (_link); + if (id != NULL) { + json_builder_begin_object (builder); + json_builder_set_member_name (builder, "kind"); + json_builder_add_string_value (builder, "drive#fileLink"); + json_builder_set_member_name (builder, "id"); + json_builder_add_string_value (builder, id); + json_builder_end_object (builder); + } + } + + json_builder_end_array (builder); + + g_list_free (parent_folders_list); + +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_documents_entry_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "docs", (gchar*) "http://schemas.google.com/docs/2007"); +} + +static gchar * +get_entry_uri (const gchar *id) +{ + return g_strconcat ("https://www.googleapis.com/drive/v2/files/", id, NULL); +} + +/** + * gdata_documents_entry_get_edited: + * @self: a #GDataDocumentsEntry + * + * Gets the #GDataDocumentsEntry:edited property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the document was last edited, or -1 + * + * Since: 0.4.0 + * Deprecated: 0.17.0: Use gdata_entry_get_updated() instead. See #GDataDocumentsEntry:edited. + */ +gint64 +gdata_documents_entry_get_edited (GDataDocumentsEntry *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), -1); + return gdata_entry_get_updated (GDATA_ENTRY (self)); +} + +/** + * gdata_documents_entry_get_last_viewed: + * @self: a #GDataDocumentsEntry + * + * Gets the #GDataDocumentsEntry:last-viewed property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the document was last viewed, or -1 + * + * Since: 0.4.0 + */ +gint64 +gdata_documents_entry_get_last_viewed (GDataDocumentsEntry *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), -1); + return self->priv->last_viewed; +} + +/** + * gdata_documents_entry_get_path: + * @self: a #GDataDocumentsEntry + * + * Builds a path for the #GDataDocumentsEntry, starting from a root node and traversing the folders containing the document, then ending with the + * document's ID. + * + * An example path would be: /folder_id1/folder_id2/document_id. + * + * Note: the path is based on the entry/document IDs of the folders (#GDataEntry:id) and document (#GDataDocumentsEntry:document-id), + * and not the entries' human-readable names (#GDataEntry:title). + * + * Return value: the folder hierarchy path containing the document, or %NULL; free with g_free() + * + * Since: 0.4.0 + */ +gchar * +gdata_documents_entry_get_path (GDataDocumentsEntry *self) +{ + GList *element, *parent_folders_list = NULL; + GString *path; + const gchar *id; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), NULL); + + path = g_string_new ("/"); + parent_folders_list = gdata_entry_look_up_links (GDATA_ENTRY (self), GDATA_LINK_PARENT); + + /* We check all the folders contained that are parents of the GDataDocumentsEntry */ + for (element = parent_folders_list; element != NULL; element = element->next) { + guint i; + gchar *folder_id = NULL; + gchar **link_href_cut = g_strsplit (gdata_link_get_uri (GDATA_LINK (element->data)), "/", 0); + + /* Extract the folder ID from the folder URI, which is of the form: + * http://docs.google.com/feeds/documents/private/full/folder%3Afolder_id + * We want the "folder_id" bit. */ + for (i = 0;; i++) { + gchar **path_cut = NULL; + + if (link_href_cut[i] == NULL) + break; + + path_cut = g_strsplit (link_href_cut[i], "%3A", 2); + if (*path_cut != NULL) { + if (strcmp (path_cut[0], "folder") == 0){ + folder_id = g_strdup (path_cut[1]); + g_strfreev (path_cut); + break; + } + } + g_strfreev (path_cut); + } + g_strfreev (link_href_cut); + g_assert (folder_id != NULL); + + /* Append the folder ID to our path */ + g_string_append (path, folder_id); + g_string_append_c (path, '/'); + g_free (folder_id); + } + + /* Append the entry ID */ + id = gdata_entry_get_id (GDATA_ENTRY (self)); + g_string_append (path, id); + + return g_string_free (path, FALSE); +} + +/** + * gdata_documents_entry_get_document_id: + * @self: a #GDataDocumentsEntry + * + * Gets the #GDataDocumentsEntry:document-id property. The + * online GData Documentation + * refers to these as “untyped resource IDs”. + * + * Return value: the document's document ID + * + * Since: 0.4.0 + * Deprecated: 0.11.0: Use gdata_documents_entry_get_resource_id() instead. See #GDataDocumentsEntry:document-id. + */ +const gchar * +gdata_documents_entry_get_document_id (GDataDocumentsEntry *self ) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), NULL); + return gdata_entry_get_id (GDATA_ENTRY (self)); +} + +/** + * gdata_documents_entry_get_resource_id: + * @self: a #GDataDocumentsEntry + * + * Gets the #GDataDocumentsEntry:resource-id property. + * + * Return value: the document's resource ID + * + * Since: 0.11.0 + */ +const gchar * +gdata_documents_entry_get_resource_id (GDataDocumentsEntry *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), NULL); + return self->priv->resource_id; +} + +/** + * gdata_documents_entry_set_writers_can_invite: + * @self: a #GDataDocumentsEntry + * @writers_can_invite: %TRUE if writers can invite other people to edit the document, %FALSE otherwise + * + * Sets the #GDataDocumentsEntry:writers-can-invite property to @writers_can_invite. + * + * Since: 0.4.0 + */ +void +gdata_documents_entry_set_writers_can_invite (GDataDocumentsEntry *self, gboolean writers_can_invite) +{ + g_return_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self)); + self->priv->writers_can_invite = writers_can_invite; + g_object_notify (G_OBJECT (self), "writers-can-invite"); +} + +/** + * gdata_documents_entry_writers_can_invite: + * @self: a #GDataDocumentsEntry + * + * Gets the #GDataDocumentsEntry:writers-can-invite property. + * + * Return value: %TRUE if writers can invite other people to edit the document, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_documents_entry_writers_can_invite (GDataDocumentsEntry *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self ), FALSE); + return self->priv->writers_can_invite; +} + +/** + * gdata_documents_entry_get_last_modified_by: + * @self: a #GDataDocumentsEntry + * + * Gets the #GDataDocumentsEntry:last-modified-by property. + * + * Return value: (transfer none): the author who last modified the document + * + * Since: 0.4.0 + */ +GDataAuthor * +gdata_documents_entry_get_last_modified_by (GDataDocumentsEntry *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), NULL); + return self->priv->last_modified_by; +} + +/** + * gdata_documents_entry_get_quota_used: + * @self: a #GDataDocumentsEntry + * + * Gets the #GDataDocumentsEntry:quota-used property. + * + * Return value: the number of quota bytes used by the document + * + * Since: 0.13.0 + */ +goffset +gdata_documents_entry_get_quota_used (GDataDocumentsEntry *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), 0); + + return self->priv->quota_used; +} + +/** + * gdata_documents_entry_get_file_size: + * @self: a #GDataDocumentsEntry + * + * Gets the #GDataDocumentsEntry:file-size property. + * + * Return value: the size of the document in bytes + * + * Since: 0.17.7 + */ +goffset +gdata_documents_entry_get_file_size (GDataDocumentsEntry *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), 0); + + return self->priv->file_size; +} + +/** + * gdata_documents_entry_is_deleted: + * @self: a #GDataDocumentsEntry + * + * Gets the #GDataDocumentsEntry:is-deleted property. + * + * Return value: %TRUE if the document has been deleted, %FALSE otherwise + * + * Since: 0.5.0 + */ +gboolean +gdata_documents_entry_is_deleted (GDataDocumentsEntry *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), FALSE); + return self->priv->is_deleted; +} diff --git a/gdata/services/documents/gdata-documents-entry.h b/gdata/services/documents/gdata-documents-entry.h new file mode 100644 index 0000000..07e05ab --- /dev/null +++ b/gdata/services/documents/gdata-documents-entry.h @@ -0,0 +1,124 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_ENTRY_H +#define GDATA_DOCUMENTS_ENTRY_H + +#include +#include + +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_DOCUMENTS_ACCESS_ROLE_OWNER: + * + * The users specified by the #GDataAccessRule have full owner access to the document. This allows them to modify the access rules and delete + * the document, amongst other things. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_ACCESS_ROLE_OWNER "owner" + +/** + * GDATA_DOCUMENTS_ACCESS_ROLE_WRITER: + * + * The users specified by the #GDataAccessRule have write access to the document. They cannot modify the access rules or delete the document. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_ACCESS_ROLE_WRITER "writer" + +/** + * GDATA_DOCUMENTS_ACCESS_ROLE_READER: + * + * The users specified by the #GDataAccessRule have read-only access to the document. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_ACCESS_ROLE_READER "reader" + +#define GDATA_TYPE_DOCUMENTS_ENTRY (gdata_documents_entry_get_type ()) +#define GDATA_DOCUMENTS_ENTRY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_ENTRY, GDataDocumentsEntry)) +#define GDATA_DOCUMENTS_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_ENTRY, GDataDocumentsEntryClass)) +#define GDATA_IS_DOCUMENTS_ENTRY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_ENTRY)) +#define GDATA_IS_DOCUMENTS_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_ENTRY)) +#define GDATA_DOCUMENTS_ENTRY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_ENTRY, GDataDocumentsEntryClass)) + +typedef struct _GDataDocumentsEntryPrivate GDataDocumentsEntryPrivate; + +/** + * GDataDocumentsEntry: + * + * All the fields in the #GDataDocumentsEntry structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataEntry parent; + GDataDocumentsEntryPrivate *priv; +} GDataDocumentsEntry; + +/** + * GDataDocumentsEntryClass: + * + * All the fields in the #GDataDocumentsEntryClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsEntryClass; + +GType gdata_documents_entry_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsEntry, g_object_unref) + +gchar *gdata_documents_entry_get_path (GDataDocumentsEntry *self) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_documents_entry_get_resource_id (GDataDocumentsEntry *self) G_GNUC_PURE; + +#ifndef LIBGDATA_DISABLE_DEPRECATED +const gchar *gdata_documents_entry_get_document_id (GDataDocumentsEntry *self) G_GNUC_PURE G_GNUC_DEPRECATED_FOR(gdata_documents_entry_get_resource_id); +gint64 gdata_documents_entry_get_edited (GDataDocumentsEntry *self) G_GNUC_DEPRECATED_FOR(gdata_entry_get_updated); +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +gint64 gdata_documents_entry_get_last_viewed (GDataDocumentsEntry *self); + +void gdata_documents_entry_set_writers_can_invite (GDataDocumentsEntry *self, gboolean writers_can_invite); +gboolean gdata_documents_entry_writers_can_invite (GDataDocumentsEntry *self) G_GNUC_PURE; + +GDataAuthor *gdata_documents_entry_get_last_modified_by (GDataDocumentsEntry *self) G_GNUC_PURE; + +goffset gdata_documents_entry_get_quota_used (GDataDocumentsEntry *self) G_GNUC_PURE; +goffset gdata_documents_entry_get_file_size (GDataDocumentsEntry *self) G_GNUC_PURE; + +gboolean gdata_documents_entry_is_deleted (GDataDocumentsEntry *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_ENTRY_H */ diff --git a/gdata/services/documents/gdata-documents-enums.c b/gdata/services/documents/gdata-documents-enums.c new file mode 100644 index 0000000..338b97c --- /dev/null +++ b/gdata/services/documents/gdata-documents-enums.c @@ -0,0 +1,28 @@ + + + +#include "gdata-documents-service.h" +#include "gdata-documents-text.h" +#include "gdata-documents-spreadsheet.h" +#include "gdata-documents-drawing.h" +#include "gdata-documents-pdf.h" +#include "gdata-documents-presentation.h" +#include "gdata-documents-enums.h" + +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/documents/gdata-documents-service.h" */ +GType +gdata_documents_service_error_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_DOCUMENTS_SERVICE_ERROR_INVALID_CONTENT_TYPE, "GDATA_DOCUMENTS_SERVICE_ERROR_INVALID_CONTENT_TYPE", "type" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataDocumentsServiceError", values); + } + return etype; +} + + + diff --git a/gdata/services/documents/gdata-documents-enums.h b/gdata/services/documents/gdata-documents-enums.h new file mode 100644 index 0000000..6ce840b --- /dev/null +++ b/gdata/services/documents/gdata-documents-enums.h @@ -0,0 +1,18 @@ + + + +#ifndef GDATA_DOCUMENTS_ENUMS_H +#define GDATA_DOCUMENTS_ENUMS_H + +#include + +G_BEGIN_DECLS +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/documents/gdata-documents-service.h" */ +GType gdata_documents_service_error_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_DATA_DOCUMENTS_SERVICE_ERROR (gdata_documents_service_error_get_type()) +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_ENUMS_H */ + + + diff --git a/gdata/services/documents/gdata-documents-feed.c b/gdata/services/documents/gdata-documents-feed.c new file mode 100644 index 0000000..3637097 --- /dev/null +++ b/gdata/services/documents/gdata-documents-feed.c @@ -0,0 +1,185 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Red Hat, Inc. 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-feed + * @short_description: GData documents feed object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-feed.h + * + * #GDataDocumentsFeed is a list of entries (#GDataDocumentsEntry subclasses) returned as the result of a query to a #GDataDocumentsService, + * or given as the input to another operation on the online service. + * + * Each #GDataDocumentsEntry represents a single object on the Google Documents online service, such as a text document, presentation document, + * spreadsheet document or a folder, and the #GDataDocumentsFeed represents a collection of those objects. + * + * Since: 0.4.0 + */ + +#include +#include +#include +#include + +#include "gdata-documents-feed.h" +#include "gdata-documents-utils.h" +#include "gdata-types.h" +#include "gdata-private.h" +#include "gdata-service.h" + +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); + +G_DEFINE_TYPE (GDataDocumentsFeed, gdata_documents_feed, GDATA_TYPE_FEED) + +static void +gdata_documents_feed_class_init (GDataDocumentsFeedClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + parsable_class->parse_json = parse_json; +} + +static void +gdata_documents_feed_init (GDataDocumentsFeed *self) +{ + /* Why am I writing it? */ +} + +static void +get_kind_and_mime_type (JsonReader *reader, gchar **out_kind, gchar **out_mime_type, GError **error) +{ + GError *child_error = NULL; + gboolean success; + gchar *kind = NULL; + gchar *mime_type = NULL; + guint i, members; + + for (i = 0, members = (guint) json_reader_count_members (reader); i < members; i++) { + json_reader_read_element (reader, i); + + if (gdata_parser_string_from_json_member (reader, "kind", P_REQUIRED | P_NON_EMPTY, &kind, &success, &child_error) == TRUE) { + if (!success && child_error != NULL) { + g_propagate_prefixed_error (error, child_error, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Failed to find ‘kind’."); + json_reader_end_element (reader); + goto out; + } + } + + if (gdata_parser_string_from_json_member (reader, "mimeType", P_DEFAULT, &mime_type, &success, &child_error) == TRUE) { + if (!success && child_error != NULL) { + g_propagate_prefixed_error (error, child_error, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "Failed to find ‘mimeType’."); + json_reader_end_element (reader); + goto out; + } + } + + json_reader_end_element (reader); + } + + if (out_kind != NULL) { + *out_kind = kind; + kind = NULL; + } + + if (out_mime_type != NULL) { + *out_mime_type = mime_type; + mime_type = NULL; + } + + out: + g_free (kind); + g_free (mime_type); +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + /* JSON format: https://developers.google.com/drive/v2/reference/files/list */ + + if (g_strcmp0 (json_reader_get_member_name (reader), "items") == 0) { + gboolean success = TRUE; + guint i, elements; + + if (json_reader_is_array (reader) == FALSE) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "JSON node ‘items’ is not an array."); + return FALSE; + } + + /* Loop through the elements array. */ + for (i = 0, elements = (guint) json_reader_count_elements (reader); success && i < elements; i++) { + GDataEntry *entry = NULL; + GError *child_error = NULL; + GType entry_type = G_TYPE_INVALID; + gchar *kind = NULL; + gchar *mime_type = NULL; + + json_reader_read_element (reader, i); + + if (json_reader_is_object (reader) == FALSE) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + /* Translators: the parameter is an error message */ + _("Error parsing JSON: %s"), + "JSON node inside ‘items’ is not an object"); + success = FALSE; + goto continuation; + } + + get_kind_and_mime_type (reader, &kind, &mime_type, &child_error); + if (child_error != NULL) { + g_propagate_error (error, child_error); + success = FALSE; + goto continuation; + } + + if (g_strcmp0 (kind, "drive#file") == 0) { + entry_type = gdata_documents_utils_get_type_from_content_type (mime_type); + } else { + g_warning ("%s files are not handled yet", kind); + } + + if (entry_type == G_TYPE_INVALID) + goto continuation; + + entry = GDATA_ENTRY (_gdata_parsable_new_from_json_node (entry_type, reader, NULL, error)); + /* Call the progress callback in the main thread */ + _gdata_feed_call_progress_callback (GDATA_FEED (parsable), user_data, entry); + _gdata_feed_add_entry (GDATA_FEED (parsable), entry); + + continuation: + g_clear_object (&entry); + g_free (kind); + g_free (mime_type); + json_reader_end_element (reader); + } + + return success; + } + + return GDATA_PARSABLE_CLASS (gdata_documents_feed_parent_class)->parse_json (parsable, reader, user_data, error); +} diff --git a/gdata/services/documents/gdata-documents-feed.h b/gdata/services/documents/gdata-documents-feed.h new file mode 100644 index 0000000..22f1fec --- /dev/null +++ b/gdata/services/documents/gdata-documents-feed.h @@ -0,0 +1,73 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier . + */ + +#ifndef GDATA_DOCUMENTS_FEED_H +#define GDATA_DOCUMENTS_FEED_H + +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_DOCUMENTS_FEED (gdata_documents_feed_get_type ()) +#define GDATA_DOCUMENTS_FEED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_FEED, GDataDocumentsFeed)) +#define GDATA_DOCUMENTS_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_FEED, GDataDocumentsFeedClass)) +#define GDATA_IS_DOCUMENTS_FEED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_FEED)) +#define GDATA_IS_DOCUMENTS_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_FEED)) +#define GDATA_DOCUMENTS_FEED_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_FEED, GDataDocumentsFeedClass)) + +typedef struct _GDataDocumentsFeedPrivate GDataDocumentsFeedPrivate; + +/** + * GDataDocumentsFeed: + * + * All the fields in the #GDataDocumentsFeed structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataFeed parent; + GDataDocumentsFeedPrivate *priv; +} GDataDocumentsFeed; + +/** + * GDataDocumentsFeedClass: + * + * All the fields in the #GDataDocumentsFeedClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataFeedClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsFeedClass; + +GType gdata_documents_feed_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsFeed, g_object_unref) + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_FEED_H */ diff --git a/gdata/services/documents/gdata-documents-folder.c b/gdata/services/documents/gdata-documents-folder.c new file mode 100644 index 0000000..b6ddd37 --- /dev/null +++ b/gdata/services/documents/gdata-documents-folder.c @@ -0,0 +1,136 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Red Hat, Inc. 2015, 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-folder + * @short_description: GData documents folder object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-folder.h + * + * #GDataDocumentsFolder is a subclass of #GDataDocumentsEntry to represent a folder from Google Documents. + * + * For more details of Google Drive's GData API, see the + * online documentation. + * + * + * Adding a Folder + * + * GDataAuthorizationDomain *domain; + * GDataDocumentsService *service; + * GDataDocumentsFolder *folder, *new_folder, *parent_folder; + * GError *error = NULL; + * + * domain = gdata_documents_service_get_primary_authorization_domain (); + * + * /* Create a service */ + * service = create_documents_service (); + * + * parent_folder = GDATA_DOCUMENTS_FOLDER (gdata_service_query_single_entry (GDATA_SERVICE (service), domain, "root", NULL, + * GDATA_TYPE_DOCUMENTS_FOLDER, NULL, &error)); + * if (error != NULL) { + * g_error ("Error getting root folder"); + * g_error_free (error); + * return; + * } + * + * /* Create the new folder */ + * folder = gdata_documents_folder_new (NULL); + * gdata_entry_set_title (GDATA_ENTRY (folder), "Folder Name"); + * + * /* Insert the folder */ + * new_folder = GDATA_DOCUMENTS_FOLDER (gdata_documents_service_add_entry_to_folder (GDATA_SERVICE (service), GDATA_DOCUMENTS_ENTRY (folder), + * parent_folder, NULL, &error)); + * + * g_object_unref (folder); + * g_object_unref (parent_folder); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error inserting new folder: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Do something with the new folder, such as store its ID for future use */ + * + * g_object_unref (new_folder); + * + * + * + * Since: 0.4.0 + */ + +#include +#include +#include +#include +#include + +#include "gdata-documents-folder.h" +#include "gdata-documents-utils.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-private.h" + +static void gdata_documents_folder_constructed (GObject *object); + +G_DEFINE_TYPE (GDataDocumentsFolder, gdata_documents_folder, GDATA_TYPE_DOCUMENTS_ENTRY) + +static void +gdata_documents_folder_class_init (GDataDocumentsFolderClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + gobject_class->constructed = gdata_documents_folder_constructed; + entry_class->kind_term = "http://schemas.google.com/docs/2007#folder"; +} + +static void +gdata_documents_folder_init (GDataDocumentsFolder *self) +{ + /* Why am I writing it? */ +} + +static void +gdata_documents_folder_constructed (GObject *object) +{ + G_OBJECT_CLASS (gdata_documents_folder_parent_class)->constructed (object); + + if (!_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object))) + gdata_documents_utils_add_content_type (GDATA_DOCUMENTS_ENTRY (object), "application/vnd.google-apps.folder"); +} + +/** + * gdata_documents_folder_new: + * @id: (allow-none): the entry's ID (not the document ID of the folder), or %NULL + * + * Creates a new #GDataDocumentsFolder with the given entry ID (#GDataEntry:id). + * + * Return value: a new #GDataDocumentsFolder, or %NULL; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataDocumentsFolder * +gdata_documents_folder_new (const gchar *id) +{ + return GDATA_DOCUMENTS_FOLDER (g_object_new (GDATA_TYPE_DOCUMENTS_FOLDER, "id", id, NULL)); +} diff --git a/gdata/services/documents/gdata-documents-folder.h b/gdata/services/documents/gdata-documents-folder.h new file mode 100644 index 0000000..9949c99 --- /dev/null +++ b/gdata/services/documents/gdata-documents-folder.h @@ -0,0 +1,76 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_FOLDER_H +#define GDATA_DOCUMENTS_FOLDER_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_DOCUMENTS_FOLDER (gdata_documents_folder_get_type ()) +#define GDATA_DOCUMENTS_FOLDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_FOLDER, GDataDocumentsFolder)) +#define GDATA_DOCUMENTS_FOLDER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_FOLDER, GDataDocumentsFolderClass)) +#define GDATA_IS_DOCUMENTS_FOLDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_FOLDER)) +#define GDATA_IS_DOCUMENTS_FOLDER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_FOLDER)) +#define GDATA_DOCUMENTS_FOLDER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_FOLDER, GDataDocumentsFolderClass)) + +typedef struct _GDataDocumentsFolderPrivate GDataDocumentsFolderPrivate; + +/** + * GDataDocumentsFolder: + * + * All the fields in the #GDataDocumentsFolder structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataDocumentsEntry parent; + GDataDocumentsFolderPrivate *priv; +} GDataDocumentsFolder; + +/** + * GDataDocumentsFolderClass: + * + * All the fields in the #GDataDocumentsFolderClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataDocumentsEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsFolderClass; + +GType gdata_documents_folder_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsFolder, g_object_unref) + +GDataDocumentsFolder *gdata_documents_folder_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_FOLDER_H */ diff --git a/gdata/services/documents/gdata-documents-metadata.c b/gdata/services/documents/gdata-documents-metadata.c new file mode 100644 index 0000000..f587af5 --- /dev/null +++ b/gdata/services/documents/gdata-documents-metadata.c @@ -0,0 +1,230 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Michael Terry 2017 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-metadata + * @short_description: GData document service metadata class + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-metadata.h + * + * #GDataDocumentsMetadata is a subclass of #GDataParsable to represent Google Drive service metadata. + * + * For more details of Google Documents' GData API, see the + * online documentation. + * + * Since: 0.17.9 + */ + +#include +#include +#include +#include + +#include "gdata-documents-metadata.h" +#include "gdata-parser.h" +#include "gdata-types.h" + +static const gchar *get_content_type (void); +static void gdata_documents_metadata_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_documents_metadata_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); + +struct _GDataDocumentsMetadataPrivate { + goffset quota_total; /* bytes */ + goffset quota_used; /* bytes */ + gboolean quota_unlimited; +}; + +enum { + PROP_QUOTA_TOTAL = 1, + PROP_QUOTA_USED, +}; + +G_DEFINE_TYPE (GDataDocumentsMetadata, gdata_documents_metadata, GDATA_TYPE_PARSABLE) + +static void +gdata_documents_metadata_class_init (GDataDocumentsMetadataClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataDocumentsMetadataPrivate)); + + gobject_class->get_property = gdata_documents_metadata_get_property; + gobject_class->set_property = gdata_documents_metadata_set_property; + + parsable_class->parse_json = parse_json; + parsable_class->get_content_type = get_content_type; + + /** + * GDataDocumentsMetadata:quota-total: + * + * The user quota limit across all services. Measured in bytes. + * + * Since: 0.17.9 + */ + g_object_class_install_property (gobject_class, PROP_QUOTA_TOTAL, + g_param_spec_int64 ("quota-total", + "Quota total", "The user quota limit across all services.", + -1, G_MAXINT64, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsMetadata:quota-used: + * + * The amount of user quota used up across all services. Measured in bytes. + * + * Since: 0.17.9 + */ + g_object_class_install_property (gobject_class, PROP_QUOTA_USED, + g_param_spec_int64 ("quota-used", + "Quota used", "The amount of user quota used up across all services.", + 0, G_MAXINT64, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_documents_metadata_init (GDataDocumentsMetadata *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_DOCUMENTS_METADATA, GDataDocumentsMetadataPrivate); +} + +static void +gdata_documents_metadata_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataDocumentsMetadata *self = GDATA_DOCUMENTS_METADATA (object); + + switch (property_id) { + case PROP_QUOTA_TOTAL: + g_value_set_int64 (value, gdata_documents_metadata_get_quota_total (self)); + break; + case PROP_QUOTA_USED: + g_value_set_int64 (value, gdata_documents_metadata_get_quota_used (self)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_documents_metadata_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + switch (property_id) { + case PROP_QUOTA_TOTAL: + case PROP_QUOTA_USED: + /* Read only. */ + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataDocumentsMetadataPrivate *priv = GDATA_DOCUMENTS_METADATA (parsable)->priv; + gboolean success = TRUE; + gchar *quota_total = NULL; + gchar *quota_used = NULL; + gchar *quota_type = NULL; + + /* JSON format: https://developers.google.com/drive/v2/reference/about */ + + if (gdata_parser_string_from_json_member (reader, "quotaBytesTotal", P_DEFAULT, "a_total, &success, error) == TRUE) { + gchar *end_ptr; + guint64 val; + + /* Even though ‘quotaBytesTotal’ is documented as long, + * it is actually a string in the JSON. + */ + val = g_ascii_strtoull (quota_total, &end_ptr, 10); + if (*end_ptr == '\0') + priv->quota_total = (goffset) val; + g_free (quota_total); + return success; + } else if (gdata_parser_string_from_json_member (reader, "quotaBytesUsedAggregate", P_DEFAULT, "a_used, &success, error) == TRUE) { + gchar *end_ptr; + guint64 val; + + /* Even though ‘quotaBytesUsedAggregate’ is documented as long, + * it is actually a string in the JSON. + */ + val = g_ascii_strtoull (quota_used, &end_ptr, 10); + if (*end_ptr == '\0') + priv->quota_used = (goffset) val; + g_free (quota_used); + return success; + } else if (gdata_parser_string_from_json_member (reader, "quotaType", P_DEFAULT, "a_type, &success, error) == TRUE) { + if (g_strcmp0 (quota_type, "UNLIMITED") == 0) + priv->quota_unlimited = TRUE; + g_free (quota_type); + return success; + } + + return GDATA_PARSABLE_CLASS (gdata_documents_metadata_parent_class)->parse_json (parsable, reader, user_data, error); +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +/** + * gdata_documents_metadata_get_quota_total: + * @self: a #GDataDocumentsMetadata + * + * Gets the #GDataDocumentsMetadata:quota-total property. + * + * Return value: the number of quota bytes available in total. Returns -1 if + * there is no quota limit. + * + * Since: 0.17.9 + */ +goffset +gdata_documents_metadata_get_quota_total (GDataDocumentsMetadata *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_METADATA (self), 0); + + if (self->priv->quota_unlimited) + return -1; + else + return self->priv->quota_total; +} + +/** + * gdata_documents_metadata_get_quota_used: + * @self: a #GDataDocumentsMetadata + * + * Gets the #GDataDocumentsMetadata:quota-used property. + * + * Return value: the number of quota bytes used by the documents service + * + * Since: 0.17.9 + */ +goffset +gdata_documents_metadata_get_quota_used (GDataDocumentsMetadata *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_METADATA (self), 0); + + return self->priv->quota_used; +} diff --git a/gdata/services/documents/gdata-documents-metadata.h b/gdata/services/documents/gdata-documents-metadata.h new file mode 100644 index 0000000..c9c8d4a --- /dev/null +++ b/gdata/services/documents/gdata-documents-metadata.h @@ -0,0 +1,77 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Michael Terry 2017 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_METADATA_H +#define GDATA_DOCUMENTS_METADATA_H + +#include +#include + +#include + +G_BEGIN_DECLS + + +#define GDATA_TYPE_DOCUMENTS_METADATA (gdata_documents_metadata_get_type ()) +#define GDATA_DOCUMENTS_METADATA(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_METADATA, GDataDocumentsMetadata)) +#define GDATA_DOCUMENTS_METADATA_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_METADATA, GDataDocumentsMetadataClass)) +#define GDATA_IS_DOCUMENTS_METADATA(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_METADATA)) +#define GDATA_IS_DOCUMENTS_METADATA_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_METADATA)) +#define GDATA_DOCUMENTS_METADATA_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_METADATA, GDataDocumentsMetadataClass)) + +typedef struct _GDataDocumentsMetadataPrivate GDataDocumentsMetadataPrivate; + +/** + * GDataDocumentsMetadata: + * + * All the fields in the #GDataDocumentsMetadata structure are private and should never be accessed directly. + * + * Since: 0.17.9 + */ +typedef struct { + GDataParsable parent; + GDataDocumentsMetadataPrivate *priv; +} GDataDocumentsMetadata; + +/** + * GDataDocumentsMetadataClass: + * + * All the fields in the #GDataDocumentsMetadataClass structure are private and should never be accessed directly. + * + * Since: 0.17.9 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsMetadataClass; + +GType gdata_documents_metadata_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsMetadata, g_object_unref) + +goffset gdata_documents_metadata_get_quota_total (GDataDocumentsMetadata *self) G_GNUC_PURE; +goffset gdata_documents_metadata_get_quota_used (GDataDocumentsMetadata *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_METADATA_H */ diff --git a/gdata/services/documents/gdata-documents-pdf.c b/gdata/services/documents/gdata-documents-pdf.c new file mode 100644 index 0000000..d4d2528 --- /dev/null +++ b/gdata/services/documents/gdata-documents-pdf.c @@ -0,0 +1,88 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Cosimo Cecchi 2012 + * Copyright (C) Red Hat, Inc. 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-pdf + * @short_description: GData Documents pdf object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-pdf.h + * + * #GDataDocumentsPdf is a subclass of #GDataDocumentsDocument to represent a PDF document from Google Documents. + * + * For more details of Google Drive's GData API, see the + * online documentation. + * + * Since: 0.13.3 + */ + +#include +#include + +#include "gdata-documents-pdf.h" +#include "gdata-documents-utils.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_documents_pdf_constructed (GObject *object); + +G_DEFINE_TYPE (GDataDocumentsPdf, gdata_documents_pdf, GDATA_TYPE_DOCUMENTS_DOCUMENT) + +static void +gdata_documents_pdf_class_init (GDataDocumentsPdfClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + gobject_class->constructed = gdata_documents_pdf_constructed; + entry_class->kind_term = "http://schemas.google.com/docs/2007#pdf"; +} + +static void +gdata_documents_pdf_init (GDataDocumentsPdf *self) +{ + /* Why am I writing it? */ +} + +static void +gdata_documents_pdf_constructed (GObject *object) +{ + G_OBJECT_CLASS (gdata_documents_pdf_parent_class)->constructed (object); + + if (!_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object))) + gdata_documents_utils_add_content_type (GDATA_DOCUMENTS_ENTRY (object), "application/pdf"); +} + +/** + * gdata_documents_pdf_new: + * @id: (allow-none): the entry's ID (not the document ID of the pdf document), or %NULL + * + * Creates a new #GDataDocumentsPdf with the given entry ID (#GDataEntry:id). + * + * Return value: (transfer full): a new #GDataDocumentsPdf, or %NULL; unref with g_object_unref() + * + * Since: 0.13.3 + */ +GDataDocumentsPdf * +gdata_documents_pdf_new (const gchar *id) +{ + return GDATA_DOCUMENTS_PDF (g_object_new (GDATA_TYPE_DOCUMENTS_PDF, "id", id, NULL)); +} diff --git a/gdata/services/documents/gdata-documents-pdf.h b/gdata/services/documents/gdata-documents-pdf.h new file mode 100644 index 0000000..701a137 --- /dev/null +++ b/gdata/services/documents/gdata-documents-pdf.h @@ -0,0 +1,77 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Cosimo Cecchi 2012 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_PDF_H +#define GDATA_DOCUMENTS_PDF_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_DOCUMENTS_PDF (gdata_documents_pdf_get_type ()) +#define GDATA_DOCUMENTS_PDF(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_PDF, GDataDocumentsPdf)) +#define GDATA_DOCUMENTS_PDF_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_PDF, GDataDocumentsPdfClass)) +#define GDATA_IS_DOCUMENTS_PDF(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_PDF)) +#define GDATA_IS_DOCUMENTS_PDF_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_PDF)) +#define GDATA_DOCUMENTS_PDF_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_PDF, GDataDocumentsPdfClass)) + +typedef struct _GDataDocumentsPdfPrivate GDataDocumentsPdfPrivate; + +/** + * GDataDocumentsPdf: + * + * All the fields in the #GDataDocumentsPdf structure are private and should never be accessed directly. + * + * Since: 0.13.3 + */ +typedef struct { + GDataDocumentsDocument parent; + GDataDocumentsPdfPrivate *priv; +} GDataDocumentsPdf; + +/** + * GDataDocumentsPdfClass: + * + * All the fields in the #GDataDocumentsPdfClass structure are private and should never be accessed directly. + * + * Since: 0.13.3 + */ +typedef struct { + /*< private >*/ + GDataDocumentsDocumentClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsPdfClass; + +GType gdata_documents_pdf_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsPdf, g_object_unref) + +GDataDocumentsPdf *gdata_documents_pdf_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_PDF_H */ diff --git a/gdata/services/documents/gdata-documents-presentation.c b/gdata/services/documents/gdata-documents-presentation.c new file mode 100644 index 0000000..9031a61 --- /dev/null +++ b/gdata/services/documents/gdata-documents-presentation.c @@ -0,0 +1,87 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Red Hat, Inc. 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-presentation + * @short_description: GData documents presentation object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-presentation.h + * + * #GDataDocumentsPresentation is a subclass of #GDataDocumentsDocument to represent a Google Documents presentation. + * + * For more details of Google Drive's GData API, see the + * online documentation. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-documents-presentation.h" +#include "gdata-documents-utils.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_documents_presentation_constructed (GObject *object); + +G_DEFINE_TYPE (GDataDocumentsPresentation, gdata_documents_presentation, GDATA_TYPE_DOCUMENTS_DOCUMENT) + +static void +gdata_documents_presentation_class_init (GDataDocumentsPresentationClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + gobject_class->constructed = gdata_documents_presentation_constructed; + entry_class->kind_term = "http://schemas.google.com/docs/2007#presentation"; +} + +static void +gdata_documents_presentation_init (GDataDocumentsPresentation *self) +{ + /* Why am I writing it? */ +} + +static void +gdata_documents_presentation_constructed (GObject *object) +{ + G_OBJECT_CLASS (gdata_documents_presentation_parent_class)->constructed (object); + + if (!_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object))) + gdata_documents_utils_add_content_type (GDATA_DOCUMENTS_ENTRY (object), "application/vnd.google-apps.presentation"); +} + +/** + * gdata_documents_presentation_new: + * @id: (allow-none): the entry's ID (not the document ID of the presentation), or %NULL + * + * Creates a new #GDataDocumentsPresentation with the given entry ID (#GDataEntry:id). + * + * Return value: (transfer full): a new #GDataDocumentsPresentation, or %NULL; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataDocumentsPresentation * +gdata_documents_presentation_new (const gchar *id) +{ + return GDATA_DOCUMENTS_PRESENTATION (g_object_new (GDATA_TYPE_DOCUMENTS_PRESENTATION, "id", id, NULL)); +} diff --git a/gdata/services/documents/gdata-documents-presentation.h b/gdata/services/documents/gdata-documents-presentation.h new file mode 100644 index 0000000..5ab4b65 --- /dev/null +++ b/gdata/services/documents/gdata-documents-presentation.h @@ -0,0 +1,147 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_PRESENTATION_H +#define GDATA_DOCUMENTS_PRESENTATION_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_DOCUMENTS_PRESENTATION_PDF: + * + * The export format for Portable Document Format (PDF). + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_PRESENTATION_PDF "pdf" + +/** + * GDATA_DOCUMENTS_PRESENTATION_PNG: + * + * The export format for Portable Network Graphics (PNG) image format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_PRESENTATION_PNG "png" + +/** + * GDATA_DOCUMENTS_PRESENTATION_PPT: + * + * The export format for Microsoft PowerPoint (PPT) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_PRESENTATION_PPT "ppt" + +/** + * GDATA_DOCUMENTS_PRESENTATION_SWF: + * + * The export format for Adobe Flash (SWF) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + * Deprecated: SWF export has been deprecated in the protocol due to low demand for it; PDF export (using %GDATA_DOCUMENTS_PRESENTATION_PDF) is + * recommended instead. (Since: 0.11.0.) + */ +#ifndef LIBGDATA_DISABLE_DEPRECATED +#define GDATA_DOCUMENTS_PRESENTATION_SWF "swf" +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +/** + * GDATA_DOCUMENTS_PRESENTATION_TXT: + * + * The export format for plain text format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_PRESENTATION_TXT "txt" + +#define GDATA_TYPE_DOCUMENTS_PRESENTATION (gdata_documents_presentation_get_type ()) +#define GDATA_DOCUMENTS_PRESENTATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_PRESENTATION, \ + GDataDocumentsPresentation)) +#define GDATA_DOCUMENTS_PRESENTATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_PRESENTATION, \ + GDataDocumentsPresentationClass)) +#define GDATA_IS_DOCUMENTS_PRESENTATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_PRESENTATION)) +#define GDATA_IS_DOCUMENTS_PRESENTATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_PRESENTATION)) +#define GDATA_DOCUMENTS_PRESENTATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_PRESENTATION, \ + GDataDocumentsPresentationClass)) + +typedef struct _GDataDocumentsPresentationPrivate GDataDocumentsPresentationPrivate; + +/** + * GDataDocumentsPresentation: + * + * All the fields in the #GDataDocumentsPresentation structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataDocumentsDocument parent; + GDataDocumentsPresentationPrivate *priv; +} GDataDocumentsPresentation; + +/** + * GDataDocumentsPresentationClass: + * + * All the fields in the #GDataDocumentsPresentationClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataDocumentsDocumentClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsPresentationClass; + +GType gdata_documents_presentation_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsPresentation, g_object_unref) + +GDataDocumentsPresentation *gdata_documents_presentation_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_PRESENTATION_H */ diff --git a/gdata/services/documents/gdata-documents-query.c b/gdata/services/documents/gdata-documents-query.c new file mode 100644 index 0000000..6070c1b --- /dev/null +++ b/gdata/services/documents/gdata-documents-query.c @@ -0,0 +1,709 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Red Hat, Inc. 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-query + * @short_description: GData Documents query object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-query.h + * + * #GDataDocumentsQuery represents a collection of query parameters specific to the Google Documents service, which go above and beyond + * those catered for by #GDataQuery. + * + * For more information on the custom GData query parameters supported by #GDataDocumentsQuery, see the online documentation. + * + * + * Querying for Documents + * + * GDataDocumentsService *service; + * GDataDocumentsQuery *query; + * GDataFeed *feed; + * GTimeVal current_time; + * GList *i; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_documents_service (); + * + * /* Create the query to use. We're going to query for the last 10 documents modified by example@gmail.com in the past week, including + * * deleted documents. */ + * query = gdata_documents_query_new_with_limits (NULL, 0, 10); + * + * gdata_documents_query_add_collaborator (query, "example@gmail.com"); + * gdata_documents_query_set_show_deleted (query, TRUE); + * + * g_get_current_time (¤t_time); + * gdata_query_set_updated_min (GDATA_QUERY (query), current_time.tv_sec - 7 * 24 * 60 * 60); + * gdata_query_set_updated_max (GDATA_QUERY (query), current_time.tv_sec); + * + * /* Execute the query */ + * feed = gdata_documents_service_query_documents (service, query, NULL, NULL, NULL, &error); + * + * g_object_unref (query); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error querying for documents: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Iterate through the returned documents and do something with them */ + * for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { + * GDataDocumentsDocument *document = GDATA_DOCUMENTS_DOCUMENT (i->data); + * + * /* Do something with the document here, such as insert it into a UI */ + * } + * + * g_object_unref (feed); + * + * + * + * Since: 0.4.0 + */ + +#include +#include +#include +#include + +#include "gd/gdata-gd-email-address.h" +#include "gdata-documents-query.h" +#include "gdata-private.h" +#include "gdata-query.h" + +#include +#include +#include +#include + +static void gdata_documents_query_dispose (GObject *object); +static void gdata_documents_query_finalize (GObject *object); +static void gdata_documents_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_documents_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +struct _GDataDocumentsQueryPrivate { + gboolean show_deleted; + gboolean show_folders; + gboolean exact_title; + gchar *folder_id; + gchar *title; + GList *collaborator_addresses; /* GDataGDEmailAddress */ + GList *reader_addresses; /* GDataGDEmailAddress */ +}; + +enum { + PROP_SHOW_DELETED = 1, + PROP_SHOW_FOLDERS, + PROP_EXACT_TITLE, + PROP_FOLDER_ID, + PROP_TITLE +}; + +G_DEFINE_TYPE (GDataDocumentsQuery, gdata_documents_query, GDATA_TYPE_QUERY) + +static void +gdata_documents_query_class_init (GDataDocumentsQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataDocumentsQueryPrivate)); + + gobject_class->get_property = gdata_documents_query_get_property; + gobject_class->set_property = gdata_documents_query_set_property; + gobject_class->dispose = gdata_documents_query_dispose; + gobject_class->finalize = gdata_documents_query_finalize; + + query_class->get_query_uri = get_query_uri; + + /** + * GDataDocumentsQuery:show-deleted: + * + * A shortcut to request all documents that have been deleted. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_SHOW_DELETED, + g_param_spec_boolean ("show-deleted", + "Show deleted?", "A shortcut to request all documents that have been deleted.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsQuery:show-folders: + * + * Specifies if the request also returns folders. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_SHOW_FOLDERS, + g_param_spec_boolean ("show-folders", + "Show folders?", "Specifies if the request also returns folders.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsQuery:exact-title: + * + * Specifies whether the query should search for an exact title match for the #GDataDocumentsQuery:title parameter. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_EXACT_TITLE, + g_param_spec_boolean ("exact-title", + "Exact title?", "Specifies whether the query should search for an exact title match.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsQuery:folder-id: + * + * Specifies the ID of the folder in which to search. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_FOLDER_ID, + g_param_spec_string ("folder-id", + "Folder ID", "Specifies the ID of the folder in which to search.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsQuery:title: + * + * A title (or title fragment) to be searched for. If #GDataDocumentsQuery:exact-title is %TRUE, an exact + * title match will be searched for, otherwise substring matches will also be returned. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TITLE, + g_param_spec_string ("title", + "Title", "A title (or title fragment) to be searched for.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_documents_query_init (GDataDocumentsQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_DOCUMENTS_QUERY, GDataDocumentsQueryPrivate); + + /* https://developers.google.com/drive/v3/reference/files/list#q */ + _gdata_query_set_pagination_type (GDATA_QUERY (self), + GDATA_QUERY_PAGINATION_TOKENS); +} + +static void +gdata_documents_query_dispose (GObject *object) +{ + GList *i; + GDataDocumentsQueryPrivate *priv = GDATA_DOCUMENTS_QUERY (object)->priv; + + for (i = priv->collaborator_addresses; i != NULL; i = i->next) + g_object_unref (i->data); + g_list_free (priv->collaborator_addresses); + priv->collaborator_addresses = NULL; + + for (i = priv->reader_addresses; i != NULL; i = i->next) + g_object_unref (i->data); + g_list_free (priv->reader_addresses); + priv->reader_addresses = NULL; + + G_OBJECT_CLASS (gdata_documents_query_parent_class)->dispose (object); +} + +static void +gdata_documents_query_finalize (GObject *object) +{ + GDataDocumentsQueryPrivate *priv = GDATA_DOCUMENTS_QUERY (object)->priv; + + g_free (priv->folder_id); + g_free (priv->title); + + G_OBJECT_CLASS (gdata_documents_query_parent_class)->finalize (object); +} + +static void +gdata_documents_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataDocumentsQueryPrivate *priv = GDATA_DOCUMENTS_QUERY (object)->priv; + + switch (property_id) { + case PROP_SHOW_DELETED: + g_value_set_boolean (value, priv->show_deleted); + break; + case PROP_SHOW_FOLDERS: + g_value_set_boolean (value, priv->show_folders); + break; + case PROP_FOLDER_ID: + g_value_set_string (value, priv->folder_id); + break; + case PROP_EXACT_TITLE: + g_value_set_boolean (value, priv->exact_title); + break; + case PROP_TITLE: + g_value_set_string (value, priv->title); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_documents_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataDocumentsQuery *self = GDATA_DOCUMENTS_QUERY (object); + + switch (property_id) { + case PROP_SHOW_DELETED: + gdata_documents_query_set_show_deleted (self, g_value_get_boolean (value)); + break; + case PROP_SHOW_FOLDERS: + gdata_documents_query_set_show_folders (self, g_value_get_boolean (value)); + break; + case PROP_FOLDER_ID: + gdata_documents_query_set_folder_id (self, g_value_get_string (value)); + break; + case PROP_EXACT_TITLE: + self->priv->exact_title = g_value_get_boolean (value); + break; + case PROP_TITLE: + gdata_documents_query_set_title (self, g_value_get_string (value), TRUE); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataDocumentsQueryPrivate *priv = GDATA_DOCUMENTS_QUERY (self)->priv; + guint max_results; + + #define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + if (priv->folder_id != NULL) { + g_string_append (query_uri, "/folder%3A"); + g_string_append_uri_escaped (query_uri, priv->folder_id, NULL, FALSE); + } + + /* Search parameters: https://developers.google.com/drive/web/search-parameters */ + + _gdata_query_clear_q_internal (self); + + if (priv->collaborator_addresses != NULL) { + GList *i; + GString *str; + + str = g_string_new (NULL); + + for (i = priv->collaborator_addresses; i != NULL; i = i->next) { + GDataGDEmailAddress *email_address = GDATA_GD_EMAIL_ADDRESS (i->data); + const gchar *address; + + address = gdata_gd_email_address_get_address (email_address); + g_string_append_printf (str, "'%s' in writers", address); + if (i->next != NULL) + g_string_append (str, " or "); + } + + _gdata_query_add_q_internal (self, str->str); + g_string_free (str, TRUE); + } + + if (priv->reader_addresses != NULL) { + GList *i; + GString *str; + + str = g_string_new (NULL); + + for (i = priv->reader_addresses; i != NULL; i = i->next) { + GDataGDEmailAddress *email_address = GDATA_GD_EMAIL_ADDRESS (i->data); + const gchar *address; + + address = gdata_gd_email_address_get_address (email_address); + g_string_append_printf (str, "'%s' in readers", address); + if (i->next != NULL) + g_string_append (str, " or "); + } + + _gdata_query_add_q_internal (self, str->str); + g_string_free (str, TRUE); + } + + if (priv->show_deleted == TRUE) + _gdata_query_add_q_internal (self, "trashed=true"); + else + _gdata_query_add_q_internal (self, "trashed=false"); + + if (priv->show_folders == FALSE) + _gdata_query_add_q_internal (self, "mimeType!='application/vnd.google-apps.folder'"); + + if (priv->title != NULL) { + GString *title_query; + const gchar *ptr, *ptr_end; + + title_query = g_string_new ("title"); + if (priv->exact_title) { + g_string_append_c (title_query, '='); + } else { + g_string_append (title_query, " contains "); + } + g_string_append_c (title_query, '\''); + + for (ptr = priv->title; ptr != NULL; ptr = ptr_end) { + /* Escape any "'" and "\" found in the title with a "\" */ + ptr_end = strpbrk (ptr, "\'\\"); + if (ptr_end == NULL) { + g_string_append (title_query, ptr); + } else { + g_string_append_len (title_query, ptr, ptr_end - ptr); + g_string_append_c (title_query, '\\'); + g_string_append_c (title_query, *ptr_end); + } + } + + g_string_append_c (title_query, '\''); + _gdata_query_add_q_internal (self, title_query->str); + g_string_free (title_query, TRUE); + } + + /* Chain up to the parent class */ + GDATA_QUERY_CLASS (gdata_documents_query_parent_class)->get_query_uri (self, feed_uri, query_uri, params_started); + + /* https://developers.google.com/drive/v2/reference/files/list */ + max_results = gdata_query_get_max_results (self); + if (max_results > 0) { + APPEND_SEP + max_results = max_results > 1000 ? 1000 : max_results; + g_string_append_printf (query_uri, "maxResults=%u", max_results); + } +} + +/** + * gdata_documents_query_new: + * @q: (allow-none): a query string, or %NULL + * + * Creates a new #GDataDocumentsQuery with its #GDataQuery:q property set to @q. + * + * Return value: a new #GDataDocumentsQuery + * + * Since: 0.4.0 + */ +GDataDocumentsQuery * +gdata_documents_query_new (const gchar *q) +{ + return g_object_new (GDATA_TYPE_DOCUMENTS_QUERY, "q", q, NULL); +} + +/** + * gdata_documents_query_new_with_limits: + * @q: (allow-none): a query string, or %NULL + * @start_index: a one-based start index for the results, or 0 + * @max_results: the maximum number of results to return, or 0 + * + * Creates a new #GDataDocumentsQuery with its #GDataQuery:q property set to @q, and the limits @start_index and @max_results + * applied. + * + * Return value: a new #GDataDocumentsQuery + * + * Since: 0.4.0 + */ +GDataDocumentsQuery * +gdata_documents_query_new_with_limits (const gchar *q, guint start_index, guint max_results) +{ + return g_object_new (GDATA_TYPE_DOCUMENTS_QUERY, + "q", q, + "start-index", start_index, + "max-results", max_results, + NULL); +} + +/** + * gdata_documents_query_show_deleted: + * @self: a #GDataDocumentsQuery + * + * Gets the #GDataDocumentsQuery:show_deleted property. + * + * Return value: %TRUE if the request should return deleted entries, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_documents_query_show_deleted (GDataDocumentsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_QUERY (self), FALSE); + return self->priv->show_deleted; +} + +/** + * gdata_documents_query_set_show_deleted: + * @self: a #GDataDocumentsQuery + * @show_deleted: %TRUE if the request should return deleted entries, %FALSE otherwise + * + * Sets the #GDataDocumentsQuery:show_deleted property to @show_deleted. + * + * Since: 0.4.0 + */ +void +gdata_documents_query_set_show_deleted (GDataDocumentsQuery *self, gboolean show_deleted) +{ + g_return_if_fail (GDATA_IS_DOCUMENTS_QUERY (self)); + self->priv->show_deleted = show_deleted; + g_object_notify (G_OBJECT (self), "show-deleted"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_documents_query_show_folders: + * @self: a #GDataDocumentsQuery + * + * Gets the #GDataDocumentsQuery:show-folders property. + * + * Return value: %TRUE if the request should return folders, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_documents_query_show_folders (GDataDocumentsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_QUERY (self), FALSE); + return self->priv->show_folders; +} + +/** + * gdata_documents_query_set_show_folders: + * @self: a #GDataDocumentsQuery + * @show_folders: %TRUE if the request should return folders, %FALSE otherwise + * + * Sets the #GDataDocumentsQuery:show-folders property to show_folders. + * + * Since: 0.4.0 + */ +void +gdata_documents_query_set_show_folders (GDataDocumentsQuery *self, gboolean show_folders) +{ + g_return_if_fail (GDATA_IS_DOCUMENTS_QUERY (self)); + self->priv->show_folders = show_folders; + g_object_notify (G_OBJECT (self), "show-folders"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_documents_query_get_folder_id: + * @self: a #GDataDocumentsQuery + * + * Gets the #GDataDocumentsQuery:folder-id property. + * + * Return value: the ID of the folder to be queried, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_documents_query_get_folder_id (GDataDocumentsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_QUERY (self), NULL); + return self->priv->folder_id; +} + +/** + * gdata_documents_query_set_folder_id: + * @self: a #GDataDocumentsQuery + * @folder_id: (allow-none): the ID of the folder to be queried, or %NULL + * + * Sets the #GDataDocumentsQuery:folder-id property to @folder_id. + * + * Set @folder_id to %NULL to unset the property in the query URI. + * + * Since: 0.4.0 + */ +void +gdata_documents_query_set_folder_id (GDataDocumentsQuery *self, const gchar *folder_id) +{ + g_return_if_fail (GDATA_IS_DOCUMENTS_QUERY (self)); + + g_free (self->priv->folder_id); + self->priv->folder_id = g_strdup (folder_id); + g_object_notify (G_OBJECT (self), "folder-id"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_documents_query_get_title: + * @self: a #GDataDocumentsQuery + * + * Gets the #GDataDocumentsQuery:title property. + * + * Return value: the title (or title fragment) being queried for, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_documents_query_get_title (GDataDocumentsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_QUERY (self), NULL); + return self->priv->title; +} + +/** + * gdata_documents_query_get_exact_title: + * @self: a #GDataDocumentsQuery + * + * Gets the #GDataDocumentsQuery:exact-title property. + * + * Return value: %TRUE if the query matches the exact title of documents with #GDataDocumentsQuery:title, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_documents_query_get_exact_title (GDataDocumentsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_QUERY (self), FALSE); + return self->priv->exact_title; +} + +/** + * gdata_documents_query_set_title: + * @self: a #GDataDocumentsQuery + * @title: (allow-none): the title (or title fragment) to query for, or %NULL + * @exact_title: %TRUE if the query should match the exact @title, %FALSE otherwise + * + * Sets the #GDataDocumentsQuery:title property to @title. + * + * Set @title to %NULL to unset the property in the query URI. + * + * Since: 0.4.0 + */ +void +gdata_documents_query_set_title (GDataDocumentsQuery *self, const gchar *title, gboolean exact_title) +{ + g_return_if_fail (GDATA_IS_DOCUMENTS_QUERY (self)); + + g_free (self->priv->title); + self->priv->title = g_strdup (title); + self->priv->exact_title = exact_title; + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "exact-title"); + g_object_notify (G_OBJECT (self), "title"); + g_object_thaw_notify (G_OBJECT (self)); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_documents_query_get_collaborator_addresses: + * @self: a #GDataDocumentsQuery + * + * Gets a list of #GDataGDEmailAddresses of the document collaborators whose documents will be queried. + * + * Return value: (element-type GData.GDEmailAddress) (transfer none): a list of #GDataGDEmailAddresses of the collaborators concerned by the + * query, or %NULL + * + * Since: 0.4.0 + */ +GList * +gdata_documents_query_get_collaborator_addresses (GDataDocumentsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_QUERY (self), NULL); + return self->priv->collaborator_addresses; +} + +/** + * gdata_documents_query_get_reader_addresses: + * @self: a #GDataDocumentsQuery + * + * Gets a list of #GDataGDEmailAddresses of the document readers whose documents will be queried. + * + * Return value: (element-type GData.GDEmailAddress) (transfer none): a list of #GDataGDEmailAddresses of the readers concerned by the query, + * or %NULL + * + * Since: 0.4.0 + */ +GList * +gdata_documents_query_get_reader_addresses (GDataDocumentsQuery *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_QUERY (self), NULL); + return self->priv->reader_addresses; +} + +/** + * gdata_documents_query_add_reader: + * @self: a #GDataDocumentsQuery + * @email_address: the e-mail address of the reader to add + * + * Add @email_address as a #GDataGDEmailAddress to the list of readers, the documents readable by whom will be queried. + * + * Since: 0.4.0 + */ +void +gdata_documents_query_add_reader (GDataDocumentsQuery *self, const gchar *email_address) +{ + GDataGDEmailAddress *address; + + g_return_if_fail (GDATA_IS_DOCUMENTS_QUERY (self)); + g_return_if_fail (email_address != NULL && *email_address != '\0'); + + address = gdata_gd_email_address_new (email_address, "reader", NULL, FALSE); + self->priv->reader_addresses = g_list_append (self->priv->reader_addresses, address); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_documents_query_add_collaborator: + * @self: a #GDataDocumentsQuery + * @email_address: the e-mail address of the collaborator to add + * + * Add @email_address as a #GDataGDEmailAddress to the list of collaborators whose edited documents will be queried. + * + * Since: 0.4.0 + */ +void +gdata_documents_query_add_collaborator (GDataDocumentsQuery *self, const gchar *email_address) +{ + GDataGDEmailAddress *address; + + g_return_if_fail (GDATA_IS_DOCUMENTS_QUERY (self)); + g_return_if_fail (email_address != NULL && *email_address != '\0'); + + address = gdata_gd_email_address_new (email_address, "collaborator", NULL, FALSE); + self->priv->collaborator_addresses = g_list_append (self->priv->collaborator_addresses, address); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} diff --git a/gdata/services/documents/gdata-documents-query.h b/gdata/services/documents/gdata-documents-query.h new file mode 100644 index 0000000..dfe369c --- /dev/null +++ b/gdata/services/documents/gdata-documents-query.h @@ -0,0 +1,93 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_QUERY_H +#define GDATA_DOCUMENTS_QUERY_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_DOCUMENTS_QUERY (gdata_documents_query_get_type ()) +#define GDATA_DOCUMENTS_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_QUERY, GDataDocumentsQuery)) +#define GDATA_DOCUMENTS_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_QUERY, GDataDocumentsQueryClass)) +#define GDATA_IS_DOCUMENTS_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_QUERY)) +#define GDATA_IS_DOCUMENTS_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_QUERY)) +#define GDATA_DOCUMENTS_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_QUERY, GDataDocumentsQueryClass)) + +typedef struct _GDataDocumentsQueryPrivate GDataDocumentsQueryPrivate; + +/** + * GDataDocumentsQuery: + * + * All the fields in the #GDataDocumentsQuery structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataQuery parent; + GDataDocumentsQueryPrivate *priv; +} GDataDocumentsQuery; + +/** + * GDataDocumentsQueryClass: + * + * All the fields in the #GDataDocumentsQueryClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataQueryClass parent; + GDataDocumentsQueryPrivate *priv; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsQueryClass; + +GType gdata_documents_query_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsQuery, g_object_unref) + +GDataDocumentsQuery *gdata_documents_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataDocumentsQuery *gdata_documents_query_new_with_limits (const gchar *q, + guint start_index, guint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gboolean gdata_documents_query_show_deleted (GDataDocumentsQuery *self) G_GNUC_PURE; +void gdata_documents_query_set_show_deleted (GDataDocumentsQuery *self, gboolean show_deleted); +gboolean gdata_documents_query_show_folders (GDataDocumentsQuery *self) G_GNUC_PURE; +void gdata_documents_query_set_show_folders (GDataDocumentsQuery *self, gboolean show_folders); +const gchar *gdata_documents_query_get_folder_id (GDataDocumentsQuery *self) G_GNUC_PURE; +void gdata_documents_query_set_folder_id (GDataDocumentsQuery *self, const gchar *folder_id); +const gchar *gdata_documents_query_get_title (GDataDocumentsQuery *self) G_GNUC_PURE; +gboolean gdata_documents_query_get_exact_title (GDataDocumentsQuery *self) G_GNUC_PURE; +void gdata_documents_query_set_title (GDataDocumentsQuery *self, const gchar *title, gboolean exact_title); +GList *gdata_documents_query_get_collaborator_addresses (GDataDocumentsQuery *self) G_GNUC_PURE; +GList *gdata_documents_query_get_reader_addresses (GDataDocumentsQuery *self) G_GNUC_PURE; +void gdata_documents_query_add_reader (GDataDocumentsQuery *self, const gchar *email_address); +void gdata_documents_query_add_collaborator (GDataDocumentsQuery *self, const gchar *email_address); + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_QUERY_H */ diff --git a/gdata/services/documents/gdata-documents-service.c b/gdata/services/documents/gdata-documents-service.c new file mode 100644 index 0000000..5d667e9 --- /dev/null +++ b/gdata/services/documents/gdata-documents-service.c @@ -0,0 +1,1553 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010, 2014 + * Copyright (C) Red Hat, Inc. 2015, 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-service + * @short_description: GData Documents service object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-service.h + * + * #GDataDocumentsService is a subclass of #GDataService for communicating with the GData API of Google Drive. It supports querying + * for, inserting, editing and deleting documents, as well as a folder hierarchy. + * The API is named ‘documents’ rather than ‘drive’ as it used to use the Google + * Documents API, which has since been deprecated. + * + * For more details of Google Drive's GData API, see the + * + * online documentation. + * + * Fore more details about the spreadsheet downloads handling, see the + * + * online explanation about the problem. + * + * + * Uploading a Document from Disk + * + * GDataDocumentsService *service; + * GDataDocumentsDocument *document, *uploaded_document; + * GFile *document_file; + * GDataDocumentsFolder *destination_folder; + * GFileInfo *file_info; + * const gchar *slug, *content_type; + * GFileInputStream *file_stream; + * GDataUploadStream *upload_stream; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_documents_service (); + * + * /* Get the document file to upload and the folder to upload it into */ + * document_file = g_file_new_for_path ("document.odt"); + * destination_folder = query_user_for_destination_folder (service); + * + * /* Get the file's display name and content type */ + * file_info = g_file_query_info (document_file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, + * G_FILE_QUERY_INFO_NONE, NULL, &error); + * + * if (error != NULL) { + * g_error ("Error getting document file information: %s", error->message); + * g_error_free (error); + * g_object_unref (destination_folder); + * g_object_unref (document_file); + * g_object_unref (service); + * return; + * } + * + * slug = g_file_info_get_display_name (file_info); + * content_type = g_file_info_get_content_type (file_info); + * + * /* Get an input stream for the file */ + * file_stream = g_file_read (document_file, NULL, &error); + * + * g_object_unref (document_file); + * + * if (error != NULL) { + * g_error ("Error getting document file stream: %s", error->message); + * g_error_free (error); + * g_object_unref (file_info); + * g_object_unref (destination_folder); + * g_object_unref (service); + * return; + * } + * + * /* Create the document metadata to upload */ + * document = gdata_documents_text_new (NULL); + * gdata_entry_set_title (GDATA_ENTRY (document), "Document Title"); + * + * /* Get an upload stream for the document */ + * upload_stream = gdata_documents_service_upload_document (service, document, slug, content_type, destination_folder, NULL, &error); + * + * g_object_unref (document); + * g_object_unref (file_info); + * g_object_unref (destination_folder); + * + * if (error != NULL) { + * g_error ("Error getting upload stream: %s", error->message); + * g_error_free (error); + * g_object_unref (file_stream); + * g_object_unref (service); + * return; + * } + * + * /* Upload the document. This is a blocking operation, and should normally be done asynchronously. */ + * g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), G_INPUT_STREAM (file_stream), + * G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error); + * + * g_object_unref (file_stream); + * + * if (error != NULL) { + * g_error ("Error splicing streams: %s", error->message); + * g_error_free (error); + * g_object_unref (upload_stream); + * g_object_unref (service); + * return; + * } + * + * /* Finish off the upload by parsing the returned updated document metadata entry */ + * uploaded_document = gdata_documents_service_finish_upload (service, upload_stream, &error); + * + * g_object_unref (upload_stream); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error uploading document: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Do something with the uploaded document */ + * + * g_object_unref (uploaded_document); + * + * + * + * The Drive service can be manipulated using batch operations, too. See the + * online documentation on batch + * operations for more information. + * + * + * Performing a Batch Operation on Documents + * + * GDataDocumentsService *service; + * GDataBatchOperation *operation; + * GDataFeed *feed; + * GDataLink *batch_link; + * GList *i; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_documents_service (); + * + * /* Create the batch operation; this requires that we have done a query first so that we can get the batch link */ + * feed = do_some_query (service); + * batch_link = gdata_feed_look_up_link (feed, GDATA_LINK_BATCH); + * operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_link_get_uri (batch_link)); + * g_object_unref (feed); + * + * gdata_batch_operation_add_query (operation, presentation_entry_id_to_query, GDATA_TYPE_DOCUMENTS_PRESENTATION, + * (GDataBatchOperationCallback) batch_query_cb, user_data); + * gdata_batch_operation_add_insertion (operation, new_entry, (GDataBatchOperationCallback) batch_insertion_cb, user_data); + * gdata_batch_operation_add_update (operation, old_entry, (GDataBatchOperationCallback) batch_update_cb, user_data); + * gdata_batch_operation_add_deletion (operation, entry_to_delete, (GDataBatchOperationCallback) batch_deletion_cb, user_data); + * + * /* Run the batch operation and handle the results in the various callbacks */ + * gdata_test_batch_operation_run (operation, NULL, &error); + * + * g_object_unref (operation); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error running batch operation: %s", error->message); + * g_error_free (error); + * return; + * } + * + * static void + * batch_query_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_type == GDATA_BATCH_OPERATION_QUERY */ + * /* Reference and do something with the returned entry. */ + * } + * + * static void + * batch_insertion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_type == GDATA_BATCH_OPERATION_INSERTION */ + * /* Reference and do something with the returned entry. */ + * } + * + * static void + * batch_update_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_type == GDATA_BATCH_OPERATION_UPDATE */ + * /* Reference and do something with the returned entry. */ + * } + * + * static void + * batch_deletion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) + * { + * /* operation_type == GDATA_BATCH_OPERATION_DELETION, entry == NULL */ + * } + * + * + * + * Starred documents are denoted by being in the %GDATA_CATEGORY_SCHEMA_LABELS_STARRED category of the %GDATA_CATEGORY_SCHEMA_LABELS schema. Documents + * can be starred or unstarred simply by adding or removing this category from them and updating the document: + * + * + * Starring a Document + * + * GDataDocumentsService *service; + * GDataDocumentsEntry *document, *updated_document; + * GDataCategory *starred_category; + * GError *error = NULL; + * + * /* Create a service and retrieve the document to be starred */ + * service = create_documents_service (); + * document = get_document_to_be_starred (service); + * + * /* Add the “starred” category to the document */ + * starred_category = gdata_category_new (GDATA_CATEGORY_SCHEMA_LABELS_STARRED, GDATA_CATEGORY_SCHEMA_LABELS, "starred"); + * gdata_entry_add_category (GDATA_ENTRY (document), starred_category); + * g_object_unref (starred_category); + * + * /* Propagate the updated document to the server */ + * updated_document = GDATA_DOCUMENTS_ENTRY (gdata_service_update_entry (GDATA_SERVICE (service), + * gdata_documents_service_get_primary_authorization_domain (), + * GDATA_ENTRY (document), NULL, &error)); + * + * g_object_unref (document); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error starring document: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Do something with the newly-starred document, like update it in the UI */ + * + * g_object_unref (updated_document); + * + * + * + * Since: 0.4.0 + */ + +#include +#include +#include +#include +#include + +#include "gdata-documents-service.h" +#include "gdata-documents-utils.h" +#include "gdata-batchable.h" +#include "gdata-service.h" +#include "gdata-private.h" +#include "gdata-upload-stream.h" + +GQuark +gdata_documents_service_error_quark (void) +{ + return g_quark_from_static_string ("gdata-documents-service-error-quark"); +} + +static void append_query_headers (GDataService *self, GDataAuthorizationDomain *domain, SoupMessage *message); +static GList *get_authorization_domains (void); +static gchar *_get_upload_uri_for_query_and_folder (GDataDocumentsUploadQuery *query, + GDataDocumentsFolder *folder) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +_GDATA_DEFINE_AUTHORIZATION_DOMAIN (documents, "writely", "https://www.googleapis.com/auth/drive") +_GDATA_DEFINE_AUTHORIZATION_DOMAIN (spreadsheets, "wise", "https://spreadsheets.google.com/feeds/") +G_DEFINE_TYPE_WITH_CODE (GDataDocumentsService, gdata_documents_service, GDATA_TYPE_SERVICE, G_IMPLEMENT_INTERFACE (GDATA_TYPE_BATCHABLE, NULL)) + +static void +gdata_documents_service_class_init (GDataDocumentsServiceClass *klass) +{ + GDataServiceClass *service_class = GDATA_SERVICE_CLASS (klass); + service_class->feed_type = GDATA_TYPE_DOCUMENTS_FEED; + + service_class->append_query_headers = append_query_headers; + service_class->get_authorization_domains = get_authorization_domains; + + service_class->api_version = "3"; +} + +static void +gdata_documents_service_init (GDataDocumentsService *self) +{ + /* Nothing to see here */ +} + +static void +append_query_headers (GDataService *self, GDataAuthorizationDomain *domain, SoupMessage *message) +{ + g_assert (message != NULL); + + if (message->method == SOUP_METHOD_POST && soup_message_headers_get_one (message->request_headers, "X-Upload-Content-Length") == NULL) { + gchar *upload_uri; + const gchar *v3_pos; + + upload_uri = soup_uri_to_string (soup_message_get_uri (message), FALSE); + v3_pos = strstr (upload_uri, "://docs.google.com/feeds/upload/create-session/default/private/full"); + + if (v3_pos != NULL) { + gchar *v2_upload_uri; + SoupURI *_v2_upload_uri; + + /* Content length header for resumable uploads. Only set it if this looks like the initial request of a resumable upload, and + * if no content length has been set previously. + * This allows methods like gdata_service_insert_entry() (which aren't resumable-upload-aware) to continue working for creating + * documents with metadata only, by simulating the initial request of a resumable upload as described here: + * https://developers.google.com/google-apps/documents-list/#creating_a_new_document_or_file_with_metadata_only */ + soup_message_headers_replace (message->request_headers, "X-Upload-Content-Length", "0"); + + /* Also set the encoding to be content length encoding. */ + soup_message_headers_set_encoding (message->request_headers, SOUP_ENCODING_CONTENT_LENGTH); + + /* HACK: Work around http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3033 by changing the upload URI + * to the v2 API's upload URI. Grrr. */ + v2_upload_uri = g_strconcat (_gdata_service_get_scheme (), "://docs.google.com/feeds/default/private/full", + v3_pos + strlen ("://docs.google.com/feeds/upload/create-session/default/private/full"), NULL); + _v2_upload_uri = soup_uri_new (v2_upload_uri); + soup_message_set_uri (message, _v2_upload_uri); + soup_uri_free (_v2_upload_uri); + g_free (v2_upload_uri); + } + + g_free (upload_uri); + } + + /* Chain up to the parent class */ + GDATA_SERVICE_CLASS (gdata_documents_service_parent_class)->append_query_headers (self, domain, message); +} + +static GList * +get_authorization_domains (void) +{ + GList *authorization_domains = NULL; + + authorization_domains = g_list_prepend (authorization_domains, get_documents_authorization_domain ()); + authorization_domains = g_list_prepend (authorization_domains, get_spreadsheets_authorization_domain ()); + + return authorization_domains; +} + +/** + * gdata_documents_service_new: + * @authorizer: (allow-none): a #GDataAuthorizer to authorize the service's requests, or %NULL + * + * Creates a new #GDataDocumentsService using the given #GDataAuthorizer. If @authorizer is %NULL, all requests are made as an unauthenticated user. + * + * Return value: a new #GDataDocumentsService, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataDocumentsService * +gdata_documents_service_new (GDataAuthorizer *authorizer) +{ + g_return_val_if_fail (authorizer == NULL || GDATA_IS_AUTHORIZER (authorizer), NULL); + + return g_object_new (GDATA_TYPE_DOCUMENTS_SERVICE, + "authorizer", authorizer, + NULL); +} + +/** + * gdata_documents_service_get_primary_authorization_domain: + * + * The primary #GDataAuthorizationDomain for interacting with Google Documents. This will not normally need to be used, as it's used internally + * by the #GDataDocumentsService methods. However, if using the plain #GDataService methods to implement custom queries or requests which libgdata + * does not support natively, then this domain may be needed to authorize the requests. + * + * The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. + * + * Return value: (transfer none): the service's authorization domain + * + * Since: 0.9.0 + */ +GDataAuthorizationDomain * +gdata_documents_service_get_primary_authorization_domain (void) +{ + return get_documents_authorization_domain (); +} + +/** + * gdata_documents_service_get_spreadsheet_authorization_domain: + * + * The #GDataAuthorizationDomain for interacting with spreadsheet data. This will not normally need to be used, as it's automatically used internally + * by the #GDataDocumentsService methods. However, if using the plain #GDataService methods to implement custom queries or requests which libgdata + * does not support natively, then this domain may be needed to authorize the requests which pertain to the Google Spreadsheets Data API, such as + * requests to download or upload spreadsheet documents. + * + * The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. + * + * Return value: (transfer none): the service's authorization domain + * + * Since: 0.9.0 + */ +GDataAuthorizationDomain * +gdata_documents_service_get_spreadsheet_authorization_domain (void) +{ + return get_spreadsheets_authorization_domain (); +} + +/** + * gdata_documents_service_get_metadata: + * @self: a #GDataDocumentsService + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Gets a #GDataDocumentsMetadata object containing metadata about the documents + * service itself, like how large the user quota is. + * + * Return value: (transfer full): the service's metadata object; unref with g_object_unref() + * + * Since: 0.17.9 + */ +GDataDocumentsMetadata * +gdata_documents_service_get_metadata (GDataDocumentsService *self, GCancellable *cancellable, GError **error) +{ + GDataDocumentsMetadata *metadata; + const gchar *uri = "https://www.googleapis.com/drive/v2/about"; + SoupMessage *message; + guint status; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + message = _gdata_service_build_message (GDATA_SERVICE (self), get_documents_authorization_domain (), SOUP_METHOD_GET, uri, NULL, FALSE); + + /* Send the message */ + status = _gdata_service_send_message (GDATA_SERVICE (self), message, cancellable, error); + + if (status == SOUP_STATUS_NONE || status == SOUP_STATUS_CANCELLED) { + /* Redirect error or cancelled */ + g_object_unref (message); + return NULL; + } else if (status != SOUP_STATUS_OK) { + /* Error */ + GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (self); + g_assert (klass->parse_error_response != NULL); + klass->parse_error_response (GDATA_SERVICE (self), GDATA_OPERATION_QUERY, status, message->reason_phrase, message->response_body->data, + message->response_body->length, error); + g_object_unref (message); + return NULL; + } + + /* Parse the JSON; and update the entry */ + g_assert (message->response_body->data != NULL); + metadata = GDATA_DOCUMENTS_METADATA (gdata_parsable_new_from_json (GDATA_TYPE_DOCUMENTS_METADATA, message->response_body->data, message->response_body->length, + error)); + g_object_unref (message); + + return metadata; +} + +static void +get_metadata_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataDocumentsService *service = GDATA_DOCUMENTS_SERVICE (source_object); + g_autoptr(GDataDocumentsMetadata) metadata = NULL; + g_autoptr(GError) error = NULL; + + /* Copy the metadata and return */ + metadata = gdata_documents_service_get_metadata (service, cancellable, &error); + if (error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&metadata), g_object_unref); +} + +/** + * gdata_documents_service_get_metadata_async: + * @self: a #GDataDocumentsService + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the operation is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Gets a #GDataDocumentsMetadata object containing metadata about the documents + * service itself, like how large the user quota is. + * + * For more details, see gdata_documents_service_get_metadata(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_documents_service_get_metadata_finish() to get the results + * of the operation. + * + * Since: 0.17.9 + */ +void +gdata_documents_service_get_metadata_async (GDataDocumentsService *self, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + + g_return_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_documents_service_get_metadata_async); + g_task_run_in_thread (task, get_metadata_thread); +} + +/** + * gdata_documents_service_get_metadata_finish: + * @self: a #GDataDocumentsService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finish an asynchronous operation to get a #GDataDocumentsMetadata started with gdata_documents_service_get_metadata_async(). + * + * Return value: (transfer full): the service's metadata object; unref with g_object_unref() + * + * Since: 0.17.9 + */ +GDataDocumentsMetadata * +gdata_documents_service_get_metadata_finish (GDataDocumentsService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_documents_service_get_metadata_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} + +static gchar * +_query_documents_build_request_uri (GDataDocumentsQuery *query) +{ + /* If we want to query for documents contained in a folder, the URI is different. + * The "/[folder:id]" suffix is added by the GDataQuery later. */ + return g_strdup ("https://www.googleapis.com/drive/v2/files"); +} + +/** + * gdata_documents_service_query_documents: + * @self: a #GDataDocumentsService + * @query: (allow-none): a #GDataDocumentsQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service to return a list of documents matching the given @query. Note that @query has to be a #GDataDocumentsQuery, rather than just + * a #GDataQuery, as it uses the folder ID specified in #GDataDocumentsQuery:folder-id. + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataDocumentsFeed of query results; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataDocumentsFeed * +gdata_documents_service_query_documents (GDataDocumentsService *self, GDataDocumentsQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) +{ + GDataFeed *feed; + gchar *request_uri; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_DOCUMENTS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_documents_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to query documents.")); + return NULL; + } + + request_uri = _query_documents_build_request_uri (query); + feed = gdata_service_query (GDATA_SERVICE (self), get_documents_authorization_domain (), request_uri, GDATA_QUERY (query), + GDATA_TYPE_DOCUMENTS_ENTRY, cancellable, progress_callback, progress_user_data, error); + g_free (request_uri); + + return GDATA_DOCUMENTS_FEED (feed); +} + +/** + * gdata_documents_service_query_documents_async: + * @self: a #GDataDocumentsService + * @query: (allow-none): a #GDataDocumentsQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return a list of documents matching the given @query. @self and + * @query are both reffed when this function is called, so can safely be unreffed after this function returns. + * + * For more details, see gdata_documents_service_query_documents(), which is the synchronous version of this function, + * and gdata_service_query_async(), which is the base asynchronous query function. + * + * Since: 0.9.1 + */ +void +gdata_documents_service_query_documents_async (GDataDocumentsService *self, GDataDocumentsQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self)); + g_return_if_fail (query == NULL || GDATA_IS_DOCUMENTS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_documents_authorization_domain ()) == FALSE) { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", + _("You must be authenticated to query documents.")); + + return; + } + + request_uri = _query_documents_build_request_uri (query); + gdata_service_query_async (GDATA_SERVICE (self), get_documents_authorization_domain (), request_uri, GDATA_QUERY (query), + GDATA_TYPE_DOCUMENTS_ENTRY, cancellable, progress_callback, progress_user_data, + destroy_progress_user_data, callback, user_data); + g_free (request_uri); +} + +static void +add_folder_link_to_entry (GDataDocumentsEntry *entry, GDataDocumentsFolder *folder) +{ + GDataLink *_link; + const gchar *id; + gchar *uri; + + /* HACK: Build the GDataLink:uri from the ID by adding the prefix. */ + id = gdata_entry_get_id (GDATA_ENTRY (folder)); + uri = g_strconcat (GDATA_DOCUMENTS_URI_PREFIX, id, NULL); + _link = gdata_link_new (uri, GDATA_LINK_PARENT); + gdata_entry_add_link (GDATA_ENTRY (entry), _link); + g_object_unref (_link); + g_free (uri); +} + +static GDataUploadStream * +upload_update_document (GDataDocumentsService *self, GDataDocumentsDocument *document, const gchar *slug, const gchar *content_type, + GDataDocumentsFolder *folder, goffset content_length, const gchar *method, const gchar *upload_uri, + GCancellable *cancellable) +{ + /* HACK: Corrects a bug on spreadsheet content types handling + * The content type for ODF spreadsheets is "application/vnd.oasis.opendocument.spreadsheet" for my ODF spreadsheet; + * but Google Documents' spreadsheet service is waiting for "application/x-vnd.oasis.opendocument.spreadsheet" + * and nothing else. + * Bug filed with Google: http://code.google.com/p/gdata-issues/issues/detail?id=1127 */ + if (strcmp (content_type, "application/vnd.oasis.opendocument.spreadsheet") == 0) + content_type = "application/x-vnd.oasis.opendocument.spreadsheet"; + + if (folder != NULL) + add_folder_link_to_entry (GDATA_DOCUMENTS_ENTRY (document), folder); + + /* We need streaming file I/O: GDataUploadStream */ + if (content_length == -1) { + /* Non-resumable upload. */ + return GDATA_UPLOAD_STREAM (gdata_upload_stream_new (GDATA_SERVICE (self), get_documents_authorization_domain (), method, upload_uri, + GDATA_ENTRY (document), slug, content_type, cancellable)); + } else { + /* Resumable upload. */ + return GDATA_UPLOAD_STREAM (gdata_upload_stream_new_resumable (GDATA_SERVICE (self), get_documents_authorization_domain (), method, + upload_uri, GDATA_ENTRY (document), slug, content_type, content_length, + cancellable)); + } +} + +static gboolean +_upload_checks (GDataDocumentsService *self, GDataDocumentsDocument *document, GError **error) +{ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_documents_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to upload documents.")); + return FALSE; + } + + if (document != NULL && gdata_entry_is_inserted (GDATA_ENTRY (document)) == TRUE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED, + _("The document has already been uploaded.")); + return FALSE; + } + + return TRUE; +} + +/** + * gdata_documents_service_upload_document: + * @self: an authenticated #GDataDocumentsService + * @document: (allow-none): the #GDataDocumentsDocument to insert, or %NULL + * @slug: the filename to give to the uploaded document + * @content_type: the content type of the uploaded data + * @folder: (allow-none): the folder to which the document should be uploaded, or %NULL + * @cancellable: (allow-none): a #GCancellable for the entire upload stream, or %NULL + * @error: a #GError, or %NULL + * + * Uploads a document to Google Documents, using the properties from @document and the document data written to the resulting #GDataUploadStream. If + * the document data does not need to be provided at the moment, just the metadata, use gdata_service_insert_entry() instead (e.g. in the case of + * creating a new, empty file to be edited at a later date). + * + * This performs a non-resumable upload, unlike gdata_documents_service_upload_document(). This means that errors during transmission will cause the + * upload to fail, and the entire document will have to be re-uploaded. It is recommended that gdata_documents_service_upload_document_resumable() + * be used instead. + * + * If @document is %NULL, only the document data will be uploaded. The new document entry will be named using @slug, and will have default metadata. + * + * The stream returned by this function should be written to using the standard #GOutputStream methods, asychronously or synchronously. Once the stream + * is closed (using g_output_stream_close()), gdata_documents_service_finish_upload() should be called on it to parse and return the updated + * #GDataDocumentsDocument for the document. This must be done, as @document isn't updated in-place. + * + * In order to cancel the upload, a #GCancellable passed in to @cancellable must be cancelled using g_cancellable_cancel(). Cancelling the individual + * #GOutputStream operations on the #GDataUploadStream will not cancel the entire upload; merely the write or close operation in question. See the + * #GDataUploadStream:cancellable for more details. + * + * Any upload errors will be thrown by the stream methods, and may come from the #GDataServiceError domain. + * + * Return value: (transfer full): a #GDataUploadStream to write the document data to, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataUploadStream * +gdata_documents_service_upload_document (GDataDocumentsService *self, GDataDocumentsDocument *document, const gchar *slug, const gchar *content_type, + GDataDocumentsFolder *folder, GCancellable *cancellable, GError **error) +{ + GDataUploadStream *upload_stream; + gchar *upload_uri; + gchar *upload_uri_prefix; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (document == NULL || GDATA_IS_DOCUMENTS_DOCUMENT (document), NULL); + g_return_val_if_fail (slug != NULL && *slug != '\0', NULL); + g_return_val_if_fail (content_type != NULL && *content_type != '\0', NULL); + g_return_val_if_fail (folder == NULL || GDATA_IS_DOCUMENTS_FOLDER (folder), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (_upload_checks (self, document, error) == FALSE) { + return NULL; + } + + upload_uri_prefix = gdata_documents_service_get_upload_uri (folder); + upload_uri = g_strconcat (upload_uri_prefix, "?uploadType=multipart", NULL); + upload_stream = upload_update_document (self, document, slug, content_type, folder, -1, SOUP_METHOD_POST, upload_uri, cancellable); + g_free (upload_uri); + g_free (upload_uri_prefix); + + return upload_stream; +} + +/** + * gdata_documents_service_upload_document_resumable: + * @self: an authenticated #GDataDocumentsService + * @document: (allow-none): the #GDataDocumentsDocument to insert, or %NULL + * @slug: the filename to give to the uploaded document + * @content_type: the content type of the uploaded data + * @content_length: the size (in bytes) of the file being uploaded + * @query: (allow-none): a query specifying parameters for the upload, or %NULL + * @cancellable: (allow-none): a #GCancellable for the entire upload stream, or %NULL + * @error: a #GError, or %NULL + * + * Uploads a document to Google Documents, using the properties from @document and the document data written to the resulting #GDataUploadStream. If + * the document data does not need to be provided at the moment, just the metadata, use gdata_service_insert_entry() instead (e.g. in the case of + * creating a new, empty file to be edited at a later date). + * + * Unlike gdata_documents_service_upload_document(), this method performs a + * resumable upload which allows for correction of + * transmission errors without re-uploading the entire file. Use of this method is preferred over gdata_documents_service_upload_document(). + * + * If @document is %NULL, only the document data will be uploaded. The new document entry will be named using @slug, and will have default metadata. + * + * If non-%NULL, the @query specifies parameters for the upload, such as a #GDataDocumentsFolder to upload the document into; and whether to treat + * the document as an opaque file, or convert it to a standard format. If @query is %NULL, the document will be uploaded into the root folder, and + * automatically converted to a standard format. No OCR or automatic language translation will be performed by default. + * + * If @query is non-%NULL and #GDataDocumentsUploadQuery:convert is %FALSE, @document must be an instance of #GDataDocumentsDocument. Otherwise, + * @document must be a subclass of it, such as #GDataDocumentsPresentation. + * + * The stream returned by this function should be written to using the standard #GOutputStream methods, asychronously or synchronously. Once the stream + * is closed (using g_output_stream_close()), gdata_documents_service_finish_upload() should be called on it to parse and return the updated + * #GDataDocumentsDocument for the document. This must be done, as @document isn't updated in-place. + * + * In order to cancel the upload, a #GCancellable passed in to @cancellable must be cancelled using g_cancellable_cancel(). Cancelling the individual + * #GOutputStream operations on the #GDataUploadStream will not cancel the entire upload; merely the write or close operation in question. See the + * #GDataUploadStream:cancellable for more details. + * + * Any upload errors will be thrown by the stream methods, and may come from the #GDataServiceError domain. + * + * Return value: (transfer full): a #GDataUploadStream to write the document data to, or %NULL; unref with g_object_unref() + * + * Since: 0.13.0 + */ +GDataUploadStream * +gdata_documents_service_upload_document_resumable (GDataDocumentsService *self, GDataDocumentsDocument *document, const gchar *slug, + const gchar *content_type, goffset content_length, GDataDocumentsUploadQuery *query, + GCancellable *cancellable, GError **error) +{ + GDataUploadStream *upload_stream; + gchar *upload_uri; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (document == NULL || GDATA_IS_DOCUMENTS_DOCUMENT (document), NULL); + g_return_val_if_fail (slug != NULL && *slug != '\0', NULL); + g_return_val_if_fail (content_type != NULL && *content_type != '\0', NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_DOCUMENTS_UPLOAD_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (_upload_checks (self, document, error) == FALSE) { + return NULL; + } + + upload_uri = _get_upload_uri_for_query_and_folder (query, NULL); + upload_stream = upload_update_document (self, document, slug, content_type, NULL, content_length, SOUP_METHOD_POST, upload_uri, cancellable); + g_free (upload_uri); + + return upload_stream; +} + +static gboolean +_update_checks (GDataDocumentsService *self, GError **error) +{ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_documents_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to update documents.")); + return FALSE; + } + + return TRUE; +} + +/** + * gdata_documents_service_update_document: + * @self: a #GDataDocumentsService + * @document: the #GDataDocumentsDocument to update + * @slug: the filename to give to the uploaded document + * @content_type: the content type of the uploaded data + * @cancellable: (allow-none): a #GCancellable for the entire upload stream, or %NULL + * @error: a #GError, or %NULL + * + * Update the document using the properties from @document and the document data written to the resulting #GDataUploadStream. If the document data does + * not need to be changed, just the metadata, use gdata_service_update_entry() instead. + * + * This performs a non-resumable upload, unlike gdata_documents_service_update_document(). This means that errors during transmission will cause the + * upload to fail, and the entire document will have to be re-uploaded. It is recommended that gdata_documents_service_update_document_resumable() + * be used instead. + * + * The stream returned by this function should be written to using the standard #GOutputStream methods, asychronously or synchronously. Once the stream + * is closed (using g_output_stream_close()), gdata_documents_service_finish_upload() should be called on it to parse and return the updated + * #GDataDocumentsDocument for the document. This must be done, as @document isn't updated in-place. + * + * In order to cancel the update, a #GCancellable passed in to @cancellable must be cancelled using g_cancellable_cancel(). Cancelling the individual + * #GOutputStream operations on the #GDataUploadStream will not cancel the entire update; merely the write or close operation in question. See the + * #GDataUploadStream:cancellable for more details. + * + * Any upload errors will be thrown by the stream methods, and may come from the #GDataServiceError domain. + * + * For more information, see gdata_service_update_entry(). + * + * Return value: (transfer full): a #GDataUploadStream to write the document data to; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataUploadStream * +gdata_documents_service_update_document (GDataDocumentsService *self, GDataDocumentsDocument *document, const gchar *slug, const gchar *content_type, + GCancellable *cancellable, GError **error) +{ + GDataUploadStream *update_stream; + const gchar *id; + gchar *update_uri; + gchar *update_uri_prefix; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_DOCUMENTS_DOCUMENT (document), NULL); + g_return_val_if_fail (slug != NULL && *slug != '\0', NULL); + g_return_val_if_fail (content_type != NULL && *content_type != '\0', NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (_update_checks (self, error) == FALSE) { + return NULL; + } + + update_uri_prefix = gdata_documents_service_get_upload_uri (NULL); + id = gdata_entry_get_id (GDATA_ENTRY (document)); + update_uri = g_strconcat (update_uri_prefix, "/", id, "?uploadType=multipart", NULL); + update_stream = upload_update_document (self, document, slug, content_type, NULL, -1, SOUP_METHOD_PUT, update_uri, cancellable); + g_free (update_uri); + g_free (update_uri_prefix); + + return update_stream; +} + +/** + * gdata_documents_service_update_document_resumable: + * @self: a #GDataDocumentsService + * @document: the #GDataDocumentsDocument to update + * @slug: the filename to give to the uploaded document + * @content_type: the content type of the uploaded data + * @content_length: the size (in bytes) of the file being uploaded + * @cancellable: (allow-none): a #GCancellable for the entire upload stream, or %NULL + * @error: a #GError, or %NULL + * + * Update the document using the properties from @document and the document data written to the resulting #GDataUploadStream. If the document data does + * not need to be changed, just the metadata, use gdata_service_update_entry() instead. + * + * Unlike gdata_documents_service_update_document(), this method performs a + * resumable upload which allows for correction of + * transmission errors without re-uploading the entire file. Use of this method is preferred over gdata_documents_service_update_document(). + * + * The stream returned by this function should be written to using the standard #GOutputStream methods, asychronously or synchronously. Once the stream + * is closed (using g_output_stream_close()), gdata_documents_service_finish_upload() should be called on it to parse and return the updated + * #GDataDocumentsDocument for the document. This must be done, as @document isn't updated in-place. + * + * In order to cancel the update, a #GCancellable passed in to @cancellable must be cancelled using g_cancellable_cancel(). Cancelling the individual + * #GOutputStream operations on the #GDataUploadStream will not cancel the entire update; merely the write or close operation in question. See the + * #GDataUploadStream:cancellable for more details. + * + * Any upload errors will be thrown by the stream methods, and may come from the #GDataServiceError domain. + * + * For more information, see gdata_service_update_entry(). + * + * Return value: (transfer full): a #GDataUploadStream to write the document data to; unref with g_object_unref() + * + * Since: 0.13.0 + */ +GDataUploadStream * +gdata_documents_service_update_document_resumable (GDataDocumentsService *self, GDataDocumentsDocument *document, const gchar *slug, + const gchar *content_type, goffset content_length, GCancellable *cancellable, GError **error) +{ + GDataLink *update_link; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_DOCUMENTS_DOCUMENT (document), NULL); + g_return_val_if_fail (slug != NULL && *slug != '\0', NULL); + g_return_val_if_fail (content_type != NULL && *content_type != '\0', NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (_update_checks (self, error) == FALSE) { + return NULL; + } + + update_link = gdata_entry_look_up_link (GDATA_ENTRY (document), GDATA_LINK_RESUMABLE_EDIT_MEDIA); + g_assert (update_link != NULL); + + return upload_update_document (self, document, slug, content_type, NULL, content_length, SOUP_METHOD_PUT, gdata_link_get_uri (update_link), + cancellable); +} + +/** + * gdata_documents_service_finish_upload: + * @self: a #GDataDocumentsService + * @upload_stream: the #GDataUploadStream from the operation + * @error: a #GError, or %NULL + * + * Finish off a document upload or update operation started by gdata_documents_service_upload_document() or gdata_documents_service_update_document(), + * parsing the result and returning the new or updated #GDataDocumentsDocument. + * + * If an error occurred during the upload or update operation, it will have been returned during the operation (e.g. by g_output_stream_splice() or one + * of the other stream methods). In such a case, %NULL will be returned but @error will remain unset. @error is only set in the case that the server + * indicates that the operation was successful, but an error is encountered in parsing the result sent by the server. + * + * In the case that no #GDataDocumentsDocument was passed (to gdata_documents_service_upload_document() or gdata_documents_service_update_document()) + * when starting the operation, %GDATA_DOCUMENTS_SERVICE_ERROR_INVALID_CONTENT_TYPE will be thrown in @error if the content type of the uploaded data + * could not be mapped to a document type with which to interpret the response from the server. + * + * Return value: (transfer full): the new or updated #GDataDocumentsDocument, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataDocumentsDocument * +gdata_documents_service_finish_upload (GDataDocumentsService *self, GDataUploadStream *upload_stream, GError **error) +{ + const gchar *content_type; + const gchar *response_body; + gssize response_length; + GType new_document_type = G_TYPE_INVALID; + + /* Get and parse the response from the server */ + response_body = gdata_upload_stream_get_response (upload_stream, &response_length); + if (response_body == NULL || response_length == 0) { + /* Error will have been set by the upload stream. */ + return NULL; + } + + content_type = gdata_upload_stream_get_content_type (upload_stream); + new_document_type = gdata_documents_utils_get_type_from_content_type (content_type); + + if (g_type_is_a (new_document_type, GDATA_TYPE_DOCUMENTS_DOCUMENT) == FALSE) { + g_set_error (error, GDATA_DOCUMENTS_SERVICE_ERROR, GDATA_DOCUMENTS_SERVICE_ERROR_INVALID_CONTENT_TYPE, + _("The content type of the supplied document (‘%s’) could not be recognized."), + content_type); + return NULL; + } + + return GDATA_DOCUMENTS_DOCUMENT (gdata_parsable_new_from_json (new_document_type, response_body, (gint) response_length, error)); +} + +/** + * gdata_documents_service_copy_document: + * @self: an authenticated #GDataDocumentsService + * @document: the #GDataDocumentsDocument to copy + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Copy the given @document, producing a duplicate document in the same folder and returning its #GDataDocumentsDocument. + * + * Errors from #GDataServiceError can be returned for exceptional conditions, as determined by the server. + * + * Return value: (transfer full): the duplicate #GDataDocumentsDocument, or %NULL; unref with g_object_unref() + * + * Since: 0.13.1 + */ +GDataDocumentsDocument * +gdata_documents_service_copy_document (GDataDocumentsService *self, GDataDocumentsDocument *document, GCancellable *cancellable, GError **error) +{ + GDataDocumentsDocument *new_document; + GDataEntry *parent = NULL; + GList *i; + GList *parent_folders_list; + const gchar *parent_id = NULL; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_DOCUMENTS_DOCUMENT (document), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_documents_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to copy documents.")); + return NULL; + } + + parent_folders_list = gdata_entry_look_up_links (GDATA_ENTRY (document), GDATA_LINK_PARENT); + for (i = parent_folders_list; i != NULL; i = i->next) { + GDataLink *_link = GDATA_LINK (i->data); + const gchar *id; + + id = gdata_documents_utils_get_id_from_link (_link); + if (id != NULL) { + parent_id = id; + break; + } + } + + g_list_free (parent_folders_list); + + if (parent_id == NULL) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NOT_FOUND, _("Parent folder not found")); + return NULL; + } + + parent = gdata_service_query_single_entry (GDATA_SERVICE (self), get_documents_authorization_domain (), parent_id, NULL, GDATA_TYPE_DOCUMENTS_FOLDER, cancellable, error); + if (parent == NULL) + return NULL; + + new_document = GDATA_DOCUMENTS_DOCUMENT (gdata_documents_service_add_entry_to_folder (self, GDATA_DOCUMENTS_ENTRY (document), GDATA_DOCUMENTS_FOLDER (parent), cancellable, error)); + g_object_unref (parent); + + return new_document; +} + +static void +copy_document_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataDocumentsService *service = GDATA_DOCUMENTS_SERVICE (source_object); + GDataDocumentsDocument *document = task_data; + g_autoptr(GDataDocumentsDocument) new_document = NULL; + g_autoptr(GError) error = NULL; + + /* Copy the document and return */ + new_document = gdata_documents_service_copy_document (service, document, cancellable, &error); + if (error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&new_document), g_object_unref); +} + +/** + * gdata_documents_service_copy_document_async: + * @self: a #GDataDocumentsService + * @document: the #GDataDocumentsDocument to copy + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the operation is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Copy the given @document, producing a duplicate document in the same folder and returning its #GDataDocumentsDocument. @self and @document are + * both reffed when this function is called, so can safely be unreffed after this function returns. + * + * For more details, see gdata_documents_service_copy_document(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_documents_service_copy_document_finish() to get the results + * of the operation. + * + * Since: 0.13.1 + */ +void +gdata_documents_service_copy_document_async (GDataDocumentsService *self, GDataDocumentsDocument *document, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + + g_return_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self)); + g_return_if_fail (GDATA_IS_DOCUMENTS_DOCUMENT (document)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_documents_service_copy_document_async); + g_task_set_task_data (task, g_object_ref (document), (GDestroyNotify) g_object_unref); + g_task_run_in_thread (task, copy_document_thread); +} + +/** + * gdata_documents_service_copy_document_finish: + * @self: a #GDataDocumentsService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finish an asynchronous operation to copy a #GDataDocumentsDocument started with gdata_documents_service_copy_document_async(). + * + * Return value: (transfer full): the duplicate #GDataDocumentsDocument, or %NULL; unref with g_object_unref() + * + * Since: 0.13.1 + */ +GDataDocumentsDocument * +gdata_documents_service_copy_document_finish (GDataDocumentsService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_documents_service_copy_document_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} + +/** + * gdata_documents_service_add_entry_to_folder: + * @self: an authenticated #GDataDocumentsService + * @entry: the #GDataDocumentsEntry to copy + * @folder: the #GDataDocumentsFolder to copy @entry into + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Add the given @entry to the specified @folder, and return an updated #GDataDocumentsEntry for @entry. If the @entry is already in another folder, + * a copy will be added to the new folder. The copy and original will have different IDs. Note that @entry can't be a #GDataDocumentsFolder that + * already exists on the server. It can be a new #GDataDocumentsFolder, or a #GDataDocumentsDocument that is either new or already present on the + * server. + * + * Errors from #GDataServiceError can be returned for exceptional conditions, as determined by the server. + * + * Return value: (transfer full): an updated #GDataDocumentsEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataDocumentsEntry * +gdata_documents_service_add_entry_to_folder (GDataDocumentsService *self, GDataDocumentsEntry *entry, GDataDocumentsFolder *folder, + GCancellable *cancellable, GError **error) +{ + GDataDocumentsEntry *new_entry; + GDataDocumentsEntry *local_entry; + GDataOperationType operation_type; + GType entry_type; + const gchar *content_type; + const gchar *etag; + const gchar *title; + const gchar *uri_prefix = "https://www.googleapis.com/drive/v2/files"; + gchar *upload_data; + gchar *uri; + SoupMessage *message; + guint status; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (entry), NULL); + g_return_val_if_fail (GDATA_IS_DOCUMENTS_FOLDER (folder), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_documents_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to insert or move documents and folders.")); + return NULL; + } + + if (gdata_entry_is_inserted (GDATA_ENTRY (entry)) == TRUE) { + const gchar *id; + + id = gdata_entry_get_id (GDATA_ENTRY (entry)); + uri = g_strconcat (uri_prefix, "/", id, "/copy", NULL); + operation_type = GDATA_OPERATION_UPDATE; + } else { + uri = g_strdup (uri_prefix); + operation_type = GDATA_OPERATION_INSERTION; + } + + entry_type = G_OBJECT_TYPE (entry); + content_type = gdata_documents_utils_get_content_type (entry); + etag = gdata_entry_get_etag (GDATA_ENTRY (entry)); + title = gdata_entry_get_title (GDATA_ENTRY (entry)); + local_entry = g_object_new (entry_type, "etag", etag, "title", title, NULL); + gdata_documents_utils_add_content_type (local_entry, content_type); + add_folder_link_to_entry (local_entry, folder); + + message = _gdata_service_build_message (GDATA_SERVICE (self), get_documents_authorization_domain (), SOUP_METHOD_POST, uri, NULL, FALSE); + g_free (uri); + + /* Append the data */ + upload_data = gdata_parsable_get_json (GDATA_PARSABLE (local_entry)); + soup_message_set_request (message, "application/json", SOUP_MEMORY_TAKE, upload_data, strlen (upload_data)); + g_object_unref (local_entry); + + /* Send the message */ + status = _gdata_service_send_message (GDATA_SERVICE (self), message, cancellable, error); + + if (status == SOUP_STATUS_NONE || status == SOUP_STATUS_CANCELLED) { + /* Redirect error or cancelled */ + g_object_unref (message); + return NULL; + } else if (status != SOUP_STATUS_OK) { + /* Error */ + GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (self); + g_assert (klass->parse_error_response != NULL); + klass->parse_error_response (GDATA_SERVICE (self), operation_type, status, message->reason_phrase, message->response_body->data, + message->response_body->length, error); + g_object_unref (message); + return NULL; + } + + /* Parse the JSON; and update the entry */ + g_assert (message->response_body->data != NULL); + new_entry = GDATA_DOCUMENTS_ENTRY (gdata_parsable_new_from_json (entry_type, message->response_body->data, message->response_body->length, + error)); + g_object_unref (message); + + return new_entry; +} + +typedef struct { + GDataDocumentsEntry *entry; + GDataDocumentsFolder *folder; +} AddEntryToFolderData; + +static void +add_entry_to_folder_data_free (AddEntryToFolderData *data) +{ + g_object_unref (data->entry); + g_object_unref (data->folder); + g_slice_free (AddEntryToFolderData, data); +} + +static void +add_entry_to_folder_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataDocumentsService *service = GDATA_DOCUMENTS_SERVICE (source_object); + g_autoptr(GDataDocumentsEntry) updated_entry = NULL; + AddEntryToFolderData *data = task_data; + g_autoptr(GError) error = NULL; + + /* Add the entry to the folder and return */ + updated_entry = gdata_documents_service_add_entry_to_folder (service, data->entry, data->folder, cancellable, &error); + if (error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&updated_entry), (GDestroyNotify) g_object_unref); +} + +/** + * gdata_documents_service_add_entry_to_folder_async: + * @self: a #GDataDocumentsService + * @entry: the #GDataDocumentsEntry to add to @folder + * @folder: the #GDataDocumentsFolder to add @entry to + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the operation is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Add the given @entry to the specified @folder. @self, @entry and @folder are all reffed when this function is called, so can safely be unreffed + * after this function returns. + * + * For more details, see gdata_documents_service_add_entry_to_folder(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_documents_service_add_entry_to_folder_finish() to get the results + * of the operation. + * + * Since: 0.8.0 + */ +void +gdata_documents_service_add_entry_to_folder_async (GDataDocumentsService *self, GDataDocumentsEntry *entry, GDataDocumentsFolder *folder, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + AddEntryToFolderData *data; + + g_return_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self)); + g_return_if_fail (GDATA_IS_DOCUMENTS_ENTRY (entry)); + g_return_if_fail (GDATA_IS_DOCUMENTS_FOLDER (folder)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + data = g_slice_new (AddEntryToFolderData); + data->entry = g_object_ref (entry); + data->folder = g_object_ref (folder); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_documents_service_add_entry_to_folder_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) add_entry_to_folder_data_free); + g_task_run_in_thread (task, add_entry_to_folder_thread); +} + +/** + * gdata_documents_service_add_entry_to_folder_finish: + * @self: a #GDataDocumentsService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finish an asynchronous operation to add a #GDataDocumentsEntry to a folder started with gdata_documents_service_add_entry_to_folder_async(). + * + * Return value: (transfer full): an updated #GDataDocumentsEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataDocumentsEntry * +gdata_documents_service_add_entry_to_folder_finish (GDataDocumentsService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_documents_service_add_entry_to_folder_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} + +/** + * gdata_documents_service_remove_entry_from_folder: + * @self: a #GDataDocumentsService + * @entry: the #GDataDocumentsEntry to remove + * @folder: the #GDataDocumentsFolder from which we should remove @entry + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Remove the given @entry from @folder, and return an updated #GDataDocumentsEntry for @entry. @entry will remain a member of any other folders it's + * currently in. Note that @entry can be either a #GDataDocumentsDocument or a #GDataDocumentsFolder. + * + * Errors from #GDataServiceError can be returned for exceptional conditions, as determined by the server. + * + * Return value: (transfer full): an updated #GDataDocumentsEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataDocumentsEntry * +gdata_documents_service_remove_entry_from_folder (GDataDocumentsService *self, GDataDocumentsEntry *entry, GDataDocumentsFolder *folder, + GCancellable *cancellable, GError **error) +{ + const gchar *folder_id; + GList *i; + GList *parent_folders_list; + GDataLink *folder_link = NULL; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (entry), NULL); + g_return_val_if_fail (GDATA_IS_DOCUMENTS_FOLDER (folder), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_documents_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to move documents and folders.")); + return NULL; + } + + folder_id = gdata_entry_get_id (GDATA_ENTRY (folder)); + g_assert (folder_id != NULL); + + parent_folders_list = gdata_entry_look_up_links (GDATA_ENTRY (entry), GDATA_LINK_PARENT); + for (i = parent_folders_list; i != NULL; i = i->next) { + GDataLink *_link = GDATA_LINK (i->data); + const gchar *id; + + id = gdata_documents_utils_get_id_from_link (_link); + if (g_strcmp0 (folder_id, id) == 0) { + folder_link = _link; + break; + } + } + + g_list_free (parent_folders_list); + + if (folder_link == NULL) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NOT_FOUND, _("Parent folder not found")); + return NULL; + } + + gdata_entry_remove_link (GDATA_ENTRY (entry), folder_link); + + return GDATA_DOCUMENTS_ENTRY (gdata_service_update_entry (GDATA_SERVICE (self), get_documents_authorization_domain (), GDATA_ENTRY (entry), + cancellable, error)); +} + +typedef struct { + GDataDocumentsEntry *entry; + GDataDocumentsFolder *folder; +} RemoveEntryFromFolderData; + +static void +remove_entry_from_folder_data_free (RemoveEntryFromFolderData *data) +{ + g_object_unref (data->entry); + g_object_unref (data->folder); + g_slice_free (RemoveEntryFromFolderData, data); +} + +static void +remove_entry_from_folder_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataDocumentsService *service = GDATA_DOCUMENTS_SERVICE (source_object); + g_autoptr(GDataDocumentsEntry) updated_entry = NULL; + RemoveEntryFromFolderData *data = task_data; + g_autoptr(GError) error = NULL; + + /* Remove the entry from the folder and return */ + updated_entry = gdata_documents_service_remove_entry_from_folder (service, data->entry, data->folder, cancellable, &error); + if (error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&updated_entry), g_object_unref); +} + +/** + * gdata_documents_service_remove_entry_from_folder_async: + * @self: a #GDataDocumentsService + * @entry: the #GDataDocumentsEntry to remove from @folder + * @folder: the #GDataDocumentsFolder to remove @entry from + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the operation is finished, or %NULL + * @user_data: (closure): data to pass to the @callback function + * + * Remove the given @entry from the specified @folder. @self, @entry and @folder are all reffed when this function is called, so can safely be unreffed + * after this function returns. + * + * For more details, see gdata_documents_service_remove_entry_from_folder(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_documents_service_remove_entry_from_folder_finish() to get the + * results of the operation. + * + * Since: 0.8.0 + */ +void +gdata_documents_service_remove_entry_from_folder_async (GDataDocumentsService *self, GDataDocumentsEntry *entry, GDataDocumentsFolder *folder, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + RemoveEntryFromFolderData *data; + + g_return_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self)); + g_return_if_fail (GDATA_IS_DOCUMENTS_ENTRY (entry)); + g_return_if_fail (GDATA_IS_DOCUMENTS_FOLDER (folder)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + data = g_slice_new (RemoveEntryFromFolderData); + data->entry = g_object_ref (entry); + data->folder = g_object_ref (folder); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_documents_service_remove_entry_from_folder_async); + g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) remove_entry_from_folder_data_free); + g_task_run_in_thread (task, remove_entry_from_folder_thread); +} + +/** + * gdata_documents_service_remove_entry_from_folder_finish: + * @self: a #GDataDocumentsService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finish an asynchronous operation to remove a #GDataDocumentsEntry from a folder started with + * gdata_documents_service_remove_entry_from_folder_async(). + * + * Return value: (transfer full): an updated #GDataDocumentsEntry, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataDocumentsEntry * +gdata_documents_service_remove_entry_from_folder_finish (GDataDocumentsService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_documents_service_remove_entry_from_folder_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} + +/* NOTE: query may be NULL. */ +static gchar * +_get_upload_uri_for_query_and_folder (GDataDocumentsUploadQuery *query, GDataDocumentsFolder *folder) +{ + if (query == NULL) { + query = gdata_documents_upload_query_new (); + } + + if (folder != NULL) { + gdata_documents_upload_query_set_folder (query, folder); + } + + return gdata_documents_upload_query_build_uri (query); +} + +/** + * gdata_documents_service_get_upload_uri: + * @folder: (allow-none): the #GDataDocumentsFolder into which to upload the document, or %NULL + * + * Gets the upload URI for documents for the service. + * + * If @folder is %NULL, the URI will be the one to upload documents to the "root" folder. + * + * Return value: the URI permitting the upload of documents to @folder, or %NULL; free with g_free() + * + * Since: 0.5.0 + */ +gchar * +gdata_documents_service_get_upload_uri (GDataDocumentsFolder *folder) +{ + g_return_val_if_fail (folder == NULL || GDATA_IS_DOCUMENTS_FOLDER (folder), NULL); + + /* Upload URI: https://developers.google.com/drive/web/manage-uploads */ + return g_strdup ("https://www.googleapis.com/upload/drive/v2/files"); +} diff --git a/gdata/services/documents/gdata-documents-service.h b/gdata/services/documents/gdata-documents-service.h new file mode 100644 index 0000000..ab2ea7e --- /dev/null +++ b/gdata/services/documents/gdata-documents-service.h @@ -0,0 +1,163 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_SERVICE_H +#define GDATA_DOCUMENTS_SERVICE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDataDocumentsServiceError: + * @GDATA_DOCUMENTS_SERVICE_ERROR_INVALID_CONTENT_TYPE: the content type of a provided file was invalid + * + * Error codes for #GDataDocumentsService operations. + * + * Since: 0.4.0 + */ +typedef enum { + GDATA_DOCUMENTS_SERVICE_ERROR_INVALID_CONTENT_TYPE +} GDataDocumentsServiceError; + +#define GDATA_TYPE_DOCUMENTS_SERVICE (gdata_documents_service_get_type ()) +#define GDATA_DOCUMENTS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_SERVICE, GDataDocumentsService)) +#define GDATA_DOCUMENTS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_SERVICE, GDataDocumentsServiceClass)) +#define GDATA_IS_DOCUMENTS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_SERVICE)) +#define GDATA_IS_DOCUMENTS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_SERVICE)) +#define GDATA_DOCUMENTS_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_SERVICE, GDataDocumentsServiceClass)) + +#define GDATA_DOCUMENTS_SERVICE_ERROR gdata_documents_service_error_quark () + +typedef struct _GDataDocumentsServicePrivate GDataDocumentsServicePrivate; + +/** + * GDataDocumentsService: + * + * All the fields in the #GDataDocumentsService structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataService parent; + GDataDocumentsServicePrivate *priv; +} GDataDocumentsService; + +/** + * GDataDocumentsServiceClass: + * + * All the fields in the #GDataDocumentsServiceClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataServiceClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataDocumentsServiceClass; + +GType gdata_documents_service_get_type (void) G_GNUC_CONST; +GQuark gdata_documents_service_error_quark (void) G_GNUC_CONST; + +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsService, g_object_unref) + +GDataDocumentsService *gdata_documents_service_new (GDataAuthorizer *authorizer) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataAuthorizationDomain *gdata_documents_service_get_primary_authorization_domain (void) G_GNUC_CONST; +GDataAuthorizationDomain *gdata_documents_service_get_spreadsheet_authorization_domain (void) G_GNUC_CONST; + +GDataDocumentsMetadata *gdata_documents_service_get_metadata (GDataDocumentsService *self, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_documents_service_get_metadata_async (GDataDocumentsService *self, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +GDataDocumentsMetadata *gdata_documents_service_get_metadata_finish (GDataDocumentsService *self, GAsyncResult *async_result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataDocumentsFeed *gdata_documents_service_query_documents (GDataDocumentsService *self, GDataDocumentsQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_documents_service_query_documents_async (GDataDocumentsService *self, GDataDocumentsQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); + +#include +#include +#include + +GDataUploadStream *gdata_documents_service_upload_document (GDataDocumentsService *self, GDataDocumentsDocument *document, const gchar *slug, + const gchar *content_type, GDataDocumentsFolder *folder, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataUploadStream *gdata_documents_service_upload_document_resumable (GDataDocumentsService *self, GDataDocumentsDocument *document, const gchar *slug, + const gchar *content_type, goffset content_length, + GDataDocumentsUploadQuery *query, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataUploadStream *gdata_documents_service_update_document (GDataDocumentsService *self, GDataDocumentsDocument *document, const gchar *slug, + const gchar *content_type, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataUploadStream *gdata_documents_service_update_document_resumable (GDataDocumentsService *self, GDataDocumentsDocument *document, const gchar *slug, + const gchar *content_type, goffset content_length, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataDocumentsDocument *gdata_documents_service_finish_upload (GDataDocumentsService *self, GDataUploadStream *upload_stream, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataDocumentsDocument *gdata_documents_service_copy_document (GDataDocumentsService *self, GDataDocumentsDocument *document, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_documents_service_copy_document_async (GDataDocumentsService *self, GDataDocumentsDocument *document, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +GDataDocumentsDocument *gdata_documents_service_copy_document_finish (GDataDocumentsService *self, GAsyncResult *async_result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataDocumentsEntry *gdata_documents_service_add_entry_to_folder (GDataDocumentsService *self, GDataDocumentsEntry *entry, + GDataDocumentsFolder *folder, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_documents_service_add_entry_to_folder_async (GDataDocumentsService *self, GDataDocumentsEntry *entry, GDataDocumentsFolder *folder, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +GDataDocumentsEntry *gdata_documents_service_add_entry_to_folder_finish (GDataDocumentsService *self, GAsyncResult *async_result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataDocumentsEntry *gdata_documents_service_remove_entry_from_folder (GDataDocumentsService *self, GDataDocumentsEntry *entry, + GDataDocumentsFolder *folder, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_documents_service_remove_entry_from_folder_async (GDataDocumentsService *self, GDataDocumentsEntry *entry, GDataDocumentsFolder *folder, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +GDataDocumentsEntry *gdata_documents_service_remove_entry_from_folder_finish (GDataDocumentsService *self, GAsyncResult *async_result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gchar *gdata_documents_service_get_upload_uri (GDataDocumentsFolder *folder) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS +#endif /* !GDATA_DOCUMENTS_SERVICE_H */ diff --git a/gdata/services/documents/gdata-documents-spreadsheet.c b/gdata/services/documents/gdata-documents-spreadsheet.c new file mode 100644 index 0000000..767689a --- /dev/null +++ b/gdata/services/documents/gdata-documents-spreadsheet.c @@ -0,0 +1,189 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Red Hat, Inc. 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-spreadsheet + * @short_description: GData Documents spreadsheet object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-spreadsheet.h + * + * #GDataDocumentsSpreadsheet is a subclass of #GDataDocumentsDocument to represent a spreadsheet from Google Documents. + * + * For more details of Google Drive's GData API, see the + * online documentation. + * + * + * Downloading a Specific Sheet of a Spreadsheet + * + * GDataDocumentsService *service; + * GDataDocumentsSpreadsheet *spreadsheet; + * GFile *destination_file; + * guint gid; + * gchar *download_uri; + * GDataDownloadStream *download_stream; + * GFileOutputStream *output_stream; + * GError *error = NULL; + * + * /* Create a service and retrieve the spreadsheet and sheet index (GID) to download and the file to save the download in */ + * service = create_youtube_service (); + * spreadsheet = get_document_to_download (service); + * destination_file = query_user_for_destination_file (spreadsheet); + * gid = query_user_for_gid (spreadsheet); + * + * /* Create the download stream */ + * download_uri = gdata_documents_spreadsheet_get_download_uri (spreadsheet, GDATA_DOCUMENTS_SPREADSHEET_CSV, gid); + * download_stream = GDATA_DOWNLOAD_STREAM (gdata_download_stream_new (service, gdata_documents_service_get_spreadsheet_authorization_domain (), + * download_uri, NULL)); + * g_free (download_uri); + * + * g_object_unref (spreadsheet); + * g_object_unref (service); + * + * /* Create the file output stream */ + * output_stream = g_file_replace (destination_file, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, NULL, &error); + * + * g_object_unref (destination_file); + * + * if (error != NULL) { + * g_error ("Error creating destination file: %s", error->message); + * g_error_free (error); + * g_object_unref (download_stream); + * return; + * } + * + * /* Download the document. This should almost always be done asynchronously. */ + * g_output_stream_splice (G_OUTPUT_STREAM (output_stream), G_INPUT_STREAM (download_stream), + * G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error); + * + * g_object_unref (output_stream); + * g_object_unref (download_stream); + * + * if (error != NULL) { + * g_error ("Error downloading spreadsheet: %s", error->message); + * g_error_free (error); + * return; + * } + * + * + * + * Since: 0.4.0 + */ + +#include +#include +#include +#include +#include + +#include "gdata-documents-spreadsheet.h" +#include "gdata-documents-utils.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_documents_spreadsheet_constructed (GObject *object); + +G_DEFINE_TYPE (GDataDocumentsSpreadsheet, gdata_documents_spreadsheet, GDATA_TYPE_DOCUMENTS_DOCUMENT) + +static void +gdata_documents_spreadsheet_class_init (GDataDocumentsSpreadsheetClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + gobject_class->constructed = gdata_documents_spreadsheet_constructed; + entry_class->kind_term = "http://schemas.google.com/docs/2007#spreadsheet"; +} + +static void +gdata_documents_spreadsheet_init (GDataDocumentsSpreadsheet *self) +{ + /* Why am I writing it? */ +} + +static void +gdata_documents_spreadsheet_constructed (GObject *object) +{ + G_OBJECT_CLASS (gdata_documents_spreadsheet_parent_class)->constructed (object); + + if (!_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object))) + gdata_documents_utils_add_content_type (GDATA_DOCUMENTS_ENTRY (object), "application/vnd.google-apps.spreadsheet"); +} + +/** + * gdata_documents_spreadsheet_new: + * @id: (allow-none): the entry's ID (not the document ID of the spreadsheet), or %NULL + * + * Creates a new #GDataDocumentsSpreadsheet with the given entry ID (#GDataEntry:id). + * + * Return value: (transfer full): a new #GDataDocumentsSpreadsheet, or %NULL; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataDocumentsSpreadsheet * +gdata_documents_spreadsheet_new (const gchar *id) +{ + return GDATA_DOCUMENTS_SPREADSHEET (g_object_new (GDATA_TYPE_DOCUMENTS_SPREADSHEET, "id", id, NULL)); +} + +/** + * gdata_documents_spreadsheet_get_download_uri: + * @self: a #GDataDocumentsSpreadsheet + * @export_format: the format in which the spreadsheet should be exported when downloaded + * @gid: the 0-based sheet ID to download, or -1 + * + * Builds and returns the download URI for the given #GDataDocumentsSpreadsheet in the desired format. Note that directly downloading + * the document using this URI isn't possible, as authentication is required. You should instead use gdata_download_stream_new() with + * the URI, and use the resulting #GInputStream. + * + * When requesting a "csv", "tsv", "pdf" or + * "html" file you may specify an additional parameter called @gid which indicates which grid, or sheet, you wish to get + * (the index is 0-based, so GID 1 actually refers to the second sheet on a given + * spreadsheet). + * + * Return value: the download URI; free with g_free() + * + * Since: 0.5.0 + */ +gchar * +gdata_documents_spreadsheet_get_download_uri (GDataDocumentsSpreadsheet *self, const gchar *export_format, gint gid) +{ + const gchar *resource_id, *document_id; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_SPREADSHEET (self), NULL); + g_return_val_if_fail (export_format != NULL && *export_format != '\0', NULL); + g_return_val_if_fail (gid >= -1, NULL); + + /* Extract the document ID from the resource ID. */ + resource_id = gdata_documents_entry_get_resource_id (GDATA_DOCUMENTS_ENTRY (self)); + g_assert (resource_id != NULL); + + document_id = g_utf8_strchr (resource_id, -1, ':'); + g_assert (document_id != NULL); + document_id++; /* skip over the colon */ + + if (gid != -1) { + return _gdata_service_build_uri ("http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=%s&exportFormat=%s&gid=%d", + document_id, export_format, gid); + } else { + return _gdata_service_build_uri ("http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=%s&exportFormat=%s", + document_id, export_format); + } +} diff --git a/gdata/services/documents/gdata-documents-spreadsheet.h b/gdata/services/documents/gdata-documents-spreadsheet.h new file mode 100644 index 0000000..438e93f --- /dev/null +++ b/gdata/services/documents/gdata-documents-spreadsheet.h @@ -0,0 +1,159 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_SPREADSHEET_H +#define GDATA_DOCUMENTS_SPREADSHEET_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_DOCUMENTS_SPREADSHEET_CSV: + * + * The export format for Comma-Separated Values (CSV) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_SPREADSHEET_CSV "csv" + +/** + * GDATA_DOCUMENTS_SPREADSHEET_ODS: + * + * The export format for OpenDocument Spreadsheet (ODS) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_SPREADSHEET_ODS "ods" + +/** + * GDATA_DOCUMENTS_SPREADSHEET_PDF: + * + * The export format for Portable Document Format (PDF). + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_SPREADSHEET_PDF "pdf" + +/** + * GDATA_DOCUMENTS_SPREADSHEET_TSV: + * + * The export format for Tab-Separated Values (TSV) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_SPREADSHEET_TSV "tsv" + +/** + * GDATA_DOCUMENTS_SPREADSHEET_XLS: + * + * The export format for Microsoft Excel spreadsheet (XLS) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_SPREADSHEET_XLS "xls" + +/** + * GDATA_DOCUMENTS_SPREADSHEET_HTML: + * + * The export format for HyperText Markup Language (HTML) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_SPREADSHEET_HTML "html" + +#define GDATA_TYPE_DOCUMENTS_SPREADSHEET (gdata_documents_spreadsheet_get_type ()) +#define GDATA_DOCUMENTS_SPREADSHEET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_SPREADSHEET, \ + GDataDocumentsSpreadsheet)) +#define GDATA_DOCUMENTS_SPREADSHEET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_SPREADSHEET, \ + GDataDocumentsSpreadsheetClass)) +#define GDATA_IS_DOCUMENTS_SPREADSHEET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_SPREADSHEET)) +#define GDATA_IS_DOCUMENTS_SPREADSHEET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_SPREADSHEET)) +#define GDATA_DOCUMENTS_SPREADSHEET_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_SPREADSHEET, \ + GDataDocumentsSpreadsheetClass)) + +typedef struct _GDataDocumentsSpreadsheetPrivate GDataDocumentsSpreadsheetPrivate; + +/** + * GDataDocumentsSpreadsheet: + * + * All the fields in the #GDataDocumentsSpreadsheet structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataDocumentsDocument parent; + GDataDocumentsSpreadsheetPrivate *priv; +} GDataDocumentsSpreadsheet; + +/** + * GDataDocumentsSpreadsheetClass: + * + * All the fields in the #GDataDocumentsSpreadsheetClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataDocumentsDocumentClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsSpreadsheetClass; + +GType gdata_documents_spreadsheet_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsSpreadsheet, g_object_unref) + +GDataDocumentsSpreadsheet *gdata_documents_spreadsheet_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gchar *gdata_documents_spreadsheet_get_download_uri (GDataDocumentsSpreadsheet *self, const gchar *export_format, + gint gid) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_SPREADSHEET_H */ diff --git a/gdata/services/documents/gdata-documents-text.c b/gdata/services/documents/gdata-documents-text.c new file mode 100644 index 0000000..3041506 --- /dev/null +++ b/gdata/services/documents/gdata-documents-text.c @@ -0,0 +1,87 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * Copyright (C) Philip Withnall 2010 + * Copyright (C) Red Hat, Inc. 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-text + * @short_description: GData Documents text object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-text.h + * + * #GDataDocumentsText is a subclass of #GDataDocumentsDocument to represent a text document from Google Documents. + * + * For more details of Google Drive's GData API, see the + * online documentation. + * + * Since: 0.4.0 + */ + +#include +#include + +#include "gdata-documents-text.h" +#include "gdata-documents-utils.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_documents_text_constructed (GObject *object); + +G_DEFINE_TYPE (GDataDocumentsText, gdata_documents_text, GDATA_TYPE_DOCUMENTS_DOCUMENT) + +static void +gdata_documents_text_class_init (GDataDocumentsTextClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + gobject_class->constructed = gdata_documents_text_constructed; + entry_class->kind_term = "http://schemas.google.com/docs/2007#document"; +} + +static void +gdata_documents_text_init (GDataDocumentsText *self) +{ + /* Why am I writing it? */ +} + +static void +gdata_documents_text_constructed (GObject *object) +{ + G_OBJECT_CLASS (gdata_documents_text_parent_class)->constructed (object); + + if (!_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object))) + gdata_documents_utils_add_content_type (GDATA_DOCUMENTS_ENTRY (object), "application/vnd.google-apps.document"); +} + +/** + * gdata_documents_text_new: + * @id: (allow-none): the entry's ID (not the document ID of the text document), or %NULL + * + * Creates a new #GDataDocumentsText with the given entry ID (#GDataEntry:id). + * + * Return value: (transfer full): a new #GDataDocumentsText, or %NULL; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataDocumentsText * +gdata_documents_text_new (const gchar *id) +{ + return GDATA_DOCUMENTS_TEXT (g_object_new (GDATA_TYPE_DOCUMENTS_TEXT, "id", id, NULL)); +} diff --git a/gdata/services/documents/gdata-documents-text.h b/gdata/services/documents/gdata-documents-text.h new file mode 100644 index 0000000..4645524 --- /dev/null +++ b/gdata/services/documents/gdata-documents-text.h @@ -0,0 +1,192 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Thibault Saunier 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_TEXT_H +#define GDATA_DOCUMENTS_TEXT_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDATA_DOCUMENTS_TEXT_DOC: + * + * The export format for Microsoft Word (DOC) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_TEXT_DOC "doc" + +/** + * GDATA_DOCUMENTS_TEXT_HTML: + * + * The export format for HyperText Markup Language (HTML) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_TEXT_HTML "html" + +/** + * GDATA_DOCUMENTS_TEXT_JPEG: + * + * The export format for JPEG image format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.13.0 + */ +#define GDATA_DOCUMENTS_TEXT_JPEG "jpeg" + +/** + * GDATA_DOCUMENTS_TEXT_ODT: + * + * The export format for OpenDocument Text (ODT) format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_TEXT_ODT "odt" + +/** + * GDATA_DOCUMENTS_TEXT_PDF: + * + * The export format for Portable Document Format (PDF). + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_TEXT_PDF "pdf" + +/** + * GDATA_DOCUMENTS_TEXT_PNG: + * + * The export format for Portable Network Graphics (PNG) image format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_TEXT_PNG "png" + +/** + * GDATA_DOCUMENTS_TEXT_RTF: + * + * The export format for Rich Text Format (RTF). + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_TEXT_RTF "rtf" + +/** + * GDATA_DOCUMENTS_TEXT_TXT: + * + * The export format for plain text format. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_TEXT_TXT "txt" + +/** + * GDATA_DOCUMENTS_TEXT_ZIP: + * + * The export format for a ZIP archive containing images and exported HTML. + * + * For more information, see the + * + * GData protocol specification. + * + * Since: 0.7.0 + */ +#define GDATA_DOCUMENTS_TEXT_ZIP "zip" + +#define GDATA_TYPE_DOCUMENTS_TEXT (gdata_documents_text_get_type ()) +#define GDATA_DOCUMENTS_TEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_TEXT, GDataDocumentsText)) +#define GDATA_DOCUMENTS_TEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_TEXT, GDataDocumentsTextClass)) +#define GDATA_IS_DOCUMENTS_TEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_TEXT)) +#define GDATA_IS_DOCUMENTS_TEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_TEXT)) +#define GDATA_DOCUMENTS_TEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_TEXT, GDataDocumentsTextClass)) + +typedef struct _GDataDocumentsTextPrivate GDataDocumentsTextPrivate; + +/** + * GDataDocumentsText: + * + * All the fields in the #GDataDocumentsText structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataDocumentsDocument parent; + GDataDocumentsTextPrivate *priv; +} GDataDocumentsText; + +/** + * GDataDocumentsTextClass: + * + * All the fields in the #GDataDocumentsTextClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataDocumentsDocumentClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsTextClass; + +GType gdata_documents_text_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsText, g_object_unref) + +GDataDocumentsText *gdata_documents_text_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_TEXT_H */ diff --git a/gdata/services/documents/gdata-documents-upload-query.c b/gdata/services/documents/gdata-documents-upload-query.c new file mode 100644 index 0000000..383db17 --- /dev/null +++ b/gdata/services/documents/gdata-documents-upload-query.c @@ -0,0 +1,423 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2012 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-documents-upload-query + * @short_description: GData Documents upload query object + * @stability: Stable + * @include: gdata/services/documents/gdata-documents-upload-query.h + * + * #GDataDocumentsUploadQuery is a collection of parameters for document uploads to Google Documents, allowing various options to be set when uploading + * a document for the first time. For example, the destination folder for the uploaded document may be specified; or whether to automatically convert + * the document to a common format. + * + * #GDataDocumentsUploadQuery is designed as an object (rather than a fixed struct or set of function arguments) to allow for easy additions of new + * Google Documents features in the future. + * + * + * Uploading an Arbitrary File from Disk + * + * GDataDocumentsService *service; + * GDataDocumentsDocument *document, *uploaded_document; + * GFile *arbitrary_file; + * GFileInfo *file_info; + * const gchar *slug, *content_type; + * goffset file_size; + * GDataDocumentsUploadQuery *upload_query; + * GFileInputStream *file_stream; + * GDataUploadStream *upload_stream; + * GError *error = NULL; + * + * /* Create a service. */ + * service = create_documents_service (); + * + * /* Get the file to upload. */ + * arbitrary_file = g_file_new_for_path ("arbitrary-file.bin"); + * + * /* Get the file's display name, content type and size. */ + * file_info = g_file_query_info (arbitrary_file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," + * G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, NULL, &error); + * + * if (error != NULL) { + * g_error ("Error getting arbitrary file information: %s", error->message); + * g_error_free (error); + * g_object_unref (arbitrary_file); + * g_object_unref (service); + * return; + * } + * + * slug = g_file_info_get_display_name (file_info); + * content_type = g_file_info_get_content_type (file_info); + * file_size = g_file_info_get_size (file_info); + * + * /* Get an input stream for the file. */ + * file_stream = g_file_read (arbitrary_file, NULL, &error); + * + * g_object_unref (arbitrary_file); + * + * if (error != NULL) { + * g_error ("Error getting arbitrary file stream: %s", error->message); + * g_error_free (error); + * g_object_unref (file_info); + * g_object_unref (service); + * return; + * } + * + * /* Create the file metadata to upload. */ + * document = gdata_documents_document_new (NULL); + * gdata_entry_set_title (GDATA_ENTRY (document), "Title for My Arbitrary File"); + * + * /* Build the upload query and set the upload to not be converted to a standard format. */ + * upload_query = gdata_documents_upload_query_new (); + * gdata_documents_upload_query_set_convert (upload_query, FALSE); + * + * /* Get an upload stream for the file. */ + * upload_stream = gdata_documents_service_upload_document_resumable (service, document, slug, content_type, file_size, upload_query, NULL, &error); + * + * g_object_unref (upload_query); + * g_object_unref (document); + * g_object_unref (file_info); + * + * if (error != NULL) { + * g_error ("Error getting upload stream: %s", error->message); + * g_error_free (error); + * g_object_unref (file_stream); + * g_object_unref (service); + * return; + * } + * + * /* Upload the document. This is a blocking operation, and should normally be done asynchronously. */ + * g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), G_INPUT_STREAM (file_stream), + * G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error); + * + * g_object_unref (file_stream); + * + * if (error != NULL) { + * g_error ("Error splicing streams: %s", error->message); + * g_error_free (error); + * g_object_unref (upload_stream); + * g_object_unref (service); + * return; + * } + * + * /* Finish off the upload by parsing the returned updated document metadata entry. */ + * uploaded_document = gdata_documents_service_finish_upload (service, upload_stream, &error); + * + * g_object_unref (upload_stream); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error uploading file: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Do something with the uploaded document. */ + * + * g_object_unref (uploaded_document); + * + * + * + * Since: 0.13.0 + */ + +#include + +#include "gdata-documents-upload-query.h" +#include "gdata-private.h" +#include "gdata-upload-stream.h" + +static void gdata_documents_upload_query_dispose (GObject *object); +static void gdata_documents_upload_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_documents_upload_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); + +struct _GDataDocumentsUploadQueryPrivate { + GDataDocumentsFolder *folder; + gboolean convert; +}; + +enum { + PROP_FOLDER = 1, + PROP_CONVERT, +}; + +G_DEFINE_TYPE (GDataDocumentsUploadQuery, gdata_documents_upload_query, G_TYPE_OBJECT) + +static void +gdata_documents_upload_query_class_init (GDataDocumentsUploadQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataDocumentsUploadQueryPrivate)); + + gobject_class->get_property = gdata_documents_upload_query_get_property; + gobject_class->set_property = gdata_documents_upload_query_set_property; + gobject_class->dispose = gdata_documents_upload_query_dispose; + + /** + * GDataDocumentsUploadQuery:folder: + * + * Folder to upload the document into. If this is %NULL, the document will be uploaded into the root folder. + * + * Since: 0.13.0 + */ + g_object_class_install_property (gobject_class, PROP_FOLDER, + g_param_spec_object ("folder", + "Folder", "Folder to upload the document into.", + GDATA_TYPE_DOCUMENTS_FOLDER, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataDocumentsUploadQuery:convert: + * + * %TRUE to automatically convert the uploaded document into a standard format (such as a text document, spreadsheet, presentation, etc.). + * %FALSE to upload the document without converting it; this allows for arbitrary files to be uploaded to Google Documents. + * + * For more information, see the + * online documentation. + * + * Note that uploading with this property set to %FALSE will only have an effect when using gdata_documents_service_update_document_resumable() + * and not gdata_documents_service_update_document(). Additionally, the #GDataDocumentsDocument passed to + * gdata_documents_service_update_document_resumable() must be a #GDataDocumentsDocument if this property is %FALSE, and a subclass of it + * otherwise. + * + * Since: 0.13.0 + */ + g_object_class_install_property (gobject_class, PROP_CONVERT, + g_param_spec_boolean ("convert", + "Convert?", "Whether to automatically convert uploaded documents into a standard format.", + TRUE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_documents_upload_query_init (GDataDocumentsUploadQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY, GDataDocumentsUploadQueryPrivate); + self->priv->convert = TRUE; +} + +static void +gdata_documents_upload_query_dispose (GObject *object) +{ + GDataDocumentsUploadQueryPrivate *priv = GDATA_DOCUMENTS_UPLOAD_QUERY (object)->priv; + + g_clear_object (&priv->folder); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_documents_upload_query_parent_class)->dispose (object); +} + +static void +gdata_documents_upload_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataDocumentsUploadQueryPrivate *priv = GDATA_DOCUMENTS_UPLOAD_QUERY (object)->priv; + + switch (property_id) { + case PROP_FOLDER: + g_value_set_object (value, priv->folder); + break; + case PROP_CONVERT: + g_value_set_boolean (value, priv->convert); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_documents_upload_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataDocumentsUploadQuery *self = GDATA_DOCUMENTS_UPLOAD_QUERY (object); + + switch (property_id) { + case PROP_FOLDER: + gdata_documents_upload_query_set_folder (self, g_value_get_object (value)); + break; + case PROP_CONVERT: + gdata_documents_upload_query_set_convert (self, g_value_get_boolean (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/** + * gdata_documents_upload_query_new: + * + * Constructs a new empty #GDataDocumentsUploadQuery. + * + * Return value: (transfer full): a new #GDataDocumentsUploadQuery; unref with g_object_unref() + * + * Since: 0.13.0 + */ +GDataDocumentsUploadQuery * +gdata_documents_upload_query_new (void) +{ + return g_object_new (GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY, NULL); +} + +/** + * gdata_documents_upload_query_build_uri: + * @self: a #GDataDocumentsUploadQuery + * + * Builds an upload URI suitable for passing to gdata_upload_stream_new_resumable() in order to upload a document to Google Documents as described in + * the + * + * online documentation. + * + * Return value: (transfer full): a complete upload URI; free with g_free() + * + * Since: 0.13.0 + */ +gchar * +gdata_documents_upload_query_build_uri (GDataDocumentsUploadQuery *self) +{ + gchar *base_uri; + GString *upload_uri; + GDataDocumentsUploadQueryPrivate *priv; + + g_return_val_if_fail (GDATA_IS_DOCUMENTS_UPLOAD_QUERY (self), NULL); + + priv = self->priv; + + /* Construct the base URI. */ + if (priv->folder != NULL) { + GDataLink *upload_link; + + /* Get the folder's upload URI. */ + upload_link = gdata_entry_look_up_link (GDATA_ENTRY (priv->folder), GDATA_LINK_RESUMABLE_CREATE_MEDIA); + + if (upload_link == NULL) { + /* Fall back to building a URI manually. */ + base_uri = _gdata_service_build_uri ("%s://docs.google.com/feeds/upload/create-session/default/private/full/%s/contents", + _gdata_service_get_scheme (), + gdata_documents_entry_get_resource_id (GDATA_DOCUMENTS_ENTRY (priv->folder))); + } else { + base_uri = g_strdup (gdata_link_get_uri (upload_link)); + } + } else { + base_uri = g_strconcat (_gdata_service_get_scheme (), "://docs.google.com/feeds/upload/create-session/default/private/full", NULL); + } + + /* Document format conversion. See: https://developers.google.com/google-apps/documents-list/#creating_or_uploading_files */ + upload_uri = g_string_new (base_uri); + g_free (base_uri); + + if (priv->convert == TRUE) { + /* Convert documents to standard formats on upload. */ + g_string_append (upload_uri, "?convert=true"); + } else { + /* Don't convert them — this permits uploading of arbitrary files. */ + g_string_append (upload_uri, "?convert=false"); + } + + return g_string_free (upload_uri, FALSE); +} + +/** + * gdata_documents_upload_query_get_folder: + * @self: a #GDataDocumentsUploadQuery + * + * Gets #GDataDocumentsUploadQuery:folder. + * + * Return value: (allow-none) (transfer none): the folder to upload into, or %NULL + * + * Since: 0.13.0 + */ +GDataDocumentsFolder * +gdata_documents_upload_query_get_folder (GDataDocumentsUploadQuery *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_UPLOAD_QUERY (self), NULL); + + return self->priv->folder; +} + +/** + * gdata_documents_upload_query_set_folder: + * @self: a #GDataDocumentsUploadQuery + * @folder: (allow-none) (transfer none): a new folder to upload into, or %NULL + * + * Sets #GDataDocumentsUploadQuery:folder to @folder. + * + * Since: 0.13.0 + */ +void +gdata_documents_upload_query_set_folder (GDataDocumentsUploadQuery *self, GDataDocumentsFolder *folder) +{ + g_return_if_fail (GDATA_IS_DOCUMENTS_UPLOAD_QUERY (self)); + g_return_if_fail (folder == NULL || GDATA_IS_DOCUMENTS_FOLDER (folder)); + + if (folder == self->priv->folder) { + return; + } + + if (folder != NULL) { + g_object_ref (folder); + } + + g_clear_object (&self->priv->folder); + self->priv->folder = folder; + + g_object_notify (G_OBJECT (self), "folder"); +} + +/** + * gdata_documents_upload_query_get_convert: + * @self: a #GDataDocumentsUploadQuery + * + * Gets #GDataDocumentsUploadQuery:convert. + * + * Return value: %TRUE to convert documents to common formats, %FALSE to upload them unmodified + * + * Since: 0.13.0 + */ +gboolean +gdata_documents_upload_query_get_convert (GDataDocumentsUploadQuery *self) +{ + g_return_val_if_fail (GDATA_IS_DOCUMENTS_UPLOAD_QUERY (self), TRUE); + + return self->priv->convert; +} + +/** + * gdata_documents_upload_query_set_convert: + * @self: a #GDataDocumentsUploadQuery + * @convert: %TRUE to convert documents to common formats, %FALSE to upload them unmodified + * + * Sets #GDataDocumentsUploadQuery:convert to @convert. + * + * Since: 0.13.0 + */ +void +gdata_documents_upload_query_set_convert (GDataDocumentsUploadQuery *self, gboolean convert) +{ + g_return_if_fail (GDATA_IS_DOCUMENTS_UPLOAD_QUERY (self)); + + if (convert == self->priv->convert) { + return; + } + + self->priv->convert = convert; + g_object_notify (G_OBJECT (self), "convert"); +} diff --git a/gdata/services/documents/gdata-documents-upload-query.h b/gdata/services/documents/gdata-documents-upload-query.h new file mode 100644 index 0000000..30582e9 --- /dev/null +++ b/gdata/services/documents/gdata-documents-upload-query.h @@ -0,0 +1,84 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2012 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_UPLOAD_QUERY_H +#define GDATA_DOCUMENTS_UPLOAD_QUERY_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY (gdata_documents_upload_query_get_type ()) +#define GDATA_DOCUMENTS_UPLOAD_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY, GDataDocumentsUploadQuery)) +#define GDATA_DOCUMENTS_UPLOAD_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY, GDataDocumentsUploadQueryClass)) +#define GDATA_IS_DOCUMENTS_UPLOAD_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY)) +#define GDATA_IS_DOCUMENTS_UPLOAD_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY)) +#define GDATA_DOCUMENTS_UPLOAD_QUERY_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY, GDataDocumentsUploadQueryClass)) + +typedef struct _GDataDocumentsUploadQueryPrivate GDataDocumentsUploadQueryPrivate; + +/** + * GDataDocumentsUploadQuery: + * + * All the fields in the #GDataDocumentsUploadQuery structure are private and should never be accessed directly. + * + * Since: 0.13.0 + */ +typedef struct { + GObject parent; + GDataDocumentsUploadQueryPrivate *priv; +} GDataDocumentsUploadQuery; + +/** + * GDataDocumentsUploadQueryClass: + * + * All the fields in the #GDataDocumentsUploadQueryClass structure are private and should never be accessed directly. + * + * Since: 0.13.0 + */ +typedef struct { + /*< private >*/ + GObjectClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDocumentsUploadQueryClass; + +GType gdata_documents_upload_query_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataDocumentsUploadQuery, g_object_unref) + +GDataDocumentsUploadQuery *gdata_documents_upload_query_new (void) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gchar *gdata_documents_upload_query_build_uri (GDataDocumentsUploadQuery *self) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataDocumentsFolder *gdata_documents_upload_query_get_folder (GDataDocumentsUploadQuery *self) G_GNUC_PURE; +void gdata_documents_upload_query_set_folder (GDataDocumentsUploadQuery *self, GDataDocumentsFolder *folder); + +gboolean gdata_documents_upload_query_get_convert (GDataDocumentsUploadQuery *self) G_GNUC_PURE; +void gdata_documents_upload_query_set_convert (GDataDocumentsUploadQuery *self, gboolean convert); + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_UPLOAD_QUERY_H */ diff --git a/gdata/services/documents/gdata-documents-utils.c b/gdata/services/documents/gdata-documents-utils.c new file mode 100644 index 0000000..b2e19d5 --- /dev/null +++ b/gdata/services/documents/gdata-documents-utils.c @@ -0,0 +1,154 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Red Hat, Inc. 2015, 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#include + +#include "gdata-documents-spreadsheet.h" +#include "gdata-documents-text.h" +#include "gdata-documents-presentation.h" +#include "gdata-documents-folder.h" +#include "gdata-documents-drawing.h" +#include "gdata-documents-pdf.h" +#include "gdata-documents-utils.h" + +/* + * gdata_documents_utils_add_content_type: + * @entry: a #GDataDocumentsEntry + * @content_type: the new entry content-type + * + * Adds a #GDataCategory representing @content_type to @entry. + * + * Since: 0.17.7 + */ +void +gdata_documents_utils_add_content_type (GDataDocumentsEntry *entry, const gchar *content_type) +{ + GDataCategory *category; + GDataEntryClass *klass = GDATA_ENTRY_GET_CLASS (entry); + + if (content_type == NULL || content_type[0] == '\0') + return; + + category = gdata_category_new (klass->kind_term, "http://schemas.google.com/g/2005#kind", content_type); + gdata_entry_add_category (GDATA_ENTRY (entry), category); + g_object_unref (category); +} + +/* + * gdata_documents_utils_get_type_from_content_type: + * @content_type: the content type + * + * Maps @content_type to a #GType representing a #GDataDocumentsEntry + * sub-class. + * + * Return value: a #GType corresponding to @content_type + * + * Since: 0.17.2 + */ +GType +gdata_documents_utils_get_type_from_content_type (const gchar *content_type) +{ + GType retval; + + /* MIME types: https://developers.google.com/drive/web/mime-types */ + + if (g_strcmp0 (content_type, "application/vnd.google-apps.folder") == 0) { + retval = GDATA_TYPE_DOCUMENTS_FOLDER; + } else if (g_strcmp0 (content_type, "application/pdf") == 0) { + retval = GDATA_TYPE_DOCUMENTS_PDF; + } else if (g_strcmp0 (content_type, "application/vnd.google-apps.document") == 0) { + retval = GDATA_TYPE_DOCUMENTS_TEXT; + } else if (g_strcmp0 (content_type, "application/vnd.google-apps.drawing") == 0) { + retval = GDATA_TYPE_DOCUMENTS_DRAWING; + } else if (g_strcmp0 (content_type, "application/vnd.google-apps.presentation") == 0) { + retval = GDATA_TYPE_DOCUMENTS_PRESENTATION; + } else if (g_strcmp0 (content_type, "application/vnd.google-apps.spreadsheet") == 0) { + retval = GDATA_TYPE_DOCUMENTS_SPREADSHEET; + } else { + retval = GDATA_TYPE_DOCUMENTS_DOCUMENT; + } + + return retval; +} + +/* + * gdata_documents_utils_get_content_type: + * @entry: a #GDataDocumentsEntry + * + * Returns the content type of @entry, if any. + * + * Return value: (nullable): content type of @entry, %NULL otherwise + * + * Since: 0.17.5 + */ +const gchar * +gdata_documents_utils_get_content_type (GDataDocumentsEntry *entry) +{ + GList *categories; + GList *i; + const gchar *retval = NULL; + + categories = gdata_entry_get_categories (GDATA_ENTRY (entry)); + for (i = categories; i != NULL; i = i->next) { + GDataCategory *category = GDATA_CATEGORY (i->data); + const gchar *label; + const gchar *scheme; + + label = gdata_category_get_label (category); + scheme = gdata_category_get_scheme (category); + if (label != NULL && label[0] != '\0' && g_strcmp0 (scheme, "http://schemas.google.com/g/2005#kind") == 0) { + retval = label; + break; + } + } + + return retval; +} + +/* + * gdata_documents_utils_get_id_from_link: + * @_link: a #GDataLink + * + * Returns the ID, if any, of the #GDataEntry pointed to by @_link. + * + * Return value: (nullable): ID of @_link, %NULL otherwise + * + * Since: 0.17.9 + */ +const gchar * +gdata_documents_utils_get_id_from_link (GDataLink *_link) +{ + const gchar *retval = NULL; + const gchar *uri; + + /* HACK: Extract the ID from the GDataLink:uri by removing the prefix. Ignore links which + * don't have the prefix. */ + uri = gdata_link_get_uri (_link); + if (g_str_has_prefix (uri, GDATA_DOCUMENTS_URI_PREFIX)) { + const gchar *id; + gsize uri_prefix_len; + + uri_prefix_len = strlen (GDATA_DOCUMENTS_URI_PREFIX); + id = uri + uri_prefix_len; + if (id[0] != '\0') + retval = id; + } + + return retval; +} diff --git a/gdata/services/documents/gdata-documents-utils.h b/gdata/services/documents/gdata-documents-utils.h new file mode 100644 index 0000000..48625d0 --- /dev/null +++ b/gdata/services/documents/gdata-documents-utils.h @@ -0,0 +1,43 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Red Hat, Inc. 2015, 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DOCUMENTS_UTILS_H +#define GDATA_DOCUMENTS_UTILS_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/* HACK: Used to convert GDataLink:uri to ID and vice-versa. */ +#define GDATA_DOCUMENTS_URI_PREFIX "https://www.googleapis.com/drive/v2/files/" + +G_GNUC_INTERNAL void gdata_documents_utils_add_content_type (GDataDocumentsEntry *entry, const gchar *content_type); + +G_GNUC_INTERNAL GType gdata_documents_utils_get_type_from_content_type (const gchar *content_type); + +G_GNUC_INTERNAL const gchar *gdata_documents_utils_get_content_type (GDataDocumentsEntry *entry); + +G_GNUC_INTERNAL const gchar *gdata_documents_utils_get_id_from_link (GDataLink *_link); + +G_END_DECLS + +#endif /* !GDATA_DOCUMENTS_UTILS_H */ diff --git a/gdata/services/freebase/gdata-freebase-enums.c b/gdata/services/freebase/gdata-freebase-enums.c new file mode 100644 index 0000000..6f18710 --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-enums.c @@ -0,0 +1,27 @@ + + + +#include "gdata-freebase-service.h" +#include "gdata-freebase-search-query.h" +#include "gdata-freebase-result.h" +#include "gdata-freebase-enums.h" + +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/freebase/gdata-freebase-search-query.h" */ +GType +gdata_freebase_search_filter_type_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_FREEBASE_SEARCH_FILTER_ALL, "GDATA_FREEBASE_SEARCH_FILTER_ALL", "all" }, + { GDATA_FREEBASE_SEARCH_FILTER_ANY, "GDATA_FREEBASE_SEARCH_FILTER_ANY", "any" }, + { GDATA_FREEBASE_SEARCH_FILTER_NOT, "GDATA_FREEBASE_SEARCH_FILTER_NOT", "not" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataFreebaseSearchFilterType", values); + } + return etype; +} + + + diff --git a/gdata/services/freebase/gdata-freebase-enums.h b/gdata/services/freebase/gdata-freebase-enums.h new file mode 100644 index 0000000..ae83389 --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-enums.h @@ -0,0 +1,18 @@ + + + +#ifndef GDATA_FREEBASE_ENUMS_H +#define GDATA_FREEBASE_ENUMS_H + +#include + +G_BEGIN_DECLS +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/freebase/gdata-freebase-search-query.h" */ +GType gdata_freebase_search_filter_type_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_FREEBASE_SEARCH_FILTER_TYPE (gdata_freebase_search_filter_type_get_type()) +G_END_DECLS + +#endif /* !GDATA_FREEBASE_ENUMS_H */ + + + diff --git a/gdata/services/freebase/gdata-freebase-query.c b/gdata/services/freebase/gdata-freebase-query.c new file mode 100644 index 0000000..8ec8314 --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-query.c @@ -0,0 +1,259 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-freebase-query + * @short_description: GData Freebase query object + * @stability: Stable + * @include: gdata/services/freebase/gdata-freebase-query.h + * + * #GDataFreebaseQuery represents a MQL query specific to the Google Freebase service. + * + * This implementation of #GDataQuery respects the gdata_query_set_max_results() call. + * + * For more details of Google Freebase API, see the + * online documentation. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + +#include +#include +#include +#include +#include + +#include "gdata-freebase-query.h" +#include "gdata-query.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +static void gdata_freebase_query_finalize (GObject *self); +static void gdata_freebase_query_set_property (GObject *self, guint prop_id, const GValue *value, GParamSpec *pspec); +static void gdata_freebase_query_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +struct _GDataFreebaseQueryPrivate { + /* These params are here not in GDataQuery due of differently named query params for JSON protocols therefore need for different parse_uri */ + GVariant *variant; + JsonNode *query_node; +}; + +enum { + PROP_VARIANT = 1, +}; + +G_DEFINE_TYPE (GDataFreebaseQuery, gdata_freebase_query, GDATA_TYPE_QUERY) + +static void +gdata_freebase_query_class_init (GDataFreebaseQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataFreebaseQueryPrivate)); + + gobject_class->finalize = gdata_freebase_query_finalize; + gobject_class->set_property = gdata_freebase_query_set_property; + gobject_class->get_property = gdata_freebase_query_get_property; + + query_class->get_query_uri = get_query_uri; + + /** + * GDataFreebaseQuery:variant: + * + * Variant containing the MQL query. The variant is a very generic container of type "a{smv}", + * containing (possibly nested) Freebase schema types and values. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + g_object_class_install_property (gobject_class, PROP_VARIANT, + g_param_spec_variant ("variant", + "Variant", + "Variant to construct the query from.", + G_VARIANT_TYPE ("a{smv}"), NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); +} + +static void +gdata_freebase_query_init (GDataFreebaseQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_FREEBASE_QUERY, GDataFreebaseQueryPrivate); + + /* https://developers.google.com/freebase/v1/search#cursor */ + _gdata_query_set_pagination_type (GDATA_QUERY (self), + GDATA_QUERY_PAGINATION_INDEXED); +} + +static void +gdata_freebase_query_finalize (GObject *self) +{ + GDataFreebaseQueryPrivate *priv = GDATA_FREEBASE_QUERY (self)->priv; + + if (priv->variant != NULL) + g_variant_unref (priv->variant); + if (priv->query_node != NULL) + json_node_free (priv->query_node); + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_freebase_query_parent_class)->finalize (self); +} + +static void +gdata_freebase_query_set_property (GObject *self, guint prop_id, const GValue *value, GParamSpec *pspec) +{ + GDataFreebaseQueryPrivate *priv = GDATA_FREEBASE_QUERY (self)->priv; + + switch (prop_id) { + case PROP_VARIANT: + priv->variant = g_value_get_variant (value); + if (priv->variant) + priv->query_node = json_gvariant_serialize (priv->variant); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); + break; + } +} + +static void +gdata_freebase_query_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec) +{ + GDataFreebaseQueryPrivate *priv = GDATA_FREEBASE_QUERY (self)->priv; + + switch (prop_id) { + case PROP_VARIANT: + g_value_set_variant (value, priv->variant); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); + break; + } +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataFreebaseQueryPrivate *priv = GDATA_FREEBASE_QUERY (self)->priv; + const gchar *query; + +#define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + query = gdata_query_get_q (self); + + if (query != NULL) { + APPEND_SEP; + g_string_append (query_uri, "query="); + g_string_append (query_uri, query); + } else if (priv->query_node != NULL) { + JsonGenerator *generator; + JsonNode *copy; + gchar *json; + guint limit; + + copy = json_node_copy (priv->query_node); + + limit = gdata_query_get_max_results (self); + + if (limit > 0) { + JsonNode *limit_node; + JsonObject *object; + + limit_node = json_node_new (JSON_NODE_VALUE); + json_node_set_int (limit_node, limit); + + object = json_node_get_object (copy); + json_object_set_member (object, "limit", limit_node); + } + + generator = json_generator_new (); + json_generator_set_root (generator, copy); + json = json_generator_to_data (generator, NULL); + g_object_unref (generator); + + APPEND_SEP; + g_string_append (query_uri, "query="); + g_string_append (query_uri, json); + g_free (json); + } + + /* We don't chain up with parent class get_query_uri because it uses + * GData protocol parameters and they aren't compatible with newest API family + */ +#undef APPEND_SEP +} + +/** + * gdata_freebase_query_new: + * @mql: a MQL query string + * + * Creates a new #GDataFreebaseQuery with the MQL query provided in @mql. MQL + * is a JSON-based query language, analogous to SPARQL. To learn more about MQL, + * see the + * MQL overview and + * cookbook. + * + * For detailed information on Freebase schemas, The "Schema" + * section on the main site allows for natural search and navigation through the multiple data properties and domains. + * + * Return value: (transfer full): a new #GDataFreebaseQuery + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseQuery * +gdata_freebase_query_new (const gchar *mql) +{ + g_return_val_if_fail (mql != NULL, NULL); + + return g_object_new (GDATA_TYPE_FREEBASE_QUERY, "q", mql, NULL); +} + +/** + * gdata_freebase_query_new_from_variant: + * @variant: a variant containing the MQL query structure + * + * Creates a new #GDataFreebaseQuery with the MQL query provided in a serialized form as @variant + * of type "a{smv}" containing the JSON data tree of a MQL query. One convenient way + * to build the variant is using json_gvariant_serialize() from a #JsonNode. For more information + * about MQL, see gdata_freebase_query_new(). + * + * #GDataFreebaseQuery takes ownership on @variant, if it has a floating reference, it will be sunk. + * Otherwise an extra reference will be added. + * + * Return value: (transfer full): a new #GDataFreebaseQuery + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseQuery * +gdata_freebase_query_new_from_variant (GVariant *variant) +{ + g_return_val_if_fail (variant != NULL, NULL); + + return g_object_new (GDATA_TYPE_FREEBASE_QUERY, + "variant", g_variant_ref_sink (variant), + NULL); +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/freebase/gdata-freebase-query.h b/gdata/services/freebase/gdata-freebase-query.h new file mode 100644 index 0000000..28c1070 --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-query.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_FREEBASE_QUERY_H +#define GDATA_FREEBASE_QUERY_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#ifndef LIBGDATA_DISABLE_DEPRECATED + +#define GDATA_TYPE_FREEBASE_QUERY (gdata_freebase_query_get_type ()) +#define GDATA_FREEBASE_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_FREEBASE_QUERY, GDataFreebaseQuery)) +#define GDATA_FREEBASE_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_FREEBASE_QUERY, GDataFreebaseQueryClass)) +#define GDATA_IS_FREEBASE_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_FREEBASE_QUERY)) +#define GDATA_IS_FREEBASE_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_FREEBASE_QUERY)) +#define GDATA_FREEBASE_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_FREEBASE_QUERY, GDataFreebaseQueryClass)) + +typedef struct _GDataFreebaseQueryPrivate GDataFreebaseQueryPrivate; + +/** + * GDataFreebaseQuery: + * + * All the fields in the #GDataFreebaseQuery structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + GDataQuery parent; + /*< private >*/ + GDataFreebaseQueryPrivate *priv; +} GDataFreebaseQuery; + +/** + * GDataFreebaseQueryClass: + * + * All the fields in the #GDataFreebaseQueryClass structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + /*< private >*/ + GDataQueryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataFreebaseQueryClass; + +GType gdata_freebase_query_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; + +GDataFreebaseQuery *gdata_freebase_query_new (const gchar *mql) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; +GDataFreebaseQuery *gdata_freebase_query_new_from_variant (GVariant *variant) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; + +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_FREEBASE_QUERY_H */ diff --git a/gdata/services/freebase/gdata-freebase-result.c b/gdata/services/freebase/gdata-freebase-result.c new file mode 100644 index 0000000..56c9022 --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-result.c @@ -0,0 +1,205 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-freebase-result + * @short_description: GData Freebase result object + * @stability: Stable + * @include: gdata/services/freebase/gdata-freebase-result.h + * + * #GDataFreebaseResult is a subclass of #GDataEntry to represent the result of a Google Freebase MQL query. + * + * For more details of Google Freebase API, see the + * online documentation. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + +#include +#include +#include +#include + +#include "gdata-freebase-result.h" +#include "gdata-private.h" +#include "gdata-types.h" + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +#define URLBASE "https://www.googleapis.com/freebase/v1/" + +enum { + PROP_VARIANT = 1 +}; + +struct _GDataFreebaseResultPrivate { + GVariant *result; +}; + +static void gdata_freebase_result_finalize (GObject *self); +static void gdata_freebase_result_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static const gchar *get_content_type (void); +static gchar *get_entry_uri (const gchar *id); + +G_DEFINE_TYPE (GDataFreebaseResult, gdata_freebase_result, GDATA_TYPE_ENTRY) + +static void +gdata_freebase_result_class_init (GDataFreebaseResultClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataFreebaseResultPrivate)); + + gobject_class->finalize = gdata_freebase_result_finalize; + gobject_class->get_property = gdata_freebase_result_get_property; + + parsable_class->parse_json = parse_json; + parsable_class->get_content_type = get_content_type; + entry_class->get_entry_uri = get_entry_uri; + + /** + * GDataFreebaseResult:variant: + * + * Variant containing the MQL result. The variant is a very generic container of type "a{smv}", + * containing (possibly nested) Freebase schema types and values. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + g_object_class_install_property (gobject_class, PROP_VARIANT, + g_param_spec_variant ("variant", + "Variant", "Variant holding the raw result.", + G_VARIANT_TYPE ("a{smv}"), NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); +} + +static void +gdata_freebase_result_init (GDataFreebaseResult *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_FREEBASE_RESULT, GDataFreebaseResultPrivate); +} + +static void +gdata_freebase_result_finalize (GObject *self) +{ + GDataFreebaseResultPrivate *priv = GDATA_FREEBASE_RESULT (self)->priv; + + if (priv->result != NULL) + g_variant_unref (priv->result); + + G_OBJECT_CLASS (gdata_freebase_result_parent_class)->finalize (self); +} + +static void +gdata_freebase_result_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec) +{ + GDataFreebaseResultPrivate *priv = GDATA_FREEBASE_RESULT (self)->priv; + + switch (prop_id) { + case PROP_VARIANT: + g_value_set_variant (value, priv->result); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); + break; + } +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataFreebaseResultPrivate *priv = GDATA_FREEBASE_RESULT (parsable)->priv; + JsonNode *root, *node; + JsonObject *object; + + if (g_strcmp0 (json_reader_get_member_name (reader), "result") != 0) + return TRUE; + + g_object_get (reader, "root", &root, NULL); + object = json_node_get_object (root); + node = json_object_get_member (object, "result"); + + priv->result = g_variant_ref_sink (json_gvariant_deserialize (node, NULL, error)); + json_node_free (root); + + return (priv->result != NULL); +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +static gchar * +get_entry_uri (const gchar *id) +{ + /* https://www.googleapis.com/freebase/v1/mqlread interface */ + return g_strconcat (URLBASE, id, NULL); +} + +/** + * gdata_freebase_result_new: + * + * Creates a new #GDataFreebaseResult. + * + * Return value: (transfer full): a new #GDataFreebaseResult; unref with g_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseResult * +gdata_freebase_result_new (void) +{ + return g_object_new (GDATA_TYPE_FREEBASE_RESULT, NULL); +} + +/** + * gdata_freebase_result_dup_variant: + * @self: a #GDataFreebaseResult + * + * Gets the result serialized as a #GVariant of type "a{smv}", containing the JSON + * data tree. This variant can be alternatively processed through json_gvariant_serialize(). + * + * Returns: (allow-none) (transfer full): the serialized result, or %NULL; unref with g_variant_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GVariant * +gdata_freebase_result_dup_variant (GDataFreebaseResult *self) +{ + GDataFreebaseResultPrivate *priv; + + g_return_val_if_fail (GDATA_IS_FREEBASE_RESULT (self), NULL); + + priv = self->priv; + + if (priv->result == NULL) + return NULL; + + return g_variant_ref (priv->result); +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/freebase/gdata-freebase-result.h b/gdata/services/freebase/gdata-freebase-result.h new file mode 100644 index 0000000..1f4950c --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-result.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_FREEBASE_RESULT_H +#define GDATA_FREEBASE_RESULT_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#ifndef LIBGDATA_DISABLE_DEPRECATED + +#define GDATA_TYPE_FREEBASE_RESULT (gdata_freebase_result_get_type ()) +#define GDATA_FREEBASE_RESULT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_FREEBASE_RESULT, GDataFreebaseResult)) +#define GDATA_FREEBASE_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_FREEBASE_RESULT, GDataFreebaseResultClass)) +#define GDATA_IS_FREEBASE_RESULT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_FREEBASE_RESULT)) +#define GDATA_IS_FREEBASE_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_FREEBASE_RESULT)) +#define GDATA_FREEBASE_RESULT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_FREEBASE_RESULT, GDataFreebaseResultClass)) + +typedef struct _GDataFreebaseResultPrivate GDataFreebaseResultPrivate; + +/** + * GDataFreebaseResult: + * + * All the fields in the #GDataFreebaseResult structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + GDataEntry parent; + GDataFreebaseResultPrivate *priv; +} GDataFreebaseResult; + +/** + * GDataFreebaseResultClass: + * + * All the fields in the #GDataFreebaseResultClass structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ + +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataFreebaseResultClass; + +GType gdata_freebase_result_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; + +GDataFreebaseResult *gdata_freebase_result_new (void) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; +GVariant *gdata_freebase_result_dup_variant (GDataFreebaseResult *self) G_GNUC_WARN_UNUSED_RESULT G_GNUC_DEPRECATED; + +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_FREEBASE_RESULT_H */ diff --git a/gdata/services/freebase/gdata-freebase-search-query.c b/gdata/services/freebase/gdata-freebase-search-query.c new file mode 100644 index 0000000..fc09a2d --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-search-query.c @@ -0,0 +1,626 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-freebase-search-query + * @short_description: GData Freebase query object + * @stability: Stable + * @include: gdata/services/freebase/gdata-freebase-query.h + * + * #GDataFreebaseQuery represents a collection of query parameters specific to the Google Freebase service. + * a #GDataFreebaseQuery is built on top of a search term, further filters can be set on the search query + * through gdata_freebase_search_query_add_filter() or gdata_freebase_search_query_add_location(). The filters + * can be nested in sublevels, created through gdata_freebase_search_query_open_filter() + * and gdata_freebase_search_query_close_filter(). + * + * For more details of Google Freebase API, see the + * online documentation. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + +#include +#include +#include +#include +#include + +#include "gdata-freebase-search-query.h" +#include "gdata-query.h" +#include "gdata-parser.h" + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +static void gdata_freebase_search_query_finalize (GObject *self); +static void gdata_freebase_search_query_set_property (GObject *self, guint prop_id, const GValue *value, GParamSpec *pspec); +static void gdata_freebase_search_query_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +typedef enum { + NODE_CONTAINER, + NODE_VALUE, + NODE_LOCATION +} FilterNodeType; + +typedef union { + FilterNodeType type; + + struct { + FilterNodeType type; + GDataFreebaseSearchFilterType filter_type; + GPtrArray *child_nodes; /* Contains owned FilterNode structs */ + } container; + + struct { + FilterNodeType type; + gchar *property; + gchar *value; + } value; + + struct { + FilterNodeType type; + guint64 radius; + gdouble lat; + gdouble lon; + } location; +} FilterNode; + +struct _GDataFreebaseSearchQueryPrivate { + FilterNode *filter; + GList *filter_stack; /* Contains unowned FilterNode structs */ + + gchar *lang; + guint stemmed : 1; +}; + +enum { + PROP_LANGUAGE = 1, + PROP_STEMMED +}; + +G_DEFINE_TYPE (GDataFreebaseSearchQuery, gdata_freebase_search_query, GDATA_TYPE_QUERY) + +static void +gdata_freebase_search_query_class_init (GDataFreebaseSearchQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataFreebaseSearchQueryPrivate)); + + gobject_class->finalize = gdata_freebase_search_query_finalize; + gobject_class->set_property = gdata_freebase_search_query_set_property; + gobject_class->get_property = gdata_freebase_search_query_get_property; + + query_class->get_query_uri = get_query_uri; + + /** + * GDataFreebaseSearchQuery:language: + * + * Language used for search results, in ISO-639-1 format. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + g_object_class_install_property (gobject_class, PROP_LANGUAGE, + g_param_spec_string ("language", + "Language used for results", + "Language in ISO-639-1 format.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + /** + * GDataFreebaseSearchQuery:stemmed: + * + * Whether word stemming should happen on the search terms. If this property is enabled, + * words like eg. "natural", "naturally" or "nature" would be all reduced to the root "natur" + * for search purposes. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + g_object_class_install_property (gobject_class, PROP_STEMMED, + g_param_spec_boolean ("stemmed", + "Stem search terms", + "Whether the search terms should be stemmed", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); +} + +static void +gdata_freebase_search_query_init (GDataFreebaseSearchQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_FREEBASE_SEARCH_QUERY, GDataFreebaseSearchQueryPrivate); +} + +static void +_free_filter_node (FilterNode *node) +{ + switch (node->type) { + case NODE_CONTAINER: + g_ptr_array_unref (node->container.child_nodes); + break; + case NODE_VALUE: + g_free (node->value.property); + g_free (node->value.value); + break; + case NODE_LOCATION: + default: + break; + } + + g_slice_free (FilterNode, node); +} + +static void +gdata_freebase_search_query_finalize (GObject *self) +{ + GDataFreebaseSearchQueryPrivate *priv = GDATA_FREEBASE_SEARCH_QUERY (self)->priv; + + g_free (priv->lang); + g_list_free (priv->filter_stack); + + if (priv->filter != NULL) + _free_filter_node (priv->filter); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_freebase_search_query_parent_class)->finalize (self); +} + +static void +gdata_freebase_search_query_set_property (GObject *self, guint prop_id, const GValue *value, GParamSpec *pspec) +{ + GDataFreebaseSearchQuery *query = GDATA_FREEBASE_SEARCH_QUERY (self); + + switch (prop_id) { + case PROP_LANGUAGE: + gdata_freebase_search_query_set_language (query, g_value_get_string (value)); + break; + case PROP_STEMMED: + gdata_freebase_search_query_set_stemmed (query, g_value_get_boolean (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); + break; + } +} + +static void +gdata_freebase_search_query_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec) +{ + GDataFreebaseSearchQueryPrivate *priv = GDATA_FREEBASE_SEARCH_QUERY (self)->priv; + + switch (prop_id) { + case PROP_LANGUAGE: + g_value_set_string (value, priv->lang); + break; + case PROP_STEMMED: + g_value_set_boolean (value, priv->stemmed); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); + break; + } +} + +static void +build_filter_string (FilterNode *node, + GString *str) +{ + switch (node->type) { + case NODE_CONTAINER: + { + /* Array matches GDataFreebaseSearchFilterType */ + const gchar *type_str[] = { "all", "any", "not" }; + guint i; + + g_assert (/* node->container.filter_type >= 0 && */ + node->container.filter_type < G_N_ELEMENTS (type_str)); + + g_string_append_printf (str, "(%s", type_str[node->container.filter_type]); + + for (i = 0; i < node->container.child_nodes->len; i++) + build_filter_string (g_ptr_array_index (node->container.child_nodes, i), str); + + g_string_append (str, ")"); + break; + } + case NODE_VALUE: + { + gchar *escaped; + + escaped = g_strescape (node->value.value, NULL); + g_string_append_printf (str, " %s:\"%s\"", node->value.property, escaped); + g_free (escaped); + break; + } + case NODE_LOCATION: + { + gchar lon_str[G_ASCII_DTOSTR_BUF_SIZE], lat_str[G_ASCII_DTOSTR_BUF_SIZE]; + + g_ascii_formatd (lon_str, G_ASCII_DTOSTR_BUF_SIZE, "%.4f", node->location.lon); + g_ascii_formatd (lat_str, G_ASCII_DTOSTR_BUF_SIZE, "%.4f", node->location.lat); + g_string_append_printf (str, "(within radius:%" G_GUINT64_FORMAT "m lon:%s lat:%s)", + node->location.radius, lon_str, lat_str); + break; + } + default: + g_assert_not_reached (); + break; + } +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataFreebaseSearchQueryPrivate *priv = GDATA_FREEBASE_SEARCH_QUERY (self)->priv; + const gchar *query, *lang = NULL; + gint64 updated_max; + guint cur, limit; + +#define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + query = gdata_query_get_q (self); + + if (query != NULL) { + APPEND_SEP; + g_string_append (query_uri, "query="); + g_string_append (query_uri, query); + } + + if (priv->filter != NULL) { + GString *str = g_string_new (NULL); + + build_filter_string (priv->filter, str); + + APPEND_SEP; + g_string_append (query_uri, "filter="); + g_string_append (query_uri, str->str); + g_string_free (str, TRUE); + } + + updated_max = gdata_query_get_updated_max (self); + + if (updated_max != -1) { + gchar *date_str; + + date_str = gdata_parser_int64_to_iso8601 (updated_max); + + APPEND_SEP; + g_string_append (query_uri, "as_of_time="); + g_string_append (query_uri, date_str); + g_free (date_str); + } + + if (priv->lang != NULL) { + lang = priv->lang; + } else { + const gchar * const *user_languages; + GString *lang_str = NULL; + gint i; + + user_languages = g_get_language_names (); + + for (i = 0; user_languages[i] != NULL; i++) { + if (strlen (user_languages[i]) != 2) + continue; + + if (!lang_str) + lang_str = g_string_new (user_languages[i]); + else + g_string_append_printf (lang_str, ",%s", user_languages[i]); + } + + lang = g_string_free (lang_str, FALSE); + } + + APPEND_SEP; + g_string_append (query_uri, "lang="); + g_string_append (query_uri, lang); + + if (priv->stemmed) { + APPEND_SEP; + g_string_append (query_uri, "stemmed=true"); + } + + cur = gdata_query_get_start_index (self); + + if (cur > 0) { + APPEND_SEP; + g_string_append_printf (query_uri, "cursor=%d", cur); + } + + limit = gdata_query_get_max_results (self); + + if (limit > 0) { + APPEND_SEP; + g_string_append_printf (query_uri, "limit=%d", limit); + } + + /* We don't chain up with parent class get_query_uri because it uses + * GData protocol parameters and they aren't compatible with newest API family + */ +#undef APPEND_SEP +} + +/** + * gdata_freebase_search_query_new: + * @search_terms: string to search for + * + * Creates a new #GDataFreebaseSearchQuery prepared to search for Freebase elements that + * match the given @search_terms. Further filters on the query can be set through + * gdata_freebase_search_query_add_filter() or gdata_freebase_search_query_add_location(). + * + * Return value: (transfer full): a new #GDataFreebaseSearchQuery; unref with g_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseSearchQuery * +gdata_freebase_search_query_new (const gchar *search_terms) +{ + g_return_val_if_fail (search_terms != NULL, NULL); + return g_object_new (GDATA_TYPE_FREEBASE_SEARCH_QUERY, "q", search_terms, NULL); +} + +/** + * gdata_freebase_search_query_open_filter: + * @self: a #GDataFreebaseSearchQuery + * @filter_type: filter type + * + * Opens a container of filter rules, those are applied according to the behavior specified by @filter_type. + * Every call to this function must be paired by a call to gdata_freebase_search_query_close_filter(). + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_search_query_open_filter (GDataFreebaseSearchQuery *self, GDataFreebaseSearchFilterType filter_type) +{ + GDataFreebaseSearchQueryPrivate *priv; + FilterNode *current_node, *node; + + g_return_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (self)); + + priv = GDATA_FREEBASE_SEARCH_QUERY (self)->priv; + + node = g_slice_new0 (FilterNode); + node->type = NODE_CONTAINER; + node->container.filter_type = filter_type; + node->container.child_nodes = g_ptr_array_new_with_free_func ((GDestroyNotify) _free_filter_node); + + if (priv->filter_stack != NULL) { + current_node = priv->filter_stack->data; + g_ptr_array_add (current_node->container.child_nodes, node); + } else if (priv->filter == NULL) { + priv->filter = node; + } else { + g_assert_not_reached (); + } + + priv->filter_stack = g_list_prepend (priv->filter_stack, node); +} + +/** + * gdata_freebase_search_query_close_filter: + * @self: a #GDataFreebaseSearchQuery + * + * Closes a filter level. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_search_query_close_filter (GDataFreebaseSearchQuery *self) +{ + GDataFreebaseSearchQueryPrivate *priv; + + g_return_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (self)); + + priv = GDATA_FREEBASE_SEARCH_QUERY (self)->priv; + + if (priv->filter_stack == NULL) + g_assert_not_reached (); + + priv->filter_stack = g_list_delete_link (priv->filter_stack, priv->filter_stack); +} + +/** + * gdata_freebase_search_query_add_filter: + * @self: a #GDataFreebaseSearchQuery + * @property: Freebase property ID + * @value: match string + * + * Adds a property filter to the query. property filters are always nested in + * containers, opened and closed through gdata_freebase_search_query_open_filter() + * and gdata_freebase_search_query_close_filter(). + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_search_query_add_filter (GDataFreebaseSearchQuery *self, const gchar *property, const gchar *value) +{ + GDataFreebaseSearchQueryPrivate *priv; + FilterNode *current_node, *node; + + g_return_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (self)); + g_return_if_fail (property != NULL && value != NULL); + + priv = GDATA_FREEBASE_SEARCH_QUERY (self)->priv; + + if (priv->filter_stack == NULL) { + g_critical ("A filter container must be opened before through " + "gdata_freebase_search_query_open_filter()"); + g_assert_not_reached (); + } + + node = g_slice_new0 (FilterNode); + node->type = NODE_VALUE; + node->value.property = g_strdup (property); + node->value.value = g_strdup (value); + + current_node = priv->filter_stack->data; + g_ptr_array_add (current_node->container.child_nodes, node); +} + +/** + * gdata_freebase_search_query_add_location: + * @self: a #GDataFreebaseSearchQuery + * @radius: radius in meters + * @lat: latitude + * @lon: longitude + * + * Adds a geolocation filter to the query. location filters are always nested in + * containers, opened and closed through gdata_freebase_search_query_open_filter() + * and gdata_freebase_search_query_close_filter(). + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_search_query_add_location (GDataFreebaseSearchQuery *self, guint64 radius, gdouble lat, gdouble lon) +{ + GDataFreebaseSearchQueryPrivate *priv = GDATA_FREEBASE_SEARCH_QUERY (self)->priv; + FilterNode *current_node, *node; + + g_return_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (self)); + + if (priv->filter_stack == NULL) { + g_critical ("A filter container must be opened before through " + "gdata_freebase_search_query_open_filter()"); + g_assert_not_reached (); + } + + node = g_slice_new0 (FilterNode); + node->type = NODE_LOCATION; + node->location.radius = radius; + node->location.lat = lat; + node->location.lon = lon; + + current_node = priv->filter_stack->data; + g_ptr_array_add (current_node->container.child_nodes, node); +} + +/** + * gdata_freebase_search_query_set_language: + * @self: a #GDataFreebaseSearchQuery + * @lang: (allow-none): Language used on the search terms and results, in ISO-639-1 format, or %NULL to unset. + * + * Sets the language used, both on the search terms and the results. If unset, + * the locale preferences will be respected. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_search_query_set_language (GDataFreebaseSearchQuery *self, + const gchar *lang) +{ + GDataFreebaseSearchQueryPrivate *priv; + + g_return_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (self)); + g_return_if_fail (!lang || strlen (lang) == 2); + + priv = self->priv; + + if (g_strcmp0 (priv->lang, lang) == 0) + return; + + g_free (priv->lang); + priv->lang = g_strdup (lang); + g_object_notify (G_OBJECT (self), "language"); +} + +/** + * gdata_freebase_search_query_get_language: + * @self: a #GDataFreebaseSearchQuery + * + * Gets the language set on the search query, or %NULL if unset. + * + * Return value: (allow-none): The language used on the query. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_search_query_get_language (GDataFreebaseSearchQuery *self) +{ + GDataFreebaseSearchQueryPrivate *priv; + + g_return_val_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (self), NULL); + + priv = self->priv; + return priv->lang; +} + +/** + * gdata_freebase_search_query_set_stemmed: + * @self: a #GDataFreebaseSearchQuery + * @stemmed: %TRUE to perform stemming on the search results + * + * Sets whether stemming is performed on the provided search terms. If @stemmed is %TRUE, + * words like eg. "natural", "naturally" or "nature" would be all reduced to the root "natur" + * for search purposes. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_search_query_set_stemmed (GDataFreebaseSearchQuery *self, + gboolean stemmed) +{ + GDataFreebaseSearchQueryPrivate *priv; + + g_return_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (self)); + + priv = self->priv; + + if (priv->stemmed == stemmed) + return; + + priv->stemmed = stemmed; + g_object_notify (G_OBJECT (self), "stemmed"); +} + +/** + * gdata_freebase_search_query_get_stemmed: + * @self: a #GDataFreebaseSearchQuery + * + * Returns whether the #GDataFreebaseSearchQuery will perform stemming on the search terms. + * + * Return value: %TRUE if the #GDataFreebaseSearchQuery performs stemming + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +gboolean +gdata_freebase_search_query_get_stemmed (GDataFreebaseSearchQuery *self) +{ + GDataFreebaseSearchQueryPrivate *priv; + + g_return_val_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (self), FALSE); + + priv = self->priv; + return priv->stemmed; +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/freebase/gdata-freebase-search-query.h b/gdata/services/freebase/gdata-freebase-search-query.h new file mode 100644 index 0000000..7c7927b --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-search-query.h @@ -0,0 +1,106 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_FREEBASE_SEARCH_QUERY_H +#define GDATA_FREEBASE_SEARCH_QUERY_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#ifndef LIBGDATA_DISABLE_DEPRECATED + +#define GDATA_TYPE_FREEBASE_SEARCH_QUERY (gdata_freebase_search_query_get_type ()) +#define GDATA_FREEBASE_SEARCH_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_FREEBASE_SEARCH_QUERY, GDataFreebaseSearchQuery)) +#define GDATA_FREEBASE_SEARCH_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_FREEBASE_SEARCH_QUERY, GDataFreebaseSearchQueryClass)) +#define GDATA_IS_FREEBASE_SEARCH_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_FREEBASE_SEARCH_QUERY)) +#define GDATA_IS_FREEBASE_SEARCH_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_FREEBASE_SEARCH_QUERY)) +#define GDATA_FREEBASE_SEARCH_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_FREEBASE_SEARCH_QUERY, GDataFreebaseSearchQueryClass)) + +typedef struct _GDataFreebaseSearchQueryPrivate GDataFreebaseSearchQueryPrivate; + +/** + * GDataFreebaseSearchFilterType: + * @GDATA_FREEBASE_SEARCH_FILTER_ALL: all enclosed elements must match, logically an AND + * @GDATA_FREEBASE_SEARCH_FILTER_ANY: any of the enclosed elements must match, logically an OR + * @GDATA_FREEBASE_SEARCH_FILTER_NOT: the match is inverted. + * + * Search filter container types. + * + * Since: 0.15.1 + */ +typedef enum { + GDATA_FREEBASE_SEARCH_FILTER_ALL, + GDATA_FREEBASE_SEARCH_FILTER_ANY, + GDATA_FREEBASE_SEARCH_FILTER_NOT +} GDataFreebaseSearchFilterType; + +/** + * GDataFreebaseSearchQuery: + * + * All the fields in the #GDataFreebaseSearchQuery structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + GDataQuery parent; + GDataFreebaseSearchQueryPrivate *priv; +} GDataFreebaseSearchQuery; + +/** + * GDataFreebaseSearchQueryClass: + * + * All the fields in the #GDataFreebaseSearchQueryClass structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + /*< private >*/ + GDataQueryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataFreebaseSearchQueryClass; + +GType gdata_freebase_search_query_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; + +GDataFreebaseSearchQuery *gdata_freebase_search_query_new (const gchar *search_terms) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; + +void gdata_freebase_search_query_open_filter (GDataFreebaseSearchQuery *self, GDataFreebaseSearchFilterType filter_type) G_GNUC_DEPRECATED; +void gdata_freebase_search_query_close_filter (GDataFreebaseSearchQuery *self) G_GNUC_DEPRECATED; +void gdata_freebase_search_query_add_filter (GDataFreebaseSearchQuery *self, const gchar *property, const gchar *value) G_GNUC_DEPRECATED; +void gdata_freebase_search_query_add_location (GDataFreebaseSearchQuery *self, guint64 radius, gdouble lat, gdouble lon) G_GNUC_DEPRECATED; + +void gdata_freebase_search_query_set_language (GDataFreebaseSearchQuery *self, const gchar *lang) G_GNUC_DEPRECATED; +const gchar * gdata_freebase_search_query_get_language (GDataFreebaseSearchQuery *self) G_GNUC_DEPRECATED; + +void gdata_freebase_search_query_set_stemmed (GDataFreebaseSearchQuery *self, gboolean stemmed) G_GNUC_DEPRECATED; +gboolean gdata_freebase_search_query_get_stemmed (GDataFreebaseSearchQuery *self) G_GNUC_DEPRECATED; + +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_FREEBASE_SEARCH_QUERY_H */ diff --git a/gdata/services/freebase/gdata-freebase-search-result.c b/gdata/services/freebase/gdata-freebase-search-result.c new file mode 100644 index 0000000..c36ad1c --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-search-result.c @@ -0,0 +1,432 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-freebase-search-result + * @short_description: GData Freebase search result object + * @stability: Stable + * @include: gdata/services/freebase/gdata-freebase-result.h + * + * #GDataFreebaseSearchResult is a subclass of #GDataEntry to represent the result of a Freebase search query. + * + * For more details of Google Freebase API, see the + * online documentation. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + +#include +#include +#include +#include + +#include "gdata-freebase-search-result.h" +#include "gdata-private.h" +#include "gdata-types.h" + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +#define URLBASE "https://www.googleapis.com/freebase/v1" + +struct _GDataFreebaseSearchResultItem { + gchar *mid; + gchar *id; + gchar *name; + gchar *lang; + gchar *notable_id; + gchar *notable_name; + gdouble score; +}; + +struct _GDataFreebaseSearchResultPrivate { + GPtrArray *items; /* contains owned GDataFreebaseSearchResultItem structs */ + guint total_hits; +}; + +static void gdata_freebase_search_result_finalize (GObject *self); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static GDataFreebaseSearchResultItem * item_copy (const GDataFreebaseSearchResultItem *item); +static void item_free (GDataFreebaseSearchResultItem *item); + +G_DEFINE_BOXED_TYPE (GDataFreebaseSearchResultItem, gdata_freebase_search_result_item, item_copy, item_free) + +G_DEFINE_TYPE (GDataFreebaseSearchResult, gdata_freebase_search_result, GDATA_TYPE_FREEBASE_RESULT) + +static void +gdata_freebase_search_result_class_init (GDataFreebaseSearchResultClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataFreebaseSearchResultPrivate)); + + gobject_class->finalize = gdata_freebase_search_result_finalize; + parsable_class->parse_json = parse_json; +} + +static GDataFreebaseSearchResultItem * +item_new (void) +{ + return g_slice_new0 (GDataFreebaseSearchResultItem); +} + +static void +item_free (GDataFreebaseSearchResultItem *item) +{ + g_free (item->mid); + g_free (item->id); + g_free (item->name); + g_free (item->lang); + g_free (item->notable_id); + g_free (item->notable_name); + g_slice_free (GDataFreebaseSearchResultItem, item); +} + +static GDataFreebaseSearchResultItem * +item_copy (const GDataFreebaseSearchResultItem *item) +{ + GDataFreebaseSearchResultItem *copy; + + copy = item_new (); + copy->mid = g_strdup (item->mid); + copy->id = g_strdup (item->id); + copy->name = g_strdup (item->name); + copy->lang = g_strdup (item->lang); + copy->notable_id = g_strdup (item->notable_id); + copy->notable_name = g_strdup (item->notable_name); + copy->score = item->score; + + return copy; +} + +static void +gdata_freebase_search_result_init (GDataFreebaseSearchResult *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_FREEBASE_SEARCH_RESULT, GDataFreebaseSearchResultPrivate); + self->priv->items = g_ptr_array_new_with_free_func ((GDestroyNotify) item_free); +} + +static void +gdata_freebase_search_result_finalize (GObject *self) +{ + GDataFreebaseSearchResultPrivate *priv = GDATA_FREEBASE_SEARCH_RESULT (self)->priv; + + g_ptr_array_unref (priv->items); + + G_OBJECT_CLASS (gdata_freebase_search_result_parent_class)->finalize (self); +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataFreebaseSearchResultPrivate *priv = GDATA_FREEBASE_SEARCH_RESULT (parsable)->priv; + const GError *inner_error = NULL; + const gchar *member_name; + gint count, i; + + GDATA_PARSABLE_CLASS (gdata_freebase_search_result_parent_class)->parse_json (parsable, reader, user_data, error); + +#define ITEM_SET_STRING(id,field,mandatory) \ + json_reader_read_member (reader, #id); \ + item->field = g_strdup (json_reader_get_string_value (reader)); \ + if (mandatory) { \ + inner_error = json_reader_get_error (reader); \ + if (inner_error != NULL) goto item_error; \ + } \ + json_reader_end_member (reader); + +#define ITEM_SET_DOUBLE(id,field) \ + json_reader_read_member (reader, #id); \ + item->field = json_reader_get_double_value (reader); \ + inner_error = json_reader_get_error (reader); \ + if (inner_error != NULL) goto item_error; \ + json_reader_end_member (reader); + + member_name = json_reader_get_member_name (reader); + + if (member_name == NULL) + return FALSE; + + if (strcmp (member_name, "hits") == 0) { + priv->total_hits = json_reader_get_int_value (reader); + return TRUE; + } else if (strcmp (member_name, "result") != 0) { + /* Avoid anything else besides hits/result */ + return TRUE; + } + + if (!json_reader_is_array (reader)) + return FALSE; + + count = json_reader_count_elements (reader); + + for (i = 0; i < count; i++) { + GDataFreebaseSearchResultItem *item; + + item = item_new (); + json_reader_read_element (reader, i); + + ITEM_SET_STRING (mid, mid, TRUE); + ITEM_SET_STRING (id, id, FALSE); + ITEM_SET_STRING (name, name, TRUE); + ITEM_SET_STRING (lang, lang, FALSE); + ITEM_SET_DOUBLE (score, score); + + /* Read "notable" */ + json_reader_read_member (reader, "notable"); + + if (json_reader_get_error (reader) == NULL) { + ITEM_SET_STRING (id, notable_id, TRUE); + ITEM_SET_STRING (name, notable_name, TRUE); + } + + json_reader_end_member (reader); + json_reader_end_element (reader); + + g_ptr_array_add (priv->items, item); + continue; + + item_error: + item_free (item); + gdata_parser_error_required_json_content_missing (reader, error); + return FALSE; + } + +#undef ITEM_SET_DOUBLE +#undef ITEM_SET_STRING + + return TRUE; +} + +/** + * gdata_freebase_search_result_new: + * + * Creates a new #GDataFreebaseSearchResult with the given ID and default properties. + * + * Return value: (transfer full): a new #GDataFreebaseSearchResult; unref with g_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseSearchResult * +gdata_freebase_search_result_new (void) +{ + return g_object_new (GDATA_TYPE_FREEBASE_SEARCH_RESULT, NULL); +} + +/** + * gdata_freebase_search_result_get_num_items: + * @self: a #GDataFreebaseSearchResult + * + * Returns the number of items contained in this result. + * + * Returns: The number of items + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +guint +gdata_freebase_search_result_get_num_items (GDataFreebaseSearchResult *self) +{ + g_return_val_if_fail (GDATA_IS_FREEBASE_SEARCH_RESULT (self), 0); + + return self->priv->items->len; +} + +/** + * gdata_freebase_search_result_get_total_hits: + * @self: a #GDataFreebaseSearchResult + * + * Returns the total number of hits found for the search query. + * + * Returns: the total number of hits. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +guint +gdata_freebase_search_result_get_total_hits (GDataFreebaseSearchResult *self) +{ + g_return_val_if_fail (GDATA_IS_FREEBASE_SEARCH_RESULT (self), 0); + + return self->priv->total_hits; +} + +/** + * gdata_freebase_search_result_get_item: + * @self: a #GDataFreebaseSearchResult + * @i: number of item to retrieve + * + * Gets an item from the search result. + * + * Returns: (transfer none) (allow-none): a search result item, or %NULL on invalid item. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const GDataFreebaseSearchResultItem * +gdata_freebase_search_result_get_item (GDataFreebaseSearchResult *self, guint i) +{ + GDataFreebaseSearchResultPrivate *priv; + + g_return_val_if_fail (GDATA_IS_FREEBASE_SEARCH_RESULT (self), NULL); + + priv = self->priv; + g_return_val_if_fail (i < priv->items->len, NULL); + + return g_ptr_array_index (priv->items, i); +} + +/** + * gdata_freebase_search_result_item_get_mid: + * @item: a #GDataFreebaseSearchResultItem + * + * Returns the machine-encoded ID (MID) of the search result item. Elements may + * have a single MID, as opposed to the potentially multiple Freebase IDs that + * may point to it. MIDs are usable interchangeably with Freebase IDs. + * + * Returns: (transfer none): The result item MID. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_search_result_item_get_mid (const GDataFreebaseSearchResultItem *item) +{ + g_return_val_if_fail (item != NULL, NULL); + return item->mid; +} + +/** + * gdata_freebase_search_result_item_get_id: + * @item: a #GDataFreebaseSearchResultItem + * + * Returns the Freebase ID of the search result item. + * + * Returns: (transfer none): The search result item Freebase ID. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_search_result_item_get_id (const GDataFreebaseSearchResultItem *item) +{ + g_return_val_if_fail (item != NULL, NULL); + + if (item->id != NULL) + return item->id; + + return item->mid; +} + +/** + * gdata_freebase_search_result_item_get_name: + * @item: a #GDataFreebaseSearchResultItem + * + * Returns the human readable name of the search result item. + * + * Returns: (transfer none): The human readable name of the item. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_search_result_item_get_name (const GDataFreebaseSearchResultItem *item) +{ + g_return_val_if_fail (item != NULL, NULL); + return item->name; +} + +/** + * gdata_freebase_search_result_item_get_language: + * @item: a #GDataFreebaseSearchResultItem + * + * Gets the language of this search result item, in ISO-639-1 format. + * + * Returns: (transfer none): The language of the search result item. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_search_result_item_get_language (const GDataFreebaseSearchResultItem *item) +{ + g_return_val_if_fail (item != NULL, NULL); + return item->lang; +} + +/** + * gdata_freebase_search_result_item_get_notable_id: + * @item: a #GDataFreebaseSearchResultItem + * + * If this search result item is notable in an specific topic, this function + * returns the Freebase ID of this topic. + * + * Returns: (transfer none) (allow-none): The topic the result item is most notable of, or %NULL. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_search_result_item_get_notable_id (const GDataFreebaseSearchResultItem *item) +{ + g_return_val_if_fail (item != NULL, NULL); + return item->notable_id; +} + +/** + * gdata_freebase_search_result_item_get_notable_name: + * @item: a #GDataFreebaseSearchResultItem + * + * If this search result item is notable in an specific topic, this function + * returns the human readable name of this topic. + * + * Returns: (transfer none) (allow-none): The human readable topic name, or %NULL + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_search_result_item_get_notable_name (const GDataFreebaseSearchResultItem *item) +{ + g_return_val_if_fail (item != NULL, NULL); + return item->notable_name; +} + +/** + * gdata_freebase_search_result_item_get_score: + * @item: a #GDataFreebaseSearchResultItem + * + * Returns the score of this search result item. The higher, the more relevant this + * item seems, given the search terms. + * + * Returns: the result item score. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +gdouble +gdata_freebase_search_result_item_get_score (const GDataFreebaseSearchResultItem *item) +{ + g_return_val_if_fail (item != NULL, 0.0); + return item->score; +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/freebase/gdata-freebase-search-result.h b/gdata/services/freebase/gdata-freebase-search-result.h new file mode 100644 index 0000000..299bc9b --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-search-result.h @@ -0,0 +1,104 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_FREEBASE_SEARCH_RESULT_H +#define GDATA_FREEBASE_SEARCH_RESULT_H + +#include +#include + +#include +#include "gdata-freebase-result.h" + +G_BEGIN_DECLS + +#ifndef LIBGDATA_DISABLE_DEPRECATED + +#define GDATA_TYPE_FREEBASE_SEARCH_RESULT_ITEM (gdata_freebase_search_result_item_get_type ()) +#define GDATA_TYPE_FREEBASE_SEARCH_RESULT (gdata_freebase_search_result_get_type ()) +#define GDATA_FREEBASE_SEARCH_RESULT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_FREEBASE_SEARCH_RESULT, GDataFreebaseSearchResult)) +#define GDATA_FREEBASE_SEARCH_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_FREEBASE_SEARCH_RESULT, GDataFreebaseSearchResultClass)) +#define GDATA_IS_FREEBASE_SEARCH_RESULT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_FREEBASE_SEARCH_RESULT)) +#define GDATA_IS_FREEBASE_SEARCH_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_FREEBASE_SEARCH_RESULT)) +#define GDATA_FREEBASE_SEARCH_RESULT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_FREEBASE_SEARCH_RESULT, GDataFreebaseSearchResultClass)) + +typedef struct _GDataFreebaseSearchResultPrivate GDataFreebaseSearchResultPrivate; + +/** + * GDataFreebaseSearchResultItem: + * + * Opaque struct holding data for a single search result item. + * + * Since: 0.15.1 + */ +typedef struct _GDataFreebaseSearchResultItem GDataFreebaseSearchResultItem; + +/** + * GDataFreebaseSearchResult: + * + * All the fields in the #GDataFreebaseSearchResult structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + GDataFreebaseResult parent; + GDataFreebaseSearchResultPrivate *priv; +} GDataFreebaseSearchResult; + +/** + * GDataFreebaseSearchResultClass: + * + * All the fields in the #GDataFreebaseSearchResultClass structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ + +typedef struct { + /*< private >*/ + GDataFreebaseResultClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataFreebaseSearchResultClass; + +GType gdata_freebase_search_result_item_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; +GType gdata_freebase_search_result_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; + +GDataFreebaseSearchResult *gdata_freebase_search_result_new (void) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; + +guint gdata_freebase_search_result_get_num_items (GDataFreebaseSearchResult *self) G_GNUC_DEPRECATED; +guint gdata_freebase_search_result_get_total_hits (GDataFreebaseSearchResult *self) G_GNUC_DEPRECATED; + +const GDataFreebaseSearchResultItem *gdata_freebase_search_result_get_item (GDataFreebaseSearchResult *self, guint i) G_GNUC_DEPRECATED; + +const gchar *gdata_freebase_search_result_item_get_mid (const GDataFreebaseSearchResultItem *item) G_GNUC_DEPRECATED; +const gchar *gdata_freebase_search_result_item_get_id (const GDataFreebaseSearchResultItem *item) G_GNUC_DEPRECATED; +const gchar *gdata_freebase_search_result_item_get_name (const GDataFreebaseSearchResultItem *item) G_GNUC_DEPRECATED; +const gchar *gdata_freebase_search_result_item_get_language (const GDataFreebaseSearchResultItem *item) G_GNUC_DEPRECATED; +const gchar *gdata_freebase_search_result_item_get_notable_id (const GDataFreebaseSearchResultItem *item) G_GNUC_DEPRECATED; +const gchar *gdata_freebase_search_result_item_get_notable_name (const GDataFreebaseSearchResultItem *item) G_GNUC_DEPRECATED; +gdouble gdata_freebase_search_result_item_get_score (const GDataFreebaseSearchResultItem *item) G_GNUC_DEPRECATED; + +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_FREEBASE_SEARCH_RESULT_H */ diff --git a/gdata/services/freebase/gdata-freebase-service.c b/gdata/services/freebase/gdata-freebase-service.c new file mode 100644 index 0000000..df1b925 --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-service.c @@ -0,0 +1,509 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-freebase-service + * @short_description: GData Freebase service object + * @stability: Stable + * @include: gdata/services/freebase/gdata-freebase-service.h + * + * #GDataFreebaseService is a subclass of #GDataService for communicating with the Google Freebase API. It supports queries + * in MQL format, that allows highly flexible queries on any topic. MQL is a JSON based query language, MQL requests consist + * of a mix of defined and empty values for types in the Freebase schema, those "placeholder" values will be filled in on the + * reply. For more information and examples, see the + * MQL overview page. + * + * For more details of Google Freebase API, see the + * online documentation. + * + * Since August 2016, [Google has retired Freebase](https://developers.google.com/freebase/), + * so all of these APIs will return an error if used; and should be considered + * deprecated. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + +#include +#include +#include +#include + +#include "gdata-freebase-service.h" +#include "gdata-freebase-result.h" +#include "gdata-freebase-search-result.h" +#include "gdata-service.h" +#include "gdata-private.h" +#include "gdata-query.h" +#include "gdata-feed.h" + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +/* Standards reference at https://developers.google.com/freebase/v1/ */ + +#define URLBASE "://www.googleapis.com/freebase/v1" +#define IMAGE_URI_PREFIX "https://usercontent.googleapis.com/freebase/v1/image" + +enum { + PROP_DEVELOPER_KEY = 1 +}; + +struct _GDataFreebaseServicePrivate { + gchar *developer_key; +}; + +static void gdata_freebase_service_set_property (GObject *self, guint prop_id, const GValue *value, GParamSpec *pspec); +static void gdata_freebase_service_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec); +static void gdata_freebase_service_finalize (GObject *self); +static void append_query_headers (GDataService *self, GDataAuthorizationDomain *domain, SoupMessage *message); +static GList *get_authorization_domains (void); + +_GDATA_DEFINE_AUTHORIZATION_DOMAIN (freebase, "freebase", "https://www.googleapis.com/auth/freebase.readonly") + +G_DEFINE_TYPE (GDataFreebaseService, gdata_freebase_service, GDATA_TYPE_SERVICE) + +static void +gdata_freebase_service_class_init (GDataFreebaseServiceClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataServiceClass *service_class = GDATA_SERVICE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataFreebaseServicePrivate)); + + gobject_class->set_property = gdata_freebase_service_set_property; + gobject_class->get_property = gdata_freebase_service_get_property; + gobject_class->finalize = gdata_freebase_service_finalize; + + service_class->append_query_headers = append_query_headers; + service_class->get_authorization_domains = get_authorization_domains; + + /** + * GDataFreebaseService:developer-key: + * + * The developer key your application has registered with the Freebase API. For more information, see the online documentation. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + g_object_class_install_property (gobject_class, PROP_DEVELOPER_KEY, + g_param_spec_string ("developer-key", + "Developer key", "Your Freebase developer API key.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); +} + +static void +gdata_freebase_service_init (GDataFreebaseService *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_FREEBASE_SERVICE, GDataFreebaseServicePrivate); +} + +static void +append_query_headers (GDataService *self, GDataAuthorizationDomain *domain, SoupMessage *message) +{ + GDataFreebaseServicePrivate *priv = GDATA_FREEBASE_SERVICE (self)->priv; + const gchar *query; + GString *new_query; + SoupURI *uri; + + g_assert (message != NULL); + + if (priv->developer_key) { + uri = soup_message_get_uri (message); + query = soup_uri_get_query (uri); + + /* Set the key on every request, as per + * https://developers.google.com/freebase/v1/parameters + */ + if (query) { + new_query = g_string_new (query); + + g_string_append (new_query, "&key="); + g_string_append_uri_escaped (new_query, priv->developer_key, NULL, FALSE); + + soup_uri_set_query (uri, new_query->str); + g_string_free (new_query, TRUE); + } + } + + /* Chain up to the parent class */ + GDATA_SERVICE_CLASS (gdata_freebase_service_parent_class)->append_query_headers (self, domain, message); +} + +static GList * +get_authorization_domains (void) +{ + return g_list_prepend (NULL, get_freebase_authorization_domain ()); +} + +static void +gdata_freebase_service_set_property (GObject *self, guint prop_id, const GValue *value, GParamSpec *pspec) +{ + GDataFreebaseServicePrivate *priv = GDATA_FREEBASE_SERVICE (self)->priv; + + switch (prop_id) { + case PROP_DEVELOPER_KEY: + priv->developer_key = g_value_dup_string (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); + break; + } +} + +static void +gdata_freebase_service_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec) +{ + GDataFreebaseServicePrivate *priv = GDATA_FREEBASE_SERVICE (self)->priv; + + switch (prop_id) { + case PROP_DEVELOPER_KEY: + g_value_set_string (value, priv->developer_key); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); + break; + } +} + +static void +gdata_freebase_service_finalize (GObject *self) +{ + GDataFreebaseServicePrivate *priv = GDATA_FREEBASE_SERVICE (self)->priv; + + g_free (priv->developer_key); + + G_OBJECT_CLASS (gdata_freebase_service_parent_class)->finalize (self); +} + +/** + * gdata_freebase_service_new: + * @developer_key: (allow-none): developer key to use the API, or %NULL + * @authorizer: (allow-none): a #GDataAuthorizer to authorize the service's requests, or %NULL + * + * Creates a new #GDataFreebaseService using the given #GDataAuthorizer. If @authorizer is %NULL, all requests are made as an unauthenticated user. + * Having both @developer_key and @authorizer set to %NULL is allowed, but this should be reserved for debugging situations, as there is a certain + * key-less quota for those purposes. If this service is used on any code intended to be deployed, one or both of @developer_key and @authorizer + * should be non-%NULL and valid. + * + * Return value: (transfer full): a new #GDataFreebaseService; unref with g_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseService * +gdata_freebase_service_new (const gchar *developer_key, GDataAuthorizer *authorizer) +{ + g_return_val_if_fail (authorizer == NULL || GDATA_IS_AUTHORIZER (authorizer), NULL); + + return g_object_new (GDATA_TYPE_FREEBASE_SERVICE, + "developer-key", developer_key, + "authorizer", authorizer, + NULL); +} + +/** + * gdata_freebase_service_get_primary_authorization_domain: + * + * The primary #GDataAuthorizationDomain for interacting with Freebase. This will not normally need to be used, as it's used internally + * by the #GDataFreebaseService methods. However, if using the plain #GDataService methods to implement custom queries or requests which libgdata + * does not support natively, then this domain may be needed to authorize the requests. + * + * The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. + * + * Return value: (transfer none): the service's authorization domain + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataAuthorizationDomain * +gdata_freebase_service_get_primary_authorization_domain (void) +{ + return get_freebase_authorization_domain (); +} + +/** + * gdata_freebase_service_query: + * @self: a #GDataFreebaseService + * @query: a #GDataFreebaseQuery with the MQL query + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: (allow-none): a #GError, or %NULL + * + * Performs a MQL query on the service, you can find out more about MQL in the online MQL documentation. + * + * Return value: (transfer full): a #GDataFreebaseResult containing the query result; unref with g_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseResult * +gdata_freebase_service_query (GDataFreebaseService *self, GDataFreebaseQuery *query, + GCancellable *cancellable, GError **error) +{ + GDataEntry *entry; + + g_return_val_if_fail (GDATA_IS_FREEBASE_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_FREEBASE_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + entry = gdata_service_query_single_entry (GDATA_SERVICE (self), get_freebase_authorization_domain (), "mqlread", + GDATA_QUERY (query), GDATA_TYPE_FREEBASE_RESULT, cancellable, error); + if (entry == NULL) + return NULL; + + return GDATA_FREEBASE_RESULT (entry); +} + +/** + * gdata_freebase_service_query_async: + * @self: a #GDataFreebaseService + * @query: a #GDataFreebaseQuery with the MQL query + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Performs a MQL query on the service. @self and @query are all reffed when this function is called, so can safely + * be unreffed after this function returns. When the query is replied, or fails, @callback will be executed, and + * the result can be obtained through gdata_service_query_single_entry_finish(). + * + * For more details, see gdata_freebase_service_query(), which is the synchronous version of + * this function. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_service_query_async (GDataFreebaseService *self, GDataFreebaseQuery *query, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_return_if_fail (GDATA_IS_FREEBASE_SERVICE (self)); + g_return_if_fail (GDATA_IS_FREEBASE_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + gdata_service_query_single_entry_async (GDATA_SERVICE (self), get_freebase_authorization_domain (), "mqlread", + GDATA_QUERY (query), GDATA_TYPE_FREEBASE_RESULT, cancellable, callback, user_data); +} + +/** + * gdata_freebase_service_get_topic: + * @self: a #GDataFreebaseService + * @query: a #GDataFreebaseTopicQuery containing the topic ID + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: (allow-none): a #GError, or %NULL + * + * Queries information about a topic, identified through a Freebase ID. You can find out more about topic queries in the + * online documentation. + * + * Return value: (transfer full): a #GDataFreebaseTopicResult containing information about the topic; unref with g_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseTopicResult * +gdata_freebase_service_get_topic (GDataFreebaseService *self, GDataFreebaseTopicQuery *query, GCancellable *cancellable, GError **error) +{ + GDataEntry *entry; + + g_return_val_if_fail (GDATA_IS_FREEBASE_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_FREEBASE_TOPIC_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + entry = gdata_service_query_single_entry (GDATA_SERVICE (self), get_freebase_authorization_domain (), "topic", + GDATA_QUERY (query), GDATA_TYPE_FREEBASE_TOPIC_RESULT, cancellable, error); + if (entry == NULL) + return NULL; + + return GDATA_FREEBASE_TOPIC_RESULT (entry); +} + +/** + * gdata_freebase_service_get_topic_async: + * @self: a #GDataFreebaseService + * @query: a #GDataFreebaseQuery with the MQL query + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries information about a topic, identified through a Freebase ID. @self and @query are all reffed when this + * function is called, so can safely be unreffed after this function returns. When the query is replied, or fails, + * @callback will be executed, and the result can be obtained through gdata_service_query_single_entry_finish(). + * + * For more details, see gdata_freebase_service_get_topic(), which is the synchronous version of + * this function. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_service_get_topic_async (GDataFreebaseService *self, GDataFreebaseTopicQuery *query, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_return_if_fail (GDATA_IS_FREEBASE_SERVICE (self)); + g_return_if_fail (GDATA_IS_FREEBASE_TOPIC_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + gdata_service_query_single_entry_async (GDATA_SERVICE (self), get_freebase_authorization_domain (), "topic", + GDATA_QUERY (query), GDATA_TYPE_FREEBASE_TOPIC_RESULT, cancellable, callback, user_data); +} + +/** + * gdata_freebase_service_search: + * @self: a #GDataFreebaseService + * @query: a #GDataFreebaseSearchQuery containing the topic ID + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: (allow-none): a #GError, or %NULL + * + * Performs a search for any given search term, filters can be set on @query to narrow down the results. The results returned + * are ordered by relevance. You can find out more about topic queries in the + * online documentation. + * + * Return value: (transfer full): a #GDataFreebaseSearchResult containing the results for the given search query; unref with g_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseSearchResult * +gdata_freebase_service_search (GDataFreebaseService *self, GDataFreebaseSearchQuery *query, GCancellable *cancellable, GError **error) +{ + GDataEntry *entry; + + g_return_val_if_fail (GDATA_IS_FREEBASE_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + entry = gdata_service_query_single_entry (GDATA_SERVICE (self), get_freebase_authorization_domain (), "search", + GDATA_QUERY (query), GDATA_TYPE_FREEBASE_SEARCH_RESULT, cancellable, error); + if (entry == NULL) + return NULL; + + return GDATA_FREEBASE_SEARCH_RESULT (entry); +} + +/** + * gdata_freebase_service_search_async: + * @self: a #GDataFreebaseService + * @query: a #GDataFreebaseQuery with the MQL query + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Performs a search for any given search term. @self and @query are all reffed when this + * function is called, so can safely be unreffed after this function returns. + * + * For more details, see gdata_freebase_service_search(), which is the synchronous version of + * this function. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_service_search_async (GDataFreebaseService *self, GDataFreebaseSearchQuery *query, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_return_if_fail (GDATA_IS_FREEBASE_SERVICE (self)); + g_return_if_fail (GDATA_IS_FREEBASE_SEARCH_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + gdata_service_query_single_entry_async (GDATA_SERVICE (self), get_freebase_authorization_domain (), "search", + GDATA_QUERY (query), GDATA_TYPE_FREEBASE_SEARCH_RESULT, cancellable, callback, user_data); +} + +static gchar * +compose_image_uri (GDataFreebaseTopicValue *value, guint max_width, guint max_height) +{ + GString *uri = g_string_new (IMAGE_URI_PREFIX); + const GDataFreebaseTopicObject *object; + gboolean first = TRUE; + + object = gdata_freebase_topic_value_get_object (value); + g_assert (object != NULL); + + g_string_append (uri, gdata_freebase_topic_object_get_id (object)); + +#define APPEND_SEP g_string_append_c (uri, first ? '?' : '&'); first = FALSE; + + if (max_width > 0) { + APPEND_SEP; + g_string_append_printf (uri, "maxwidth=%d", max_width); + } + + if (max_height > 0) { + APPEND_SEP; + g_string_append_printf (uri, "maxheight=%d", max_height); + } +#undef APPEND_SEP + + return g_string_free (uri, FALSE); +} + +/** + * gdata_freebase_service_get_image: + * @self: a #GDataFreebaseService + * @value: a #GDataFreebaseTopicValue from a topic result + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @max_width: maximum width of the image returned, or 0 + * @max_height: maximum height of the image returned, or 0 + * @error: (allow-none): a #GError, or %NULL + * + * Creates an input stream to an image object returned in a topic query. If @max_width and @max_height + * are unspecified (i.e. set to 0), the image returned will be the smallest available. + * + * Return value: (transfer full): a #GInputStream opened to the image; unref with g_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GInputStream * +gdata_freebase_service_get_image (GDataFreebaseService *self, GDataFreebaseTopicValue *value, + GCancellable *cancellable, guint max_width, guint max_height, GError **error) +{ + GInputStream *stream; + gchar *uri; + + g_return_val_if_fail (GDATA_IS_FREEBASE_SERVICE (self), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (value != NULL, NULL); + g_return_val_if_fail (!error || !*error, NULL); + g_return_val_if_fail (max_width < 4096 && max_height < 4096, NULL); + + if (!gdata_freebase_topic_value_is_image (value)) { + g_set_error (error, + GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER, + _("Property ‘%s’ does not hold an image"), + gdata_freebase_topic_value_get_property (value)); + return NULL; + } + + uri = compose_image_uri (value, max_width, max_height); + stream = gdata_download_stream_new (GDATA_SERVICE (self), get_freebase_authorization_domain (), uri, cancellable); + g_free (uri); + + return stream; +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/freebase/gdata-freebase-service.h b/gdata/services/freebase/gdata-freebase-service.h new file mode 100644 index 0000000..1897c15 --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-service.h @@ -0,0 +1,111 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_FREEBASE_SERVICE_H +#define GDATA_FREEBASE_SERVICE_H + +#include +#include +#include + +#include +#include +#include "gdata-freebase-query.h" +#include "gdata-freebase-result.h" +#include "gdata-freebase-search-query.h" +#include "gdata-freebase-search-result.h" +#include "gdata-freebase-topic-query.h" +#include "gdata-freebase-topic-result.h" + +G_BEGIN_DECLS + +#ifndef LIBGDATA_DISABLE_DEPRECATED + +#define GDATA_TYPE_FREEBASE_SERVICE (gdata_freebase_service_get_type ()) +#define GDATA_FREEBASE_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_FREEBASE_SERVICE, GDataFreebaseService)) +#define GDATA_FREEBASE_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_FREEBASE_SERVICE, GDataFreebaseServiceClass)) +#define GDATA_IS_FREEBASE_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_FREEBASE_SERVICE)) +#define GDATA_IS_FREEBASE_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_FREEBASE_SERVICE)) +#define GDATA_FREEBASE_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_FREEBASE_SERVICE, GDataFreebaseServiceClass)) + +typedef struct _GDataFreebaseServicePrivate GDataFreebaseServicePrivate; + +/** + * GDataFreebaseService: + * + * All the fields in the #GDataFreebaseService structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + GDataService parent; + /*< private >*/ + GDataFreebaseServicePrivate *priv; +} GDataFreebaseService; + +/** + * GDataFreebaseServiceClass: + * + * All the fields in the #GDataFreebaseServiceClass structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + /*< private >*/ + GDataServiceClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataFreebaseServiceClass; + +GType gdata_freebase_service_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; + +GDataFreebaseService *gdata_freebase_service_new (const gchar *developer_key, GDataAuthorizer *authorizer) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; + +GDataAuthorizationDomain *gdata_freebase_service_get_primary_authorization_domain (void) G_GNUC_CONST G_GNUC_DEPRECATED; + +GDataFreebaseResult *gdata_freebase_service_query (GDataFreebaseService *self, GDataFreebaseQuery *query, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; +void gdata_freebase_service_query_async (GDataFreebaseService *self, GDataFreebaseQuery *query, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) G_GNUC_DEPRECATED; + +GDataFreebaseTopicResult *gdata_freebase_service_get_topic (GDataFreebaseService *self, GDataFreebaseTopicQuery *query, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; +void gdata_freebase_service_get_topic_async (GDataFreebaseService *self, GDataFreebaseTopicQuery *query, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) G_GNUC_DEPRECATED; + +GDataFreebaseSearchResult *gdata_freebase_service_search (GDataFreebaseService *self, GDataFreebaseSearchQuery *query, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; +void gdata_freebase_service_search_async (GDataFreebaseService *self, GDataFreebaseSearchQuery *query, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) G_GNUC_DEPRECATED; + +GInputStream *gdata_freebase_service_get_image (GDataFreebaseService *self, GDataFreebaseTopicValue *value, + GCancellable *cancellable, guint max_width, guint max_height, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; + +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_FREEBASE_SERVICE_H */ diff --git a/gdata/services/freebase/gdata-freebase-topic-query.c b/gdata/services/freebase/gdata-freebase-topic-query.c new file mode 100644 index 0000000..05740ba --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-topic-query.c @@ -0,0 +1,351 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-freebase-topic-query + * @short_description: GData Freebase topic query object + * @stability: Stable + * @include: gdata/services/freebase/gdata-freebase-topic-query.h + * + * #GDataFreebaseTopicQuery represents a Freebase topic query. The topic query happens on a single Freebase ID, + * given in gdata_freebase_topic_query_new(), the reply returns all known information in Freebase for that given ID. + * For more documentation and examples, see the + * Topic response API documentation + * + * This implementation of #GDataQuery respects the gdata_query_set_max_results() and gdata_query_set_updated_max() calls. + * + * For more details of Google Freebase API, see the + * online documentation. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + +#include +#include +#include +#include +#include + +#include "gdata-freebase-topic-query.h" +#include "gdata-query.h" +#include "gdata-parser.h" + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +static void gdata_freebase_topic_query_finalize (GObject *self); +static void gdata_freebase_topic_query_set_property (GObject *self, guint prop_id, const GValue *value, GParamSpec *pspec); +static void gdata_freebase_topic_query_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +struct _GDataFreebaseTopicQueryPrivate { + gchar *lang; + gchar **filter; +}; + +enum { + PROP_LANGUAGE = 1, + PROP_FILTER +}; + +G_DEFINE_TYPE (GDataFreebaseTopicQuery, gdata_freebase_topic_query, GDATA_TYPE_QUERY) + +static void +gdata_freebase_topic_query_class_init (GDataFreebaseTopicQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataFreebaseTopicQueryPrivate)); + + gobject_class->finalize = gdata_freebase_topic_query_finalize; + gobject_class->set_property = gdata_freebase_topic_query_set_property; + gobject_class->get_property = gdata_freebase_topic_query_get_property; + + query_class->get_query_uri = get_query_uri; + + /** + * GDataFreebaseTopicQuery:language: + * + * Language used for topic values in the result, in ISO-639-1 format. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + g_object_class_install_property (gobject_class, PROP_LANGUAGE, + g_param_spec_string ("language", + "Language used for results", + "Language in ISO-639-1 format.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + + /** + * GDataFreebaseTopicQuery:filter: + * + * Array of properties (eg. "/common/topic/description", or "/computer/software/first_released"), or property + * domains (eg. "/common/topic", or "/computer") to be used as filter. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + g_object_class_install_property (gobject_class, PROP_FILTER, + g_param_spec_boxed ("filter", + "Filter", + "Property domain to be used as filter", + G_TYPE_STRV, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_freebase_topic_query_init (GDataFreebaseTopicQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_FREEBASE_TOPIC_QUERY, GDataFreebaseTopicQueryPrivate); +} + +static void +gdata_freebase_topic_query_finalize (GObject *self) +{ + GDataFreebaseTopicQueryPrivate *priv = GDATA_FREEBASE_TOPIC_QUERY (self)->priv; + + g_free (priv->lang); + g_free (priv->filter); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_freebase_topic_query_parent_class)->finalize (self); +} + +static void +gdata_freebase_topic_query_set_property (GObject *self, guint prop_id, const GValue *value, GParamSpec *pspec) +{ + GDataFreebaseTopicQuery *query = GDATA_FREEBASE_TOPIC_QUERY (self); + + switch (prop_id) { + case PROP_LANGUAGE: + gdata_freebase_topic_query_set_language (query, g_value_get_string (value)); + break; + case PROP_FILTER: + gdata_freebase_topic_query_set_filter (query, g_value_get_boxed (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); + break; + } +} + +static void +gdata_freebase_topic_query_get_property (GObject *self, guint prop_id, GValue *value, GParamSpec *pspec) +{ + GDataFreebaseTopicQueryPrivate *priv = GDATA_FREEBASE_TOPIC_QUERY (self)->priv; + + switch (prop_id) { + case PROP_LANGUAGE: + g_value_set_string (value, priv->lang); + break; + case PROP_FILTER: + g_value_set_boxed (value, priv->filter); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); + break; + } +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataFreebaseTopicQueryPrivate *priv = GDATA_FREEBASE_TOPIC_QUERY (self)->priv; + const gchar *lang = NULL; + gint64 updated_max; + guint limit; + + g_string_append (query_uri, gdata_query_get_q (self)); + +#define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + if (priv->lang != NULL) { + lang = priv->lang; + } else { + const gchar * const *user_languages; + guint i; + + user_languages = g_get_language_names (); + + /* Pick the first user language */ + for (i = 0; user_languages[i] != NULL; i++) { + if (strlen (user_languages[i]) == 2) { + lang = user_languages[i]; + break; + } + } + } + + APPEND_SEP; + g_string_append (query_uri, "lang="); + g_string_append (query_uri, lang); + + if (priv->filter) { + guint i; + + for (i = 0; priv->filter[i] != NULL; i++) { + APPEND_SEP; + g_string_append (query_uri, "filter="); + g_string_append (query_uri, priv->filter[i]); + } + } + + updated_max = gdata_query_get_updated_max (self); + + if (updated_max > -1) { + APPEND_SEP; + g_string_append_printf (query_uri, "dateline=%" G_GINT64_FORMAT, updated_max); + } + + limit = gdata_query_get_max_results (self); + + if (limit > 0) { + APPEND_SEP; + g_string_append_printf (query_uri, "limit=%d", limit); + } + + /* We don't chain up with parent class get_query_uri because it uses + * GData protocol parameters and they aren't compatible with newest API family + */ +#undef APPEND_SEP +} + +/** + * gdata_freebase_topic_query_new: + * @id: a Freebase ID or MID + * + * Creates a new #GDataFreebaseTopicQuery for the given Freebase ID. Those can be + * obtained programmatically through gdata_freebase_search_result_item_get_id() or + * embedded in the result of a gdata_freebase_service_query() call. + * + * Return value: (transfer full): a new #GDataFreebaseTopicQuery + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseTopicQuery * +gdata_freebase_topic_query_new (const gchar *id) +{ + g_return_val_if_fail (id != NULL, NULL); + return g_object_new (GDATA_TYPE_FREEBASE_TOPIC_QUERY, "q", id, NULL); +} + +/** + * gdata_freebase_topic_query_set_language: + * @self: a #GDataFreebaseTopicQuery + * @lang: (allow-none): language used on the topic query, in ISO-639-1 format, or %NULL to unset the language + * + * Sets the language used in the topic query. If unset, + * the locale preferences will be respected. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_topic_query_set_language (GDataFreebaseTopicQuery *self, + const gchar *lang) +{ + GDataFreebaseTopicQueryPrivate *priv; + + g_return_if_fail (GDATA_IS_FREEBASE_TOPIC_QUERY (self)); + g_return_if_fail (lang == NULL || strlen (lang) == 2); + + priv = self->priv; + + if (g_strcmp0 (priv->lang, lang) == 0) + return; + + g_free (priv->lang); + priv->lang = g_strdup (lang); + g_object_notify (G_OBJECT (self), "language"); +} + +/** + * gdata_freebase_topic_query_get_language: + * @self: a #GDataFreebaseTopicQuery + * + * Gets the language set on the topic query, or %NULL if unset. + * + * Return value: (allow-none): The language used on the query. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_topic_query_get_language (GDataFreebaseTopicQuery *self) +{ + g_return_val_if_fail (GDATA_IS_FREEBASE_TOPIC_QUERY (self), NULL); + + return self->priv->lang; +} + +/** + * gdata_freebase_topic_query_set_filter: + * @self: a #GDataFreebaseTopicQuery + * @filter: (array zero-terminated=1) (allow-none): %NULL-terminated array of filter strings, or %NULL to unset + * + * Sets a filter on the properties to be returned by the #GDataFreebaseTopicQuery, a filter string usually contains either + * a specific property (eg. "/common/topic/description", or "/computer/software/first_released"), or a property domain + * (eg. "/common/topic", or "/computer"), all properties pertaining to the domain will be returned through the + * #GDataFreebaseTopicResult in the latter case. Other special strings can be passed as filter strings, those are documented + * in the Topic API overview + * + * If multiple filter strings are set, the result will contain all information necessary to satisfy each of those individually. + * If no filter is set, the "commons" special value will be implicitly assumed, which returns a reasonably complete data set. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_topic_query_set_filter (GDataFreebaseTopicQuery *self, const gchar * const *filter) +{ + GDataFreebaseTopicQueryPrivate *priv; + + g_return_if_fail (GDATA_IS_FREEBASE_TOPIC_QUERY (self)); + priv = self->priv; + + g_strfreev (priv->filter); + priv->filter = g_strdupv ((gchar **) filter); + g_object_notify (G_OBJECT (self), "filter"); +} + +/** + * gdata_freebase_topic_query_get_filter: + * @self: a #GDataFreebaseTopicQuery + * + * Gets the filter set on the topic query, or %NULL if unset. + * + * Return value: (array zero-terminated=1) (transfer none) (allow-none): The filter used on the query. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * const * +gdata_freebase_topic_query_get_filter (GDataFreebaseTopicQuery *self) +{ + g_return_val_if_fail (GDATA_IS_FREEBASE_TOPIC_QUERY (self), NULL); + + return (const gchar * const *) self->priv->filter; +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/freebase/gdata-freebase-topic-query.h b/gdata/services/freebase/gdata-freebase-topic-query.h new file mode 100644 index 0000000..4d20a98 --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-topic-query.h @@ -0,0 +1,84 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_FREEBASE_TOPIC_QUERY_H +#define GDATA_FREEBASE_TOPIC_QUERY_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#ifndef LIBGDATA_DISABLE_DEPRECATED + +#define GDATA_TYPE_FREEBASE_TOPIC_QUERY (gdata_freebase_topic_query_get_type ()) +#define GDATA_FREEBASE_TOPIC_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_FREEBASE_TOPIC_QUERY, GDataFreebaseTopicQuery)) +#define GDATA_FREEBASE_TOPIC_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_FREEBASE_TOPIC_QUERY, GDataFreebaseTopicQueryClass)) +#define GDATA_IS_FREEBASE_TOPIC_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_FREEBASE_TOPIC_QUERY)) +#define GDATA_IS_FREEBASE_TOPIC_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_FREEBASE_TOPIC_QUERY)) +#define GDATA_FREEBASE_TOPIC_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_FREEBASE_TOPIC_QUERY, GDataFreebaseTopicQueryClass)) + +typedef struct _GDataFreebaseTopicQueryPrivate GDataFreebaseTopicQueryPrivate; + +/** + * GDataFreebaseTopicQuery: + * + * All the fields in the #GDataFreebaseTopicQuery structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + GDataQuery parent; + GDataFreebaseTopicQueryPrivate *priv; +} GDataFreebaseTopicQuery; + +/** + * GDataFreebaseTopicQueryClass: + * + * All the fields in the #GDataFreebaseTopicQueryClass structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + /*< private >*/ + GDataQueryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataFreebaseTopicQueryClass; + +GType gdata_freebase_topic_query_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; + +GDataFreebaseTopicQuery *gdata_freebase_topic_query_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; +void gdata_freebase_topic_query_set_language (GDataFreebaseTopicQuery *self, const gchar *lang) G_GNUC_DEPRECATED; +const gchar *gdata_freebase_topic_query_get_language (GDataFreebaseTopicQuery *self) G_GNUC_DEPRECATED; + +void gdata_freebase_topic_query_set_filter (GDataFreebaseTopicQuery *self, const gchar * const *filter) G_GNUC_DEPRECATED; +const gchar * const *gdata_freebase_topic_query_get_filter (GDataFreebaseTopicQuery *self) G_GNUC_DEPRECATED; + +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_FREEBASE_TOPIC_QUERY_H */ diff --git a/gdata/services/freebase/gdata-freebase-topic-result.c b/gdata/services/freebase/gdata-freebase-topic-result.c new file mode 100644 index 0000000..1796efc --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-topic-result.c @@ -0,0 +1,1047 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-freebase-topic-result + * @short_description: GData Freebase topic result object + * @stability: Stable + * @include: gdata/services/freebase/gdata-freebase-topic-result.h + * + * #GDataFreebaseTopicResult is a subclass of #GDataFreebaseResult that contains all or a subset of the information + * contained in Freebase about the Freebase ID given to the #GDataFreebaseTopicQuery. + * + * For more details of Google Freebase API, see the + * online documentation. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ + +typedef struct _GDataFreebaseTopicValueArray GDataFreebaseTopicValueArray; + +#include +#include +#include +#include + +#include "gdata-freebase-topic-result.h" +#include "gdata-download-stream.h" +#include "gdata-private.h" +#include "gdata-types.h" + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +typedef enum { + TYPE_NONE, + TYPE_BOOL, + TYPE_INT, + TYPE_DOUBLE, + TYPE_STRING, + TYPE_DATETIME, + TYPE_COMPOUND, + TYPE_OBJECT, + TYPE_KEY, + TYPE_URI +} TopicValueType; + +/* Wraps a compound object, either the main object returned by the result, or a + * complex object within the result values (events are at least composed of + * location and time at least, for example). + */ +struct _GDataFreebaseTopicObject { + gchar *id; + GHashTable *values; /* Hashtable of property->GDataFreebaseTopicValueArray */ + volatile gint ref_count; +}; + +/* Wraps an array of values, single-valued properties will contain an array with a single value here */ +struct _GDataFreebaseTopicValueArray { + TopicValueType type; + GPtrArray *values; + guint64 hits; /* Total number of hits, as opposed to values->len */ +}; + +/* Wraps a single value in the topic result, may be either simple (numbers, strings, Freebase IDs...), + * or nested compound types (contained by a GDataFreebaseTopicObject, which is what the value would + * contain in that case). + */ +struct _GDataFreebaseTopicValue { + gchar *property; + gchar *text; + gchar *lang; + gchar *creator; + gint64 timestamp; + GValue value; + volatile gint ref_count; +}; + +struct _GDataFreebaseTopicResultPrivate { + GDataFreebaseTopicObject *object; +}; + +static void gdata_freebase_topic_result_finalize (GObject *self); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static GDataFreebaseTopicObject *object_new (const gchar *id); +static void value_free (GDataFreebaseTopicValue *object); +static gboolean reader_get_properties (JsonReader *reader, GDataFreebaseTopicObject *object, GError **error); + +G_DEFINE_BOXED_TYPE (GDataFreebaseTopicObject, gdata_freebase_topic_object, gdata_freebase_topic_object_ref, gdata_freebase_topic_object_unref) +G_DEFINE_BOXED_TYPE (GDataFreebaseTopicValue, gdata_freebase_topic_value, gdata_freebase_topic_value_ref, gdata_freebase_topic_value_unref) +G_DEFINE_TYPE (GDataFreebaseTopicResult, gdata_freebase_topic_result, GDATA_TYPE_FREEBASE_RESULT) + +static void +gdata_freebase_topic_result_class_init (GDataFreebaseTopicResultClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataFreebaseTopicResultPrivate)); + + gobject_class->finalize = gdata_freebase_topic_result_finalize; + parsable_class->parse_json = parse_json; +} + +static void +gdata_freebase_topic_result_init (GDataFreebaseTopicResult *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_FREEBASE_TOPIC_RESULT, GDataFreebaseTopicResultPrivate); +} + +static void +gdata_freebase_topic_result_finalize (GObject *self) +{ + GDataFreebaseTopicResultPrivate *priv = GDATA_FREEBASE_TOPIC_RESULT (self)->priv; + + gdata_freebase_topic_object_unref (priv->object); + + G_OBJECT_CLASS (gdata_freebase_topic_result_parent_class)->finalize (self); +} + +static GDataFreebaseTopicValueArray * +value_array_new (TopicValueType type, guint64 hits) +{ + GDataFreebaseTopicValueArray *array; + + array = g_slice_new0 (GDataFreebaseTopicValueArray); + array->values = g_ptr_array_new_with_free_func ((GDestroyNotify) gdata_freebase_topic_value_unref); + array->type = type; + array->hits = hits; + + return array; +} + +/* Takes ownership on @value */ +static void +value_array_add (GDataFreebaseTopicValueArray *array, GDataFreebaseTopicValue *value) +{ + g_ptr_array_add (array->values, value); +} + +static void +value_array_free (GDataFreebaseTopicValueArray *array) +{ + g_ptr_array_unref (array->values); + g_slice_free (GDataFreebaseTopicValueArray, array); +} + +static guint64 +reader_get_item_count (JsonReader *reader) +{ + gint64 count; + + json_reader_read_member (reader, "count"); + count = json_reader_get_int_value (reader); + json_reader_end_member (reader); + + return (guint64) count; +} + +static guint +reader_get_value_type (JsonReader *reader, const gchar *property, GError **error) +{ + TopicValueType type = TYPE_NONE; + const GError *reader_error; + const gchar *valuestr; + + json_reader_read_member (reader, "valuetype"); + valuestr = json_reader_get_string_value (reader); + + reader_error = json_reader_get_error (reader); + + if (reader_error != NULL) { + if (error != NULL && *error == NULL) + *error = g_error_copy (reader_error); + } else { + if (strcmp (valuestr, "key") == 0) + type = TYPE_KEY; + else if (strcmp (valuestr, "uri") == 0) + type = TYPE_URI; + else if (strcmp (valuestr, "compound") == 0) + type = TYPE_COMPOUND; + else if (strcmp (valuestr, "object") == 0) + type = TYPE_OBJECT; + else if (strcmp (valuestr, "float") == 0) + type = TYPE_DOUBLE; + else if (strcmp (valuestr, "string") == 0) + type = TYPE_STRING; + else if (strcmp (valuestr, "int") == 0) + type = TYPE_INT; + else if (strcmp (valuestr, "bool") == 0) + type = TYPE_BOOL; + else if (strcmp (valuestr, "datetime") == 0) + type = TYPE_DATETIME; + else + gdata_parser_error_required_json_content_missing (reader, error); + } + + json_reader_end_member (reader); + return type; +} + +static void +value_free (GDataFreebaseTopicValue *value) +{ + if (G_IS_VALUE (&value->value)) + g_value_unset (&value->value); + g_free (value->text); + g_free (value->lang); + g_free (value->creator); + g_free (value->property); + g_slice_free (GDataFreebaseTopicValue, value); +} + +/* Parsing functions to create GDataFreebaseTopicValues, and arrays of those */ +static gchar * +reader_dup_member_string (JsonReader *reader, const gchar *member, GError **error) +{ + const GError *reader_error; + gchar *str; + + if (error != NULL && *error != NULL) + return NULL; + + json_reader_read_member (reader, member); + str = g_strdup (json_reader_get_string_value (reader)); + reader_error = json_reader_get_error (reader); + + if (reader_error != NULL) { + g_free (str); + str = NULL; + + if (error != NULL) + *error = g_error_copy (reader_error); + } + + json_reader_end_member (reader); + + return str; +} + +static gint64 +reader_parse_timestamp (JsonReader *reader, const gchar *member, GError **error) +{ + const GError *reader_error; + const gchar *date_str; + gint64 timestamp = -1; + + if (error != NULL && *error != NULL) + return -1; + + json_reader_read_member (reader, member); + date_str = json_reader_get_string_value (reader); + reader_error = json_reader_get_error (reader); + + if (reader_error != NULL) { + if (error != NULL) + *error = g_error_copy (reader_error); + } else if (date_str) { + if (!gdata_parser_int64_from_iso8601 (date_str, ×tamp)) + timestamp = -1; + } + + json_reader_end_member (reader); + + return timestamp; +} + +static gboolean +reader_fill_simple_gvalue (JsonReader *reader, TopicValueType type, GValue *value) +{ + gboolean retval = TRUE; + gint64 datetime; + + json_reader_read_member (reader, "value"); + + if (json_reader_get_error (reader) != NULL) { + json_reader_end_member (reader); + return FALSE; + } + + switch (type) { + case TYPE_BOOL: + case TYPE_INT: + case TYPE_DOUBLE: + case TYPE_STRING: + json_node_get_value (json_reader_get_value (reader), value); + break; + case TYPE_DATETIME: + if (gdata_parser_int64_from_iso8601 (json_reader_get_string_value (reader), &datetime) || + gdata_parser_int64_from_date (json_reader_get_string_value (reader), &datetime)) { + g_value_init (value, G_TYPE_INT64); + g_value_set_int64 (value, datetime); + } else { + retval = FALSE; + } + + break; + case TYPE_NONE: + case TYPE_COMPOUND: + case TYPE_OBJECT: + case TYPE_KEY: + case TYPE_URI: + default: + retval = FALSE; + } + + json_reader_end_member (reader); + return retval; +} + +static GDataFreebaseTopicObject * +reader_create_object (JsonReader *reader, TopicValueType type) +{ + GDataFreebaseTopicObject *object; + + if (type != TYPE_OBJECT && type != TYPE_COMPOUND) + return NULL; + + json_reader_read_member (reader, "id"); + + if (json_reader_get_error (reader) != NULL) { + json_reader_end_member (reader); + return NULL; + } + + object = object_new (json_reader_get_string_value (reader)); + json_reader_end_member (reader); + + return object; +} + +static gboolean +reader_fill_object_gvalue (JsonReader *reader, TopicValueType type, GValue *value) +{ + GDataFreebaseTopicObject *object; + + if (type != TYPE_OBJECT) + return FALSE; + + object = reader_create_object (reader, type); + + if (object != NULL) { + g_value_init (value, GDATA_TYPE_FREEBASE_TOPIC_OBJECT); + g_value_take_boxed (value, object); + } + + return (object != NULL); +} + +static gboolean +reader_fill_compound_gvalue (JsonReader *reader, TopicValueType type, GValue *value, GError **error) +{ + GDataFreebaseTopicObject *object; + + if (type != TYPE_COMPOUND) + return FALSE; + + object = reader_create_object (reader, type); + + if (object == NULL) + return FALSE; + + json_reader_read_member (reader, "property"); + + if (json_reader_get_error (reader) != NULL) { + json_reader_end_member (reader); + gdata_freebase_topic_object_unref (object); + return FALSE; + } + + reader_get_properties (reader, object, error); + json_reader_end_member (reader); + + g_value_init (value, GDATA_TYPE_FREEBASE_TOPIC_OBJECT); + g_value_take_boxed (value, object); + return TRUE; +} + +static GDataFreebaseTopicValue * +reader_create_value (JsonReader *reader, const gchar *property, TopicValueType type, GError **error) +{ + GDataFreebaseTopicValue *value; + + value = g_slice_new0 (GDataFreebaseTopicValue); + + value->ref_count = 1; + value->property = g_strdup (property); + value->text = reader_dup_member_string (reader, "text", error); + value->lang = reader_dup_member_string (reader, "lang", error); + + /* Not all parsed nodes are meant to contain creator/timestamp tags, + * do not pass error to those, so parsing continues. + */ + value->creator = reader_dup_member_string (reader, "creator", NULL); + value->timestamp = reader_parse_timestamp (reader, "timestamp", NULL); + + if (reader_fill_simple_gvalue (reader, type, &value->value) || + reader_fill_object_gvalue (reader, type, &value->value) || + reader_fill_compound_gvalue (reader, type, &value->value, error)) + return value; + + value_free (value); + return NULL; +} + +static GDataFreebaseTopicValueArray * +reader_create_value_array (JsonReader *reader, const gchar *property, GError **error) +{ + GDataFreebaseTopicValueArray *array; + GDataFreebaseTopicValue *value; + TopicValueType type; + guint64 count, i; + + count = reader_get_item_count (reader); + + if (count <= 0) + return NULL; + + type = reader_get_value_type (reader, property, error); + + if (type == TYPE_NONE || type == TYPE_URI || type == TYPE_KEY) + return NULL; + + array = value_array_new (type, count); + + json_reader_read_member (reader, "values"); + count = json_reader_count_elements (reader); + + for (i = 0; i < count; i++) { + json_reader_read_element (reader, i); + value = reader_create_value (reader, property, type, error); + json_reader_end_element (reader); + + if (value != NULL) + value_array_add (array, value); + } + + json_reader_end_member (reader); + + return array; +} + +static GDataFreebaseTopicObject * +object_new (const gchar *id) +{ + GDataFreebaseTopicObject *object; + + object = g_slice_new0 (GDataFreebaseTopicObject); + object->id = g_strdup (id); + object->ref_count = 1; + object->values = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) value_array_free); + return object; +} + +/* Takes ownership on @array */ +static void +object_add_value (GDataFreebaseTopicObject *object, const gchar *property, GDataFreebaseTopicValueArray *array) +{ + g_return_if_fail (object != NULL); + g_return_if_fail (property != NULL); + g_return_if_fail (array != NULL); + g_hash_table_replace (object->values, g_strdup (property), array); +} + +static gboolean +reader_get_properties (JsonReader *reader, GDataFreebaseTopicObject *object, GError **error) +{ + GDataFreebaseTopicValueArray *array; + gboolean retval = TRUE; + gint count, i; + + count = json_reader_count_members (reader); + + for (i = 0; i < count; i++) { + GError *inner_error = NULL; + const gchar *name; + gchar *property; + + json_reader_read_element (reader, i); + property = g_strdup (json_reader_get_member_name (reader)); + name = property; + + /* Reverse properties start with !, display those as + * regular properties, and skip that char + */ + if (name[0] == '!') + name++; + + /* All Freebase properties and IDs start with '/' */ + if (name[0] != '/') + continue; + + /* Parse the value for this property, possibly with nested contents */ + array = reader_create_value_array (reader, name, &inner_error); + json_reader_end_element (reader); + + if (inner_error != NULL) { + g_propagate_error (error, inner_error); + retval = FALSE; + break; + } else if (array != NULL) { + /* Takes ownership of array */ + object_add_value (object, name, array); + } + + g_free (property); + } + + return retval; +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + GDataFreebaseTopicResultPrivate *priv = GDATA_FREEBASE_TOPIC_RESULT (parsable)->priv; + const gchar *member_name; + + GDATA_PARSABLE_CLASS (gdata_freebase_topic_result_parent_class)->parse_json (parsable, reader, user_data, error); + + member_name = json_reader_get_member_name (reader); + + if (member_name == NULL) + return FALSE; + + if (strcmp (member_name, "id") == 0) { + /* We only expect one member containing information */ + g_assert (priv->object == NULL); + priv->object = object_new (json_reader_get_string_value (reader)); + } else if (strcmp (member_name, "property") == 0) { + reader_get_properties (reader, priv->object, error); + } else { + return FALSE; + } + + return TRUE; +} + +/** + * gdata_freebase_topic_result_new: + * + * Creates a new #GDataFreebaseTopicResult with the given ID and default properties. + * + * Return value: (transfer full): a new #GDataFreebaseTopicResult; unref with g_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseTopicResult * +gdata_freebase_topic_result_new (void) +{ + return g_object_new (GDATA_TYPE_FREEBASE_TOPIC_RESULT, NULL); +} + +/** + * gdata_freebase_topic_result_dup_object: + * @self: a #GDataFreebaseTopicResult + * + * Returns a reference to the root #GDataFreebaseTopicObject containing the + * topic query results. + * + * Returns: (transfer full): A new reference on the result object, unref with + * gdata_freebase_topic_object_unref() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseTopicObject * +gdata_freebase_topic_result_dup_object (GDataFreebaseTopicResult *self) +{ + g_return_val_if_fail (GDATA_IS_FREEBASE_TOPIC_RESULT (self), NULL); + + return gdata_freebase_topic_object_ref (self->priv->object); +} + +/** + * gdata_freebase_topic_object_ref: + * @object: a #GDataFreebaseTopicObject + * + * Creates and returns a new reference on @object. + * + * Returns: (transfer full): @object, with an extra reference. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseTopicObject * +gdata_freebase_topic_object_ref (GDataFreebaseTopicObject *object) +{ + g_return_val_if_fail (object != NULL, NULL); + + g_atomic_int_inc (&object->ref_count); + return object; +} + +/** + * gdata_freebase_topic_object_unref: + * @object: (transfer full): a #GDataFreebaseTopicResult + * + * Removes a reference from @object. If the reference count drops to 0, + * the object is freed. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_topic_object_unref (GDataFreebaseTopicObject *object) +{ + g_return_if_fail (object != NULL); + + if (g_atomic_int_dec_and_test (&object->ref_count)) { + g_hash_table_unref (object->values); + g_free (object->id); + g_slice_free (GDataFreebaseTopicObject, object); + } +} + +/** + * gdata_freebase_topic_object_list_properties: + * @object: a #GDataFreebaseTopicObject + * + * Returns the list of Freebase properties described by @object. + * + * Returns: (transfer container) (element-type gchar*): An array of property names, free with g_ptr_array_unref(). + * + * Since: 0.15.1 +Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GPtrArray * +gdata_freebase_topic_object_list_properties (const GDataFreebaseTopicObject *object) +{ + GPtrArray *properties; + GHashTableIter iter; + gchar *property; + + g_return_val_if_fail (object != NULL, NULL); + + properties = g_ptr_array_new (); + g_hash_table_iter_init (&iter, object->values); + + while (g_hash_table_iter_next (&iter, (gpointer *) &property, NULL)) + g_ptr_array_add (properties, property); + + return properties; +} + +/** + * gdata_freebase_topic_object_get_property_count: + * @object: a #GDataFreebaseTopicObject + * @property: a property name contained in @object + * + * Returns the number of values that @object holds for the given @property. If @object + * contains no information about @property, 0 is returned. + * + * Returns: The number of values contained for @property + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +guint64 +gdata_freebase_topic_object_get_property_count (const GDataFreebaseTopicObject *object, const gchar *property) +{ + GDataFreebaseTopicValueArray *array; + + g_return_val_if_fail (object != NULL, 0); + g_return_val_if_fail (property != NULL, 0); + array = g_hash_table_lookup (object->values, property); + + if (array == NULL) + return 0; + + return array->values->len; +} + +/** + * gdata_freebase_topic_object_get_property_hits: + * @object: a #GDataFreebaseTopicObject + * @property: a property name contained in @object + * + * Returns the total number of hits that the Freebase database stores + * for this object, this number either equals or is greater than + * gdata_freebase_topic_object_get_property_count(), the query limit + * can be controlled through gdata_query_set_max_results() on the topic + * query. + * + * If @object contains no information about @property, 0 is returned. + * + * Returns: the total number of hits for this property + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +guint64 +gdata_freebase_topic_object_get_property_hits (const GDataFreebaseTopicObject *object, const gchar *property) +{ + GDataFreebaseTopicValueArray *array; + + g_return_val_if_fail (object != NULL, 0); + g_return_val_if_fail (property != NULL, 0); + array = g_hash_table_lookup (object->values, property); + + if (array == NULL) + return 0; + + return array->hits; +} + +/** + * gdata_freebase_topic_object_get_property_value: + * @object: a #GDataFreebaseTopicObject + * @property: a property name contained in @object + * @item: item number to retrieve from @property + * + * Gets the value that @object stores for this @property/@item pair, as a generic + * #GDataFreebaseTopicValue. If @object contains no information about @property, + * or @item is outside the [0..gdata_freebase_topic_object_get_property_count() - 1] + * range, %NULL is returned. + * + * Returns: (allow-none) (transfer none): the value for this property/item + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseTopicValue * +gdata_freebase_topic_object_get_property_value (const GDataFreebaseTopicObject *object, const gchar *property, gint64 item) +{ + GDataFreebaseTopicValueArray *array; + + g_return_val_if_fail (object != NULL, NULL); + g_return_val_if_fail (property != NULL, NULL); + array = g_hash_table_lookup (object->values, property); + + if (array == NULL) + return NULL; + + if (item < 0 || item >= array->values->len) + return NULL; + + return g_ptr_array_index (array->values, item); +} + +/** + * gdata_freebase_topic_object_get_id: + * @object: a #GDataFreebaseTopicObject + * + * Gets the Freebase ID for this specific object. + * + * Returns: (transfer none): the Freebase ID of this object + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_topic_object_get_id (const GDataFreebaseTopicObject *object) +{ + g_return_val_if_fail (object != NULL, NULL); + return object->id; +} + +/** + * gdata_freebase_topic_value_ref: + * @value: a #GDataFreebaseTopicValue + * + * Creates and returns a new reference on @value. + * + * Returns: (transfer full): @value, with an extra reference. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GDataFreebaseTopicValue * +gdata_freebase_topic_value_ref (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, NULL); + + g_atomic_int_inc (&value->ref_count); + return value; +} + +/** + * gdata_freebase_topic_value_unref: + * @value: (transfer full): a #GDataFreebaseTopicValue + * + * Removes a reference from @value. If the reference count drops to 0, + * the object is freed. + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_topic_value_unref (GDataFreebaseTopicValue *value) +{ + g_return_if_fail (value != NULL); + + if (g_atomic_int_dec_and_test (&value->ref_count)) + value_free (value); +} + +/** + * gdata_freebase_topic_value_get_property: + * @value: a #GDataFreebaseTopicValue + * + * Returns the property name that this value describes + * + * Returns: the property name of @value + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_topic_value_get_property (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, NULL); + return value->property; +} + +/** + * gdata_freebase_topic_value_get_text: + * @value: a #GDataFreebaseTopicValue + * + * Returns a textual representation of this value, this is either + * the value contained transformed to a string, or a concatenation + * of subvalues for compound types. + * + * Returns: a textual representation of @value + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_topic_value_get_text (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, NULL); + return value->text; +} + +/** + * gdata_freebase_topic_value_get_language: + * @value: a #GDataFreebaseTopicValue + * + * Returns the language used in the content of @value + * + * Returns: the language @value is written in + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_topic_value_get_language (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, NULL); + return value->lang; +} + +/** + * gdata_freebase_topic_value_get_creator: + * @value: a #GDataFreebaseTopicValue + * + * Returns the Freebase ID of the user that created this value. + * + * Returns: the creator of this value, as a Freebase ID + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_topic_value_get_creator (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, NULL); + return value->creator; +} + +/** + * gdata_freebase_topic_value_get_timestamp: + * @value: #GDataFreebaseTopicValue + * + * Returns the time at which this value was created in the Freebase database. + * It's a UNIX timestamp in seconds since the epoch. If @value has no timestamp, + * -1 will be returned. + * + * Returns: The creation time of @value, or -1 + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +gint64 +gdata_freebase_topic_value_get_timestamp (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, 0); + return value->timestamp; +} + +/** + * gdata_freebase_topic_value_get_value_type: + * @value: a #GDataFreebaseTopicValue + * + * Returns the #GType of the real value held in @value. + * + * Returns: the #GType of the contained value + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +GType +gdata_freebase_topic_value_get_value_type (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, G_TYPE_INVALID); + return G_VALUE_TYPE (&value->value); +} + +/** + * gdata_freebase_topic_value_copy_value: + * @value: a #GDataFreebaseTopicValue + * @gvalue: (out caller-allocates) (transfer full): an empty #GValue + * + * Copies in @gvalue the value held in @value. the #GValue must be later freed through g_value_unset() + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +void +gdata_freebase_topic_value_copy_value (GDataFreebaseTopicValue *value, GValue *gvalue) +{ + g_return_if_fail (value != NULL); + + g_value_copy (&value->value, gvalue); +} + +/** + * gdata_freebase_topic_value_get_int: + * @value: a #GDataFreebaseTopicValue + * + * Returns a #gint64 value held in @value. It is only valid to call this if the #GType is a %G_TYPE_INT64 + * + * Returns: the #gint64 value + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +gint64 +gdata_freebase_topic_value_get_int (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, 0); + g_return_val_if_fail (G_VALUE_HOLDS_INT64 (&value->value), 0); + + return g_value_get_int64 (&value->value); +} + +/** + * gdata_freebase_topic_value_get_double: + * @value: a #GDataFreebaseTopicValue + * + * Returns a #gdouble value held in @value. It is only valid to call this if the #GType is a %G_TYPE_DOUBLE + * + * Returns: the #gdouble value + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +gdouble +gdata_freebase_topic_value_get_double (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, 0); + g_return_val_if_fail (G_VALUE_HOLDS_DOUBLE (&value->value), 0); + + return g_value_get_double (&value->value); +} + +/** + * gdata_freebase_topic_value_get_string: + * @value: a #GDataFreebaseTopicValue + * + * Returns a string value held in @value. It is only valid to call this if the #GType is a %G_TYPE_STRING + * + * Returns: the string value + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const gchar * +gdata_freebase_topic_value_get_string (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, NULL); + g_return_val_if_fail (G_VALUE_HOLDS_STRING (&value->value), NULL); + + return g_value_get_string (&value->value); +} + +/** + * gdata_freebase_topic_value_get_object: + * @value: a #GDataFreebaseTopicValue + * + * Returns a compound/complex object held in @value. It is only valid to call this if the #GType is a + * %GDATA_TYPE_FREEBASE_TOPIC_OBJECT. + * + * Returns: (transfer none): the compound value as a #GDataFreebaseTopicObject + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +const GDataFreebaseTopicObject * +gdata_freebase_topic_value_get_object (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, NULL); + g_return_val_if_fail (G_VALUE_HOLDS (&value->value, GDATA_TYPE_FREEBASE_TOPIC_OBJECT), NULL); + + return g_value_get_boxed (&value->value); +} + +/** + * gdata_freebase_topic_value_is_image: + * @value: a #GDataFreebaseTopicValue + * + * Returns true if @value holds a freebase image object, on such values it + * will be valid to call gdata_freebase_service_get_image() to get a stream + * to the image itself. + * + * Returns: Whether @value holds a Freebase image object + * + * Since: 0.15.1 + * Deprecated: 0.17.7: Google Freebase has been permanently shut down. + */ +gboolean +gdata_freebase_topic_value_is_image (GDataFreebaseTopicValue *value) +{ + g_return_val_if_fail (value != NULL, FALSE); + + return (strcmp (value->property, "/common/topic/image") == 0); +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/freebase/gdata-freebase-topic-result.h b/gdata/services/freebase/gdata-freebase-topic-result.h new file mode 100644 index 0000000..34b73e2 --- /dev/null +++ b/gdata/services/freebase/gdata-freebase-topic-result.h @@ -0,0 +1,135 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) 2014 Carlos Garnacho + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_FREEBASE_TOPIC_RESULT_H +#define GDATA_FREEBASE_TOPIC_RESULT_H + +#include +#include + +#include +#include "gdata-freebase-result.h" + +G_BEGIN_DECLS + +#ifndef LIBGDATA_DISABLE_DEPRECATED + +#define GDATA_TYPE_FREEBASE_TOPIC_OBJECT (gdata_freebase_topic_object_get_type ()) +#define GDATA_TYPE_FREEBASE_TOPIC_VALUE (gdata_freebase_topic_value_get_type ()) +#define GDATA_TYPE_FREEBASE_TOPIC_RESULT (gdata_freebase_topic_result_get_type ()) +#define GDATA_FREEBASE_TOPIC_RESULT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_FREEBASE_TOPIC_RESULT, GDataFreebaseTopicResult)) +#define GDATA_FREEBASE_TOPIC_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_FREEBASE_TOPIC_RESULT, GDataFreebaseTopicResultClass)) +#define GDATA_IS_FREEBASE_TOPIC_RESULT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_FREEBASE_TOPIC_RESULT)) +#define GDATA_IS_FREEBASE_TOPIC_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_FREEBASE_TOPIC_RESULT)) +#define GDATA_FREEBASE_TOPIC_RESULT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_FREEBASE_TOPIC_RESULT, GDataFreebaseTopicResultClass)) + +typedef struct _GDataFreebaseTopicResultPrivate GDataFreebaseTopicResultPrivate; + +/** + * GDataFreebaseTopicObject: + * + * Opaque struct containing a Freebase topic object. This object may contain one or more + * #GDataFreebaseTopicValue structs, which may in turn contain nested #GDataFreebaseTopicObject + * structs to express complex data. + * + * Since: 0.15.1 + */ +typedef struct _GDataFreebaseTopicObject GDataFreebaseTopicObject; + +/** + * GDataFreebaseTopicValue: + * + * Opaque struct containing a value of a Freebase topic object. This struct may contain a simple + * value (integers, doubles, strings...) or complex values, expressed through a #GDataFreebaseTopicObject. + * + * Since: 0.15.1 + */ +typedef struct _GDataFreebaseTopicValue GDataFreebaseTopicValue; + +/** + * GDataFreebaseTopicResult: + * + * All the fields in the #GDataFreebaseTopicResult structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + GDataFreebaseResult parent; + GDataFreebaseTopicResultPrivate *priv; +} GDataFreebaseTopicResult; + +/** + * GDataFreebaseTopicResultClass: + * + * All the fields in the #GDataFreebaseTopicResultClass structure are private and should never be accessed directly. + * + * Since: 0.15.1 + */ +typedef struct { + /*< private >*/ + GDataFreebaseResultClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataFreebaseTopicResultClass; + +GType gdata_freebase_topic_object_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; +GType gdata_freebase_topic_value_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; +GType gdata_freebase_topic_result_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; + +GDataFreebaseTopicResult *gdata_freebase_topic_result_new (void) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC G_GNUC_DEPRECATED; + +GDataFreebaseTopicObject *gdata_freebase_topic_result_dup_object (GDataFreebaseTopicResult *self) G_GNUC_DEPRECATED; + +GDataFreebaseTopicObject *gdata_freebase_topic_object_ref (GDataFreebaseTopicObject *object) G_GNUC_DEPRECATED; +void gdata_freebase_topic_object_unref (GDataFreebaseTopicObject *object) G_GNUC_DEPRECATED; + +GPtrArray *gdata_freebase_topic_object_list_properties (const GDataFreebaseTopicObject *object) G_GNUC_DEPRECATED; + +const gchar *gdata_freebase_topic_object_get_id (const GDataFreebaseTopicObject *object) G_GNUC_DEPRECATED; +guint64 gdata_freebase_topic_object_get_property_count (const GDataFreebaseTopicObject *object, const gchar *property) G_GNUC_DEPRECATED; +guint64 gdata_freebase_topic_object_get_property_hits (const GDataFreebaseTopicObject *object, const gchar *property) G_GNUC_DEPRECATED; +GDataFreebaseTopicValue *gdata_freebase_topic_object_get_property_value (const GDataFreebaseTopicObject *object, const gchar *property, gint64 item) G_GNUC_DEPRECATED; + +GDataFreebaseTopicValue *gdata_freebase_topic_value_ref (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; +void gdata_freebase_topic_value_unref (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; + +const gchar *gdata_freebase_topic_value_get_property (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; + +const gchar *gdata_freebase_topic_value_get_text (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; +const gchar *gdata_freebase_topic_value_get_language (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; +const gchar *gdata_freebase_topic_value_get_creator (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; +gint64 gdata_freebase_topic_value_get_timestamp (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; +GType gdata_freebase_topic_value_get_value_type (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; +void gdata_freebase_topic_value_copy_value (GDataFreebaseTopicValue *value, GValue *gvalue) G_GNUC_DEPRECATED; + +gint64 gdata_freebase_topic_value_get_int (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; +gdouble gdata_freebase_topic_value_get_double (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; +const gchar *gdata_freebase_topic_value_get_string (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; +const GDataFreebaseTopicObject *gdata_freebase_topic_value_get_object (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; + +gboolean gdata_freebase_topic_value_is_image (GDataFreebaseTopicValue *value) G_GNUC_DEPRECATED; + +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_FREEBASE_TOPIC_RESULT_H */ diff --git a/gdata/services/picasaweb/gdata-picasaweb-album.c b/gdata/services/picasaweb/gdata-picasaweb-album.c new file mode 100644 index 0000000..515d34a --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-album.c @@ -0,0 +1,1268 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-picasaweb-album + * @short_description: GData PicasaWeb album object + * @stability: Stable + * @include: gdata/services/picasaweb/gdata-picasaweb-album.h + * + * #GDataPicasaWebAlbum is a subclass of #GDataEntry to represent an album from Google PicasaWeb. + * + * For more details of Google PicasaWeb's GData API, see the + * online documentation. + * + * + * Getting Basic Album Data + * + * GDataFeed *album_feed; + * GList *album_entries; + * + * /* Query for a feed of GDataPicasaWebAlbums owned by user "libgdata.picasaweb" */ + * album_feed = gdata_picasaweb_service_query_all_albums (service, NULL, "libgdata.picasaweb", NULL, NULL, NULL, NULL); + * + * /* Get a list of GDataPicasaWebAlbums from the query's feed */ + * for (album_entries = gdata_feed_get_entries (album_feed); album_entries != NULL; album_entries = album_entries->next) { + * GDataPicasaWebAlbum *album; + * guint num_photos; + * const gchar *owner_nickname, *title, *summary; + * gint64 timestamp; + * GList *thumbnails; + * + * album = GDATA_PICASAWEB_ALBUM (album_entries->data); + * + * /* Get various bits of information about the album */ + * num_photos = gdata_picasaweb_album_get_num_photos (album); + * owner_nickname = gdata_picasaweb_album_get_nickname (album); + * title = gdata_entry_get_title (GDATA_ENTRY (album)); + * summary = gdata_entry_get_summary (GDATA_ENTRY (album)); + * /* Get the day the album was shot on or, if not set, when it was uploaded. This is in milliseconds since the epoch. */ + * timestamp = gdata_picasaweb_album_get_timestamp (album); + * + * for (thumbnails = gdata_picasaweb_album_get_thumbnails (album); thumbnails != NULL; thumbnails = thumbnails->next) { + * GDataMediaThumbnail *thumbnail; + * GDataDownloadStream *download_stream; + * GdkPixbuf *pixbuf; + * + * thumbnail = GDATA_MEDIA_THUMBNAIL (thumbnails->data); + * /* Do something fun with the thumbnails, like download and display them. We could just as easily download them into + * * files using g_file_create() and g_output_stream_splice(), rather than create GdkPixbufs directly from them. + * * Note that this is a blocking operation. */ + * download_stream = gdata_media_thumbnail_download (thumbnail, GDATA_SERVICE (service), NULL, NULL); + * pixbuf = gdk_pixbuf_new_from_stream (G_INPUT_STREAM (download_stream), NULL, NULL); + * g_object_unref (download_stream); + * /* ... */ + * g_object_unref (pixbuf); + * } + * + * /* Do something worthwhile with your album data */ + * } + * + * g_object_unref (album_feed); + * + * + * + * Since: 0.4.0 + */ + +/* TODO: support the album cover/icon ? I think this is already done with the thumbnails, but we don't set it yet :( */ + +#include +#include +#include +#include +#include + +#include "gdata-picasaweb-album.h" +#include "gdata-private.h" +#include "gdata-service.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "media/gdata-media-group.h" +#include "gdata-picasaweb-enums.h" +#include "georss/gdata-georss-where.h" + +static GObject *gdata_picasaweb_album_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); +static void gdata_picasaweb_album_dispose (GObject *object); +static void gdata_picasaweb_album_finalize (GObject *object); +static void gdata_picasaweb_album_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_picasaweb_album_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataPicasaWebAlbumPrivate { + gchar *album_id; + gchar *user; + gchar *nickname; + gint64 edited; + gchar *location; + GDataPicasaWebVisibility visibility; + gint64 timestamp; /* in milliseconds! */ + guint num_photos; + guint num_photos_remaining; + glong bytes_used; + gboolean is_commenting_enabled; + guint comment_count; + + /* media:group */ + GDataMediaGroup *media_group; + /* georss:where */ + GDataGeoRSSWhere *georss_where; +}; + +enum { + PROP_USER = 1, + PROP_NICKNAME, + PROP_EDITED, + PROP_LOCATION, + PROP_VISIBILITY, + PROP_TIMESTAMP, + PROP_NUM_PHOTOS, + PROP_NUM_PHOTOS_REMAINING, + PROP_BYTES_USED, + PROP_IS_COMMENTING_ENABLED, + PROP_COMMENT_COUNT, + PROP_TAGS, + PROP_LATITUDE, + PROP_LONGITUDE, + PROP_ALBUM_ID +}; + +G_DEFINE_TYPE (GDataPicasaWebAlbum, gdata_picasaweb_album, GDATA_TYPE_ENTRY) + +static void +gdata_picasaweb_album_class_init (GDataPicasaWebAlbumClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataPicasaWebAlbumPrivate)); + + gobject_class->constructor = gdata_picasaweb_album_constructor; + gobject_class->get_property = gdata_picasaweb_album_get_property; + gobject_class->set_property = gdata_picasaweb_album_set_property; + gobject_class->dispose = gdata_picasaweb_album_dispose; + gobject_class->finalize = gdata_picasaweb_album_finalize; + + parsable_class->parse_xml = parse_xml; + parsable_class->get_xml = get_xml; + parsable_class->get_namespaces = get_namespaces; + + entry_class->kind_term = "http://schemas.google.com/photos/2007#album"; + + /** + * GDataPicasaWebAlbum:album-id: + * + * The ID of the album. This is a substring of the ID returned by gdata_entry_get_id() for #GDataPicasaWebAlbums; for example, + * if gdata_entry_get_id() returned "http://picasaweb.google.com/data/entry/user/libgdata.picasaweb/albumid/5328889949261497249" for a + * particular #GDataPicasaWebAlbum, the #GDataPicasaWebAlbum:album-id property would be "5328889949261497249". + * + * For more information, see the + * gphoto specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_ALBUM_ID, + g_param_spec_string ("album-id", + "Album ID", "The ID of the album.", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:user: + * + * The username of the album owner. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_USER, + g_param_spec_string ("user", + "User", "The username of the album owner.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:nickname: + * + * The user's nickname. This is a user-specified value that should be used when referring to the user by name. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_NICKNAME, + g_param_spec_string ("nickname", + "Nickname", "The user's nickname.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:edited: + * + * The time this album was last edited. If the album has not been edited yet, the content indicates the time it was created. + * + * For more information, see the + * Atom Publishing Protocol specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_EDITED, + g_param_spec_int64 ("edited", + "Edited", "The time this album was last edited.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:location: + * + * The user-specified location associated with the album. A place name. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LOCATION, + g_param_spec_string ("location", + "Location", "The user-specified location associated with the album.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:visibility: + * + * The visibility (or access rights) of the album. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_VISIBILITY, + g_param_spec_enum ("visibility", + "Visibility", "The visibility (or access rights) of the album.", + GDATA_TYPE_PICASAWEB_VISIBILITY, GDATA_PICASAWEB_PRIVATE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:timestamp: + * + * The timestamp of when the album occurred, settable by the user. This a UNIX timestamp in milliseconds (not seconds) since the epoch. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TIMESTAMP, + g_param_spec_int64 ("timestamp", + "Timestamp", "The timestamp of when the album occurred, settable by the user.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /* TODO: Change to photo-count? */ + /** + * GDataPicasaWebAlbum:num-photos: + * + * The number of photos and videos in the album. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_NUM_PHOTOS, + g_param_spec_uint ("num-photos", + "Number of photos", "The number of photos and videos in the album.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /* TODO: Change to remaining-photos-count? */ + /** + * GDataPicasaWebAlbum:num-photos-remaining: + * + * The number of photos and videos that can still be uploaded to this album. + * This doesn't account for quota, just a hardcoded maximum number per album set by Google. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_NUM_PHOTOS_REMAINING, + g_param_spec_uint ("num-photos-remaining", + "Number of photo spaces remaining", "The number of files spaces still free for uploads.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:bytes-used: + * + * The number of bytes consumed by this album and its contents. Note that this is only set if the authenticated user is the owner of the + * album; it's otherwise -1. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_BYTES_USED, + g_param_spec_long ("bytes-used", + "Number of bytes used", "The number of bytes consumed by this album and its contents.", + -1, G_MAXLONG, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:commenting-enabled: + * + * Whether commenting is enabled for this album. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_COMMENTING_ENABLED, + g_param_spec_boolean ("is-commenting-enabled", + "Commenting enabled?", "Whether commenting is enabled for this album.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:comment-count: + * + * The number of comments on the album. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_COMMENT_COUNT, + g_param_spec_uint ("comment-count", + "Comment count", "The number of comments on the album.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:tags: + * + * A %NULL-terminated array of tags associated with the album; all the tags associated with the individual photos in the album. + * + * For more information, see the + * Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TAGS, + g_param_spec_boxed ("tags", + "Tags", "A NULL-terminated array of tags associated with the album", + G_TYPE_STRV, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:latitude: + * + * The location as a latitude coordinate associated with this album. Valid latitudes range from -90.0 + * to 90.0 inclusive. + * + * For more information, see the + * GeoRSS specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_LATITUDE, + g_param_spec_double ("latitude", + "Latitude", "The location as a latitude coordinate associated with this album.", + -90.0, 90.0, 0.0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebAlbum:longitude: + * + * The location as a longitude coordinate associated with this album. Valid longitudes range from -180.0 + * to 180.0 inclusive. + * + * For more information, see the + * GeoRSS specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_LONGITUDE, + g_param_spec_double ("longitude", + "Longitude", "The location as a longitude coordinate associated with this album.", + -180.0, 180.0, 0.0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +notify_title_cb (GDataPicasaWebAlbum *self, GParamSpec *pspec, gpointer user_data) +{ + /* Update our media:group title */ + if (self->priv->media_group != NULL) + gdata_media_group_set_title (self->priv->media_group, gdata_entry_get_title (GDATA_ENTRY (self))); +} + +static void +notify_summary_cb (GDataPicasaWebAlbum *self, GParamSpec *pspec, gpointer user_data) +{ + /* Update our media:group description */ + if (self->priv->media_group != NULL) + gdata_media_group_set_description (self->priv->media_group, gdata_entry_get_summary (GDATA_ENTRY (self))); +} + +static void notify_visibility_cb (GDataPicasaWebAlbum *self, GParamSpec *pspec, gpointer user_data); + +static void +notify_rights_cb (GDataPicasaWebAlbum *self, GParamSpec *pspec, gpointer user_data) +{ + const gchar *rights = gdata_entry_get_rights (GDATA_ENTRY (self)); + + /* Update our gphoto:visibility */ + g_signal_handlers_block_by_func (self, notify_visibility_cb, NULL); + + if (rights == NULL || strcmp (rights, "public") == 0) { + gdata_picasaweb_album_set_visibility (self, GDATA_PICASAWEB_PUBLIC); + } else if (strcmp (rights, "private") == 0) { + gdata_picasaweb_album_set_visibility (self, GDATA_PICASAWEB_PRIVATE); + } else { + /* Print out a warning and leave the visibility as it is */ + g_warning ("Unknown or value: %s", rights); + } + + g_signal_handlers_unblock_by_func (self, notify_visibility_cb, NULL); +} + +static void +notify_visibility_cb (GDataPicasaWebAlbum *self, GParamSpec *pspec, gpointer user_data) +{ + /* Update our GDataEntry's atom:rights */ + g_signal_handlers_block_by_func (self, notify_rights_cb, NULL); + + switch (self->priv->visibility) { + case GDATA_PICASAWEB_PUBLIC: + gdata_entry_set_rights (GDATA_ENTRY (self), "public"); + break; + case GDATA_PICASAWEB_PRIVATE: + gdata_entry_set_rights (GDATA_ENTRY (self), "private"); + break; + default: + g_assert_not_reached (); + } + + g_signal_handlers_unblock_by_func (self, notify_rights_cb, NULL); +} + +static void +gdata_picasaweb_album_init (GDataPicasaWebAlbum *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_PICASAWEB_ALBUM, GDataPicasaWebAlbumPrivate); + self->priv->media_group = g_object_new (GDATA_TYPE_MEDIA_GROUP, NULL); + self->priv->georss_where = g_object_new (GDATA_TYPE_GEORSS_WHERE, NULL); + self->priv->edited = -1; + self->priv->timestamp = -1; + + /* Set the initial visibility */ + self->priv->visibility = GDATA_PICASAWEB_PRIVATE; + gdata_entry_set_rights (GDATA_ENTRY (self), "private"); + + /* Connect to the notify::title signal from GDataEntry so our media:group title can be kept in sync + * (the title of an album is duplicated in atom:title and media:group/media:title) */ + g_signal_connect (GDATA_ENTRY (self), "notify::title", G_CALLBACK (notify_title_cb), NULL); + /* Connect to the notify::description signal from GDataEntry so our media:group description can be kept in sync + * (the description of an album is duplicated in atom:summary and media:group/media:description) */ + g_signal_connect (GDATA_ENTRY (self), "notify::summary", G_CALLBACK (notify_summary_cb), NULL); + /* Connect to the notify::rights signal from GDataEntry so our gphoto:visibility can be kept in sync (and vice-versa) + * (visibility settings are duplicated in atom:rights and gphoto:visibility) */ + g_signal_connect (GDATA_ENTRY (self), "notify::rights", G_CALLBACK (notify_rights_cb), NULL); + g_signal_connect (self, "notify::visibility", G_CALLBACK (notify_visibility_cb), NULL); +} + +static GObject * +gdata_picasaweb_album_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) +{ + GObject *object; + + /* Chain up to the parent class */ + object = G_OBJECT_CLASS (gdata_picasaweb_album_parent_class)->constructor (type, n_construct_params, construct_params); + + if (_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object)) == FALSE) { + GDataPicasaWebAlbumPrivate *priv = GDATA_PICASAWEB_ALBUM (object)->priv; + GTimeVal time_val; + + /* Set the edited and timestamp properties to the current time (creation time). bgo#599140 + * We don't do this in *_init() since that would cause setting it from parse_xml() to fail (duplicate element). */ + g_get_current_time (&time_val); + priv->timestamp = (gint64) time_val.tv_sec * 1000; + priv->edited = time_val.tv_sec; + } + + return object; +} + +static void +gdata_picasaweb_album_dispose (GObject *object) +{ + GDataPicasaWebAlbumPrivate *priv = GDATA_PICASAWEB_ALBUM (object)->priv; + + if (priv->media_group != NULL) + g_object_unref (priv->media_group); + priv->media_group = NULL; + + if (priv->georss_where != NULL) + g_object_unref (priv->georss_where); + priv->georss_where = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_picasaweb_album_parent_class)->dispose (object); +} + +static void +gdata_picasaweb_album_finalize (GObject *object) +{ + GDataPicasaWebAlbumPrivate *priv = GDATA_PICASAWEB_ALBUM (object)->priv; + + g_free (priv->album_id); + g_free (priv->user); + g_free (priv->nickname); + g_free (priv->location); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_picasaweb_album_parent_class)->finalize (object); +} + +static void +gdata_picasaweb_album_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataPicasaWebAlbumPrivate *priv = GDATA_PICASAWEB_ALBUM (object)->priv; + + switch (property_id) { + case PROP_ALBUM_ID: + g_value_set_string (value, priv->album_id); + break; + case PROP_USER: + g_value_set_string (value, priv->user); + break; + case PROP_NICKNAME: + g_value_set_string (value, priv->nickname); + break; + case PROP_EDITED: + g_value_set_int64 (value, priv->edited); + break; + case PROP_LOCATION: + g_value_set_string (value, priv->location); + break; + case PROP_VISIBILITY: + g_value_set_enum (value, priv->visibility); + break; + case PROP_TIMESTAMP: + g_value_set_int64 (value, priv->timestamp); + break; + case PROP_NUM_PHOTOS: + g_value_set_uint (value, priv->num_photos); + break; + case PROP_NUM_PHOTOS_REMAINING: + g_value_set_uint (value, priv->num_photos_remaining); + break; + case PROP_BYTES_USED: + g_value_set_long (value, priv->bytes_used); + break; + case PROP_IS_COMMENTING_ENABLED: + g_value_set_boolean (value, priv->is_commenting_enabled); + break; + case PROP_COMMENT_COUNT: + g_value_set_uint (value, priv->comment_count); + break; + case PROP_TAGS: + g_value_set_boxed (value, gdata_media_group_get_keywords (priv->media_group)); + break; + case PROP_LATITUDE: + g_value_set_double (value, gdata_georss_where_get_latitude (priv->georss_where)); + break; + case PROP_LONGITUDE: + g_value_set_double (value, gdata_georss_where_get_longitude (priv->georss_where)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_picasaweb_album_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataPicasaWebAlbum *self = GDATA_PICASAWEB_ALBUM (object); + + switch (property_id) { + case PROP_ALBUM_ID: + /* Construct only */ + g_free (self->priv->album_id); + self->priv->album_id = g_value_dup_string (value); + break; + case PROP_LOCATION: + gdata_picasaweb_album_set_location (self, g_value_get_string (value)); + break; + case PROP_VISIBILITY: + gdata_picasaweb_album_set_visibility (self, g_value_get_enum (value)); + break; + case PROP_TIMESTAMP: + gdata_picasaweb_album_set_timestamp (self, g_value_get_int64 (value)); + break; + case PROP_IS_COMMENTING_ENABLED: + gdata_picasaweb_album_set_is_commenting_enabled (self, g_value_get_boolean (value)); + break; + case PROP_TAGS: + gdata_picasaweb_album_set_tags (self, g_value_get_boxed (value)); + break; + case PROP_LATITUDE: + gdata_picasaweb_album_set_coordinates (self, g_value_get_double (value), + gdata_georss_where_get_longitude (self->priv->georss_where)); + break; + case PROP_LONGITUDE: + gdata_picasaweb_album_set_coordinates (self, gdata_georss_where_get_latitude (self->priv->georss_where), + g_value_get_double (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataPicasaWebAlbum *self = GDATA_PICASAWEB_ALBUM (parsable); + + /* TODO: media:group should also be P_NO_DUPES, but we can't, as priv->media_group has to be pre-populated + * in order for things like gdata_picasaweb_album_get_tags() to work. */ + if (gdata_parser_is_namespace (node, "http://www.w3.org/2007/app") == TRUE && + gdata_parser_int64_time_from_element (node, "edited", P_REQUIRED | P_NO_DUPES, &(self->priv->edited), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://search.yahoo.com/mrss/") == TRUE && + gdata_parser_object_from_element (node, "group", P_REQUIRED, GDATA_TYPE_MEDIA_GROUP, + &(self->priv->media_group), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://www.georss.org/georss") == TRUE && + gdata_parser_object_from_element (node, "where", P_REQUIRED, GDATA_TYPE_GEORSS_WHERE, + &(self->priv->georss_where), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/photos/2007") == TRUE) { + if (gdata_parser_string_from_element (node, "user", P_REQUIRED | P_NON_EMPTY, &(self->priv->user), &success, error) == TRUE || + gdata_parser_string_from_element (node, "nickname", P_REQUIRED | P_NON_EMPTY, &(self->priv->nickname), &success, error) == TRUE || + gdata_parser_string_from_element (node, "location", P_NONE, &(self->priv->location), &success, error) == TRUE || + gdata_parser_string_from_element (node, "id", P_REQUIRED | P_NON_EMPTY | P_NO_DUPES, + &(self->priv->album_id), &success, error) == TRUE) { + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "access") == 0) { + /* gphoto:access */ + xmlChar *access_level = xmlNodeListGetString (doc, node->children, TRUE); + if (xmlStrcmp (access_level, (xmlChar*) "public") == 0) { + gdata_picasaweb_album_set_visibility (self, GDATA_PICASAWEB_PUBLIC); + } else if (xmlStrcmp (access_level, (xmlChar*) "private") == 0 || + xmlStrcmp (access_level, (xmlChar*) "protected") == 0) { + gdata_picasaweb_album_set_visibility (self, GDATA_PICASAWEB_PRIVATE); + } else { + gdata_parser_error_unknown_content (node, (gchar*) access_level, error); + xmlFree (access_level); + return FALSE; + } + xmlFree (access_level); + } else if (xmlStrcmp (node->name, (xmlChar*) "timestamp") == 0) { + /* gphoto:timestamp */ + xmlChar *timestamp_str; + guint64 milliseconds; + + timestamp_str = xmlNodeListGetString (doc, node->children, TRUE); + milliseconds = g_ascii_strtoull ((gchar*) timestamp_str, NULL, 10); + xmlFree (timestamp_str); + + gdata_picasaweb_album_set_timestamp (self, (gint64) milliseconds); + } else if (xmlStrcmp (node->name, (xmlChar*) "numphotos") == 0) { + /* gphoto:numphotos */ + xmlChar *num_photos = xmlNodeListGetString (doc, node->children, TRUE); + if (num_photos == NULL || *num_photos == '\0') { + xmlFree (num_photos); + return gdata_parser_error_required_content_missing (node, error); + } + + self->priv->num_photos = g_ascii_strtoull ((char*) num_photos, NULL, 10); + xmlFree (num_photos); + } else if (xmlStrcmp (node->name, (xmlChar*) "numphotosremaining") == 0) { + /* gphoto:numphotosremaining */ + xmlChar *num_photos_remaining = xmlNodeListGetString (doc, node->children, TRUE); + if (num_photos_remaining == NULL || *num_photos_remaining == '\0') { + xmlFree (num_photos_remaining); + return gdata_parser_error_required_content_missing (node, error); + } + + self->priv->num_photos_remaining = g_ascii_strtoull ((char*) num_photos_remaining, NULL, 10); + xmlFree (num_photos_remaining); + } else if (xmlStrcmp (node->name, (xmlChar*) "bytesUsed") == 0) { + /* gphoto:bytesUsed */ + xmlChar *bytes_used = xmlNodeListGetString (doc, node->children, TRUE); + if (bytes_used == NULL || *bytes_used == '\0') { + xmlFree (bytes_used); + return gdata_parser_error_required_content_missing (node, error); + } + + self->priv->bytes_used = g_ascii_strtoll ((char*) bytes_used, NULL, 10); + xmlFree (bytes_used); + } else if (xmlStrcmp (node->name, (xmlChar*) "commentingEnabled") == 0) { + /* gphoto:commentingEnabled */ + xmlChar *commenting_enabled = xmlNodeListGetString (doc, node->children, TRUE); + if (commenting_enabled == NULL || *commenting_enabled == '\0') { + xmlFree (commenting_enabled); + return gdata_parser_error_required_content_missing (node, error); + } + + gdata_picasaweb_album_set_is_commenting_enabled (self, + (xmlStrcmp (commenting_enabled, (xmlChar*) "true") == 0) ? TRUE : FALSE); + xmlFree (commenting_enabled); + } else if (xmlStrcmp (node->name, (xmlChar*) "commentCount") == 0) { + /* gphoto:commentCount */ + xmlChar *comment_count = xmlNodeListGetString (doc, node->children, TRUE); + if (comment_count == NULL || *comment_count == '\0') { + xmlFree (comment_count); + return gdata_parser_error_required_content_missing (node, error); + } + + self->priv->comment_count = g_ascii_strtoull ((char*) comment_count, NULL, 10); + xmlFree (comment_count); + } else { + return GDATA_PARSABLE_CLASS (gdata_picasaweb_album_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else { + return GDATA_PARSABLE_CLASS (gdata_picasaweb_album_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataPicasaWebAlbumPrivate *priv = GDATA_PICASAWEB_ALBUM (parsable)->priv; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_picasaweb_album_parent_class)->get_xml (parsable, xml_string); + + /* Add all the album-specific XML */ + if (priv->album_id != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->album_id, ""); + + if (priv->location != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->location, ""); + + switch (priv->visibility) { + case GDATA_PICASAWEB_PUBLIC: + g_string_append (xml_string, "public"); + break; + case GDATA_PICASAWEB_PRIVATE: + g_string_append (xml_string, "private"); + break; + default: + g_assert_not_reached (); + } + + if (priv->timestamp != -1) { + /* in milliseconds */ + g_string_append_printf (xml_string, "%" G_GINT64_FORMAT "", priv->timestamp); + } + + if (priv->is_commenting_enabled == FALSE) + g_string_append (xml_string, "false"); + else + g_string_append (xml_string, "true"); + + /* media:group */ + _gdata_parsable_get_xml (GDATA_PARSABLE (priv->media_group), xml_string, FALSE); + + /* georss:where */ + if (priv->georss_where != NULL && gdata_georss_where_get_latitude (priv->georss_where) != G_MAXDOUBLE && + gdata_georss_where_get_longitude (priv->georss_where) != G_MAXDOUBLE) { + _gdata_parsable_get_xml (GDATA_PARSABLE (priv->georss_where), xml_string, FALSE); + } + + /* TODO: + * - Finish supporting all tags + * - Check all tags here are valid for insertions and updates + */ +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + GDataPicasaWebAlbumPrivate *priv = GDATA_PICASAWEB_ALBUM (parsable)->priv; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_picasaweb_album_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "gphoto", (gchar*) "http://schemas.google.com/photos/2007"); + g_hash_table_insert (namespaces, (gchar*) "app", (gchar*) "http://www.w3.org/2007/app"); + + /* Add the media:group namespaces */ + GDATA_PARSABLE_GET_CLASS (priv->media_group)->get_namespaces (GDATA_PARSABLE (priv->media_group), namespaces); + /* Add the georss:where namespaces */ + GDATA_PARSABLE_GET_CLASS (priv->georss_where)->get_namespaces (GDATA_PARSABLE (priv->georss_where), namespaces); +} + +/** + * gdata_picasaweb_album_new: + * @id: (allow-none): the album's entry ID, or %NULL + * + * Creates a new #GDataPicasaWebAlbum with the given ID and default properties. @id is the ID which would be returned by gdata_entry_get_id(), + * not gdata_picasaweb_album_get_id(). + * + * If @id is not %NULL and can't be parsed to extract an album ID, %NULL will be returned. + * + * Return value: a new #GDataPicasaWebAlbum, or %NULL; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataPicasaWebAlbum * +gdata_picasaweb_album_new (const gchar *id) +{ + const gchar *album_id = NULL, *i; + + if (id != NULL) { + album_id = g_strrstr (id, "/"); + if (album_id == NULL) + return NULL; + album_id++; /* skip the slash */ + + /* Ensure the @album_id is entirely numeric */ + for (i = album_id; *i != '\0'; i = g_utf8_next_char (i)) { + if (g_unichar_isdigit (g_utf8_get_char (i)) == FALSE) + return NULL; + } + } + + return GDATA_PICASAWEB_ALBUM (g_object_new (GDATA_TYPE_PICASAWEB_ALBUM, "id", id, "album-id", album_id, NULL)); +} + +/** + * gdata_picasaweb_album_get_id: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:album-id property. + * + * Return value: the album's ID + * + * Since: 0.7.0 + */ +const gchar * +gdata_picasaweb_album_get_id (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), NULL); + return self->priv->album_id; +} + +/** + * gdata_picasaweb_album_get_user: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:user property. + * + * Return value: the album owner's username + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_album_get_user (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), NULL); + return self->priv->user; +} + +/** + * gdata_picasaweb_album_get_nickname: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:nickname property. + * + * Return value: the album owner's nickname + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_album_get_nickname (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), NULL); + return self->priv->nickname; +} + +/** + * gdata_picasaweb_album_get_edited: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:edited property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the album was last edited, or -1 + * + * Since: 0.4.0 + */ +gint64 +gdata_picasaweb_album_get_edited (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), -1); + return self->priv->edited; +} + +/** + * gdata_picasaweb_album_get_location: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:location property. + * + * Return value: the album's location, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_album_get_location (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), NULL); + return self->priv->location; +} + +/** + * gdata_picasaweb_album_set_location: + * @self: a #GDataPicasaWebAlbum + * @location: (allow-none): the new album location, or %NULL + * + * Sets the #GDataPicasaWebAlbum:location property to @location. + * + * Set @location to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_album_set_location (GDataPicasaWebAlbum *self, const gchar *location) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_ALBUM (self)); + + g_free (self->priv->location); + self->priv->location = g_strdup (location); + g_object_notify (G_OBJECT (self), "location"); +} + +/** + * gdata_picasaweb_album_get_visibility: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:visibility property. + * + * Return value: the album's visibility level + * + * Since: 0.4.0 + */ +GDataPicasaWebVisibility +gdata_picasaweb_album_get_visibility (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), GDATA_PICASAWEB_PUBLIC); + return self->priv->visibility; +} + +/** + * gdata_picasaweb_album_set_visibility: + * @self: a #GDataPicasaWebAlbum + * @visibility: the new album visibility level + * + * Sets the #GDataPicasaWebAlbum:visibility property to @visibility. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_album_set_visibility (GDataPicasaWebAlbum *self, GDataPicasaWebVisibility visibility) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_ALBUM (self)); + + self->priv->visibility = visibility; + g_object_notify (G_OBJECT (self), "visibility"); +} + +/** + * gdata_picasaweb_album_get_timestamp: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:timestamp property. This value usually holds either the date that best corresponds to the album of photos, or to the + * day it was uploaded. It's a UNIX timestamp in milliseconds (not seconds) since the epoch. If the property is unset, -1 + * will be returned. + * + * Return value: the UNIX timestamp for the timestamp property in milliseconds, or -1 + * + * Since: 0.4.0 + */ +gint64 +gdata_picasaweb_album_get_timestamp (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), -1); + return self->priv->timestamp; +} + +/** + * gdata_picasaweb_album_set_timestamp: + * @self: a #GDataPicasaWebAlbum + * @timestamp: a UNIX timestamp, or -1 + * + * Sets the #GDataPicasaWebAlbum:timestamp property from @timestamp. This should be a UNIX timestamp in milliseconds (not seconds) since the epoch. + * + * Set @timestamp to -1 to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_album_set_timestamp (GDataPicasaWebAlbum *self, gint64 timestamp) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_ALBUM (self)); + g_return_if_fail (timestamp >= -1); + + self->priv->timestamp = timestamp; + g_object_notify (G_OBJECT (self), "timestamp"); +} + +/** + * gdata_picasaweb_album_get_num_photos: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:num-photos property. + * + * Return value: the number of photos currently in the album + * + * Since: 0.4.0 + */ +guint +gdata_picasaweb_album_get_num_photos (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), 0); + return self->priv->num_photos; +} + +/** + * gdata_picasaweb_album_get_num_photos_remaining: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:num-photos-remaining property. + * + * Return value: the number of photos that can still be uploaded to the album + * + * Since: 0.4.0 + */ +guint +gdata_picasaweb_album_get_num_photos_remaining (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), 0); + return self->priv->num_photos_remaining; +} + +/** + * gdata_picasaweb_album_get_bytes_used: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:bytes-used property. It will return -1 if the current authenticated + * user is not the owner of the album. + * + * Return value: the number of bytes used by the album and its contents, or -1 + * + * Since: 0.4.0 + */ +glong +gdata_picasaweb_album_get_bytes_used (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), -1); + return self->priv->bytes_used; +} + +/** + * gdata_picasaweb_album_is_commenting_enabled: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:is-commenting-enabled property. + * + * Return value: %TRUE if commenting is enabled for the album, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_picasaweb_album_is_commenting_enabled (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), FALSE); + return self->priv->is_commenting_enabled; +} + +/** + * gdata_picasaweb_album_set_is_commenting_enabled: + * @self: a #GDataPicasaWebAlbum + * @is_commenting_enabled: %TRUE if commenting should be enabled for the album, %FALSE otherwise + * + * Sets the #GDataPicasaWebAlbum:is-commenting-enabled property to @is_commenting_enabled. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_album_set_is_commenting_enabled (GDataPicasaWebAlbum *self, gboolean is_commenting_enabled) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_ALBUM (self)); + self->priv->is_commenting_enabled = is_commenting_enabled; + g_object_notify (G_OBJECT (self), "is-commenting-enabled"); +} + +/** + * gdata_picasaweb_album_get_comment_count: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:comment-count property. + * + * Return value: the number of comments on the album + * + * Since: 0.4.0 + */ +guint +gdata_picasaweb_album_get_comment_count (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), 0); + return self->priv->comment_count; +} + +/** + * gdata_picasaweb_album_get_tags: + * @self: a #GDataPicasaWebAlbum + * + * Gets the #GDataPicasaWebAlbum:tags property. + * + * Return value: (array zero-terminated=1) (transfer none): a %NULL-terminated array of tags associated with all the photos in the album, or %NULL + * + * Since: 0.4.0 + */ +const gchar * const * +gdata_picasaweb_album_get_tags (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), NULL); + return gdata_media_group_get_keywords (self->priv->media_group); +} + +/** + * gdata_picasaweb_album_set_tags: + * @self: a #GDataPicasaWebAlbum + * @tags: (array zero-terminated=1) (allow-none): the new %NULL-terminated array of tags, or %NULL + * + * Sets the #GDataPicasaWebAlbum:tags property to @tags. + * + * Set @tags to %NULL to unset the album's tag list. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_album_set_tags (GDataPicasaWebAlbum *self, const gchar * const *tags) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_ALBUM (self)); + + gdata_media_group_set_keywords (self->priv->media_group, tags); + g_object_notify (G_OBJECT (self), "tags"); +} + +/** + * gdata_picasaweb_album_get_contents: + * @self: a #GDataPicasaWebAlbum + * + * Returns a list of media content, such as the cover image for the album. + * + * Return value: (element-type GData.MediaContent) (transfer none): a #GList of #GDataMediaContent items + * + * Since: 0.4.0 + */ +GList * +gdata_picasaweb_album_get_contents (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), NULL); + return gdata_media_group_get_contents (self->priv->media_group); +} + +/** + * gdata_picasaweb_album_get_thumbnails: + * @self: a #GDataPicasaWebAlbum + * + * Returns a list of thumbnails, often at different sizes, for this album. + * + * Return value: (element-type GData.MediaThumbnail) (transfer none): a #GList of #GDataMediaThumbnails, or %NULL + * + * Since: 0.4.0 + */ +GList * +gdata_picasaweb_album_get_thumbnails (GDataPicasaWebAlbum *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (self), NULL); + return gdata_media_group_get_thumbnails (self->priv->media_group); +} + +/** + * gdata_picasaweb_album_get_coordinates: + * @self: a #GDataPicasaWebAlbum + * @latitude: (out caller-allocates) (allow-none): return location for the latitude, or %NULL + * @longitude: (out caller-allocates) (allow-none): return location for the longitude, or %NULL + * + * Gets the #GDataPicasaWebAlbum:latitude and #GDataPicasaWebAlbum:longitude properties, + * setting the out parameters to them. If either latitude or longitude is %NULL, that parameter will not be set. + * If the coordinates are unset, @latitude and @longitude will be set to %G_MAXDOUBLE. + * + * Since: 0.5.0 + */ +void +gdata_picasaweb_album_get_coordinates (GDataPicasaWebAlbum *self, gdouble *latitude, gdouble *longitude) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_ALBUM (self)); + + if (latitude != NULL) + *latitude = gdata_georss_where_get_latitude (self->priv->georss_where); + if (longitude != NULL) + *longitude = gdata_georss_where_get_longitude (self->priv->georss_where); +} + +/** + * gdata_picasaweb_album_set_coordinates: + * @self: a #GDataPicasaWebAlbum + * @latitude: the album's new latitude coordinate, or %G_MAXDOUBLE + * @longitude: the album's new longitude coordinate, or %G_MAXDOUBLE + * + * Sets the #GDataPicasaWebAlbum:latitude and #GDataPicasaWebAlbum:longitude properties to + * @latitude and @longitude respectively. + * + * Since: 0.5.0 + */ +void +gdata_picasaweb_album_set_coordinates (GDataPicasaWebAlbum *self, gdouble latitude, gdouble longitude) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_ALBUM (self)); + + gdata_georss_where_set_latitude (self->priv->georss_where, latitude); + gdata_georss_where_set_longitude (self->priv->georss_where, longitude); + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "latitude"); + g_object_notify (G_OBJECT (self), "longitude"); + g_object_thaw_notify (G_OBJECT (self)); +} diff --git a/gdata/services/picasaweb/gdata-picasaweb-album.h b/gdata/services/picasaweb/gdata-picasaweb-album.h new file mode 100644 index 0000000..e228aca --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-album.h @@ -0,0 +1,114 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_PICASWEB_ALBUM_H +#define GDATA_PICASWEB_ALBUM_H + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * GDataPicasaWebVisibility: + * @GDATA_PICASAWEB_PUBLIC: the album is visible to everyone, regardless of whether they're authenticated + * @GDATA_PICASAWEB_PRIVATE: the album is visible only to authenticated users in a whitelist + * + * Visibility statuses available for albums on PicasaWeb. For more information, see the + * online documentation. + * + * Since: 0.4.0 + */ +typedef enum { + GDATA_PICASAWEB_PUBLIC = 1, + GDATA_PICASAWEB_PRIVATE +} GDataPicasaWebVisibility; + +#define GDATA_TYPE_PICASAWEB_ALBUM (gdata_picasaweb_album_get_type ()) +#define GDATA_PICASAWEB_ALBUM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_PICASAWEB_ALBUM, GDataPicasaWebAlbum)) +#define GDATA_PICASAWEB_ALBUM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_PICASAWEB_ALBUM, GDataPicasaWebAlbumClass)) +#define GDATA_IS_PICASAWEB_ALBUM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_PICASAWEB_ALBUM)) +#define GDATA_IS_PICASAWEB_ALBUM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_PICASAWEB_ALBUM)) +#define GDATA_PICASAWEB_ALBUM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_PICASAWEB_ALBUM, GDataPicasaWebAlbumClass)) + +typedef struct _GDataPicasaWebAlbumPrivate GDataPicasaWebAlbumPrivate; + +/** + * GDataPicasaWebAlbum: + * + * All the fields in the #GDataPicasaWebAlbum structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataEntry parent; + GDataPicasaWebAlbumPrivate *priv; +} GDataPicasaWebAlbum; + +/** + * GDataPicasaWebAlbumClass: + * + * All the fields in the #GDataPicasaWebAlbumClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataPicasaWebAlbumClass; + +GType gdata_picasaweb_album_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataPicasaWebAlbum, g_object_unref) + +GDataPicasaWebAlbum *gdata_picasaweb_album_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_picasaweb_album_get_id (GDataPicasaWebAlbum *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_album_get_user (GDataPicasaWebAlbum *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_album_get_nickname (GDataPicasaWebAlbum *self) G_GNUC_PURE; +gint64 gdata_picasaweb_album_get_edited (GDataPicasaWebAlbum *self); +const gchar *gdata_picasaweb_album_get_location (GDataPicasaWebAlbum *self) G_GNUC_PURE; +void gdata_picasaweb_album_set_location (GDataPicasaWebAlbum *self, const gchar *location); +GDataPicasaWebVisibility gdata_picasaweb_album_get_visibility (GDataPicasaWebAlbum *self) G_GNUC_PURE; +void gdata_picasaweb_album_set_visibility (GDataPicasaWebAlbum *self, GDataPicasaWebVisibility visibility); +gint64 gdata_picasaweb_album_get_timestamp (GDataPicasaWebAlbum *self); +void gdata_picasaweb_album_set_timestamp (GDataPicasaWebAlbum *self, gint64 timestamp); +guint gdata_picasaweb_album_get_num_photos (GDataPicasaWebAlbum *self) G_GNUC_PURE; +guint gdata_picasaweb_album_get_num_photos_remaining (GDataPicasaWebAlbum *self) G_GNUC_PURE; +glong gdata_picasaweb_album_get_bytes_used (GDataPicasaWebAlbum *self) G_GNUC_PURE; +gboolean gdata_picasaweb_album_is_commenting_enabled (GDataPicasaWebAlbum *self) G_GNUC_PURE; +void gdata_picasaweb_album_set_is_commenting_enabled (GDataPicasaWebAlbum *self, gboolean is_commenting_enabled); +guint gdata_picasaweb_album_get_comment_count (GDataPicasaWebAlbum *self) G_GNUC_PURE; +const gchar * const *gdata_picasaweb_album_get_tags (GDataPicasaWebAlbum *self) G_GNUC_PURE; +void gdata_picasaweb_album_set_tags (GDataPicasaWebAlbum *self, const gchar * const *tags); +GList *gdata_picasaweb_album_get_contents (GDataPicasaWebAlbum *self) G_GNUC_PURE; +GList *gdata_picasaweb_album_get_thumbnails (GDataPicasaWebAlbum *self) G_GNUC_PURE; +void gdata_picasaweb_album_get_coordinates (GDataPicasaWebAlbum *self, gdouble *latitude, gdouble *longitude); +void gdata_picasaweb_album_set_coordinates (GDataPicasaWebAlbum *self, gdouble latitude, gdouble longitude); + +G_END_DECLS + +#endif /* !GDATA_PICASAWEB_ALBUM_H */ diff --git a/gdata/services/picasaweb/gdata-picasaweb-comment.c b/gdata/services/picasaweb/gdata-picasaweb-comment.c new file mode 100644 index 0000000..d43ea21 --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-comment.c @@ -0,0 +1,114 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-picasaweb-comment + * @short_description: GData PicasaWeb comment object + * @stability: Stable + * @include: gdata/services/picasaweb/gdata-picasaweb-comment.h + * + * #GDataPicasaWebComment is a subclass of #GDataComment to represent a comment on a #GDataPicasaWebFile. It is returned by the #GDataCommentable + * interface implementation on #GDataPicasaWebFile. + * + * It's possible to query for, add and delete #GDataPicasaWebComments from #GDataPicasaWebFiles. + * + * Since: 0.10.0 + */ + +#include +#include + +#include "gdata-picasaweb-comment.h" + +static void gdata_picasaweb_comment_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_picasaweb_comment_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); + +enum { + PROP_ETAG = 1, +}; + +G_DEFINE_TYPE (GDataPicasaWebComment, gdata_picasaweb_comment, GDATA_TYPE_COMMENT) + +static void +gdata_picasaweb_comment_class_init (GDataPicasaWebCommentClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + gobject_class->get_property = gdata_picasaweb_comment_get_property; + gobject_class->set_property = gdata_picasaweb_comment_set_property; + + entry_class->kind_term = "http://schemas.google.com/photos/2007#comment"; + + /* Override the ETag property since ETags don't seem to be supported for PicasaWeb comments. */ + g_object_class_override_property (gobject_class, PROP_ETAG, "etag"); +} + +static void +gdata_picasaweb_comment_init (GDataPicasaWebComment *self) +{ + /* Nothing to see here. */ +} + +static void +gdata_picasaweb_comment_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ETAG: + /* Never return an ETag */ + g_value_set_string (value, NULL); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_picasaweb_comment_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ETAG: + /* Never set an ETag (note that this doesn't stop it being set in GDataEntry due to XML parsing) */ + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/** + * gdata_picasaweb_comment_new: + * @id: the comment's ID, or %NULL + * + * Creates a new #GDataPicasaWebComment with the given ID and default properties. + * + * Return value: a new #GDataPicasaWebComment; unref with g_object_unref() + * + * Since: 0.10.0 + */ +GDataPicasaWebComment * +gdata_picasaweb_comment_new (const gchar *id) +{ + return GDATA_PICASAWEB_COMMENT (g_object_new (GDATA_TYPE_PICASAWEB_COMMENT, + "id", id, + NULL)); +} diff --git a/gdata/services/picasaweb/gdata-picasaweb-comment.h b/gdata/services/picasaweb/gdata-picasaweb-comment.h new file mode 100644 index 0000000..af48a3c --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-comment.h @@ -0,0 +1,75 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_PICASAWEB_COMMENT_H +#define GDATA_PICASAWEB_COMMENT_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_PICASAWEB_COMMENT (gdata_picasaweb_comment_get_type ()) +#define GDATA_PICASAWEB_COMMENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_PICASAWEB_COMMENT, GDataPicasaWebComment)) +#define GDATA_PICASAWEB_COMMENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_PICASAWEB_COMMENT, GDataPicasaWebCommentClass)) +#define GDATA_IS_PICASAWEB_COMMENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_PICASAWEB_COMMENT)) +#define GDATA_IS_PICASAWEB_COMMENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_PICASAWEB_COMMENT)) +#define GDATA_PICASAWEB_COMMENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_PICASAWEB_COMMENT, GDataPicasaWebCommentClass)) + +typedef struct _GDataPicasaWebCommentPrivate GDataPicasaWebCommentPrivate; + +/** + * GDataPicasaWebComment: + * + * All the fields in the #GDataPicasaWebComment structure are private and should never be accessed directly. + * + * Since: 0.10.0 + */ +typedef struct { + GDataComment parent; + GDataPicasaWebCommentPrivate *priv; +} GDataPicasaWebComment; + +/** + * GDataPicasaWebCommentClass: + * + * All the fields in the #GDataPicasaWebCommentClass structure are private and should never be accessed directly. + * + * Since: 0.10.0 + */ +typedef struct { + /*< private >*/ + GDataCommentClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataPicasaWebCommentClass; + +GType gdata_picasaweb_comment_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataPicasaWebComment, g_object_unref) + +GDataPicasaWebComment *gdata_picasaweb_comment_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_PICASAWEB_COMMENT_H */ diff --git a/gdata/services/picasaweb/gdata-picasaweb-enums.c b/gdata/services/picasaweb/gdata-picasaweb-enums.c new file mode 100644 index 0000000..98cb149 --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-enums.c @@ -0,0 +1,24 @@ + + + +#include "gdata-picasaweb-album.h" +#include "gdata-picasaweb-enums.h" + +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/picasaweb/gdata-picasaweb-album.h" */ +GType +gdata_picasaweb_visibility_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_PICASAWEB_PUBLIC, "GDATA_PICASAWEB_PUBLIC", "public" }, + { GDATA_PICASAWEB_PRIVATE, "GDATA_PICASAWEB_PRIVATE", "private" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataPicasaWebVisibility", values); + } + return etype; +} + + + diff --git a/gdata/services/picasaweb/gdata-picasaweb-enums.h b/gdata/services/picasaweb/gdata-picasaweb-enums.h new file mode 100644 index 0000000..7d76185 --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-enums.h @@ -0,0 +1,18 @@ + + + +#ifndef GDATA_PICASAWEB_ENUMS_H +#define GDATA_PICASAWEB_ENUMS_H + +#include + +G_BEGIN_DECLS +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/picasaweb/gdata-picasaweb-album.h" */ +GType gdata_picasaweb_visibility_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_PICASAWEB_VISIBILITY (gdata_picasaweb_visibility_get_type()) +G_END_DECLS + +#endif /* !GDATA_PICASAWEB_ENUMS_H */ + + + diff --git a/gdata/services/picasaweb/gdata-picasaweb-feed.c b/gdata/services/picasaweb/gdata-picasaweb-feed.c new file mode 100644 index 0000000..d3c1d01 --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-feed.c @@ -0,0 +1,91 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * Copyright (C) Richard Schwarting 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-picasaweb-feed + * @short_description: GData PicasaWeb Feed object + * @stability: Stable + * @include: gdata/services/picasaweb/gdata-picasaweb-feed.h + * + * #GDataPicasaWebFeed is a subclass of #GDataFeed to represent properties for a PicasaWeb feed. It adds a couple of + * properties which are specific to the Google PicasaWeb API. + * + * Since: 0.6.0 + */ + +#include +#include + +#include "gdata-picasaweb-feed.h" +#include "gdata-feed.h" +#include "gdata-private.h" + +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); + +G_DEFINE_TYPE (GDataPicasaWebFeed, gdata_picasaweb_feed, GDATA_TYPE_FEED) + +static void +gdata_picasaweb_feed_class_init (GDataPicasaWebFeedClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + parsable_class->parse_xml = parse_xml; +} + +static void +gdata_picasaweb_feed_init (GDataPicasaWebFeed *self) +{ + /* Nothing to see here */ +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + if (gdata_parser_is_namespace (node, "http://schemas.google.com/photos/2007") == TRUE) { + if (xmlStrcmp (node->name, (xmlChar*) "user") == 0 || + xmlStrcmp (node->name, (xmlChar*) "nickname") == 0 || + xmlStrcmp (node->name, (xmlChar*) "quotacurrent") == 0 || + xmlStrcmp (node->name, (xmlChar*) "quotalimit") == 0 || + xmlStrcmp (node->name, (xmlChar*) "maxPhotosPerAlbum") == 0 || + xmlStrcmp (node->name, (xmlChar*) "thumbnail") == 0 || + xmlStrcmp (node->name, (xmlChar*) "allowDownloads") == 0 || + xmlStrcmp (node->name, (xmlChar*) "allowPrints") == 0 || + xmlStrcmp (node->name, (xmlChar*) "id") == 0 || + xmlStrcmp (node->name, (xmlChar*) "rights") == 0 || + xmlStrcmp (node->name, (xmlChar*) "location") == 0 || + xmlStrcmp (node->name, (xmlChar*) "access") == 0 || + xmlStrcmp (node->name, (xmlChar*) "timestamp") == 0 || + xmlStrcmp (node->name, (xmlChar*) "numphotos") == 0 || + xmlStrcmp (node->name, (xmlChar*) "numphotosremaining") == 0 || + xmlStrcmp (node->name, (xmlChar*) "bytesUsed") == 0) { + /* From user's feed of album entries. Redundant with user entry represented by #GDataPicasaWebUser. + * Capturing and ignoring. See bgo #589858. */ + } else { + return GDATA_PARSABLE_CLASS (gdata_picasaweb_feed_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else if (gdata_parser_is_namespace (node, "http://www.georss.org/georss") == TRUE && xmlStrcmp (node->name, (xmlChar*) "where") == 0) { + /* From user's feed of album entries. Redundant with user entry represented by #GDataPicasaWebUser. + * Capturing and ignoring. See bgo #589858. */ + } else { + return GDATA_PARSABLE_CLASS (gdata_picasaweb_feed_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + diff --git a/gdata/services/picasaweb/gdata-picasaweb-feed.h b/gdata/services/picasaweb/gdata-picasaweb-feed.h new file mode 100644 index 0000000..14a8688 --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-feed.h @@ -0,0 +1,73 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * Copyright (C) Richard Schwarting 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_PICASAWEB_FEED_H +#define GDATA_PICASAWEB_FEED_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_PICASAWEB_FEED (gdata_picasaweb_feed_get_type ()) +#define GDATA_PICASAWEB_FEED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_PICASAWEB_FEED, GDataPicasaWebFeed)) +#define GDATA_PICASAWEB_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_PICASAWEB_FEED, GDataPicasaWebFeedClass)) +#define GDATA_IS_PICASAWEB_FEED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_PICASAWEB_FEED)) +#define GDATA_IS_PICASAWEB_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_PICASAWEB_FEED)) +#define GDATA_PICASAWEB_FEED_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_PICASAWEB_FEED, GDataPicasaWebFeedClass)) + +/** + * GDataPicasaWebFeed: + * + * All the fields in the #GDataPicasaWebFeed structure are private and should never be accessed directly. + * + * Since: 0.6.0 + */ +typedef struct { + GDataFeed parent; + /*< private >*/ + gpointer padding1; /* reserved for private struct */ +} GDataPicasaWebFeed; + +/** + * GDataPicasaWebFeedClass: + * + * All the fields in the #GDataPicasaWebFeedClass structure are private and should never be accessed directly. + * + * Since: 0.6.0 + */ +typedef struct { + /*< private >*/ + GDataFeedClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataPicasaWebFeedClass; + +GType gdata_picasaweb_feed_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataPicasaWebFeed, g_object_unref) + +G_END_DECLS + +#endif /* !GDATA_PICASAWEB_FEED_H */ diff --git a/gdata/services/picasaweb/gdata-picasaweb-file.c b/gdata/services/picasaweb/gdata-picasaweb-file.c new file mode 100644 index 0000000..dc80c86 --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-file.c @@ -0,0 +1,1801 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-picasaweb-file + * @short_description: GData PicasaWeb file object + * @stability: Stable + * @include: gdata/services/picasaweb/gdata-picasaweb-file.h + * + * #GDataPicasaWebFile is a subclass of #GDataEntry to represent a file (photo or video) in an album on Google PicasaWeb. + * + * #GDataPicasaWebFile implements #GDataCommentable, allowing comments on files to be queried using gdata_commentable_query_comments(), new + * comments to be added to files using gdata_commentable_insert_comment() and existing comments to be deleted from files using + * gdata_commentable_delete_comment(). + * + * For more details of Google PicasaWeb's GData API, see the + * online documentation. + * + * + * Getting Basic Photo Data + * + * GDataFeed *photo_feed; + * GList *photo_entries; + * + * /* Query for a feed of GDataPicasaWebFiles belonging to the given GDataPicasaWebAlbum album */ + * photo_feed = gdata_picasaweb_service_query_files (service, album, NULL, NULL, NULL, NULL, NULL); + * + * /* Get a list of GDataPicasaWebFiles from the query's feed */ + * for (photo_entries = gdata_feed_get_entries (photo_feed); photo_entries != NULL; photo_entries = photo_entries->next) { + * GDataPicasaWebFile *photo; + * guint height, width; + * gsize file_size; + * gint64 timestamp; + * const gchar *title, *summary; + * GList *contents; + * + * photo = GDATA_PICASAWEB_FILE (photo_entries->data); + * + * /* Get various bits of information about the photo */ + * height = gdata_picasaweb_file_get_height (photo); + * width = gdata_picasaweb_file_get_width (photo); + * file_size = gdata_picasaweb_file_get_size (photo); + * timestamp = gdata_picasaweb_file_get_timestamp (photo); + * title = gdata_entry_get_title (GDATA_ENTRY (photo)); + * summary = gdata_entry_get_summary (GDATA_ENTRY (photo)); + * + * /* Obtain the image data at various sizes */ + * for (contents = gdata_picasaweb_file_get_contents (photo); contents != NULL; contents = contents->next) { + * GDataMediaContent *content; + * GDataDownloadStream *download_stream; + * GFileOutputStream *file_stream; + * GFile *new_file; + * + * content = GDATA_MEDIA_CONTENT (contents->data); + * /* Do something fun with the actual images, like download them to a file. + * * Note that this is a blocking operation. */ + * download_stream = gdata_media_content_download (content, GDATA_SERVICE (service), NULL, NULL); + * new_file = g_file_new_for_path (file_path); + * file_stream = g_file_create (new_file, G_FILE_CREATE_NONE, NULL, NULL); + * g_output_stream_splice (G_OUTPUT_STREAM (file_stream), G_INPUT_STREAM (download_stream), + * G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, NULL); + * g_object_unref (file_stream); + * g_object_unref (download_stream); + * /* ... */ + * g_object_unref (new_file); + * } + * + * /* Do something worthwhile with your image data */ + * } + * + * g_object_unref (photo_feed); + * + * + * + * Since: 0.4.0 + */ + +#include +#include +#include +#include +#include + +#include "gdata-picasaweb-file.h" +#include "gdata-private.h" +#include "gdata-service.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "media/gdata-media-group.h" +#include "exif/gdata-exif-tags.h" +#include "georss/gdata-georss-where.h" +#include "gd/gdata-gd-feed-link.h" +#include "gdata-commentable.h" +#include "gdata-picasaweb-comment.h" +#include "gdata-picasaweb-service.h" + +static GObject *gdata_picasaweb_file_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); +static void gdata_picasaweb_file_dispose (GObject *object); +static void gdata_picasaweb_file_finalize (GObject *object); +static void gdata_picasaweb_file_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_picasaweb_file_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_xml (GDataParsable *parsable, GString *xml_string); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); +static gchar *get_entry_uri (const gchar *id) G_GNUC_WARN_UNUSED_RESULT; +GDataAuthorizationDomain *get_authorization_domain (GDataCommentable *self) G_GNUC_CONST; +static gchar *get_query_comments_uri (GDataCommentable *self) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; +static gchar *get_insert_comment_uri (GDataCommentable *self, GDataComment *comment_) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; +static gboolean is_comment_deletable (GDataCommentable *self, GDataComment *comment_); +static void gdata_picasaweb_file_commentable_init (GDataCommentableInterface *iface); + +struct _GDataPicasaWebFilePrivate { + gchar *file_id; + gint64 edited; + gchar *version; + gchar *album_id; + guint width; + guint height; + gsize size; + gchar *checksum; + gint64 timestamp; /* in milliseconds! */ + gboolean is_commenting_enabled; + guint comment_count; + guint rotation; + gchar *video_status; + + /* media:group */ + GDataMediaGroup *media_group; + /* exif:tags */ + GDataExifTags *exif_tags; + /* georss:where */ + GDataGeoRSSWhere *georss_where; +}; + +enum { + PROP_EDITED = 1, + PROP_VERSION, + PROP_ALBUM_ID, + PROP_WIDTH, + PROP_HEIGHT, + PROP_SIZE, + PROP_CHECKSUM, + PROP_TIMESTAMP, + PROP_IS_COMMENTING_ENABLED, + PROP_COMMENT_COUNT, + PROP_ROTATION, + PROP_VIDEO_STATUS, + PROP_CREDIT, + PROP_CAPTION, + PROP_TAGS, + PROP_DISTANCE, + PROP_EXPOSURE, + PROP_FLASH, + PROP_FOCAL_LENGTH, + PROP_FSTOP, + PROP_IMAGE_UNIQUE_ID, + PROP_ISO, + PROP_MAKE, + PROP_MODEL, + PROP_LATITUDE, + PROP_LONGITUDE, + PROP_FILE_ID +}; + +G_DEFINE_TYPE_WITH_CODE (GDataPicasaWebFile, gdata_picasaweb_file, GDATA_TYPE_ENTRY, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMMENTABLE, gdata_picasaweb_file_commentable_init)) + +static void +gdata_picasaweb_file_class_init (GDataPicasaWebFileClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataPicasaWebFilePrivate)); + + gobject_class->constructor = gdata_picasaweb_file_constructor; + gobject_class->get_property = gdata_picasaweb_file_get_property; + gobject_class->set_property = gdata_picasaweb_file_set_property; + gobject_class->dispose = gdata_picasaweb_file_dispose; + gobject_class->finalize = gdata_picasaweb_file_finalize; + + parsable_class->get_xml = get_xml; + parsable_class->parse_xml = parse_xml; + parsable_class->get_namespaces = get_namespaces; + + entry_class->get_entry_uri = get_entry_uri; + entry_class->kind_term = "http://schemas.google.com/photos/2007#photo"; + + /** + * GDataPicasaWebFile:file-id: + * + * The ID of the file. This is a substring of the ID returned by gdata_entry_get_id() for #GDataPicasaWebFiles; for example, + * if gdata_entry_get_id() returned + * "http://picasaweb.google.com/data/entry/user/libgdata.picasaweb/albumid/5328889949261497249/photoid/5328890138794566386" for a + * particular #GDataPicasaWebFile, the #GDataPicasaWebFile:file-id property would be "5328890138794566386". + * + * For more information, see the + * gphoto specification. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_FILE_ID, + g_param_spec_string ("file-id", + "File ID", "The ID of the file.", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:version: + * + * The version number of the file. Version numbers are based on modification time, so they don't increment linearly. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_VERSION, + g_param_spec_string ("version", + "Version", "The version number of the file.", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:album-id: + * + * The ID for the file's album. This is in the same form as returned by gdata_picasaweb_album_get_id(). + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_ALBUM_ID, + g_param_spec_string ("album-id", + "Album ID", "The ID for the file's album.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:checksum: + * + * A checksum of the file, useful for duplicate detection. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_CHECKSUM, + g_param_spec_string ("checksum", + "Checksum", "A checksum of the file, useful for duplicate detection.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:video-status: + * + * The status of the file, if it is a video. For example: %GDATA_PICASAWEB_VIDEO_STATUS_PENDING or %GDATA_PICASAWEB_VIDEO_STATUS_FAILED. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_VIDEO_STATUS, + g_param_spec_string ("video-status", + "Video Status", "The status of the file, if it is a video.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:width: + * + * The width of the photo or video, in pixels. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_WIDTH, + g_param_spec_uint ("width", + "Width", "The width of the photo or video, in pixels.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:height: + * + * The height of the photo or video, in pixels. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_HEIGHT, + g_param_spec_uint ("height", + "Height", "The height of the photo or video, in pixels.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:size: + * + * The size of the file, in bytes. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_SIZE, + g_param_spec_ulong ("size", + "Size", "The size of the file, in bytes.", + 0, G_MAXULONG, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:edited: + * + * The time this file was last edited. If the file has not been edited yet, the content indicates the time it was created. + * + * For more information, see the + * Atom Publishing Protocol specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_EDITED, + g_param_spec_int64 ("edited", + "Edited", "The time this file was last edited.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:timestamp: + * + * The time the file was purportedly taken. This a UNIX timestamp in milliseconds (not seconds) since the epoch. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TIMESTAMP, + g_param_spec_int64 ("timestamp", + "Timestamp", "The time the file was purportedly taken.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:comment-count: + * + * The number of comments on the file. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_COMMENT_COUNT, + g_param_spec_uint ("comment-count", + "Comment Count", "The number of comments on the file.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:rotation: + * + * The rotation of the photo, in degrees. This will only be non-zero for files which are pending rotation, and haven't yet been + * permanently modified. For files which have already been rotated, this will be 0. + * + * For more information, see the + * gphoto specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_ROTATION, + g_param_spec_uint ("rotation", + "Rotation", "The rotation of the photo, in degrees.", + 0, 359, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:is-commenting-enabled: + * + * Whether commenting is enabled for this file. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_COMMENTING_ENABLED, + g_param_spec_boolean ("is-commenting-enabled", + "Commenting enabled?", "Indicates whether comments are enabled.", + TRUE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:credit: + * + * The nickname of the user credited with this file. + * + * For more information, see the Media RSS + * specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_CREDIT, + g_param_spec_string ("credit", + "Credit", "The nickname of the user credited with this file.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:caption: + * + * The file's descriptive caption. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_CAPTION, + g_param_spec_string ("caption", + "Caption", "The file's descriptive caption.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:tags: + * + * A %NULL-terminated array of tags associated with the file. + * + * For more information, see the + * Media RSS specification. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TAGS, + g_param_spec_boxed ("tags", + "Tags", "A NULL-terminated array of tags associated with the file.", + G_TYPE_STRV, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:distance: + * + * The distance to the subject reported in the image's EXIF. + * + * For more information, see the + * EXIF element reference. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_DISTANCE, + g_param_spec_double ("distance", + "Distance", "The distance to the subject.", + -1.0, G_MAXDOUBLE, -1.0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:exposure: + * + * The exposure time. + * + * For more information, see the + * EXIF element reference. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_EXPOSURE, + g_param_spec_double ("exposure", + "Exposure", "The exposure time.", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:flash: + * + * Indicates whether the flash was used. + * + * For more information, see the + * EXIF element reference. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_FLASH, + g_param_spec_boolean ("flash", + "Flash", "Indicates whether the flash was used.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:focal-length: + * + * The focal length for the shot. + * + * For more information, see the + * EXIF element reference. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_FOCAL_LENGTH, + g_param_spec_double ("focal-length", + "Focal Length", "The focal length used in the shot.", + -1.0, G_MAXDOUBLE, -1.0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /* TODO: Rename to f-stop */ + /** + * GDataPicasaWebFile:fstop: + * + * The F-stop value. + * + * For more information, see the + * EXIF element reference. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_FSTOP, + g_param_spec_double ("fstop", + "F-stop", "The F-stop used.", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:image-unique-id: + * + * An unique ID for the image found in the EXIF. + * + * For more information, see the + * EXIF element reference. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_IMAGE_UNIQUE_ID, + g_param_spec_string ("image-unique-id", + "Image Unique ID", "An unique ID for the image.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:iso: + * + * The ISO speed. + * + * For more information, see the + * EXIF element reference and ISO 5800:1987. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_ISO, + g_param_spec_long ("iso", + "ISO", "The ISO speed.", + -1, G_MAXLONG, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:make: + * + * The name of the manufacturer of the camera. + * + * For more information, see the + * EXIF element reference. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_MAKE, + g_param_spec_string ("make", + "Make", "The name of the manufacturer.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:model: + * + * The model of the camera. + * + * For more information, see the + * EXIF element reference. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_MODEL, + g_param_spec_string ("model", + "Model", "The model of the camera.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:latitude: + * + * The location as a latitude coordinate associated with this file. Valid latitudes range from -90.0 + * to 90.0 inclusive. + * + * For more information, see the + * GeoRSS specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_LATITUDE, + g_param_spec_double ("latitude", + "Latitude", "The location as a latitude coordinate associated with this file.", + -90.0, 90.0, 0.0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebFile:longitude: + * + * The location as a longitude coordinate associated with this file. Valid longitudes range from -180.0 + * to 180.0 inclusive. + * + * For more information, see the + * GeoRSS specification. + * + * Since: 0.5.0 + */ + g_object_class_install_property (gobject_class, PROP_LONGITUDE, + g_param_spec_double ("longitude", + "Longitude", "The location as a longitude coordinate associated with this file.", + -180.0, 180.0, 0.0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_picasaweb_file_commentable_init (GDataCommentableInterface *iface) +{ + iface->comment_type = GDATA_TYPE_PICASAWEB_COMMENT; + iface->get_authorization_domain = get_authorization_domain; + iface->get_query_comments_uri = get_query_comments_uri; + iface->get_insert_comment_uri = get_insert_comment_uri; + iface->is_comment_deletable = is_comment_deletable; +} + +static void +notify_title_cb (GDataPicasaWebFile *self, GParamSpec *pspec, gpointer user_data) +{ + /* Keep the atom:title and media:group/media:title in sync */ + if (self->priv->media_group != NULL) + gdata_media_group_set_title (self->priv->media_group, gdata_entry_get_title (GDATA_ENTRY (self))); +} + +static void +notify_summary_cb (GDataPicasaWebFile *self, GParamSpec *pspec, gpointer user_data) +{ + /* Keep the atom:summary and media:group/media:description in sync */ + if (self->priv->media_group != NULL) + gdata_media_group_set_description (self->priv->media_group, gdata_entry_get_summary (GDATA_ENTRY (self))); +} + +static void +gdata_picasaweb_file_init (GDataPicasaWebFile *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_PICASAWEB_FILE, GDataPicasaWebFilePrivate); + self->priv->media_group = g_object_new (GDATA_TYPE_MEDIA_GROUP, NULL); + self->priv->exif_tags = g_object_new (GDATA_TYPE_EXIF_TAGS, NULL); + self->priv->georss_where = g_object_new (GDATA_TYPE_GEORSS_WHERE, NULL); + self->priv->is_commenting_enabled = TRUE; + self->priv->edited = -1; + self->priv->timestamp = -1; + + /* We need to keep atom:title (the canonical title for the file) in sync with media:group/media:title */ + g_signal_connect (self, "notify::title", G_CALLBACK (notify_title_cb), NULL); + /* atom:summary (the canonical summary/caption for the file) in sync with media:group/media:description */ + g_signal_connect (self, "notify::summary", G_CALLBACK (notify_summary_cb), NULL); +} + +static GObject * +gdata_picasaweb_file_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) +{ + GObject *object; + + /* Chain up to the parent class */ + object = G_OBJECT_CLASS (gdata_picasaweb_file_parent_class)->constructor (type, n_construct_params, construct_params); + + if (_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object)) == FALSE) { + GDataPicasaWebFilePrivate *priv = GDATA_PICASAWEB_FILE (object)->priv; + GTimeVal time_val; + + /* Set the edited and timestamp properties to the current time (creation time). bgo#599140 + * We don't do this in *_init() since that would cause setting it from parse_xml() to fail (duplicate element). */ + g_get_current_time (&time_val); + priv->timestamp = (gint64) time_val.tv_sec * 1000; + priv->edited = time_val.tv_sec; + } + + return object; +} + +static void +gdata_picasaweb_file_dispose (GObject *object) +{ + GDataPicasaWebFilePrivate *priv = GDATA_PICASAWEB_FILE (object)->priv; + + if (priv->media_group != NULL) + g_object_unref (priv->media_group); + priv->media_group = NULL; + + if (priv->exif_tags != NULL) + g_object_unref (priv->exif_tags); + priv->exif_tags = NULL; + + if (priv->georss_where != NULL) + g_object_unref (priv->georss_where); + priv->georss_where = NULL; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_picasaweb_file_parent_class)->dispose (object); +} + +static void +gdata_picasaweb_file_finalize (GObject *object) +{ + GDataPicasaWebFilePrivate *priv = GDATA_PICASAWEB_FILE (object)->priv; + + g_free (priv->file_id); + g_free (priv->version); + g_free (priv->album_id); + g_free (priv->checksum); + g_free (priv->video_status); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_picasaweb_file_parent_class)->finalize (object); +} + +static void +gdata_picasaweb_file_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataPicasaWebFilePrivate *priv = GDATA_PICASAWEB_FILE (object)->priv; + + switch (property_id) { + case PROP_FILE_ID: + g_value_set_string (value, priv->file_id); + break; + case PROP_EDITED: + g_value_set_int64 (value, priv->edited); + break; + case PROP_VERSION: + g_value_set_string (value, priv->version); + break; + case PROP_ALBUM_ID: + g_value_set_string (value, priv->album_id); + break; + case PROP_WIDTH: + g_value_set_uint (value, priv->width); + break; + case PROP_HEIGHT: + g_value_set_uint (value, priv->height); + break; + case PROP_SIZE: + g_value_set_ulong (value, priv->size); + break; + case PROP_CHECKSUM: + g_value_set_string (value, priv->checksum); + break; + case PROP_TIMESTAMP: + g_value_set_int64 (value, priv->timestamp); + break; + case PROP_IS_COMMENTING_ENABLED: + g_value_set_boolean (value, priv->is_commenting_enabled); + break; + case PROP_COMMENT_COUNT: + g_value_set_uint (value, priv->comment_count); + break; + case PROP_ROTATION: + g_value_set_uint (value, priv->rotation); + break; + case PROP_VIDEO_STATUS: + g_value_set_string (value, priv->video_status); + break; + case PROP_CREDIT: { + GDataMediaCredit *credit = gdata_media_group_get_credit (priv->media_group); + g_value_set_string (value, gdata_media_credit_get_credit (credit)); + break; } + case PROP_CAPTION: + g_value_set_string (value, gdata_entry_get_summary (GDATA_ENTRY (object))); + break; + case PROP_TAGS: + g_value_set_boxed (value, gdata_media_group_get_keywords (priv->media_group)); + break; + case PROP_DISTANCE: + g_value_set_double (value, gdata_exif_tags_get_distance (priv->exif_tags)); + break; + case PROP_EXPOSURE: + g_value_set_double (value, gdata_exif_tags_get_exposure (priv->exif_tags)); + break; + case PROP_FLASH: + g_value_set_boolean (value, gdata_exif_tags_get_flash (priv->exif_tags)); + break; + case PROP_FOCAL_LENGTH: + g_value_set_double (value, gdata_exif_tags_get_focal_length (priv->exif_tags)); + break; + case PROP_FSTOP: + g_value_set_double (value, gdata_exif_tags_get_fstop (priv->exif_tags)); + break; + case PROP_IMAGE_UNIQUE_ID: + g_value_set_string (value, gdata_exif_tags_get_image_unique_id (priv->exif_tags)); + break; + case PROP_ISO: + g_value_set_long (value, gdata_exif_tags_get_iso (priv->exif_tags)); + break; + case PROP_MAKE: + g_value_set_string (value, gdata_exif_tags_get_make (priv->exif_tags)); + break; + case PROP_MODEL: + g_value_set_string (value, gdata_exif_tags_get_model (priv->exif_tags)); + break; + case PROP_LATITUDE: + g_value_set_double (value, gdata_georss_where_get_latitude (priv->georss_where)); + break; + case PROP_LONGITUDE: + g_value_set_double (value, gdata_georss_where_get_longitude (priv->georss_where)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_picasaweb_file_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataPicasaWebFile *self = GDATA_PICASAWEB_FILE (object); + + switch (property_id) { + case PROP_FILE_ID: + /* Construct only */ + g_free (self->priv->file_id); + self->priv->file_id = g_value_dup_string (value); + break; + case PROP_VERSION: + /* Construct only */ + g_free (self->priv->version); + self->priv->version = g_value_dup_string (value); + break; + case PROP_ALBUM_ID: + /* TODO: do we allow this to change albums? I think that's how pictures are moved. */ + gdata_picasaweb_file_set_album_id (self, g_value_get_string (value)); + break; + case PROP_CHECKSUM: + gdata_picasaweb_file_set_checksum (self, g_value_get_string (value)); + break; + case PROP_TIMESTAMP: + gdata_picasaweb_file_set_timestamp (self, g_value_get_int64 (value)); + break; + case PROP_IS_COMMENTING_ENABLED: /* TODO I don't think we can change this on a per file basis */ + gdata_picasaweb_file_set_is_commenting_enabled (self, g_value_get_boolean (value)); + break; + case PROP_ROTATION: + gdata_picasaweb_file_set_rotation (self, g_value_get_uint (value)); + break; + case PROP_CAPTION: + gdata_picasaweb_file_set_caption (self, g_value_get_string (value)); + break; + case PROP_TAGS: + gdata_picasaweb_file_set_tags (self, g_value_get_boxed (value)); + break; + case PROP_LATITUDE: + gdata_picasaweb_file_set_coordinates (self, g_value_get_double (value), + gdata_georss_where_get_longitude (self->priv->georss_where)); + break; + case PROP_LONGITUDE: + gdata_picasaweb_file_set_coordinates (self, gdata_georss_where_get_latitude (self->priv->georss_where), + g_value_get_double (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataPicasaWebFile *self = GDATA_PICASAWEB_FILE (parsable); + + /* TODO: media:group should also be P_NO_DUPES, but we can't, as priv->media_group has to be pre-populated + * in order for things like gdata_picasaweb_file_set_description() to work. */ + if (gdata_parser_is_namespace (node, "http://www.w3.org/2007/app") == TRUE && + gdata_parser_int64_time_from_element (node, "edited", P_REQUIRED | P_NO_DUPES, &(self->priv->edited), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://search.yahoo.com/mrss/") == TRUE && + gdata_parser_object_from_element (node, "group", P_REQUIRED, GDATA_TYPE_MEDIA_GROUP, + &(self->priv->media_group), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://www.georss.org/georss") == TRUE && + gdata_parser_object_from_element (node, "where", P_REQUIRED, GDATA_TYPE_GEORSS_WHERE, + &(self->priv->georss_where), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/photos/exif/2007") == TRUE && + gdata_parser_object_from_element (node, "tags", P_REQUIRED, GDATA_TYPE_EXIF_TAGS, + &(self->priv->exif_tags), &success, error) == TRUE) { + return success; + } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/photos/2007") == TRUE) { + if (gdata_parser_string_from_element (node, "videostatus", P_NO_DUPES, &(self->priv->video_status), &success, error) == TRUE || + gdata_parser_string_from_element (node, "imageVersion", P_NONE, &(self->priv->version), &success, error) == TRUE || + gdata_parser_string_from_element (node, "albumid", P_NONE, &(self->priv->album_id), &success, error) == TRUE || + gdata_parser_string_from_element (node, "checksum", P_NONE, &(self->priv->checksum), &success, error) == TRUE || + gdata_parser_string_from_element (node, "id", P_REQUIRED | P_NON_EMPTY | P_NO_DUPES, + &(self->priv->file_id), &success, error) == TRUE) { + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "width") == 0) { + /* gphoto:width */ + xmlChar *width = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->width = g_ascii_strtoull ((gchar*) width, NULL, 10); + xmlFree (width); + } else if (xmlStrcmp (node->name, (xmlChar*) "height") == 0) { + /* gphoto:height */ + xmlChar *height = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->height = g_ascii_strtoull ((gchar*) height, NULL, 10); + xmlFree (height); + } else if (xmlStrcmp (node->name, (xmlChar*) "size") == 0) { + /* gphoto:size */ + xmlChar *size = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->size = g_ascii_strtoull ((gchar*) size, NULL, 10); + xmlFree (size); + } else if (xmlStrcmp (node->name, (xmlChar*) "timestamp") == 0) { + /* gphoto:timestamp */ + xmlChar *timestamp_str; + guint64 milliseconds; + + timestamp_str = xmlNodeListGetString (doc, node->children, TRUE); + milliseconds = g_ascii_strtoull ((gchar*) timestamp_str, NULL, 10); + xmlFree (timestamp_str); + + gdata_picasaweb_file_set_timestamp (self, (gint64) milliseconds); + } else if (xmlStrcmp (node->name, (xmlChar*) "commentingEnabled") == 0) { + /* gphoto:commentingEnabled */ + xmlChar *is_commenting_enabled = xmlNodeListGetString (doc, node->children, TRUE); + if (is_commenting_enabled == NULL) + return gdata_parser_error_required_content_missing (node, error); + self->priv->is_commenting_enabled = (xmlStrcmp (is_commenting_enabled, (xmlChar*) "true") == 0 ? TRUE : FALSE); + xmlFree (is_commenting_enabled); + } else if (xmlStrcmp (node->name, (xmlChar*) "commentCount") == 0) { + /* gphoto:commentCount */ + xmlChar *comment_count = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->comment_count = g_ascii_strtoull ((gchar*) comment_count, NULL, 10); + xmlFree (comment_count); + } else if (xmlStrcmp (node->name, (xmlChar*) "access") == 0) { + /* gphoto:access */ + /* Visibility is already obtained through the album. When PicasaWeb supports per-file access restrictions, + * we'll expose this property. Until then, we'll catch this to suppress the Unhandled XML warning. + * See https://bugzilla.gnome.org/show_bug.cgi?id=589858 */ + } else if (xmlStrcmp (node->name, (xmlChar*) "rotation") == 0) { + /* gphoto:rotation */ + xmlChar *rotation = xmlNodeListGetString (doc, node->children, TRUE); + gdata_picasaweb_file_set_rotation (self, g_ascii_strtoull ((gchar*) rotation, NULL, 10)); + xmlFree (rotation); + } else { + return GDATA_PARSABLE_CLASS (gdata_picasaweb_file_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else { + return GDATA_PARSABLE_CLASS (gdata_picasaweb_file_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static void +get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataPicasaWebFilePrivate *priv = GDATA_PICASAWEB_FILE (parsable)->priv; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_picasaweb_file_parent_class)->get_xml (parsable, xml_string); + + /* Add all the PicasaWeb-specific XML */ + if (priv->file_id != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->file_id, ""); + + if (priv->version != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->version, ""); + + if (priv->album_id != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->album_id, ""); + + if (priv->checksum != NULL) + gdata_parser_string_append_escaped (xml_string, "", priv->checksum, ""); + + if (priv->timestamp != -1) { + /* timestamp is in milliseconds */ + g_string_append_printf (xml_string, "%" G_GINT64_FORMAT "", priv->timestamp); + } + + if (priv->is_commenting_enabled == TRUE) + g_string_append (xml_string, "true"); + else + g_string_append (xml_string, "false"); + + if (priv->rotation > 0) + g_string_append_printf (xml_string, "%u", priv->rotation); + + /* media:group */ + _gdata_parsable_get_xml (GDATA_PARSABLE (priv->media_group), xml_string, FALSE); + + /* georss:where */ + if (priv->georss_where != NULL && gdata_georss_where_get_latitude (priv->georss_where) != G_MAXDOUBLE && + gdata_georss_where_get_longitude (priv->georss_where) != G_MAXDOUBLE) { + _gdata_parsable_get_xml (GDATA_PARSABLE (priv->georss_where), xml_string, FALSE); + } + + /* TODO: + * - Finish supporting all tags + * - Check all tags here are valid for insertions and updates + */ +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + GDataPicasaWebFilePrivate *priv = GDATA_PICASAWEB_FILE (parsable)->priv; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_picasaweb_file_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "gphoto", (gchar*) "http://schemas.google.com/photos/2007"); + g_hash_table_insert (namespaces, (gchar*) "app", (gchar*) "http://www.w3.org/2007/app"); + + /* Add the media:group namespaces */ + GDATA_PARSABLE_GET_CLASS (priv->media_group)->get_namespaces (GDATA_PARSABLE (priv->media_group), namespaces); + /* Add the exif:tags namespaces */ + GDATA_PARSABLE_GET_CLASS (priv->exif_tags)->get_namespaces (GDATA_PARSABLE (priv->exif_tags), namespaces); + /* Add the georss:where namespaces */ + GDATA_PARSABLE_GET_CLASS (priv->georss_where)->get_namespaces (GDATA_PARSABLE (priv->georss_where), namespaces); +} + +static gchar * +get_entry_uri (const gchar *id) +{ + /* For files, the ID is of the form: "http://picasaweb.google.com/data/entry/user/liz/albumid/albumID/photoid/photoID" + * whereas the URI is of the form: "http://picasaweb.google.com/data/entry/api/user/liz/albumid/albumID/photoid/photoID" */ + gchar **parts, *uri; + + parts = g_strsplit (id, "/entry/user/", 2); + g_assert (parts[0] != NULL && parts[1] != NULL && parts[2] == NULL); + uri = g_strconcat (parts[0], "/entry/api/user/", parts[1], NULL); + g_strfreev (parts); + + return uri; +} + +GDataAuthorizationDomain * +get_authorization_domain (GDataCommentable *self) +{ + return gdata_picasaweb_service_get_primary_authorization_domain (); +} + +static gchar * +get_query_comments_uri (GDataCommentable *self) +{ + GDataLink *_link; + SoupURI *uri; + GHashTable *query; + gchar *output_uri; + + /* Get the feed link of the form: https://picasaweb.google.com/data/feed/api/user/[userID]/albumid/[albumID]/photoid/[photoID] */ + _link = gdata_entry_look_up_link (GDATA_ENTRY (self), "http://schemas.google.com/g/2005#feed"); + g_assert (_link != NULL); + + /* We're going to query the comments belonging to the photo, so add the comment kind. This link isn't available as a normal on + * photos. It's of the form: https://picasaweb.google.com/data/feed/api/user/[userID]/albumid/[albumID]/photoid/[photoID]?kind=comment */ + uri = soup_uri_new (gdata_link_get_uri (_link)); + query = soup_form_decode (uri->query); + + g_hash_table_replace (query, g_strdup ("kind"), (gchar*) "comment"); /* libsoup only specifies a destruction function for the key */ + soup_uri_set_query_from_form (uri, query); + output_uri = soup_uri_to_string (uri, FALSE); + + g_hash_table_destroy (query); + soup_uri_free (uri); + + return output_uri; +} + +static gchar * +get_insert_comment_uri (GDataCommentable *self, GDataComment *comment_) +{ + GDataLink *_link; + + _link = gdata_entry_look_up_link (GDATA_ENTRY (self), "http://schemas.google.com/g/2005#feed"); + g_assert (_link != NULL); + + return g_strdup (gdata_link_get_uri (_link)); +} + +static gboolean +is_comment_deletable (GDataCommentable *self, GDataComment *comment_) +{ + return (gdata_entry_look_up_link (GDATA_ENTRY (comment_), GDATA_LINK_EDIT) != NULL) ? TRUE : FALSE; +} + +/** + * gdata_picasaweb_file_new: + * @id: (allow-none): the file's ID, or %NULL + * + * Creates a new #GDataPicasaWebFile with the given ID and default properties. + * + * Return value: a new #GDataPicasaWebFile; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataPicasaWebFile * +gdata_picasaweb_file_new (const gchar *id) +{ + const gchar *file_id = NULL, *i; + + if (id != NULL) { + file_id = g_strrstr (id, "/"); + if (file_id == NULL) + return NULL; + file_id++; /* skip the slash */ + + /* Ensure the @file_id is entirely numeric */ + for (i = file_id; *i != '\0'; i = g_utf8_next_char (i)) { + if (g_unichar_isdigit (g_utf8_get_char (i)) == FALSE) + return NULL; + } + } + + return GDATA_PICASAWEB_FILE (g_object_new (GDATA_TYPE_PICASAWEB_FILE, "id", id, "file-id", file_id, NULL)); +} + +/** + * gdata_picasaweb_file_get_id: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:file-id property. + * + * Return value: the file's ID + * + * Since: 0.7.0 + */ +const gchar * +gdata_picasaweb_file_get_id (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return self->priv->file_id; +} + +/** + * gdata_picasaweb_file_get_edited: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:edited property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the file was last edited, or -1 + * + * Since: 0.4.0 + */ +gint64 +gdata_picasaweb_file_get_edited (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), -1); + return self->priv->edited; +} + +/** + * gdata_picasaweb_file_get_version: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:version property. + * + * Return value: the file's version number, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_file_get_version (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return self->priv->version; +} + +/** + * gdata_picasaweb_file_get_album_id: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:album-id property. This is in the same form as returned by gdata_picasaweb_album_get_id(). + * + * Return value: the ID of the album containing the #GDataPicasaWebFile + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_file_get_album_id (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return self->priv->album_id; +} + +/** + * gdata_picasaweb_file_set_album_id: + * @self: a #GDataPicasaWebFile + * @album_id: the ID of the new album for this file + * + * Sets the #GDataPicasaWebFile:album-id property, effectively moving the file to the album. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_file_set_album_id (GDataPicasaWebFile *self, const gchar *album_id) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_FILE (self)); + g_return_if_fail (album_id != NULL && *album_id != '\0'); + + g_free (self->priv->album_id); + self->priv->album_id = g_strdup (album_id); + g_object_notify (G_OBJECT (self), "album-id"); +} + +/** + * gdata_picasaweb_file_get_width: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:width property. + * + * Return value: the width of the image or video, in pixels + * + * Since: 0.4.0 + */ +guint +gdata_picasaweb_file_get_width (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), 0); + return self->priv->width; +} + +/** + * gdata_picasaweb_file_get_height: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:height property. + * + * Return value: the height of the image or video, in pixels + * + * Since: 0.4.0 + */ +guint +gdata_picasaweb_file_get_height (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), 0); + return self->priv->height; +} + +/** + * gdata_picasaweb_file_get_size: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:size property. + * + * Return value: the size of the file, in bytes + * + * Since: 0.4.0 + */ +gsize +gdata_picasaweb_file_get_size (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), 0); + return self->priv->size; +} + +/** + * gdata_picasaweb_file_get_checksum: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:checksum property. + * + * Return value: the checksum assigned to this file, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_file_get_checksum (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return self->priv->checksum; +} + +/** + * gdata_picasaweb_file_set_checksum: + * @self: a #GDataPicasaWebFile + * @checksum: (allow-none): the new checksum for this file, or %NULL + * + * Sets the #GDataPicasaWebFile:checksum property to @checksum. + * + * Set @checksum to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_file_set_checksum (GDataPicasaWebFile *self, const gchar *checksum) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_FILE (self)); + + g_free (self->priv->checksum); + self->priv->checksum = g_strdup (checksum); + g_object_notify (G_OBJECT (self), "checksum"); +} + +/** + * gdata_picasaweb_file_get_timestamp: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:timestamp property. It's a UNIX timestamp in milliseconds (not seconds) since the epoch. If the property is unset, + * -1 will be returned. + * + * Return value: the UNIX timestamp for the timestamp property in milliseconds, or -1 + * + * Since: 0.4.0 + */ +gint64 +gdata_picasaweb_file_get_timestamp (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), -1); + return self->priv->timestamp; +} + +/** + * gdata_picasaweb_file_set_timestamp: + * @self: a #GDataPicasaWebFile + * @timestamp: a UNIX timestamp, or -1 + * + * Sets the #GDataPicasaWebFile:timestamp property from @timestamp. This should be a UNIX timestamp in milliseconds (not seconds) since the epoch. If + * @timestamp is -1, the property will be unset. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_file_set_timestamp (GDataPicasaWebFile *self, gint64 timestamp) +{ + /* RHSTODO: I think the timestamp value is just being + over-ridden by the file's actual EXIF time value; unless + we're setting this incorrectly here or in get_xml(); test that */ + /* RHSTODO: improve testing of setters in tests/picasa.c */ + + g_return_if_fail (GDATA_IS_PICASAWEB_FILE (self)); + g_return_if_fail (timestamp >= -1); + + self->priv->timestamp = timestamp; + g_object_notify (G_OBJECT (self), "timestamp"); +} + +/** + * gdata_picasaweb_file_is_commenting_enabled: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:is-commenting-enabled property. + * + * Return value: %TRUE if commenting is enabled, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_picasaweb_file_is_commenting_enabled (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), FALSE); + return self->priv->is_commenting_enabled; +} + +/** + * gdata_picasaweb_file_set_is_commenting_enabled: + * @self: a #GDataPicasaWebFile + * @is_commenting_enabled: %TRUE if commenting should be enabled for the file, %FALSE otherwise + * + * Sets the #GDataPicasaWebFile:is-commenting-enabled property to @is_commenting_enabled. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_file_set_is_commenting_enabled (GDataPicasaWebFile *self, gboolean is_commenting_enabled) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_FILE (self)); + self->priv->is_commenting_enabled = is_commenting_enabled; + g_object_notify (G_OBJECT (self), "is-commenting-enabled"); +} + +/** + * gdata_picasaweb_file_get_comment_count: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:comment-count property. + * + * Return value: the number of comments on the file + * + * Since: 0.4.0 + */ +guint +gdata_picasaweb_file_get_comment_count (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), 0); + return self->priv->comment_count; +} + +/** + * gdata_picasaweb_file_get_rotation: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:rotation property. + * + * Return value: the image's rotation, in degrees + * + * Since: 0.4.0 + */ +guint +gdata_picasaweb_file_get_rotation (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), 0); + return self->priv->rotation; +} + +/** + * gdata_picasaweb_file_set_rotation: + * @self: a #GDataPicasaWebFile + * @rotation: the new rotation for the image, in degrees + * + * Sets the #GDataPicasaWebFile:rotation property to @rotation. + * + * The rotation is absolute, rather than cumulative, through successive calls to gdata_picasaweb_file_set_rotation(), + * so calling it with 90° then 20° will result in a final rotation of 20°. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_file_set_rotation (GDataPicasaWebFile *self, guint rotation) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_FILE (self)); + self->priv->rotation = rotation % 360; + g_object_notify (G_OBJECT (self), "rotation"); +} + + +/** + * gdata_picasaweb_file_get_video_status: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:video-status property. + * + * Return value: the status of this video ("pending", "ready", "final" or "failed"), or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_file_get_video_status (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return self->priv->video_status; +} + +/** + * gdata_picasaweb_file_get_tags: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:tags property. + * + * Return value: (array zero-terminated=1) (transfer none): a %NULL-terminated array of tags associated with the file, or %NULL + * + * Since: 0.4.0 + */ +const gchar * const * +gdata_picasaweb_file_get_tags (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return gdata_media_group_get_keywords (self->priv->media_group); +} + +/** + * gdata_picasaweb_file_set_tags: + * @self: a #GDataPicasaWebFile + * @tags: (array zero-terminated=1) (allow-none): a new %NULL-terminated array of tags, or %NULL + * + * Sets the #GDataPicasaWebFile:tags property to @tags. + * + * Set @tags to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_file_set_tags (GDataPicasaWebFile *self, const gchar * const *tags) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_FILE (self)); + + gdata_media_group_set_keywords (self->priv->media_group, tags); + g_object_notify (G_OBJECT (self), "tags"); +} + +/** + * gdata_picasaweb_file_get_credit: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:credit property. + * + * Return value: the nickname of the user credited with this file + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_file_get_credit (GDataPicasaWebFile *self) +{ + GDataMediaCredit *credit; + + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + + credit = gdata_media_group_get_credit (self->priv->media_group); + return (credit == NULL) ? NULL : gdata_media_credit_get_credit (credit); +} + +/** + * gdata_picasaweb_file_get_caption: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:caption property. + * + * Return value: the file's descriptive caption, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_file_get_caption (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return gdata_entry_get_summary (GDATA_ENTRY (self)); +} + +/** + * gdata_picasaweb_file_set_caption: + * @self: a #GDataPicasaWebFile + * @caption: (allow-none): the file's new caption, or %NULL + * + * Sets the #GDataPicasaWebFile:caption property to @caption. + * + * Set @caption to %NULL to unset the file's caption. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_file_set_caption (GDataPicasaWebFile *self, const gchar *caption) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_FILE (self)); + + gdata_entry_set_summary (GDATA_ENTRY (self), caption); + gdata_media_group_set_description (self->priv->media_group, caption); + g_object_notify (G_OBJECT (self), "caption"); +} + +/** + * gdata_picasaweb_file_get_contents: + * @self: a #GDataPicasaWebFile + * + * Returns a list of media content, e.g. the actual photo or video. + * + * Return value: (element-type GData.MediaContent) (transfer none): a #GList of #GDataMediaContent items + * + * Since: 0.4.0 + */ +GList * +gdata_picasaweb_file_get_contents (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return gdata_media_group_get_contents (self->priv->media_group); +} + +/** + * gdata_picasaweb_file_get_thumbnails: + * @self: a #GDataPicasaWebFile + * + * Returns a list of thumbnails, often at different sizes, for this + * file. Currently, PicasaWeb usually returns three thumbnails, with + * widths in pixels of 72, 144, and 288. However, the thumbnail will + * not be larger than the actual image, so thumbnails may be smaller + * than the widths listed above. + * + * Return value: (element-type GData.MediaThumbnail) (transfer none): a #GList of #GDataMediaThumbnails, or %NULL + * + * Since: 0.4.0 + */ +GList * +gdata_picasaweb_file_get_thumbnails (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return gdata_media_group_get_thumbnails (self->priv->media_group); +} + +/** + * gdata_picasaweb_file_get_distance: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:distance property. + * + * Return value: the distance recorded in the photo's EXIF, or -1 if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_picasaweb_file_get_distance (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), -1); + return gdata_exif_tags_get_distance (self->priv->exif_tags); +} + +/** + * gdata_picasaweb_file_get_exposure: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:exposure property. + * + * Return value: the exposure value, or 0 if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_picasaweb_file_get_exposure (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), 0); + return gdata_exif_tags_get_exposure (self->priv->exif_tags); +} + +/** + * gdata_picasaweb_file_get_flash: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:flash property. + * + * Return value: %TRUE if flash was used, %FALSE otherwise + * + * Since: 0.5.0 + */ +gboolean +gdata_picasaweb_file_get_flash (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), FALSE); + return gdata_exif_tags_get_flash (self->priv->exif_tags); +} + +/** + * gdata_picasaweb_file_get_focal_length: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:focal-length property. + * + * Return value: the focal-length value, or -1 if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_picasaweb_file_get_focal_length (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), -1); + return gdata_exif_tags_get_focal_length (self->priv->exif_tags); +} + +/** + * gdata_picasaweb_file_get_fstop: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:fstop property. + * + * Return value: the F-stop value, or 0 if unknown + * + * Since: 0.5.0 + */ +gdouble +gdata_picasaweb_file_get_fstop (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), 0); + return gdata_exif_tags_get_fstop (self->priv->exif_tags); +} + +/** + * gdata_picasaweb_file_get_image_unique_id: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:image-unique-id property. + * + * Return value: the photo's unique EXIF identifier, or %NULL + * + * Since: 0.5.0 + */ +const gchar * +gdata_picasaweb_file_get_image_unique_id (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return gdata_exif_tags_get_image_unique_id (self->priv->exif_tags); +} + +/** + * gdata_picasaweb_file_get_iso: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:iso property. + * + * Return value: the ISO speed, or -1 if unknown + * + * Since: 0.5.0 + */ +gint +gdata_picasaweb_file_get_iso (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), -1); + return gdata_exif_tags_get_iso (self->priv->exif_tags); +} + +/** + * gdata_picasaweb_file_get_make: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:make property. + * + * Return value: the name of the manufacturer of the camera, or %NULL if unknown + * + * Since: 0.5.0 + */ +const gchar * +gdata_picasaweb_file_get_make (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return gdata_exif_tags_get_make (self->priv->exif_tags); +} + +/** + * gdata_picasaweb_file_get_model: + * @self: a #GDataPicasaWebFile + * + * Gets the #GDataPicasaWebFile:model property. + * + * Return value: the model name of the camera, or %NULL if unknown + * + * Since: 0.5.0 + */ +const gchar * +gdata_picasaweb_file_get_model (GDataPicasaWebFile *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (self), NULL); + return gdata_exif_tags_get_model (self->priv->exif_tags); +} + +/** + * gdata_picasaweb_file_get_coordinates: + * @self: a #GDataPicasaWebFile + * @latitude: (out caller-allocates) (allow-none): return location for the latitude, or %NULL + * @longitude: (out caller-allocates) (allow-none): return location for the longitude, or %NULL + * + * Gets the #GDataPicasaWebFile:latitude and #GDataPicasaWebFile:longitude properties, setting the out parameters to them. + * If either latitude or longitude is %NULL, that parameter will not be set. If the coordinates are unset, + * @latitude and @longitude will be set to %G_MAXDOUBLE. + * + * Since: 0.5.0 + */ +void +gdata_picasaweb_file_get_coordinates (GDataPicasaWebFile *self, gdouble *latitude, gdouble *longitude) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_FILE (self)); + + if (latitude != NULL) + *latitude = gdata_georss_where_get_latitude (self->priv->georss_where); + if (longitude != NULL) + *longitude = gdata_georss_where_get_longitude (self->priv->georss_where); +} + +/** + * gdata_picasaweb_file_set_coordinates: + * @self: a #GDataPicasaWebFile + * @latitude: the file's new latitude coordinate, or %G_MAXDOUBLE + * @longitude: the file's new longitude coordinate, or %G_MAXDOUBLE + * + * Sets the #GDataPicasaWebFile:latitude and #GDataPicasaWebFile:longitude properties to + * @latitude and @longitude respectively. + * + * Since: 0.5.0 + */ +void +gdata_picasaweb_file_set_coordinates (GDataPicasaWebFile *self, gdouble latitude, gdouble longitude) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_FILE (self)); + + gdata_georss_where_set_latitude (self->priv->georss_where, latitude); + gdata_georss_where_set_longitude (self->priv->georss_where, longitude); + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "latitude"); + g_object_notify (G_OBJECT (self), "longitude"); + g_object_thaw_notify (G_OBJECT (self)); +} diff --git a/gdata/services/picasaweb/gdata-picasaweb-file.h b/gdata/services/picasaweb/gdata-picasaweb-file.h new file mode 100644 index 0000000..1bd9f0f --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-file.h @@ -0,0 +1,154 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_PICASAWEB_FILE_H +#define GDATA_PICASAWEB_FILE_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_PICASAWEB_VIDEO_STATUS_PENDING: + * + * The video is still being processed. + * + * Since: 0.7.0 + */ +#define GDATA_PICASAWEB_VIDEO_STATUS_PENDING "pending" + +/** + * GDATA_PICASAWEB_VIDEO_STATUS_READY: + * + * The video has been processed, but still needs thumbnailing. + * + * Since: 0.7.0 + */ +#define GDATA_PICASAWEB_VIDEO_STATUS_READY "ready" + +/** + * GDATA_PICASAWEB_VIDEO_STATUS_FINAL: + * + * The video has been processed and thumbnailed. + * + * Since: 0.7.0 + */ +#define GDATA_PICASAWEB_VIDEO_STATUS_FINAL "final" + +/** + * GDATA_PICASAWEB_VIDEO_STATUS_FAILED: + * + * There was an error while processing or thumbnailing the video and it should be deleted. + * + * Since: 0.7.0 + */ +#define GDATA_PICASAWEB_VIDEO_STATUS_FAILED "failed" + +#define GDATA_TYPE_PICASAWEB_FILE (gdata_picasaweb_file_get_type ()) +#define GDATA_PICASAWEB_FILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_PICASAWEB_FILE, GDataPicasaWebFile)) +#define GDATA_PICASAWEB_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_PICASAWEB_FILE, GDataPicasaWebFileClass)) +#define GDATA_IS_PICASAWEB_FILE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_PICASAWEB_FILE)) +#define GDATA_IS_PICASAWEB_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_PICASAWEB_FILE)) +#define GDATA_PICASAWEB_FILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_PICASAWEB_FILE, GDataPicasaWebFileClass)) + +typedef struct _GDataPicasaWebFilePrivate GDataPicasaWebFilePrivate; + +/** + * GDataPicasaWebFile: + * + * All the fields in the #GDataPicasaWebFile structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataEntry parent; + GDataPicasaWebFilePrivate *priv; +} GDataPicasaWebFile; + +/** + * GDataPicasaWebFileClass: + * + * All the fields in the #GDataPicasaWebFileClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataPicasaWebFileClass; + +GType gdata_picasaweb_file_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataPicasaWebFile, g_object_unref) + +GDataPicasaWebFile *gdata_picasaweb_file_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_picasaweb_file_get_id (GDataPicasaWebFile *self) G_GNUC_PURE; +gint64 gdata_picasaweb_file_get_edited (GDataPicasaWebFile *self); +const gchar *gdata_picasaweb_file_get_version (GDataPicasaWebFile *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_file_get_album_id (GDataPicasaWebFile *self) G_GNUC_PURE; +/* TODO should we have a more obvious _move() API too? nah */ +void gdata_picasaweb_file_set_album_id (GDataPicasaWebFile *self, const gchar *album_id); +guint gdata_picasaweb_file_get_width (GDataPicasaWebFile *self) G_GNUC_PURE; +guint gdata_picasaweb_file_get_height (GDataPicasaWebFile *self) G_GNUC_PURE; +gsize gdata_picasaweb_file_get_size (GDataPicasaWebFile *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_file_get_checksum (GDataPicasaWebFile *self) G_GNUC_PURE; +void gdata_picasaweb_file_set_checksum (GDataPicasaWebFile *self, const gchar *checksum); +gint64 gdata_picasaweb_file_get_timestamp (GDataPicasaWebFile *self); +void gdata_picasaweb_file_set_timestamp (GDataPicasaWebFile *self, gint64 timestamp); +gboolean gdata_picasaweb_file_is_commenting_enabled (GDataPicasaWebFile *self) G_GNUC_PURE; +void gdata_picasaweb_file_set_is_commenting_enabled (GDataPicasaWebFile *self, gboolean is_commenting_enabled); +guint gdata_picasaweb_file_get_comment_count (GDataPicasaWebFile *self) G_GNUC_PURE; +guint gdata_picasaweb_file_get_rotation (GDataPicasaWebFile *self) G_GNUC_PURE; +void gdata_picasaweb_file_set_rotation (GDataPicasaWebFile *self, guint rotation); +const gchar *gdata_picasaweb_file_get_video_status (GDataPicasaWebFile *self) G_GNUC_PURE; +const gchar * const *gdata_picasaweb_file_get_tags (GDataPicasaWebFile *self) G_GNUC_PURE; +void gdata_picasaweb_file_set_tags (GDataPicasaWebFile *self, const gchar * const *tags); +const gchar *gdata_picasaweb_file_get_credit (GDataPicasaWebFile *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_file_get_caption (GDataPicasaWebFile *self) G_GNUC_PURE; +void gdata_picasaweb_file_set_caption (GDataPicasaWebFile *self, const gchar *caption); +GList *gdata_picasaweb_file_get_contents (GDataPicasaWebFile *self) G_GNUC_PURE; +GList *gdata_picasaweb_file_get_thumbnails (GDataPicasaWebFile *self) G_GNUC_PURE; +gdouble gdata_picasaweb_file_get_distance (GDataPicasaWebFile *self) G_GNUC_PURE; +gdouble gdata_picasaweb_file_get_exposure (GDataPicasaWebFile *self) G_GNUC_PURE; +gboolean gdata_picasaweb_file_get_flash (GDataPicasaWebFile *self) G_GNUC_PURE; +gdouble gdata_picasaweb_file_get_focal_length (GDataPicasaWebFile *self) G_GNUC_PURE; +gdouble gdata_picasaweb_file_get_fstop (GDataPicasaWebFile *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_file_get_image_unique_id (GDataPicasaWebFile *self) G_GNUC_PURE; +gint gdata_picasaweb_file_get_iso (GDataPicasaWebFile *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_file_get_make (GDataPicasaWebFile *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_file_get_model (GDataPicasaWebFile *self) G_GNUC_PURE; +void gdata_picasaweb_file_get_coordinates (GDataPicasaWebFile *self, gdouble *latitude, gdouble *longitude); +void gdata_picasaweb_file_set_coordinates (GDataPicasaWebFile *self, gdouble latitude, gdouble longitude); + +/* TODO implement is video */ +/* TODO implement get comments */ + +G_END_DECLS + +#endif /* !GDATA_PICASAWEB_FILE_H */ diff --git a/gdata/services/picasaweb/gdata-picasaweb-query.c b/gdata/services/picasaweb/gdata-picasaweb-query.c new file mode 100644 index 0000000..5785157 --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-query.c @@ -0,0 +1,608 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-picasaweb-query + * @short_description: GData PicasaWeb query object + * @stability: Stable + * @include: gdata/services/picasaweb/gdata-picasaweb-query.h + * + * #GDataPicasaWebQuery represents a collection of query parameters specific to the Google PicasaWeb service, which go above and beyond + * those catered for by #GDataQuery. + * + * For more information on the custom GData query parameters supported by #GDataPicasaWebQuery, see the online documentation. + * + * Since: 0.4.0 + */ + +#include +#include +#include +#include + +#include "gdata-picasaweb-query.h" +#include "gdata-query.h" +#include "gdata-picasaweb-enums.h" +#include "gdata-private.h" + +static void gdata_picasaweb_query_finalize (GObject *object); +static void gdata_picasaweb_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_picasaweb_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +struct _GDataPicasaWebQueryPrivate { + GDataPicasaWebVisibility visibility; + gchar *thumbnail_size; + gchar *image_size; + gchar *tag; + gchar *location; + + struct { + gdouble north; + gdouble east; + gdouble south; + gdouble west; + } bounding_box; +}; + +enum { + PROP_VISIBILITY = 1, + PROP_THUMBNAIL_SIZE, + PROP_IMAGE_SIZE, + PROP_TAG, + PROP_LOCATION +}; + +G_DEFINE_TYPE (GDataPicasaWebQuery, gdata_picasaweb_query, GDATA_TYPE_QUERY) + +static void +gdata_picasaweb_query_class_init (GDataPicasaWebQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataPicasaWebQueryPrivate)); + + gobject_class->get_property = gdata_picasaweb_query_get_property; + gobject_class->set_property = gdata_picasaweb_query_set_property; + gobject_class->finalize = gdata_picasaweb_query_finalize; + + query_class->get_query_uri = get_query_uri; + + /** + * GDataPicasaWebQuery:visibility: + * + * Specifies which albums should be listed, in terms of their visibility (#GDataPicasaWebAlbum:visibility). + * + * Set the property to 0 to list all albums, regardless of their visibility. Otherwise, use values + * from #GDataPicasaWebVisibility. + * + * For more information, see the + * online documentation. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_VISIBILITY, + g_param_spec_int ("visibility", + "Visibility", "Specifies which albums should be listed, in terms of their visibility.", + 0, GDATA_PICASAWEB_PRIVATE, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebQuery:thumbnail-size: + * + * A comma-separated list of thumbnail widths (in pixels) to return. Only certain sizes are allowed, and whether the thumbnail should be + * cropped or scaled can be specified; for more information, see the + * online documentation. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_THUMBNAIL_SIZE, + g_param_spec_string ("thumbnail-size", + "Thumbnail size", "A comma-separated list of thumbnail width (in pixels) to return.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebQuery:image-size: + * + * A comma-separated list of image sizes (width in pixels) to return. Only certain sizes are allowed, and whether the image should be + * cropped or scaled can be specified; for more information, see the + * online documentation. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_IMAGE_SIZE, + g_param_spec_string ("image-size", + "Image size", "A comma-separated list of image sizes (width in pixels) to return.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebQuery:tag: + * + * A tag which returned results must contain. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_TAG, + g_param_spec_string ("tag", + "Tag", "A tag which returned results must contain.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebQuery:location: + * + * A location to search for photos, e.g. "London". + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_LOCATION, + g_param_spec_string ("location", + "Location", "A location to search for photos, e.g. \"London\".", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_picasaweb_query_init (GDataPicasaWebQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_PICASAWEB_QUERY, GDataPicasaWebQueryPrivate); + + /* https://developers.google.com/picasa-web/docs/3.0/reference#Parameters */ + _gdata_query_set_pagination_type (GDATA_QUERY (self), + GDATA_QUERY_PAGINATION_INDEXED); +} + +static void +gdata_picasaweb_query_finalize (GObject *object) +{ + GDataPicasaWebQueryPrivate *priv = GDATA_PICASAWEB_QUERY (object)->priv; + + g_free (priv->thumbnail_size); + g_free (priv->image_size); + g_free (priv->tag); + g_free (priv->location); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_picasaweb_query_parent_class)->finalize (object); +} + +static void +gdata_picasaweb_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataPicasaWebQueryPrivate *priv = GDATA_PICASAWEB_QUERY (object)->priv; + + switch (property_id) { + case PROP_VISIBILITY: + g_value_set_int (value, priv->visibility); + break; + case PROP_THUMBNAIL_SIZE: + g_value_set_string (value, priv->thumbnail_size); + break; + case PROP_IMAGE_SIZE: + g_value_set_string (value, priv->image_size); + break; + case PROP_TAG: + g_value_set_string (value, priv->tag); + break; + case PROP_LOCATION: + g_value_set_string (value, priv->location); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_picasaweb_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataPicasaWebQuery *self = GDATA_PICASAWEB_QUERY (object); + + switch (property_id) { + case PROP_VISIBILITY: + gdata_picasaweb_query_set_visibility (self, g_value_get_int (value)); + break; + case PROP_THUMBNAIL_SIZE: + gdata_picasaweb_query_set_thumbnail_size (self, g_value_get_string (value)); + break; + case PROP_IMAGE_SIZE: + gdata_picasaweb_query_set_image_size (self, g_value_get_string (value)); + break; + case PROP_TAG: + gdata_picasaweb_query_set_tag (self, g_value_get_string (value)); + break; + case PROP_LOCATION: + gdata_picasaweb_query_set_location (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataPicasaWebQueryPrivate *priv = GDATA_PICASAWEB_QUERY (self)->priv; + + #define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + /* Chain up to the parent class */ + GDATA_QUERY_CLASS (gdata_picasaweb_query_parent_class)->get_query_uri (self, feed_uri, query_uri, params_started); + + APPEND_SEP + if (priv->visibility == 0) + ; // Appending nothing to retrieve all for authenticated users and just public albums for unauthenticated + else if (priv->visibility == GDATA_PICASAWEB_PUBLIC) + g_string_append (query_uri, "access=public"); + else if (priv->visibility == GDATA_PICASAWEB_PRIVATE) + g_string_append (query_uri, "access=private"); + else + g_assert_not_reached (); + + if (priv->thumbnail_size != NULL) { + APPEND_SEP + g_string_append (query_uri, "thumbsize="); + g_string_append_uri_escaped (query_uri, priv->thumbnail_size, NULL, FALSE); + } + + if (priv->image_size != NULL) { + APPEND_SEP + g_string_append (query_uri, "imgmax="); + g_string_append_uri_escaped (query_uri, priv->image_size, NULL, FALSE); + } + + if (priv->tag != NULL) { + APPEND_SEP + g_string_append (query_uri, "tag="); + g_string_append_uri_escaped (query_uri, priv->tag, NULL, FALSE); + } + + if (priv->bounding_box.north != priv->bounding_box.south && priv->bounding_box.east != priv->bounding_box.west) { + gchar west[G_ASCII_DTOSTR_BUF_SIZE], south[G_ASCII_DTOSTR_BUF_SIZE], east[G_ASCII_DTOSTR_BUF_SIZE], north[G_ASCII_DTOSTR_BUF_SIZE]; + + APPEND_SEP + g_string_append_printf (query_uri, "bbox=%s,%s,%s,%s", + g_ascii_dtostr (west, sizeof (west), priv->bounding_box.west), + g_ascii_dtostr (south, sizeof (south), priv->bounding_box.south), + g_ascii_dtostr (east, sizeof (east), priv->bounding_box.east), + g_ascii_dtostr (north, sizeof (north), priv->bounding_box.north)); + } + + if (priv->location != NULL) { + APPEND_SEP + g_string_append (query_uri, "l="); + g_string_append_uri_escaped (query_uri, priv->location, NULL, FALSE); + } +} + +/** + * gdata_picasaweb_query_new: + * @q: (allow-none): a query string, or %NULL + * + * Creates a new #GDataPicasaWebQuery with its #GDataQuery:q property set to @q. + * + * Note that when querying for albums with gdata_picasaweb_service_query_all_albums(), the @q parameter cannot be used. + * + * Return value: a new #GDataPicasaWebQuery + * + * Since: 0.4.0 + */ +GDataPicasaWebQuery * +gdata_picasaweb_query_new (const gchar *q) +{ + return g_object_new (GDATA_TYPE_PICASAWEB_QUERY, "q", q, NULL); +} + +/** + * gdata_picasaweb_query_new_with_limits: + * @q: (allow-none): a query string, or %NULL + * @start_index: the index of the first result to include, or 0 + * @max_results: the maximum number of results to include, or 0 + * + * Creates a #GDataPicasaWebQuery with its #GDataQuery:q property set to @q, returning @max_results starting from the @start_indexth result. + * + * Note that when querying for albums with gdata_picasaweb_service_query_all_albums(), the @q parameter cannot be used. + * + * This is useful for paging through results, but the result set between separate queries may change. So, if you use this to + * request the next ten results after a previous query, it may include some of the previously returned results if their order changed, or + * omit ones that would have otherwise been found in a earlier but larger query. + * + * Return value: a new #GDataPicasaWebQuery + * + * Since: 0.6.0 + */ +GDataPicasaWebQuery * +gdata_picasaweb_query_new_with_limits (const gchar *q, guint start_index, guint max_results) +{ + return g_object_new (GDATA_TYPE_PICASAWEB_QUERY, + "q", q, + "start-index", start_index, + "max-results", max_results, + NULL); +} + +/** + * gdata_picasaweb_query_get_visibility: + * @self: a #GDataPicasaWebQuery + * + * Gets the #GDataPicasaWebQuery:visibility property. + * + * Return value: the visibility of the objects to retrieve, or 0 to retrieve all objects + * + * Since: 0.4.0 + */ +GDataPicasaWebVisibility +gdata_picasaweb_query_get_visibility (GDataPicasaWebQuery *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_QUERY (self), 0); + return self->priv->visibility; +} + +/** + * gdata_picasaweb_query_set_visibility: + * @self: a #GDataPicasaWebQuery + * @visibility: the visibility of the objects to retrieve, or 0 to retrieve all objects + * + * Sets the #GDataPicasaWebQuery:visibility property to @visibility. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_query_set_visibility (GDataPicasaWebQuery *self, GDataPicasaWebVisibility visibility) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_QUERY (self)); + self->priv->visibility = visibility; + g_object_notify (G_OBJECT (self), "visibility"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_picasaweb_query_get_thumbnail_size: + * @self: a #GDataPicasaWebQuery + * + * Gets the #GDataPicasaWebQuery:thumbnail-size property. + * + * Return value: a comma-separated list of thumbnail sizes to retrieve, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_query_get_thumbnail_size (GDataPicasaWebQuery *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_QUERY (self), NULL); + return self->priv->thumbnail_size; +} + +/** + * gdata_picasaweb_query_set_thumbnail_size: + * @self: a #GDataPicasaWebQuery + * @thumbnail_size: (allow-none): a comma-separated list of thumbnail sizes to retrieve, or %NULL + * + * Sets the #GDataPicasaWebQuery:thumbnail-size property to @thumbnail_size. + * + * Set @thumbnail_size to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_query_set_thumbnail_size (GDataPicasaWebQuery *self, const gchar *thumbnail_size) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_QUERY (self)); + + g_free (self->priv->thumbnail_size); + self->priv->thumbnail_size = g_strdup (thumbnail_size); + g_object_notify (G_OBJECT (self), "thumbnail-size"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_picasaweb_query_get_image_size: + * @self: a #GDataPicasaWebQuery + * + * Gets the #GDataPicasaWebQuery:image-size property. + * + * Return value: the currently set desired image size for retrieval, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_query_get_image_size (GDataPicasaWebQuery *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_QUERY (self), NULL); + return self->priv->image_size; +} + +/** + * gdata_picasaweb_query_set_image_size: + * @self: a #GDataPicasaWebQuery + * @image_size: (allow-none): the desired size of the image to be retrieved, or %NULL + * + * Sets the #GDataPicasaWebQuery:image-size property to @image_size. + * Valid sizes are described in the + * online documentation. + * + * Set @image_size to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_query_set_image_size (GDataPicasaWebQuery *self, const gchar *image_size) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_QUERY (self)); + + g_free (self->priv->image_size); + self->priv->image_size = g_strdup (image_size); + g_object_notify (G_OBJECT (self), "image-size"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_picasaweb_query_get_tag: + * @self: a #GDataPicasaWebQuery + * + * Gets the #GDataPicasaWebQuery:tag property. + * + * Return value: a tag which retrieved objects must have, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_query_get_tag (GDataPicasaWebQuery *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_QUERY (self), NULL); + return self->priv->tag; +} + +/** + * gdata_picasaweb_query_set_tag: + * @self: a #GDataPicasaWebQuery + * @tag: (allow-none): a tag which retrieved objects must have, or %NULL + * + * Sets the #GDataPicasaWebQuery:tag property to @tag. + * + * Set @tag to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_query_set_tag (GDataPicasaWebQuery *self, const gchar *tag) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_QUERY (self)); + + g_free (self->priv->tag); + self->priv->tag = g_strdup (tag); + g_object_notify (G_OBJECT (self), "tag"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_picasaweb_query_get_bounding_box: + * @self: a #GDataPicasaWebQuery + * @north: (out caller-allocates) (allow-none): return location for the latitude of the top of the box, or %NULL + * @east: (out caller-allocates) (allow-none): return location for the longitude of the right of the box, or %NULL + * @south: (out caller-allocates) (allow-none): return location for the latitude of the south of the box, or %NULL + * @west: (out caller-allocates) (allow-none): return location for the longitude of the left of the box, or %NULL + * + * Gets the latitudes and longitudes of a bounding box, inside which all the results must lie. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_query_get_bounding_box (GDataPicasaWebQuery *self, gdouble *north, gdouble *east, gdouble *south, gdouble *west) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_QUERY (self)); + + if (north != NULL) + *north = self->priv->bounding_box.north; + if (east != NULL) + *east = self->priv->bounding_box.east; + if (south != NULL) + *south = self->priv->bounding_box.south; + if (west != NULL) + *west = self->priv->bounding_box.west; +} + +/** + * gdata_picasaweb_query_set_bounding_box: + * @self: a #GDataPicasaWebQuery + * @north: latitude of the top of the box + * @east: longitude of the right of the box + * @south: latitude of the bottom of the box + * @west: longitude of the left of the box + * + * Sets a bounding box, inside which all the returned results must lie. + * + * Set @north, @east, @south and @west to 0 to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_query_set_bounding_box (GDataPicasaWebQuery *self, gdouble north, gdouble east, gdouble south, gdouble west) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_QUERY (self)); + g_return_if_fail (north >= -90.0 && north <= 90.0); + g_return_if_fail (south >= -90.0 && south <= 90.0); + g_return_if_fail (east >= -180.0 && east <= 180.0); + g_return_if_fail (west >= -180.0 && west <= 180.0); + + self->priv->bounding_box.north = north; + self->priv->bounding_box.east = east; + self->priv->bounding_box.south = south; + self->priv->bounding_box.west = west; + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_picasaweb_query_get_location: + * @self: a #GDataPicasaWebQuery + * + * Gets the #GDataPicasaWebQuery:location property. + * + * Return value: a location which returned objects must be near, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_picasaweb_query_get_location (GDataPicasaWebQuery *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_QUERY (self), NULL); + return self->priv->location; +} + +/** + * gdata_picasaweb_query_set_location: + * @self: a #GDataPicasaWebQuery + * @location: (allow-none): a location which returned objects must be near, or %NULL + * + * Sets the #GDataPicasaWebQuery:location property to @location. + * + * Set @location to %NULL to unset the property. + * + * Since: 0.4.0 + */ +void +gdata_picasaweb_query_set_location (GDataPicasaWebQuery *self, const gchar *location) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_QUERY (self)); + + g_free (self->priv->location); + self->priv->location = g_strdup (location); + g_object_notify (G_OBJECT (self), "location"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} diff --git a/gdata/services/picasaweb/gdata-picasaweb-query.h b/gdata/services/picasaweb/gdata-picasaweb-query.h new file mode 100644 index 0000000..8c9492f --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-query.h @@ -0,0 +1,92 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_PICASAWEB_QUERY_H +#define GDATA_PICASAWEB_QUERY_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_PICASAWEB_QUERY (gdata_picasaweb_query_get_type ()) +#define GDATA_PICASAWEB_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_PICASAWEB_QUERY, GDataPicasaWebQuery)) +#define GDATA_PICASAWEB_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_PICASAWEB_QUERY, GDataPicasawebQueryClass)) +#define GDATA_IS_PICASAWEB_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_PICASAWEB_QUERY)) +#define GDATA_IS_PICASAWEB_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_PICASAWEB_QUERY)) +#define GDATA_PICASAWEB_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_PICASAWEB_QUERY, GDataPicasawebQueryClass)) + +typedef struct _GDataPicasaWebQueryPrivate GDataPicasaWebQueryPrivate; + +/** + * GDataPicasaWebQuery: + * + * All the fields in the #GDataPicasaWebQuery structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataQuery parent; + GDataPicasaWebQueryPrivate *priv; +} GDataPicasaWebQuery; + +/** + * GDataPicasaWebQueryClass: + * + * All the fields in the #GDataPicasaWebQueryClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataQueryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataPicasaWebQueryClass; + +GType gdata_picasaweb_query_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataPicasaWebQuery, g_object_unref) + +GDataPicasaWebQuery *gdata_picasaweb_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataPicasaWebQuery *gdata_picasaweb_query_new_with_limits (const gchar *q, + guint start_index, guint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataPicasaWebVisibility gdata_picasaweb_query_get_visibility (GDataPicasaWebQuery *self) G_GNUC_PURE; +void gdata_picasaweb_query_set_visibility (GDataPicasaWebQuery *self, GDataPicasaWebVisibility visibility); +const gchar *gdata_picasaweb_query_get_thumbnail_size (GDataPicasaWebQuery *self) G_GNUC_PURE; +void gdata_picasaweb_query_set_thumbnail_size (GDataPicasaWebQuery *self, const gchar *thumbnail_size); +const gchar *gdata_picasaweb_query_get_image_size (GDataPicasaWebQuery *self) G_GNUC_PURE; +void gdata_picasaweb_query_set_image_size (GDataPicasaWebQuery *self, const gchar *image_size); +const gchar *gdata_picasaweb_query_get_tag (GDataPicasaWebQuery *self) G_GNUC_PURE; +void gdata_picasaweb_query_set_tag (GDataPicasaWebQuery *self, const gchar *tag); +void gdata_picasaweb_query_get_bounding_box (GDataPicasaWebQuery *self, gdouble *north, gdouble *east, gdouble *south, gdouble *west); +void gdata_picasaweb_query_set_bounding_box (GDataPicasaWebQuery *self, gdouble north, gdouble east, gdouble south, gdouble west); +const gchar *gdata_picasaweb_query_get_location (GDataPicasaWebQuery *self) G_GNUC_PURE; +void gdata_picasaweb_query_set_location (GDataPicasaWebQuery *self, const gchar *location); + +G_END_DECLS + +#endif /* !GDATA_PICASAWEB_QUERY_H */ diff --git a/gdata/services/picasaweb/gdata-picasaweb-service.c b/gdata/services/picasaweb/gdata-picasaweb-service.c new file mode 100644 index 0000000..8ce7374 --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-service.c @@ -0,0 +1,741 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-picasaweb-service + * @short_description: GData PicasaWeb service object + * @stability: Stable + * @include: gdata/services/picasaweb/gdata-picasaweb-service.h + * + * #GDataPicasaWebService is a subclass of #GDataService for communicating with the GData API of Google PicasaWeb. It supports querying for files + * and albums, and uploading files. + * + * For more details of PicasaWeb's GData API, see the + * online documentation. + * + * + * Authenticating and Creating a New Album + * + * GDataClientLoginAuthorizer *authorizer; + * GDataPicasaWebService *service; + * GDataPicasaWebAlbum *album, *inserted_album; + * + * /* Create a service object and authorize against the PicasaWeb service */ + * authorizer = gdata_client_login_authorizer_new ("companyName-applicationName-versionID", GDATA_TYPE_PICASAWEB_SERVICE); + * gdata_client_login_authorizer_authenticate (authorizer, username, password, NULL, NULL); + * service = gdata_picasaweb_service_new (GDATA_AUTHORIZER (authorizer)); + * + * /* Create a GDataPicasaWebAlbum entry for the new album, setting some information about it */ + * album = gdata_picasaweb_album_new (NULL); + * gdata_entry_set_title (GDATA_ENTRY (album), "Photos from the Rhine"); + * gdata_entry_set_summary (GDATA_ENTRY (album), "An album of our adventures on the great river."); + * gdata_picasaweb_album_set_location (album, "The Rhine, Germany"); + * + * /* Insert the new album on the server. Note that this is a blocking operation. */ + * inserted_album = gdata_picasaweb_service_insert_album (service, album, NULL, NULL); + * + * g_object_unref (album); + * g_object_unref (inserted_album); + * g_object_unref (service); + * g_object_unref (authorizer); + * + * + * + * + * Uploading a Photo or Video + * + * GDataPicasaWebFile *file_entry, *uploaded_file_entry; + * GDataUploadStream *upload_stream; + * GFile *file_data; + * GFileInfo *file_info; + * GFileInputStream *file_stream; + * + * /* Specify the GFile image on disk to upload */ + * file_data = g_file_new_for_path (path); + * + * /* Get the file information for the file being uploaded. If another data source was being used for the upload, it would have to + * * provide an appropriate slug and content type. Note that this is a blocking operation. */ + * file_info = g_file_query_info (file_data, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, + * G_FILE_QUERY_INFO_NONE, NULL, NULL); + * + * /* Create a GDataPicasaWebFile entry for the image, setting a title and caption/summary */ + * file_entry = gdata_picasaweb_file_new (NULL); + * gdata_entry_set_title (GDATA_ENTRY (file_entry), "Black Cat"); + * gdata_entry_set_summary (GDATA_ENTRY (file_entry), "Photo of the world's most beautiful cat."); + * + * /* Create an upload stream for the file. This is non-blocking. */ + * upload_stream = gdata_picasaweb_service_upload_file (service, album, file_entry, g_file_info_get_display_name (file_info), + * g_file_info_get_content_type (file_info), NULL, NULL); + * g_object_unref (file_info); + * g_object_unref (file_entry); + * + * /* Prepare a file stream for the file to be uploaded. This is a blocking operation. */ + * file_stream = g_file_read (file_data, NULL, NULL); + * g_object_unref (file_data); + * + * /* Upload the file to the server. Note that this is a blocking operation. */ + * g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), G_INPUT_STREAM (file_stream), + * G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, NULL); + * + * /* Parse the resulting updated entry. This is a non-blocking operation. */ + * uploaded_file_entry = gdata_picasaweb_service_finish_file_upload (service, upload_stream, NULL); + * g_object_unref (file_stream); + * g_object_unref (upload_stream); + * + * /* ... */ + * + * g_object_unref (uploaded_file_entry); + * + * + * + * + * Since: 0.4.0 + */ + +#include +#include +#include + +#include "gdata-service.h" +#include "gdata-picasaweb-service.h" +#include "gdata-private.h" +#include "gdata-parser.h" +#include "atom/gdata-link.h" +#include "gdata-upload-stream.h" +#include "gdata-picasaweb-feed.h" + +static GList *get_authorization_domains (void); + +_GDATA_DEFINE_AUTHORIZATION_DOMAIN (picasaweb, "lh2", "http://picasaweb.google.com/data/") +G_DEFINE_TYPE (GDataPicasaWebService, gdata_picasaweb_service, GDATA_TYPE_SERVICE) + +static void +gdata_picasaweb_service_class_init (GDataPicasaWebServiceClass *klass) +{ + GDataServiceClass *service_class = GDATA_SERVICE_CLASS (klass); + service_class->feed_type = GDATA_TYPE_PICASAWEB_FEED; + service_class->get_authorization_domains = get_authorization_domains; +} + +static void +gdata_picasaweb_service_init (GDataPicasaWebService *self) +{ + /* Nothing to see here */ +} + +static GList * +get_authorization_domains (void) +{ + return g_list_prepend (NULL, get_picasaweb_authorization_domain ()); +} + +/** + * gdata_picasaweb_service_new: + * @authorizer: (allow-none): a #GDataAuthorizer to authorize the service's requests, or %NULL + * + * Creates a new #GDataPicasaWebService using the given #GDataAuthorizer. If @authorizer is %NULL, all requests are made as an unauthenticated user. + * + * Return value: a new #GDataPicasaWebService, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataPicasaWebService * +gdata_picasaweb_service_new (GDataAuthorizer *authorizer) +{ + g_return_val_if_fail (authorizer == NULL || GDATA_IS_AUTHORIZER (authorizer), NULL); + + return g_object_new (GDATA_TYPE_PICASAWEB_SERVICE, + "authorizer", authorizer, + NULL); +} + +/** + * gdata_picasaweb_service_get_primary_authorization_domain: + * + * The primary #GDataAuthorizationDomain for interacting with PicasaWeb. This will not normally need to be used, as it's used internally + * by the #GDataPicasaWebService methods. However, if using the plain #GDataService methods to implement custom queries or requests which libgdata + * does not support natively, then this domain may be needed to authorize the requests. + * + * The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. + * + * Return value: (transfer none): the service's authorization domain + * + * Since: 0.9.0 + */ +GDataAuthorizationDomain * +gdata_picasaweb_service_get_primary_authorization_domain (void) +{ + return get_picasaweb_authorization_domain (); +} + +/* + * create_uri: + * @self: a #GDataPicasaWebService + * @username: (allow-none): the username to use, or %NULL to use the currently logged in user + * @type: the type of object to access: "entry" for a user, or "feed" for an album + * + * Builds a URI to use when querying for albums or a user. + * + * Return value: a constructed URI; free with g_free() + * + * Since: 0.4.0 + */ +static gchar * +create_uri (GDataPicasaWebService *self, const gchar *username, const gchar *type) +{ + if (username == NULL) { + /* Ensure we're authorized first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_picasaweb_authorization_domain ()) == FALSE) { + return NULL; + } + + /* Querying Picasa albums for the "default" user when logged in returns the albums for the authenticated user */ + username = "default"; + } + + return _gdata_service_build_uri ("https://picasaweb.google.com/data/%s/api/user/%s", type, username); +} + +/** + * gdata_picasaweb_service_get_user: + * @self: a #GDataPicasaWebService + * @username: (allow-none): the username of the user whose information you wish to retrieve, or %NULL for the currently authenticated user. + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Queries the service to return the user specified by @username. + * + * Return value: (transfer full): a #GDataPicasaWebUser; unref with g_object_unref() + * + * Since: 0.6.0 + */ +GDataPicasaWebUser * +gdata_picasaweb_service_get_user (GDataPicasaWebService *self, const gchar *username, GCancellable *cancellable, GError **error) +{ + gchar *uri; + GDataParsable *user; + SoupMessage *message; + + g_return_val_if_fail (GDATA_IS_PICASAWEB_SERVICE (self), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + uri = create_uri (self, username, "entry"); + if (uri == NULL) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must specify a username or be authenticated to query a user.")); + return NULL; + } + + message = _gdata_service_query (GDATA_SERVICE (self), get_picasaweb_authorization_domain (), uri, NULL, cancellable, error); + g_free (uri); + + if (message == NULL) + return NULL; + + g_assert (message->response_body->data != NULL); + user = gdata_parsable_new_from_xml (GDATA_TYPE_PICASAWEB_USER, message->response_body->data, message->response_body->length, error); + g_object_unref (message); + + return GDATA_PICASAWEB_USER (user); +} + +static void +get_user_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataPicasaWebService *service = GDATA_PICASAWEB_SERVICE (source_object); + const gchar *username = task_data; + g_autoptr(GDataPicasaWebUser) user = NULL; + g_autoptr(GError) error = NULL; + + /* Get the user and return */ + user = gdata_picasaweb_service_get_user (service, username, cancellable, &error); + + if (error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&user), g_object_unref); +} + +/** + * gdata_picasaweb_service_get_user_async: + * @self: a #GDataPicasaWebService + * @username: (allow-none): the username of the user whose information you wish to retrieve, or %NULL for the currently authenticated user + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return the user specified by @username. + * + * For more details, see gdata_picasaweb_service_get_user() which is the synchronous version of this method. + * + * When the operation is finished, @callback will be called. You can then call gdata_picasaweb_service_get_user_finish() to get the results of the + * operation. + * + * Since: 0.9.1 + */ +void +gdata_picasaweb_service_get_user_async (GDataPicasaWebService *self, const gchar *username, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + + g_return_if_fail (GDATA_IS_PICASAWEB_SERVICE (self)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_picasaweb_service_get_user_async); + g_task_set_task_data (task, g_strdup (username), (GDestroyNotify) g_free); + g_task_run_in_thread (task, get_user_thread); +} + +/** + * gdata_picasaweb_service_get_user_finish: + * @self: a #GDataPicasaWebService + * @result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous user retrieval operation started with gdata_picasaweb_service_get_user_async(). + * + * Return value: (transfer full): a #GDataPicasaWebUser; unref with g_object_unref() + * + * Since: 0.9.1 + */ +GDataPicasaWebUser * +gdata_picasaweb_service_get_user_finish (GDataPicasaWebService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_picasaweb_service_get_user_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} + +/** + * gdata_picasaweb_service_query_all_albums: + * @self: a #GDataPicasaWebService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @username: (allow-none): the username of the user whose albums you wish to retrieve, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service to return a list of all albums belonging to the specified @username which match the given + * @query. If a user is authenticated with the service, @username can be set as %NULL to return a list of albums belonging + * to the currently-authenticated user. + * + * Note that the #GDataQuery:q query parameter cannot be set on @query for album queries. + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataFeed * +gdata_picasaweb_service_query_all_albums (GDataPicasaWebService *self, GDataQuery *query, const gchar *username, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + gchar *uri; + GDataFeed *album_feed; + + g_return_val_if_fail (GDATA_IS_PICASAWEB_SERVICE (self), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (query != NULL && gdata_query_get_q (query) != NULL) { + /* Bug #593336 — Query parameter "q=..." isn't valid for album kinds */ + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER, + _("Query parameter not allowed for albums.")); + return NULL; + } + + uri = create_uri (self, username, "feed"); + if (uri == NULL) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must specify a username or be authenticated to query all albums.")); + return NULL; + } + + /* Execute the query */ + album_feed = gdata_service_query (GDATA_SERVICE (self), get_picasaweb_authorization_domain (), uri, query, GDATA_TYPE_PICASAWEB_ALBUM, + cancellable, progress_callback, progress_user_data, error); + g_free (uri); + + return album_feed; +} + +/** + * gdata_picasaweb_service_query_all_albums_async: + * @self: a #GDataPicasaWebService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @username: (allow-none): the username of the user whose albums you wish to retrieve, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return a list of all albums belonging to the specified @username which match the given + * @query. @self, @query and @username are all reffed/copied when this function is called, so can safely be unreffed/freed after + * this function returns. + * + * For more details, see gdata_picasaweb_service_query_all_albums(), which is the synchronous version of + * this function, and gdata_service_query_async(), which is the base asynchronous query function. + * + * Since: 0.9.1 + */ +void +gdata_picasaweb_service_query_all_albums_async (GDataPicasaWebService *self, GDataQuery *query, const gchar *username, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *uri; + + g_return_if_fail (GDATA_IS_PICASAWEB_SERVICE (self)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + if (query != NULL && gdata_query_get_q (query) != NULL) { + /* Bug #593336 — Query parameter "q=..." isn't valid for album kinds */ + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER, "%s", + _("Query parameter not allowed for albums.")); + + return; + } + + uri = create_uri (self, username, "feed"); + if (uri == NULL) { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", + _("You must specify a username or be authenticated to query all albums.")); + + return; + } + + /* Schedule the async query */ + gdata_service_query_async (GDATA_SERVICE (self), get_picasaweb_authorization_domain (), uri, query, GDATA_TYPE_PICASAWEB_ALBUM, cancellable, + progress_callback, progress_user_data, destroy_progress_user_data, callback, user_data); + g_free (uri); +} + +static const gchar * +get_query_files_uri (GDataPicasaWebAlbum *album, GError **error) +{ + if (album != NULL) { + GDataLink *_link = gdata_entry_look_up_link (GDATA_ENTRY (album), "http://schemas.google.com/g/2005#feed"); + if (_link == NULL) { + /* Error */ + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, + _("The album did not have a feed link.")); + return NULL; + } + + return gdata_link_get_uri (_link); + } else { + /* Default URI */ + return "https://picasaweb.google.com/data/feed/api/user/default/albumid/default"; + } +} + +/** + * gdata_picasaweb_service_query_files: + * @self: a #GDataPicasaWebService + * @album: (allow-none): a #GDataPicasaWebAlbum from which to retrieve the files, or %NULL + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the specified @album for a list of the files which match the given @query. If @album is %NULL and a user is + * authenticated with the service, the user's default album will be queried. + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + * + * Since: 0.4.0 + */ +GDataFeed * +gdata_picasaweb_service_query_files (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + const gchar *uri; + + g_return_val_if_fail (GDATA_IS_PICASAWEB_SERVICE (self), NULL); + g_return_val_if_fail (album == NULL || GDATA_IS_PICASAWEB_ALBUM (album), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + uri = get_query_files_uri (album, error); + if (uri == NULL) + return NULL; + + /* Execute the query */ + return gdata_service_query (GDATA_SERVICE (self), get_picasaweb_authorization_domain (), uri, GDATA_QUERY (query), GDATA_TYPE_PICASAWEB_FILE, + cancellable, progress_callback, progress_user_data, error); +} + +/** + * gdata_picasaweb_service_query_files_async: + * @self: a #GDataPicasaWebService + * @album: (allow-none): a #GDataPicasaWebAlbum from which to retrieve the files, or %NULL + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the specified @album for a list of the files which match the given @query. If @album is %NULL and a user is authenticated with the service, + * the user's default album will be queried. @self, @album and @query are all reffed when this function is called, so can safely be unreffed after + * this function returns. + * + * For more details, see gdata_picasaweb_service_query_files(), which is the synchronous version of this function, and gdata_service_query_async(), + * which is the base asynchronous query function. + * + * Since: 0.9.1 + */ +void +gdata_picasaweb_service_query_files_async (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data) +{ + const gchar *request_uri; + GError *child_error = NULL; + + g_return_if_fail (GDATA_IS_PICASAWEB_SERVICE (self)); + g_return_if_fail (album == NULL || GDATA_IS_PICASAWEB_ALBUM (album)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + request_uri = get_query_files_uri (album, &child_error); + if (request_uri == NULL) { + g_task_report_error (self, callback, user_data, gdata_service_query_async, g_steal_pointer (&child_error)); + return; + } + + gdata_service_query_async (GDATA_SERVICE (self), get_picasaweb_authorization_domain (), request_uri, GDATA_QUERY (query), + GDATA_TYPE_PICASAWEB_FILE, cancellable, progress_callback, progress_user_data, destroy_progress_user_data, + callback, user_data); +} + +/** + * gdata_picasaweb_service_upload_file: + * @self: a #GDataPicasaWebService + * @album: (allow-none): a #GDataPicasaWebAlbum into which to insert the file, or %NULL + * @file_entry: a #GDataPicasaWebFile to insert + * @slug: the filename to give to the uploaded file + * @content_type: the content type of the uploaded data + * @cancellable: (allow-none): a #GCancellable for the entire upload stream, or %NULL + * @error: a #GError, or %NULL + * + * Uploads a file (photo or video) to the given PicasaWeb @album, using the metadata from @file and the file data written to the resulting + * #GDataUploadStream. If @album is %NULL, the file will be uploaded to the currently-authenticated user's "Drop Box" album. A user must be + * authenticated to use this function. + * + * If @file has already been inserted, a %GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED error will be returned. + * + * If no user is authenticated with the service, %GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED will be returned. It is recommended to retry the + * upload after refreshing the authorization tokens held by the associated #GDataAuthorizer using gdata_authorizer_refresh_authorization(). + * + * The stream returned by this function should be written to using the standard #GOutputStream methods, asychronously or synchronously. Once the stream + * is closed (using g_output_stream_close()), gdata_picasaweb_service_finish_file_upload() should be called on it to parse and return the updated + * #GDataPicasaWebFile for the uploaded file. This must be done, as @file_entry isn't updated in-place. + * + * In order to cancel the upload, a #GCancellable passed in to @cancellable must be cancelled using g_cancellable_cancel(). Cancelling the individual + * #GOutputStream operations on the #GDataUploadStream will not cancel the entire upload; merely the write or close operation in question. See the + * #GDataUploadStream:cancellable for more details. + * + * Any upload errors will be thrown by the stream methods, and may come from the #GDataServiceError domain. + * + * Return value: (transfer full): a #GDataUploadStream to write the file data to, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataUploadStream * +gdata_picasaweb_service_upload_file (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GDataPicasaWebFile *file_entry, const gchar *slug, + const gchar *content_type, GCancellable *cancellable, GError **error) +{ + const gchar *album_id = NULL; + GDataUploadStream *upload_stream; + gchar *upload_uri; + + g_return_val_if_fail (GDATA_IS_PICASAWEB_SERVICE (self), NULL); + g_return_val_if_fail (album == NULL || GDATA_IS_PICASAWEB_ALBUM (album), NULL); + g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (file_entry), NULL); + g_return_val_if_fail (slug != NULL && *slug != '\0', NULL); + g_return_val_if_fail (content_type != NULL && *content_type != '\0', NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (gdata_entry_is_inserted (GDATA_ENTRY (file_entry)) == TRUE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED, + _("The entry has already been inserted.")); + return NULL; + } + + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_picasaweb_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to upload a file.")); + return NULL; + } + + /* PicasaWeb allows you to post to a default Dropbox */ + album_id = (album != NULL) ? gdata_picasaweb_album_get_id (album) : "default"; + + /* Build the upload URI and upload stream */ + upload_uri = _gdata_service_build_uri ("https://picasaweb.google.com/data/feed/api/user/default/albumid/%s", album_id); + upload_stream = GDATA_UPLOAD_STREAM (gdata_upload_stream_new (GDATA_SERVICE (self), get_picasaweb_authorization_domain (), SOUP_METHOD_POST, + upload_uri, GDATA_ENTRY (file_entry), slug, content_type, cancellable)); + g_free (upload_uri); + + return upload_stream; +} + +/** + * gdata_picasaweb_service_finish_file_upload: + * @self: a #GDataPicasaWebService + * @upload_stream: the #GDataUploadStream from the operation + * @error: a #GError, or %NULL + * + * Finish off a file upload operation started by gdata_picasaweb_service_upload_file(), parsing the result and returning the new #GDataPicasaWebFile. + * + * If an error occurred during the upload operation, it will have been returned during the operation (e.g. by g_output_stream_splice() or one + * of the other stream methods). In such a case, %NULL will be returned but @error will remain unset. @error is only set in the case that the server + * indicates that the operation was successful, but an error is encountered in parsing the result sent by the server. + * + * Return value: (transfer full): the new #GDataPicasaWebFile, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataPicasaWebFile * +gdata_picasaweb_service_finish_file_upload (GDataPicasaWebService *self, GDataUploadStream *upload_stream, GError **error) +{ + const gchar *response_body; + gssize response_length; + + g_return_val_if_fail (GDATA_IS_PICASAWEB_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (upload_stream), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Get the response from the server */ + response_body = gdata_upload_stream_get_response (upload_stream, &response_length); + if (response_body == NULL || response_length == 0) + return NULL; + + /* Parse the response to produce a GDataPicasaWebFile */ + return GDATA_PICASAWEB_FILE (gdata_parsable_new_from_xml (GDATA_TYPE_PICASAWEB_FILE, response_body, (gint) response_length, error)); +} + +/** + * gdata_picasaweb_service_insert_album: + * @self: a #GDataPicasaWebService + * @album: a #GDataPicasaWebAlbum to create on the server + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: a #GError, or %NULL + * + * Inserts a new album described by @album. A user must be + * authenticated to use this function. + * + * Return value: (transfer full): the inserted #GDataPicasaWebAlbum; unref with + * g_object_unref() + * + * Since: 0.6.0 + */ +GDataPicasaWebAlbum * +gdata_picasaweb_service_insert_album (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GCancellable *cancellable, GError **error) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_PICASAWEB_ALBUM (album), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (gdata_entry_is_inserted (GDATA_ENTRY (album)) == TRUE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED, + _("The album has already been inserted.")); + return NULL; + } + + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_picasaweb_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to insert an album.")); + return NULL; + } + + return GDATA_PICASAWEB_ALBUM (gdata_service_insert_entry (GDATA_SERVICE (self), get_picasaweb_authorization_domain (), + "https://picasaweb.google.com/data/feed/api/user/default", + GDATA_ENTRY (album), cancellable, error)); +} + +/** + * gdata_picasaweb_service_insert_album_async: + * @self: a #GDataPicasaWebService + * @album: a #GDataPicasaWebAlbum to create on the server + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Inserts a new album described by @album. The user must be authenticated to use this function. @self and @album are both reffed when this function + * is called, so can safely be unreffed after this function returns. + * + * @callback should call gdata_service_insert_entry_finish() to obtain a #GDataPicasaWebAlbum representing the inserted album and to check for + * possible errors. + * + * For more details, see gdata_picasaweb_service_insert_album(), which is the synchronous version of this function, and + * gdata_service_insert_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.8.0 + */ +void +gdata_picasaweb_service_insert_album_async (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_return_if_fail (GDATA_IS_PICASAWEB_SERVICE (self)); + g_return_if_fail (GDATA_IS_PICASAWEB_ALBUM (album)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + gdata_service_insert_entry_async (GDATA_SERVICE (self), get_picasaweb_authorization_domain (), + "https://picasaweb.google.com/data/feed/api/user/default", GDATA_ENTRY (album), cancellable, callback, + user_data); +} diff --git a/gdata/services/picasaweb/gdata-picasaweb-service.h b/gdata/services/picasaweb/gdata-picasaweb-service.h new file mode 100644 index 0000000..f144edb --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-service.h @@ -0,0 +1,120 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Richard Schwarting 2009 + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_PICASAWEB_SERVICE_H +#define GDATA_PICASAWEB_SERVICE_H + +#include +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_PICASAWEB_SERVICE (gdata_picasaweb_service_get_type ()) +#define GDATA_PICASAWEB_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_PICASAWEB_SERVICE, GDataPicasaWebService)) +#define GDATA_PICASAWEB_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_PICASAWEB_SERVICE, GDataPicasaWebServiceClass)) +#define GDATA_IS_PICASAWEB_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_PICASAWEB_SERVICE)) +#define GDATA_IS_PICASAWEB_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_PICASAWEB_SERVICE)) +#define GDATA_PICASAWEB_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_PICASAWEB_SERVICE, GDataPicasaWebServiceClass)) + +/** + * GDataPicasaWebService: + * + * All the fields in the #GDataPicasaWebService structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + GDataService parent; +} GDataPicasaWebService; + +/** + * GDataPicasaWebServiceClass: + * + * All the fields in the #GDataPicasaWebServiceClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataServiceClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataPicasaWebServiceClass; + +GType gdata_picasaweb_service_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataPicasaWebService, g_object_unref) + +GDataPicasaWebService *gdata_picasaweb_service_new (GDataAuthorizer *authorizer) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataAuthorizationDomain *gdata_picasaweb_service_get_primary_authorization_domain (void) G_GNUC_CONST; + +#include + +GDataPicasaWebUser *gdata_picasaweb_service_get_user (GDataPicasaWebService *self, const gchar *username, + GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_picasaweb_service_get_user_async (GDataPicasaWebService *self, const gchar *username, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); +GDataPicasaWebUser *gdata_picasaweb_service_get_user_finish (GDataPicasaWebService *self, GAsyncResult *result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataFeed *gdata_picasaweb_service_query_all_albums (GDataPicasaWebService *self, GDataQuery *query, const gchar *username, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_picasaweb_service_query_all_albums_async (GDataPicasaWebService *self, GDataQuery *query, const gchar *username, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); + +GDataFeed *gdata_picasaweb_service_query_files (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_picasaweb_service_query_files_async (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); + +#include + +GDataUploadStream *gdata_picasaweb_service_upload_file (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GDataPicasaWebFile *file_entry, + const gchar *slug, const gchar *content_type, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataPicasaWebFile *gdata_picasaweb_service_finish_file_upload (GDataPicasaWebService *self, GDataUploadStream *upload_stream, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataPicasaWebAlbum *gdata_picasaweb_service_insert_album (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_picasaweb_service_insert_album_async (GDataPicasaWebService *self, GDataPicasaWebAlbum *album, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data); + +G_END_DECLS + +#endif /* !GDATA_PICASAWEB_SERVICE_H */ diff --git a/gdata/services/picasaweb/gdata-picasaweb-user.c b/gdata/services/picasaweb/gdata-picasaweb-user.c new file mode 100644 index 0000000..38db73f --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-user.c @@ -0,0 +1,376 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * Copyright (C) Richard Schwarting 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-picasaweb-user + * @short_description: GData PicasaWeb User object + * @stability: Stable + * @include: gdata/services/picasaweb/gdata-picasaweb-user.h + * + * #GDataPicasaWebUser is a subclass of #GDataEntry to represent properties for a PicasaWeb user. It adds a couple of + * properties which are specific to the Google PicasaWeb API. + * + * Since: 0.6.0 + */ + +#include +#include + +#include "gdata-picasaweb-user.h" +#include "gdata-entry.h" +#include "gdata-private.h" + +static void gdata_picasaweb_user_finalize (GObject *object); +static void gdata_picasaweb_user_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataPicasaWebUserPrivate { + gchar *user; + gchar *nickname; + gint64 quota_limit; + gint64 quota_current; + gint max_photos_per_album; + gchar *thumbnail_uri; +}; + +enum { + PROP_USER = 1, + PROP_NICKNAME, + PROP_QUOTA_LIMIT, + PROP_QUOTA_CURRENT, + PROP_MAX_PHOTOS_PER_ALBUM, + PROP_THUMBNAIL_URI +}; + +G_DEFINE_TYPE (GDataPicasaWebUser, gdata_picasaweb_user, GDATA_TYPE_ENTRY) + +static void +gdata_picasaweb_user_class_init (GDataPicasaWebUserClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataPicasaWebUserPrivate)); + + gobject_class->get_property = gdata_picasaweb_user_get_property; + gobject_class->finalize = gdata_picasaweb_user_finalize; + + parsable_class->parse_xml = parse_xml; + parsable_class->get_namespaces = get_namespaces; + + entry_class->kind_term = "http://schemas.google.com/photos/2007#user"; + + /** + * GDataPicasaWebUser:user: + * + * The username of the user, as seen in feed URLs. + * http://code.google.com/apis/picasaweb/docs/2.0/reference.html#gphoto_user + * + * Since: 0.6.0 + */ + g_object_class_install_property (gobject_class, PROP_USER, + g_param_spec_string ("user", + "User", "The username of the user.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebUser:nickname: + * + * The user's nickname. This is a user-specified value that should be used when referring to the user by name. + * http://code.google.com/apis/picasaweb/docs/2.0/reference.html#gphoto_nickname + * + * Since: 0.6.0 + */ + g_object_class_install_property (gobject_class, PROP_NICKNAME, + g_param_spec_string ("nickname", + "Nickname", "The user's nickname.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebUser:quota-limit: + * + * The total amount of space, in bytes, available to the user. + * http://code.google.com/apis/picasaweb/docs/2.0/reference.html#gphoto_quotalimit + * + * If the #GDataPicasaWebUser does not represent the currently authenticated user, this will be -1. + * + * Since: 0.6.0 + */ + g_object_class_install_property (gobject_class, PROP_QUOTA_LIMIT, + g_param_spec_int64 ("quota-limit", + "Quota Limit", "The total amount of space, in bytes, available to the user.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebUser:quota-current: + * + * The current amount of space, in bytes, already used by the user. + * http://code.google.com/apis/picasaweb/docs/2.0/reference.html#gphoto_quotacurrent + * + * If the #GDataPicasaWebUser does not represent the currently authenticated user, this will be -1. + * + * Since: 0.6.0 + */ + g_object_class_install_property (gobject_class, PROP_QUOTA_CURRENT, + g_param_spec_int64 ("quota-current", + "Quota Current", "The current amount of space, in bytes, already used by the user.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebUser:max-photos-per-album: + * + * The maximum number of photos allowed in an album. + * http://code.google.com/apis/picasaweb/docs/2.0/reference.html#gphoto_maxPhotosPerAlbum + * + * If the #GDataPicasaWebUser does not represent the currently authenticated user, this will be -1. + * + * Since: 0.6.0 + */ + g_object_class_install_property (gobject_class, PROP_MAX_PHOTOS_PER_ALBUM, + g_param_spec_int ("max-photos-per-album", + "Max Photos Per Album", "The maximum number of photos allowed in an album.", + -1, G_MAXINT, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataPicasaWebUser:thumbnail-uri: + * + * The URI of a thumbnail-sized portrait of the user. + * http://code.google.com/apis/picasaweb/docs/2.0/reference.html#gphoto_thumbnail + * + * Since: 0.6.0 + */ + g_object_class_install_property (gobject_class, PROP_THUMBNAIL_URI, + g_param_spec_string ("thumbnail-uri", + "Thumbnail URI", "The URI of a thumbnail-sized portrait of the user.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_picasaweb_user_init (GDataPicasaWebUser *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_PICASAWEB_USER, GDataPicasaWebUserPrivate); + + /* Initialise the properties whose values we can theoretically not know */ + self->priv->quota_limit = self->priv->quota_current = self->priv->max_photos_per_album = -1; +} + +static void +gdata_picasaweb_user_finalize (GObject *object) +{ + GDataPicasaWebUserPrivate *priv = GDATA_PICASAWEB_USER (object)->priv; + + g_free (priv->user); + g_free (priv->nickname); + g_free (priv->thumbnail_uri); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_picasaweb_user_parent_class)->finalize (object); +} + +static void +gdata_picasaweb_user_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataPicasaWebUserPrivate *priv = GDATA_PICASAWEB_USER (object)->priv; + + switch (property_id) { + case PROP_USER: + g_value_set_string (value, priv->user); + break; + case PROP_NICKNAME: + g_value_set_string (value, priv->nickname); + break; + case PROP_QUOTA_LIMIT: + g_value_set_int64 (value, priv->quota_limit); + break; + case PROP_QUOTA_CURRENT: + g_value_set_int64 (value, priv->quota_current); + break; + case PROP_MAX_PHOTOS_PER_ALBUM: + g_value_set_int (value, priv->max_photos_per_album); + break; + case PROP_THUMBNAIL_URI: + g_value_set_string (value, priv->thumbnail_uri); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + gboolean success; + GDataPicasaWebUser *self = GDATA_PICASAWEB_USER (parsable); + + if (gdata_parser_is_namespace (node, "http://schemas.google.com/photos/2007") == FALSE) + return GDATA_PARSABLE_CLASS (gdata_picasaweb_user_parent_class)->parse_xml (parsable, doc, node, user_data, error); + + if (gdata_parser_string_from_element (node, "user", P_REQUIRED | P_NON_EMPTY, &(self->priv->user), &success, error) == TRUE || + gdata_parser_string_from_element (node, "nickname", P_REQUIRED | P_NON_EMPTY, &(self->priv->nickname), &success, error) == TRUE || + gdata_parser_string_from_element (node, "thumbnail", P_REQUIRED | P_NON_EMPTY, &(self->priv->thumbnail_uri), &success, error) == TRUE || + gdata_parser_int64_from_element (node, "quotacurrent", P_REQUIRED | P_NO_DUPES, &(self->priv->quota_current), -1, &success, error) == TRUE || + gdata_parser_int64_from_element (node, "quotalimit", P_REQUIRED | P_NO_DUPES, &(self->priv->quota_limit), -1, &success, error) == TRUE) { + return success; + } else if (xmlStrcmp (node->name, (xmlChar*) "maxPhotosPerAlbum") == 0) { + /* gphoto:max-photos-per-album */ + xmlChar *max_photos_per_album = xmlNodeListGetString (doc, node->children, TRUE); + self->priv->max_photos_per_album = g_ascii_strtoll ((char*) max_photos_per_album, NULL, 10); + xmlFree (max_photos_per_album); + } else if (xmlStrcmp (node->name, (xmlChar*) "x-allowDownloads") == 0) { /* RHSTODO: see if this comes with the user */ + /* gphoto:allowDownloads */ + /* TODO: Not part of public API so we're capturing and ignoring for now. See bgo #589858. */ + } else if (xmlStrcmp (node->name, (xmlChar*) "x-allowPrints") == 0) { /* RHSTODO: see if this comes with the user */ + /* gphoto:allowPrints */ + /* TODO: Not part of public API so we're capturing and ignoring for now. See bgo #589858. */ + } else { + return GDATA_PARSABLE_CLASS (gdata_picasaweb_user_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_picasaweb_user_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "gphoto", (gchar*) "http://schemas.google.com/photos/2007"); +} + +/** + * gdata_picasaweb_user_get_user: + * @self: a #GDataPicasaWebUser + * + * Gets the #GDataPicasaWebUser:user property. + * + * Return value: the feed's user, or %NULL + * + * Since: 0.6.0 + */ +const gchar * +gdata_picasaweb_user_get_user (GDataPicasaWebUser *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_USER (self), NULL); + return self->priv->user; +} + +/** + * gdata_picasaweb_user_get_nickname: + * @self: a #GDataPicasaWebUser + * + * Gets the #GDataPicasaWebUser:nickname property. + * + * Return value: the nickname of the feed's user's nickname, or %NULL + * + * Since: 0.6.0 + */ +const gchar * +gdata_picasaweb_user_get_nickname (GDataPicasaWebUser *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_USER (self), NULL); + return self->priv->nickname; +} + +/** + * gdata_picasaweb_user_get_quota_limit: + * @self: a #GDataPicasaWebUser + * + * Gets the #GDataPicasaWebUser:quota-limit property. Note that + * this information is not available when accessing feeds which we + * haven't authenticated, and 0 is returned. + * + * Return value: the maximum capacity in bytes for this feed's account, or -1 + * + * Since: 0.6.0 + */ +gint64 +gdata_picasaweb_user_get_quota_limit (GDataPicasaWebUser *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_USER (self), -1); + return self->priv->quota_limit; +} + +/** + * gdata_picasaweb_user_get_quota_current: + * @self: a #GDataPicasaWebUser + * + * Gets the #GDataPicasaWebUser:quota-current property. Note that + * this information is not available when accessing feeds which we + * haven't authenticated, and 0 is returned. + * + * Return value: the current number of bytes in use by this feed's account, or -1 + * + * Since: 0.6.0 + */ +gint64 +gdata_picasaweb_user_get_quota_current (GDataPicasaWebUser *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_USER (self), -1); + return self->priv->quota_current; +} + +/** + * gdata_picasaweb_user_get_max_photos_per_album: + * @self: a #GDataPicasaWebUser + * + * Gets the #GDataPicasaWebUser:max-photos-per-album property. Note that + * this information is not available when accessing feeds which we + * haven't authenticated, and 0 is returned. + * + * Return value: the maximum number of photos an album for this account can hold, or -1 + * + * Since: 0.6.0 + */ +gint +gdata_picasaweb_user_get_max_photos_per_album (GDataPicasaWebUser *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_USER (self), -1); + return self->priv->max_photos_per_album; +} + +/** + * gdata_picasaweb_user_get_thumbnail_uri: + * @self: a #GDataPicasaWebUser + * + * Gets the #GDataPicasaWebUser:thumbnail-uri property. + * + * Return value: the URI for the thumbnail of the account, or %NULL + * + * Since: 0.6.0 + */ +const gchar * +gdata_picasaweb_user_get_thumbnail_uri (GDataPicasaWebUser *self) +{ + g_return_val_if_fail (GDATA_IS_PICASAWEB_USER (self), NULL); + return self->priv->thumbnail_uri; +} + +/* TODO: in the future, see if we can change things like the user's nickname and thumbnail/avatar */ diff --git a/gdata/services/picasaweb/gdata-picasaweb-user.h b/gdata/services/picasaweb/gdata-picasaweb-user.h new file mode 100644 index 0000000..e8f6f11 --- /dev/null +++ b/gdata/services/picasaweb/gdata-picasaweb-user.h @@ -0,0 +1,82 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * Copyright (C) Richard Schwarting 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_PICASAWEB_USER_H +#define GDATA_PICASAWEB_USER_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_PICASAWEB_USER (gdata_picasaweb_user_get_type ()) +#define GDATA_PICASAWEB_USER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_PICASAWEB_USER, GDataPicasaWebUser)) +#define GDATA_PICASAWEB_USER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_PICASAWEB_USER, GDataPicasaWebUserClass)) +#define GDATA_IS_PICASAWEB_USER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_PICASAWEB_USER)) +#define GDATA_IS_PICASAWEB_USER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_PICASAWEB_USER)) +#define GDATA_PICASAWEB_USER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_PICASAWEB_USER, GDataPicasaWebUserClass)) + +typedef struct _GDataPicasaWebUserPrivate GDataPicasaWebUserPrivate; + +/** + * GDataPicasaWebUser: + * + * All the fields in the #GDataPicasaWebUser structure are private and should never be accessed directly. + * + * Since: 0.6.0 + */ +typedef struct { + GDataEntry parent; + GDataPicasaWebUserPrivate *priv; +} GDataPicasaWebUser; + +/** + * GDataPicasaWebUserClass: + * + * All the fields in the #GDataPicasaWebUserClass structure are private and should never be accessed directly. + * + * Since: 0.6.0 + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataPicasaWebUserClass; + +GType gdata_picasaweb_user_get_type (void) G_GNUC_CONST; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDataPicasaWebUser, g_object_unref) + +const gchar *gdata_picasaweb_user_get_user (GDataPicasaWebUser *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_user_get_nickname (GDataPicasaWebUser *self) G_GNUC_PURE; +gint64 gdata_picasaweb_user_get_quota_limit (GDataPicasaWebUser *self) G_GNUC_PURE; +gint64 gdata_picasaweb_user_get_quota_current (GDataPicasaWebUser *self) G_GNUC_PURE; +gint gdata_picasaweb_user_get_max_photos_per_album (GDataPicasaWebUser *self) G_GNUC_PURE; +const gchar *gdata_picasaweb_user_get_thumbnail_uri (GDataPicasaWebUser *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_PICASAWEB_USER_H */ diff --git a/gdata/services/tasks/gdata-tasks-query.c b/gdata/services/tasks/gdata-tasks-query.c new file mode 100644 index 0000000..80ff702 --- /dev/null +++ b/gdata/services/tasks/gdata-tasks-query.c @@ -0,0 +1,659 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Peteris Krisjanis 2013 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-tasks-query + * @short_description: GData Tasks query object + * @stability: Stable + * @include: gdata/services/tasks/gdata-tasks-query.h + * + * #GDataTasksQuery represents a collection of query parameters specific to the Google Tasks service, which go above and beyond + * those catered for by #GDataQuery. + * + * For more details of Google Tasks API, see the + * online documentation. + * + * Since: 0.15.0 + */ + +#include +#include +#include +#include + +#include "gdata-tasks-query.h" +#include "gdata-query.h" +#include "gdata-parser.h" +#include "gdata-private.h" + +static void gdata_tasks_query_finalize (GObject *object); +static void gdata_tasks_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_tasks_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +struct _GDataTasksQueryPrivate { + gint64 completed_max; + gint64 completed_min; + gint64 due_max; + gint64 due_min; + gboolean show_completed; + gboolean show_deleted; + gboolean show_hidden; +}; + +enum { + PROP_COMPLETED_MAX = 1, + PROP_COMPLETED_MIN, + PROP_DUE_MAX, + PROP_DUE_MIN, + PROP_SHOW_COMPLETED, + PROP_SHOW_DELETED, + PROP_SHOW_HIDDEN, +}; + +G_DEFINE_TYPE (GDataTasksQuery, gdata_tasks_query, GDATA_TYPE_QUERY) + +static void +gdata_tasks_query_class_init (GDataTasksQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataTasksQueryPrivate)); + + gobject_class->set_property = gdata_tasks_query_set_property; + gobject_class->get_property = gdata_tasks_query_get_property; + gobject_class->finalize = gdata_tasks_query_finalize; + + query_class->get_query_uri = get_query_uri; + + /** + * GDataTasksQuery:completed-max: + * + * Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. + * The default is not to filter by completion date. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_COMPLETED_MAX, + g_param_spec_int64 ("completed-max", + "Max task completion date", "Upper bound for a task's completion date to filter by.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksQuery:completed-min: + * + * Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. + * The default is not to filter by completion date. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_COMPLETED_MIN, + g_param_spec_int64 ("completed-min", + "Min task completion date", "Lower bound for a task's completion date to filter by.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksQuery:due-max: + * + * Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. + * The default is not to filter by completion date. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_DUE_MAX, + g_param_spec_int64 ("due-max", + "Max task completion date", "Upper bound for a task's completion date to filter by.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksQuery:due-min: + * + * Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. + * The default is not to filter by completion date. + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_DUE_MIN, + g_param_spec_int64 ("due-min", + "Min task completion date", "Lower bound for a task's completion date to filter by.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksQuery:show-completed: + * + * Flag indicating whether completed tasks are returned in the result. Optional. The default is %FALSE. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_SHOW_COMPLETED, + g_param_spec_boolean ("show-completed", + "Show completed tasks?", "Indicated whatever completed tasks are returned in the result.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksQuery:show-deleted: + * + * Flag indicating whether deleted tasks are returned in the result. Optional. The default is %FALSE. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_SHOW_DELETED, + g_param_spec_boolean ("show-deleted", + "Show deleted tasks?", "Indicated whatever deleted tasks are returned in the result.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksQuery:show-hidden: + * + * Flag indicating whether hidden tasks are returned in the result. Optional. The default is %FALSE. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_SHOW_HIDDEN, + g_param_spec_boolean ("show-hidden", + "Show hidden tasks?", "Indicated whatever hidden tasks are returned in the result.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_tasks_query_init (GDataTasksQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_TASKS_QUERY, GDataTasksQueryPrivate); + self->priv->completed_min = -1; + self->priv->completed_max = -1; + self->priv->due_min = -1; + self->priv->due_max = -1; + + _gdata_query_set_pagination_type (GDATA_QUERY (self), + GDATA_QUERY_PAGINATION_TOKENS); +} + +static void +gdata_tasks_query_finalize (GObject *object) +{ + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_tasks_query_parent_class)->finalize (object); +} + +static void +gdata_tasks_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataTasksQueryPrivate *priv = GDATA_TASKS_QUERY (object)->priv; + + switch (property_id) { + case PROP_COMPLETED_MAX: + g_value_set_int64 (value, priv->completed_max); + break; + case PROP_COMPLETED_MIN: + g_value_set_int64 (value, priv->completed_min); + break; + case PROP_DUE_MAX: + g_value_set_int64 (value, priv->due_max); + break; + case PROP_DUE_MIN: + g_value_set_int64 (value, priv->due_min); + break; + case PROP_SHOW_COMPLETED: + g_value_set_boolean (value, priv->show_completed); + break; + case PROP_SHOW_DELETED: + g_value_set_boolean (value, priv->show_deleted); + break; + case PROP_SHOW_HIDDEN: + g_value_set_boolean (value, priv->show_hidden); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_tasks_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataTasksQuery *self = GDATA_TASKS_QUERY (object); + + switch (property_id) { + case PROP_COMPLETED_MAX: + gdata_tasks_query_set_completed_max (self, g_value_get_int64 (value)); + break; + case PROP_COMPLETED_MIN: + gdata_tasks_query_set_completed_min (self, g_value_get_int64 (value)); + break; + case PROP_DUE_MAX: + gdata_tasks_query_set_due_max (self, g_value_get_int64 (value)); + break; + case PROP_DUE_MIN: + gdata_tasks_query_set_due_min (self, g_value_get_int64 (value)); + break; + case PROP_SHOW_COMPLETED: + gdata_tasks_query_set_show_completed (self, g_value_get_boolean (value)); + break; + case PROP_SHOW_DELETED: + gdata_tasks_query_set_show_deleted (self, g_value_get_boolean (value)); + break; + case PROP_SHOW_HIDDEN: + gdata_tasks_query_set_show_hidden (self, g_value_get_boolean (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataTasksQueryPrivate *priv = GDATA_TASKS_QUERY (self)->priv; + + /* Chain up to the parent class. This adds a load of irrelevant query + * parameters, but they’re harmless. Importantly, it adds pagination + * support. */ + GDATA_QUERY_CLASS (gdata_tasks_query_parent_class)->get_query_uri (self, feed_uri, query_uri, params_started); + + #define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + if (gdata_query_get_max_results (GDATA_QUERY (self)) > 0) { + APPEND_SEP + g_string_append_printf (query_uri, "maxResults=%u", gdata_query_get_max_results (GDATA_QUERY (self))); + } + + if (gdata_query_get_updated_min (GDATA_QUERY (self)) != -1) { + gchar *updated_min; + + APPEND_SEP + g_string_append (query_uri, "updatedMin="); + updated_min = gdata_parser_int64_to_iso8601_numeric_timezone (gdata_query_get_updated_min (GDATA_QUERY (self))); + g_string_append (query_uri, updated_min); + g_free (updated_min); + } + + if (priv->completed_min != -1) { + gchar *completed_min; + + APPEND_SEP + g_string_append (query_uri, "completedMin="); + completed_min = gdata_parser_int64_to_iso8601_numeric_timezone (priv->completed_min); + g_string_append (query_uri, completed_min); + g_free (completed_min); + } + + if (priv->completed_max != -1) { + gchar *completed_max; + + APPEND_SEP + g_string_append (query_uri, "completedMax="); + completed_max = gdata_parser_int64_to_iso8601_numeric_timezone (priv->completed_max); + g_string_append (query_uri, completed_max); + g_free (completed_max); + } + + if (priv->due_min != -1) { + gchar *due_min; + + APPEND_SEP + g_string_append (query_uri, "dueMin="); + due_min = gdata_parser_int64_to_iso8601_numeric_timezone (priv->due_min); + g_string_append (query_uri, due_min); + g_free (due_min); + } + + if (priv->due_max != -1) { + gchar *due_max; + + APPEND_SEP + g_string_append (query_uri, "dueMax="); + due_max = gdata_parser_int64_to_iso8601_numeric_timezone (priv->due_max); + g_string_append (query_uri, due_max); + g_free (due_max); + } + + APPEND_SEP + if (priv->show_completed == TRUE) { + g_string_append (query_uri, "showCompleted=true"); + } else { + g_string_append (query_uri, "showCompleted=false"); + } + + APPEND_SEP + if (priv->show_deleted == TRUE) { + g_string_append (query_uri, "showDeleted=true"); + } else { + g_string_append (query_uri, "showDeleted=false"); + } + + APPEND_SEP + if (priv->show_hidden == TRUE) { + g_string_append (query_uri, "showHidden=true"); + } else { + g_string_append (query_uri, "showHidden=false"); + } + + #undef APPEND_SEP +} + +/** + * gdata_tasks_query_new: + * @q: (allow-none): a query string, or %NULL + * + * Creates a new #GDataTasksQuery. @q is unused and must be set to %NULL. + * + * Return value: a new #GDataTasksQuery + * + * Since: 0.15.0 + */ +GDataTasksQuery * +gdata_tasks_query_new (const gchar *q) +{ + /* Ignore the q parameter, as it's not used in any of the queries and + * will cause errors. */ + return g_object_new (GDATA_TYPE_TASKS_QUERY, NULL); +} + +/** + * gdata_tasks_query_get_completed_max: + * @self: a #GDataTasksQuery + * + * Gets the #GDataTasksQuery:completed-max property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the completed-max property, or -1 + * + * Since: 0.15.0 + */ +gint64 +gdata_tasks_query_get_completed_max (GDataTasksQuery *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_QUERY (self), -1); + return self->priv->completed_max; +} + +/** + * gdata_tasks_query_set_completed_max: + * @self: a #GDataTasksQuery + * @completed_max: upper bound for a task's completion date by UNIX timestamp, or -1 + * + * Sets the #GDataTasksQuery:completed-max property of the #GDataTasksQuery + * to the new time/date, @completed_max. + * + * Set @completed_max to -1 to unset the property in the query URI. + * + * Since: 0.15.0 + */ +void +gdata_tasks_query_set_completed_max (GDataTasksQuery *self, gint64 completed_max) +{ + g_return_if_fail (GDATA_IS_TASKS_QUERY (self)); + g_return_if_fail (completed_max >= -1); + + self->priv->completed_max = completed_max; + g_object_notify (G_OBJECT (self), "completed-max"); + + /* Our current ETag will no longer be relevant. */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_tasks_query_get_completed_min: + * @self: a #GDataTasksQuery + * + * Gets the #GDataTasksQuery:completed-min property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the completed-min property, or -1 + * + * Since: 0.15.0 + */ +gint64 +gdata_tasks_query_get_completed_min (GDataTasksQuery *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_QUERY (self), -1); + return self->priv->completed_min; +} + +/** + * gdata_tasks_query_set_completed_min: + * @self: a #GDataTasksQuery + * @completed_min: lower bound for a task's completion date by UNIX timestamp, or -1 + * + * Sets the #GDataTasksQuery:completed-min property of the #GDataTasksQuery + * to the new time/date, @completed_min. + * + * Set @completed_min to -1 to unset the property in the query URI. + * + * Since: 0.15.0 + */ +void +gdata_tasks_query_set_completed_min (GDataTasksQuery *self, gint64 completed_min) +{ + g_return_if_fail (GDATA_IS_TASKS_QUERY (self)); + g_return_if_fail (completed_min >= -1); + + self->priv->completed_min = completed_min; + g_object_notify (G_OBJECT (self), "completed-min"); + + /* Our current ETag will no longer be relevant. */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_tasks_query_get_due_max: + * @self: a #GDataTasksQuery + * + * Gets the #GDataTasksQuery:due-max property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the due-max property, or -1 + * + * Since: 0.15.0 + */ +gint64 +gdata_tasks_query_get_due_max (GDataTasksQuery *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_QUERY (self), -1); + return self->priv->due_max; +} + +/** + * gdata_tasks_query_set_due_max: + * @self: a #GDataTasksQuery + * @due_max: upper bound for a task's due date by UNIX timestamp, or -1 + * + * Sets the #GDataTasksQuery:due-max property of the #GDataTasksQuery + * to the new time/date, @due_max. + * + * Set @due_max to -1 to unset the property in the query URI. + * + * Since: 0.15.0 + */ +void +gdata_tasks_query_set_due_max (GDataTasksQuery *self, gint64 due_max) +{ + g_return_if_fail (GDATA_IS_TASKS_QUERY (self)); + g_return_if_fail (due_max >= -1); + + self->priv->due_max = due_max; + g_object_notify (G_OBJECT (self), "due-max"); + + /* Our current ETag will no longer be relevant. */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + + +/** + * gdata_tasks_query_get_due_min: + * @self: a #GDataTasksQuery + * + * Gets the #GDataTasksQuery:due-min property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the due-min property, or -1 + * + * Since: 0.15.0 + */ +gint64 +gdata_tasks_query_get_due_min (GDataTasksQuery *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_QUERY (self), -1); + return self->priv->due_min; +} + +/** + * gdata_tasks_query_set_due_min: + * @self: a #GDataTasksQuery + * @due_min: lower bound for a task's due date by UNIX timestamp, or -1 + * + * Sets the #GDataTasksQuery:due-min property of the #GDataTasksQuery + * to the new time/date, @due_min. + * + * Set @due_min to -1 to unset the property in the query URI. + * + * Since: 0.15.0 + */ +void +gdata_tasks_query_set_due_min (GDataTasksQuery *self, gint64 due_min) +{ + g_return_if_fail (GDATA_IS_TASKS_QUERY (self)); + g_return_if_fail (due_min >= -1); + + self->priv->due_min = due_min; + g_object_notify (G_OBJECT (self), "due-min"); + + /* Our current ETag will no longer be relevant. */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_tasks_query_get_show_completed: + * @self: a #GDataTasksQuery + * + * Gets the #GDataTasksQuery:show-completed property. + * + * Return value: the show-completed property + * + * Since: 0.15.0 + */ +gboolean +gdata_tasks_query_get_show_completed (GDataTasksQuery *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_QUERY (self), FALSE); + return self->priv->show_completed; +} + +/** + * gdata_tasks_query_set_show_completed: + * @self: a #GDataTasksQuery + * @show_completed: %TRUE to show completed tasks, %FALSE otherwise + * + * Sets the #GDataTasksQuery:show-completed property of the #GDataTasksQuery. + * + * Since: 0.15.0 + */ +void +gdata_tasks_query_set_show_completed (GDataTasksQuery *self, gboolean show_completed) +{ + g_return_if_fail (GDATA_IS_TASKS_QUERY (self)); + + self->priv->show_completed = show_completed; + g_object_notify (G_OBJECT (self), "show-completed"); + + /* Our current ETag will no longer be relevant. */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_tasks_query_get_show_deleted: + * @self: a #GDataTasksQuery + * + * Gets the #GDataTasksQuery:show-deleted property. + * + * Return value: the show-deleted property + * + * Since: 0.15.0 + */ +gboolean +gdata_tasks_query_get_show_deleted (GDataTasksQuery *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_QUERY (self), FALSE); + return self->priv->show_deleted; +} + +/** + * gdata_tasks_query_set_show_deleted: + * @self: a #GDataTasksQuery + * @show_deleted: %TRUE to show deleted tasks, %FALSE otherwise + * + * Sets the #GDataTasksQuery:show-deleted property of the #GDataTasksQuery. + * + * Since: 0.15.0 + */ +void +gdata_tasks_query_set_show_deleted (GDataTasksQuery *self, gboolean show_deleted) +{ + g_return_if_fail (GDATA_IS_TASKS_QUERY (self)); + + self->priv->show_deleted = show_deleted; + g_object_notify (G_OBJECT (self), "show-deleted"); + + /* Our current ETag will no longer be relevant. */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_tasks_query_get_show_hidden: + * @self: a #GDataTasksQuery + * + * Gets the #GDataTasksQuery:show-hidden property. + * + * Return value: the show-hidden property + * + * Since: 0.15.0 + */ +gboolean +gdata_tasks_query_get_show_hidden (GDataTasksQuery *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_QUERY (self), FALSE); + return self->priv->show_hidden; +} + +/** + * gdata_tasks_query_set_show_hidden: + * @self: a #GDataTasksQuery + * @show_hidden: %TRUE to show hidden tasks, %FALSE otherwise + * + * Sets the #GDataTasksQuery:show-hidden property of the #GDataTasksQuery. + * + * Since: 0.15.0 + */ +void +gdata_tasks_query_set_show_hidden (GDataTasksQuery *self, gboolean show_hidden) +{ + g_return_if_fail (GDATA_IS_TASKS_QUERY (self)); + + self->priv->show_hidden = show_hidden; + g_object_notify (G_OBJECT (self), "show-hidden"); + + /* Our current ETag will no longer be relevant. */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} diff --git a/gdata/services/tasks/gdata-tasks-query.h b/gdata/services/tasks/gdata-tasks-query.h new file mode 100644 index 0000000..bb399d9 --- /dev/null +++ b/gdata/services/tasks/gdata-tasks-query.h @@ -0,0 +1,90 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Peteris Krisjanis 2013 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_TASKS_QUERY_H +#define GDATA_TASKS_QUERY_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_TASKS_QUERY (gdata_tasks_query_get_type ()) +#define GDATA_TASKS_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_TASKS_QUERY, GDataTasksQuery)) +#define GDATA_TASKS_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_TASKS_QUERY, GDataTasksQueryClass)) +#define GDATA_IS_TASKS_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_TASKS_QUERY)) +#define GDATA_IS_TASKS_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_TASKS_QUERY)) +#define GDATA_TASKS_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_TASKS_QUERY, GDataTasksQueryClass)) + +typedef struct _GDataTasksQueryPrivate GDataTasksQueryPrivate; + +/** + * GDataTasksQuery: + * + * All the fields in the #GDataTasksQuery structure are private and should never be accessed directly. + * + * Since: 0.15.0 + */ +typedef struct { + GDataQuery parent; + GDataTasksQueryPrivate *priv; +} GDataTasksQuery; + +/** + * GDataTasksQueryClass: + * + * All the fields in the #GDataTasksQueryClass structure are private and should never be accessed directly. + * + * Since: 0.15.0 + */ +typedef struct { + /*< private >*/ + GDataQueryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataTasksQueryClass; + +GType gdata_tasks_query_get_type (void) G_GNUC_CONST; + +GDataTasksQuery *gdata_tasks_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +gint64 gdata_tasks_query_get_completed_max (GDataTasksQuery *self) G_GNUC_PURE; +void gdata_tasks_query_set_completed_max (GDataTasksQuery *self, gint64 completed_max); +gint64 gdata_tasks_query_get_completed_min (GDataTasksQuery *self) G_GNUC_PURE; +void gdata_tasks_query_set_completed_min (GDataTasksQuery *self, gint64 completed_min); +gint64 gdata_tasks_query_get_due_max (GDataTasksQuery *self) G_GNUC_PURE; +void gdata_tasks_query_set_due_max (GDataTasksQuery *self, gint64 due_max); +gint64 gdata_tasks_query_get_due_min (GDataTasksQuery *self) G_GNUC_PURE; +void gdata_tasks_query_set_due_min (GDataTasksQuery *self, gint64 due_min); +gboolean gdata_tasks_query_get_show_completed (GDataTasksQuery *self) G_GNUC_PURE; +void gdata_tasks_query_set_show_completed (GDataTasksQuery *self, gboolean show_completed); +gboolean gdata_tasks_query_get_show_deleted (GDataTasksQuery *self) G_GNUC_PURE; +void gdata_tasks_query_set_show_deleted (GDataTasksQuery *self, gboolean show_deleted); +gboolean gdata_tasks_query_get_show_hidden (GDataTasksQuery *self) G_GNUC_PURE; +void gdata_tasks_query_set_show_hidden (GDataTasksQuery *self, gboolean show_hidden); + +G_END_DECLS + +#endif /* !GDATA_TASKS_QUERY_H */ diff --git a/gdata/services/tasks/gdata-tasks-service.c b/gdata/services/tasks/gdata-tasks-service.c new file mode 100644 index 0000000..4fcbb2c --- /dev/null +++ b/gdata/services/tasks/gdata-tasks-service.c @@ -0,0 +1,872 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Peteris Krisjanis 2013 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-tasks-service + * @short_description: GData Tasks service object + * @stability: Stable + * @include: gdata/services/tasks/gdata-tasks-service.h + * + * #GDataTasksService is a subclass of #GDataService for communicating with the API of Google Tasks. It supports querying + * for, inserting, editing and deleting tasks from tasklists, as well as operations on the tasklists themselves. + * + * For more details of Google Tasks API, see the + * online documentation. + * + * Since: 0.15.0 + */ + +#include +#include +#include +#include + +#include "gdata-tasks-service.h" +#include "gdata-service.h" +#include "gdata-private.h" +#include "gdata-query.h" +#include "gdata-feed.h" + +/* Standards reference here: https://developers.google.com/google-apps/tasks/v1/reference/ */ + +static void parse_error_response (GDataService *self, + GDataOperationType operation_type, + guint status, const gchar *reason_phrase, + const gchar *response_body, gint length, + GError **error); +static GList *get_authorization_domains (void); + +_GDATA_DEFINE_AUTHORIZATION_DOMAIN (tasks, "tasks", "https://www.googleapis.com/auth/tasks") +G_DEFINE_TYPE (GDataTasksService, gdata_tasks_service, GDATA_TYPE_SERVICE) + +static void +gdata_tasks_service_class_init (GDataTasksServiceClass *klass) +{ + GDataServiceClass *service_class = GDATA_SERVICE_CLASS (klass); + + service_class->feed_type = GDATA_TYPE_FEED; + + service_class->parse_error_response = parse_error_response; + service_class->get_authorization_domains = get_authorization_domains; +} + +static void +gdata_tasks_service_init (GDataTasksService *self) +{ + /* Nothing to see here */ +} + +/* The error format used by the Google Tasks API doesn’t seem to be documented + * anywhere, which is a little frustrating. Here’s an example of it: + * { + * "error": { + * "errors": [ + * { + * "domain": "usageLimits", + * "reason": "dailyLimitExceededUnreg", + * "message": "Daily Limit for Unauthenticated Use Exceeded.", + * "extendedHelp": "https://code.google.com/apis/console" + * } + * ], + * "code": 403, + * "message": "Daily Limit for Unauthenticated Use Exceeded." + * } + * } + * or: + * { + * "error": { + * "errors": [ + * { + * "domain": "global", + * "reason": "authError", + * "message": "Invalid Credentials", + * "locationType": "header", + * "location": "Authorization" + * } + * ], + * "code": 401, + * "message": "Invalid Credentials" + * } + * } + */ +static void +parse_error_response (GDataService *self, GDataOperationType operation_type, + guint status, const gchar *reason_phrase, + const gchar *response_body, gint length, GError **error) +{ + JsonParser *parser = NULL; /* owned */ + JsonReader *reader = NULL; /* owned */ + gint i; + GError *child_error = NULL; + + if (response_body == NULL) { + goto parent; + } + + if (length == -1) { + length = strlen (response_body); + } + + parser = json_parser_new (); + if (!json_parser_load_from_data (parser, response_body, length, + &child_error)) { + goto parent; + } + + reader = json_reader_new (json_parser_get_root (parser)); + + /* Check that the outermost node is an object. */ + if (!json_reader_is_object (reader)) { + goto parent; + } + + /* Grab the ‘error’ member, then its ‘errors’ member. */ + if (!json_reader_read_member (reader, "error") || + !json_reader_is_object (reader) || + !json_reader_read_member (reader, "errors") || + !json_reader_is_array (reader)) { + goto parent; + } + + /* Parse each of the errors. Return the first one, and print out any + * others. */ + for (i = 0; i < json_reader_count_elements (reader); i++) { + const gchar *domain, *reason, *message, *extended_help; + const gchar *location_type, *location; + + /* Parse the error. */ + if (!json_reader_read_element (reader, i) || + !json_reader_is_object (reader)) { + goto parent; + } + + json_reader_read_member (reader, "domain"); + domain = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "reason"); + reason = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "message"); + message = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "extendedHelp"); + extended_help = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "locationType"); + location_type = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "location"); + location = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + /* End the error element. */ + json_reader_end_element (reader); + + /* Create an error message, but only for the first error */ + if (error == NULL || *error == NULL) { + if (g_strcmp0 (domain, "usageLimits") == 0 && + g_strcmp0 (reason, + "dailyLimitExceededUnreg") == 0) { + /* Daily Limit for Unauthenticated Use + * Exceeded. */ + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED, + _("You have made too many API " + "calls recently. Please wait a " + "few minutes and try again.")); + } else if (g_strcmp0 (domain, "global") == 0 && + (g_strcmp0 (reason, "authError") == 0 || + g_strcmp0 (reason, "required") == 0)) { + /* Authentication problem */ + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to " + "do this.")); + } else { + /* Unknown or validation (protocol) error. Fall + * back to working off the HTTP status code. */ + g_warning ("Unknown error code ‘%s’ in domain " + "‘%s’ received with location type " + "‘%s’, location ‘%s’, extended help " + "‘%s’ and message ‘%s’.", + reason, domain, location_type, + location, extended_help, message); + + goto parent; + } + } else { + /* For all errors after the first, log the error in the + * terminal. */ + g_debug ("Error message received in response: domain " + "‘%s’, reason ‘%s’, extended help ‘%s’, " + "message ‘%s’, location type ‘%s’, location " + "‘%s’.", + domain, reason, extended_help, message, + location_type, location); + } + } + + /* End the ‘errors’ and ‘error’ members. */ + json_reader_end_element (reader); + json_reader_end_element (reader); + + g_clear_object (&reader); + g_clear_object (&parser); + + /* Ensure we’ve actually set an error message. */ + g_assert (error == NULL || *error != NULL); + + return; + +parent: + g_clear_object (&reader); + g_clear_object (&parser); + + /* Chain up to the parent class */ + GDATA_SERVICE_CLASS (gdata_tasks_service_parent_class)->parse_error_response (self, operation_type, status, reason_phrase, + response_body, length, error); +} + +static GList * +get_authorization_domains (void) +{ + return g_list_prepend (NULL, get_tasks_authorization_domain ()); +} + +/** + * gdata_tasks_service_new: + * @authorizer: (allow-none): a #GDataAuthorizer to authorize the service's requests, or %NULL + * + * Creates a new #GDataTasksService using the given #GDataAuthorizer. If @authorizer is %NULL, all requests are made as an unauthenticated user. + * + * Return value: a new #GDataTasksService, or %NULL; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataTasksService * +gdata_tasks_service_new (GDataAuthorizer *authorizer) +{ + g_return_val_if_fail (authorizer == NULL || GDATA_IS_AUTHORIZER (authorizer), NULL); + + return g_object_new (GDATA_TYPE_TASKS_SERVICE, + "authorizer", authorizer, + NULL); +} + +/** + * gdata_tasks_service_get_primary_authorization_domain: + * + * The primary #GDataAuthorizationDomain for interacting with Google Tasks. This will not normally need to be used, as it's used internally + * by the #GDataTasksService methods. However, if using the plain #GDataService methods to implement custom queries or requests which libgdata + * does not support natively, then this domain may be needed to authorize the requests. + * + * The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. + * + * Return value: (transfer none): the service's authorization domain + * + * Since: 0.15.0 + */ +GDataAuthorizationDomain * +gdata_tasks_service_get_primary_authorization_domain (void) +{ + return get_tasks_authorization_domain (); +} + +/** + * gdata_tasks_service_query_all_tasklists: + * @self: a #GDataTasksService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: (allow-none): a #GError, or %NULL + * + * Queries the service to return a list of all tasklists from the authenticated account which match the given + * @query. It will return all tasklists the user has read access to. + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataFeed * +gdata_tasks_service_query_all_tasklists (GDataTasksService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + GDataFeed *feed; + gchar *request_uri; + + g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_tasks_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to query all tasklists.")); + return NULL; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/tasks/v1/users/@me/lists", NULL); + feed = gdata_service_query (GDATA_SERVICE (self), get_tasks_authorization_domain (), request_uri, query, GDATA_TYPE_TASKS_TASKLIST, + cancellable, progress_callback, progress_user_data, error); + g_free (request_uri); + + return feed; +} + +/** + * gdata_tasks_service_query_all_tasklists_async: + * @self: a #GDataTasksService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return a list of all tasklists from the authenticated account which match the given + * @query. @self and @query are all reffed when this function is called, so can safely be unreffed after + * this function returns. + * + * For more details, see gdata_tasks_service_query_all_tasklists(), which is the synchronous version of + * this function, and gdata_service_query_async(), which is the base asynchronous query function. + * + * Since: 0.15.0 + */ +void +gdata_tasks_service_query_all_tasklists_async (GDataTasksService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_TASKS_SERVICE (self)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_tasks_authorization_domain ()) == FALSE) { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", + _("You must be authenticated to query all tasklists.")); + + return; + } + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/tasks/v1/users/@me/lists", NULL); + gdata_service_query_async (GDATA_SERVICE (self), get_tasks_authorization_domain (), request_uri, query, GDATA_TYPE_TASKS_TASKLIST, + cancellable, progress_callback, progress_user_data, destroy_progress_user_data, callback, user_data); + g_free (request_uri); +} + +/** + * gdata_tasks_service_query_tasks: + * @self: a #GDataTasksService + * @tasklist: a #GDataTasksTasklist + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: (allow-none): a #GError, or %NULL + * + * Queries the service to return a list of tasks in the given @tasklist, which match @query. + * + * For more details, see gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataFeed * +gdata_tasks_service_query_tasks (GDataTasksService *self, GDataTasksTasklist *tasklist, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) +{ + gchar* request_uri; + GDataFeed *feed; + + g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist), NULL); + g_return_val_if_fail (gdata_entry_get_id (GDATA_ENTRY (tasklist)) != NULL, NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_tasks_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to query your own tasks.")); + return NULL; + } + + /* Should add /tasks as requested by API */ + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/tasks/v1/lists/", gdata_entry_get_id (GDATA_ENTRY (tasklist)), "/tasks", NULL); + /* Execute the query */ + feed = gdata_service_query (GDATA_SERVICE (self), get_tasks_authorization_domain (), request_uri, query, GDATA_TYPE_TASKS_TASK, cancellable, + progress_callback, progress_user_data, error); + g_free (request_uri); + + return feed; +} + +/** + * gdata_tasks_service_query_tasks_async: + * @self: a #GDataTasksService + * @tasklist: a #GDataTasksTasklist + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when the query is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service to return a list of tasks in the given @tasklist, which match @query. @self, @tasklist and @query are all reffed when this + * function is called, so can safely be unreffed after this function returns. + * + * Get the results of the query using gdata_service_query_finish() in the @callback. + * + * For more details, see gdata_tasks_service_query_tasks(), which is the synchronous version of this function, and gdata_service_query_async(), + * which is the base asynchronous query function. + * + * Since: 0.15.0 + */ +void +gdata_tasks_service_query_tasks_async (GDataTasksService *self, GDataTasksTasklist *tasklist, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_TASKS_SERVICE (self)); + g_return_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist)); + g_return_if_fail (gdata_entry_get_id (GDATA_ENTRY (tasklist)) != NULL); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + /* Ensure we're authenticated first */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_tasks_authorization_domain ()) == FALSE) { + g_autoptr(GTask) task = NULL; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_service_query_async); + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", + _("You must be authenticated to query your own tasks.")); + + return; + } + + /* Should add /tasks as requested by API */ + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/tasks/v1/lists/", gdata_entry_get_id (GDATA_ENTRY (tasklist)), "/tasks", NULL); + /* Execute the query */ + gdata_service_query_async (GDATA_SERVICE (self), get_tasks_authorization_domain (), request_uri, query, GDATA_TYPE_TASKS_TASK, cancellable, + progress_callback, progress_user_data, destroy_progress_user_data, callback, user_data); + g_free (request_uri); +} + +/** + * gdata_tasks_service_insert_task: + * @self: a #GDataTasksService + * @task: the #GDataTasksTask to insert + * @tasklist: #GDataTasksTasklist to insert into + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: (allow-none): a #GError, or %NULL + * + * Inserts @task by uploading it to the online tasks service into tasklist @tasklist. It is safe to unref @tasklist after function returns. + * + * For more details, see gdata_service_insert_entry(). + * + * Return value: (transfer full): an updated #GDataTasksTask, or %NULL; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataTasksTask * +gdata_tasks_service_insert_task (GDataTasksService *self, GDataTasksTask *task, GDataTasksTasklist *tasklist, GCancellable *cancellable, GError **error) +{ + gchar *request_uri; + GDataEntry *entry; + + g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_TASKS_TASK (task), NULL); + g_return_val_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist), NULL); + g_return_val_if_fail (gdata_entry_get_id (GDATA_ENTRY (tasklist)) != NULL, NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/tasks/v1/lists/", gdata_entry_get_id (GDATA_ENTRY (tasklist)), "/tasks", NULL); + entry = gdata_service_insert_entry (GDATA_SERVICE (self), get_tasks_authorization_domain (), request_uri, GDATA_ENTRY (task), cancellable, error); + g_free (request_uri); + + return GDATA_TASKS_TASK (entry); +} + +/** + * gdata_tasks_service_insert_task_async: + * @self: a #GDataTasksService + * @task: the #GDataTasksTask to insert + * @tasklist: #GDataTasksTasklist to insert into + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Inserts @task by uploading it to the online tasks service into tasklist @tasklist. @self, @task and @tasklist are all reffed when this function is called, so can safely be + * unreffed after this function returns. + * + * @callback should call gdata_service_insert_entry_finish() to obtain a #GDataTasksTask representing the inserted task and to check for possible + * errors. + * + * For more details, see gdata_tasks_service_insert_task(), which is the synchronous version of this function, and + * gdata_service_insert_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.15.0 + */ +void +gdata_tasks_service_insert_task_async (GDataTasksService *self, GDataTasksTask *task, GDataTasksTasklist *tasklist, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_TASKS_SERVICE (self)); + g_return_if_fail (GDATA_IS_TASKS_TASK (task)); + g_return_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist)); + g_return_if_fail (gdata_entry_get_id (GDATA_ENTRY (tasklist)) != NULL); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/tasks/v1/lists/", gdata_entry_get_id (GDATA_ENTRY (tasklist)), "/tasks", NULL); + gdata_service_insert_entry_async (GDATA_SERVICE (self), get_tasks_authorization_domain (), request_uri, GDATA_ENTRY (task), cancellable, + callback, user_data); + g_free (request_uri); +} + +/** + * gdata_tasks_service_insert_tasklist: + * @self: a #GDataTasksService + * @tasklist: #GDataTasksTasklist to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: (allow-none): a #GError, or %NULL + * + * Inserts @tasklist by uploading it to the online tasks service. + * + * For more details, see gdata_service_insert_entry(). + * + * Return value: (transfer full): an updated #GDataTasksTasklist, or %NULL; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataTasksTasklist * +gdata_tasks_service_insert_tasklist (GDataTasksService *self, GDataTasksTasklist *tasklist, GCancellable *cancellable, GError **error) +{ + gchar *request_uri; + GDataEntry *entry; + + g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/tasks/v1/users/@me/lists", NULL); + entry = gdata_service_insert_entry (GDATA_SERVICE (self), get_tasks_authorization_domain (), request_uri, GDATA_ENTRY (tasklist), cancellable, error); + g_free (request_uri); + + return GDATA_TASKS_TASKLIST (entry); +} + +/** + * gdata_tasks_service_insert_tasklist_async: + * @self: a #GDataTasksService + * @tasklist: #GDataTasksTasklist to insert + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Inserts @tasklist by uploading it to the online tasks service. @self and @tasklist are both reffed when this function is called, so can safely be + * unreffed after this function returns. + * + * @callback should call gdata_service_insert_entry_finish() to obtain a #GDataTasksTasklist representing the inserted tasklist and to check for possible + * errors. + * + * For more details, see gdata_tasks_service_insert_tasklist(), which is the synchronous version of this function, and + * gdata_service_insert_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.15.0 + */ +void +gdata_tasks_service_insert_tasklist_async (GDataTasksService *self, GDataTasksTasklist *tasklist, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *request_uri; + + g_return_if_fail (GDATA_IS_TASKS_SERVICE (self)); + g_return_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/tasks/v1/users/@me/lists", NULL); + gdata_service_insert_entry_async (GDATA_SERVICE (self), get_tasks_authorization_domain (), request_uri, GDATA_ENTRY (tasklist), cancellable, + callback, user_data); + g_free (request_uri); +} + +/** + * gdata_tasks_service_delete_task: + * @self: a #GDataTasksService + * @task: the #GDataTasksTask to delete + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: (allow-none): a #GError, or %NULL + * + * Delete @task from online tasks service. + * + * For more details, see gdata_service_delete_entry(). + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.15.0 + */ +gboolean +gdata_tasks_service_delete_task (GDataTasksService *self, GDataTasksTask *task, GCancellable *cancellable, GError **error) +{ + g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), FALSE); + g_return_val_if_fail (GDATA_IS_TASKS_TASK (task), FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + return gdata_service_delete_entry (GDATA_SERVICE (self), get_tasks_authorization_domain (), GDATA_ENTRY (task), cancellable, error); +} + +/** + * gdata_tasks_service_delete_task_async: + * @self: a #GDataTasksService + * @task: #GDataTasksTask to delete + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Deletes @task from online tasks service. @self and @task are both reffed when this function is called, so can safely be + * unreffed after this function returns. + * + * @callback should call gdata_service_delete_entry_finish() to finish deleting task and to check for possible + * errors. + * + * For more details, see gdata_tasks_service_delete_task(), which is the synchronous version of this function, and + * gdata_service_delete_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.15.0 + */ +void +gdata_tasks_service_delete_task_async (GDataTasksService *self, GDataTasksTask *task, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_return_if_fail (GDATA_IS_TASKS_SERVICE (self)); + g_return_if_fail (GDATA_IS_TASKS_TASK (task)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + gdata_service_delete_entry_async (GDATA_SERVICE (self), get_tasks_authorization_domain (), GDATA_ENTRY (task), cancellable, + callback, user_data); +} + +/** + * gdata_tasks_service_delete_tasklist: + * @self: a #GDataTasksService + * @tasklist: the #GDataTasksTasklist to delete + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: (allow-none): a #GError, or %NULL + * + * Delete @tasklist from online tasks service. + * + * For more details, see gdata_service_delete_entry(). + * + * Return value: %TRUE on success, %FALSE otherwise + * + * Since: 0.15.0 + */ +gboolean +gdata_tasks_service_delete_tasklist (GDataTasksService *self, GDataTasksTasklist *tasklist, GCancellable *cancellable, GError **error) +{ + g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), FALSE); + g_return_val_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist), FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + return gdata_service_delete_entry (GDATA_SERVICE (self), get_tasks_authorization_domain (), GDATA_ENTRY (tasklist), cancellable, error); +} + +/** + * gdata_tasks_service_delete_tasklist_async: + * @self: a #GDataTasksService + * @tasklist: #GDataTasksTasklist to delete + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Deletes @tasklist from online tasks service. @self and @tasklist are both reffed when this function is called, so can safely be + * unreffed after this function returns. + * + * @callback should call gdata_service_delete_entry_finish() to finish deleting tasklist and to check for possible + * errors. + * + * For more details, see gdata_tasks_service_delete_tasklist(), which is the synchronous version of this function, and + * gdata_service_delete_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.15.0 + */ +void +gdata_tasks_service_delete_tasklist_async (GDataTasksService *self, GDataTasksTasklist *tasklist, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_return_if_fail (GDATA_IS_TASKS_SERVICE (self)); + g_return_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + gdata_service_delete_entry_async (GDATA_SERVICE (self), get_tasks_authorization_domain (), GDATA_ENTRY (tasklist), cancellable, + callback, user_data); +} + +/** + * gdata_tasks_service_update_task: + * @self: a #GDataTasksService + * @task: the #GDataTasksTask to update + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: (allow-none): a #GError, or %NULL + * + * Update @task in online tasks service. + * + * For more details, see gdata_service_update_entry(). + * + * Return value: (transfer full): an updated #GDataTasksTask, or %NULL; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataTasksTask * +gdata_tasks_service_update_task (GDataTasksService *self, GDataTasksTask *task, GCancellable *cancellable, GError **error) +{ + g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_TASKS_TASK (task), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + return GDATA_TASKS_TASK (gdata_service_update_entry (GDATA_SERVICE (self), get_tasks_authorization_domain (), GDATA_ENTRY (task), cancellable, error)); +} + +/** + * gdata_tasks_service_update_task_async: + * @self: a #GDataTasksService + * @task: #GDataTasksTask to update + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Updates @task to online tasks service. @self and @task are both reffed when this function is called, so can safely be + * unreffed after this function returns. + * + * @callback should call gdata_service_update_entry_finish() to obtain a #GDataTasksTask representing the updated task and to check for possible + * errors. + * + * For more details, see gdata_tasks_service_update_task(), which is the synchronous version of this function, and + * gdata_service_update_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.15.0 + */ +void +gdata_tasks_service_update_task_async (GDataTasksService *self, GDataTasksTask *task, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_return_if_fail (GDATA_IS_TASKS_SERVICE (self)); + g_return_if_fail (GDATA_IS_TASKS_TASK (task)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + gdata_service_update_entry_async (GDATA_SERVICE (self), get_tasks_authorization_domain (), GDATA_ENTRY (task), cancellable, + callback, user_data); +} + +/** + * gdata_tasks_service_update_tasklist: + * @self: a #GDataTasksService + * @tasklist: the #GDataTasksTasklist to update + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @error: (allow-none): a #GError, or %NULL + * + * Update @tasklist in online tasks service. + * + * For more details, see gdata_service_update_entry(). + * + * Return value: (transfer full): an updated #GDataTasksTasklist, or %NULL; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataTasksTasklist * +gdata_tasks_service_update_tasklist (GDataTasksService *self, GDataTasksTasklist *tasklist, GCancellable *cancellable, GError **error) +{ + g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + return GDATA_TASKS_TASKLIST (gdata_service_update_entry (GDATA_SERVICE (self), get_tasks_authorization_domain (), GDATA_ENTRY (tasklist), cancellable, error)); +} + +/** + * gdata_tasks_service_update_tasklist_async: + * @self: a #GDataTasksService + * @tasklist: #GDataTasksTasklist to update + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when insertion is finished + * @user_data: (closure): data to pass to the @callback function + * + * Updates @tasklist from online tasks service. @self and @tasklist are both reffed when this function is called, so can safely be + * unreffed after this function returns. + * + * @callback should call gdata_service_update_entry_finish() to obtain a #GDataTasksTasklist representing the updated task and to check for possible + * errors. + * + * For more details, see gdata_tasks_service_update_tasklist(), which is the synchronous version of this function, and + * gdata_service_update_entry_async(), which is the base asynchronous insertion function. + * + * Since: 0.15.0 + */ +void +gdata_tasks_service_update_tasklist_async (GDataTasksService *self, GDataTasksTasklist *tasklist, GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_return_if_fail (GDATA_IS_TASKS_SERVICE (self)); + g_return_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + gdata_service_update_entry_async (GDATA_SERVICE (self), get_tasks_authorization_domain (), GDATA_ENTRY (tasklist), cancellable, + callback, user_data); +} diff --git a/gdata/services/tasks/gdata-tasks-service.h b/gdata/services/tasks/gdata-tasks-service.h new file mode 100644 index 0000000..625c217 --- /dev/null +++ b/gdata/services/tasks/gdata-tasks-service.h @@ -0,0 +1,115 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Peteris Krisjanis 2013 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_TASKS_SERVICE_H +#define GDATA_TASKS_SERVICE_H + +#include +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_TASKS_SERVICE (gdata_tasks_service_get_type ()) +#define GDATA_TASKS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_TASKS_SERVICE, GDataTasksService)) +#define GDATA_TASKS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_TASKS_SERVICE, GDataTasksServiceClass)) +#define GDATA_IS_TASKS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_TASKS_SERVICE)) +#define GDATA_IS_TASKS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_TASKS_SERVICE)) +#define GDATA_TASKS_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_TASKS_SERVICE, GDataTasksServiceClass)) + +/** + * GDataTasksService: + * + * All the fields in the #GDataTasksService structure are private and should never be accessed directly. + * + * Since: 0.15.0 + */ +typedef struct { + GDataService parent; +} GDataTasksService; + +/** + * GDataTasksServiceClass: + * + * All the fields in the #GDataTasksServiceClass structure are private and should never be accessed directly. + * + * Since: 0.15.0 + */ +typedef struct { + /*< private >*/ + GDataServiceClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataTasksServiceClass; + +GType gdata_tasks_service_get_type (void) G_GNUC_CONST; + +GDataTasksService *gdata_tasks_service_new (GDataAuthorizer *authorizer) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataAuthorizationDomain *gdata_tasks_service_get_primary_authorization_domain (void) G_GNUC_CONST; + +GDataFeed *gdata_tasks_service_query_all_tasklists (GDataTasksService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_tasks_service_query_all_tasklists_async (GDataTasksService *self, GDataQuery *query, GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data); + +GDataFeed *gdata_tasks_service_query_tasks (GDataTasksService *self, GDataTasksTasklist *tasklist, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_tasks_service_query_tasks_async (GDataTasksService *self, GDataTasksTasklist *tasklist, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, GAsyncReadyCallback callback, gpointer user_data); + +GDataTasksTask *gdata_tasks_service_insert_task (GDataTasksService *self, GDataTasksTask *task, GDataTasksTasklist *tasklist, + GCancellable *cancellable, GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; +void gdata_tasks_service_insert_task_async (GDataTasksService *self, GDataTasksTask *task, GDataTasksTasklist *tasklist, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +GDataTasksTasklist *gdata_tasks_service_insert_tasklist (GDataTasksService *self, GDataTasksTasklist *tasklist, + GCancellable *cancellable, GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; +void gdata_tasks_service_insert_tasklist_async (GDataTasksService *self, GDataTasksTasklist *tasklist, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +gboolean gdata_tasks_service_delete_task (GDataTasksService *self, GDataTasksTask *task, + GCancellable *cancellable, GError **error); +void gdata_tasks_service_delete_task_async (GDataTasksService *self, GDataTasksTask *task, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +gboolean gdata_tasks_service_delete_tasklist (GDataTasksService *self, GDataTasksTasklist *tasklist, + GCancellable *cancellable, GError **error); +void gdata_tasks_service_delete_tasklist_async (GDataTasksService *self, GDataTasksTasklist *tasklist, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +GDataTasksTask *gdata_tasks_service_update_task (GDataTasksService *self, GDataTasksTask *task, + GCancellable *cancellable, GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; +void gdata_tasks_service_update_task_async (GDataTasksService *self, GDataTasksTask *task, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +GDataTasksTasklist *gdata_tasks_service_update_tasklist (GDataTasksService *self, GDataTasksTasklist *tasklist, + GCancellable *cancellable, GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; +void gdata_tasks_service_update_tasklist_async (GDataTasksService *self, GDataTasksTasklist *tasklist, + GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); + +G_END_DECLS + +#endif /* !GDATA_TASKS_SERVICE_H */ diff --git a/gdata/services/tasks/gdata-tasks-task.c b/gdata/services/tasks/gdata-tasks-task.c new file mode 100644 index 0000000..568c828 --- /dev/null +++ b/gdata/services/tasks/gdata-tasks-task.c @@ -0,0 +1,680 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Peteris Krisjanis 2013 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-tasks-task + * @short_description: GData Tasks task object + * @stability: Stable + * @include: gdata/services/tasks/gdata-tasks-task.h + * + * #GDataTasksTask is a subclass of #GDataEntry to represent a task in a tasklist from Google Tasks. + * + * All functionality of Tasks is currently supported except + * links. + * + * For more details of Google Tasks API, see the + * online documentation. + * + * Since: 0.15.0 + */ + +#include +#include +#include +#include + +#include "gdata-tasks-task.h" +#include "gdata-private.h" +#include "gdata-service.h" +#include "gdata-parser.h" +#include "gdata-types.h" +#include "gdata-comparable.h" + +static void gdata_tasks_task_finalize (GObject *object); +static void gdata_tasks_task_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_tasks_task_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_json (GDataParsable *parsable, JsonBuilder *builder); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static const gchar *get_content_type (void); + +struct _GDataTasksTaskPrivate { + gchar *parent; + gchar *position; + gchar *notes; + gchar *status; + gint64 due; + gint64 completed; + gboolean deleted; + gboolean hidden; +}; + +enum { + PROP_PARENT = 1, + PROP_POSITION, + PROP_NOTES, + PROP_STATUS, + PROP_DUE, + PROP_COMPLETED, + PROP_DELETED, + PROP_HIDDEN, +}; + +G_DEFINE_TYPE (GDataTasksTask, gdata_tasks_task, GDATA_TYPE_ENTRY) + +static void +gdata_tasks_task_class_init (GDataTasksTaskClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataTasksTaskPrivate)); + + gobject_class->get_property = gdata_tasks_task_get_property; + gobject_class->set_property = gdata_tasks_task_set_property; + gobject_class->finalize = gdata_tasks_task_finalize; + + parsable_class->parse_json = parse_json; + parsable_class->get_json = get_json; + parsable_class->get_content_type = get_content_type; + + entry_class->kind_term = "tasks#task"; + + /** + * GDataTasksTask:parent: + * + * Parent task identifier. This field is omitted if it is a top-level task. This field is read-only. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_PARENT, + g_param_spec_string ("parent", + "Parent of task", "Identifier of parent task.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksTask:position: + * + * String indicating the position of the task among its sibling tasks under the same parent task + * or at the top level. If this string is greater than another task's corresponding position string + * according to lexicographical ordering, the task is positioned after the other task under the same + * parent task (or at the top level). This field is read-only. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_POSITION, + g_param_spec_string ("position", + "Position of task", "Position of the task among sibling tasks using lexicographical order.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksTask:notes: + * + * This is where the description of what needs to be done in the task is stored. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_NOTES, + g_param_spec_string ("notes", + "Notes of task", "Notes describing the task.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksTask:status: + * + * Status of the task. This is either %GDATA_TASKS_STATUS_NEEDS_ACTION + * or %GDATA_TASKS_STATUS_COMPLETED. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_STATUS, + g_param_spec_string ("status", + "Status of task", "Status of the task.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksTask:due: + * + * Due date of the task (as a RFC 3339 timestamp; seconds since the UNIX + * epoch). + * + * This field is -1 if the task has no due + * date assigned. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_DUE, + g_param_spec_int64 ("due", + "Due date of the task", "Due date of the task.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksTask:completed: + * + * Completion date of the task (as a RFC 3339 timestamp; seconds since + * the UNIX epoch). + * + * This field is -1 if the task has not + * been completed. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_COMPLETED, + g_param_spec_int64 ("completed", + "Completion date of task", "Completion date of the task.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksTask:is-deleted: + * + * Flag indicating whether the task has been deleted. The default is %FALSE. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_DELETED, + g_param_spec_boolean ("is-deleted", + "Deleted?", "Indicated whatever task is deleted.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataTasksTask:is-hidden: + * + * Flag indicating whether the task is hidden. This is the case if the task + * had been marked completed when the task list was last cleared. + * The default is %FALSE. This field is read-only. + * + * Since: 0.15.0 + */ + g_object_class_install_property (gobject_class, PROP_HIDDEN, + g_param_spec_boolean ("is-hidden", + "Hidden?", "Indicated whatever task is hidden.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_tasks_task_init (GDataTasksTask *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_TASKS_TASK, GDataTasksTaskPrivate); + self->priv->due = -1; + self->priv->completed = -1; +} + +static void +gdata_tasks_task_finalize (GObject *object) +{ + GDataTasksTaskPrivate *priv = GDATA_TASKS_TASK (object)->priv; + + g_free (priv->parent); + g_free (priv->position); + g_free (priv->notes); + g_free (priv->status); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_tasks_task_parent_class)->finalize (object); +} + +static void +gdata_tasks_task_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataTasksTaskPrivate *priv = GDATA_TASKS_TASK (object)->priv; + + switch (property_id) { + case PROP_PARENT: + g_value_set_string (value, priv->parent); + break; + case PROP_POSITION: + g_value_set_string (value, priv->position); + break; + case PROP_NOTES: + g_value_set_string (value, priv->notes); + break; + case PROP_STATUS: + g_value_set_string (value, priv->status); + break; + case PROP_DUE: + g_value_set_int64 (value, priv->due); + break; + case PROP_COMPLETED: + g_value_set_int64 (value, priv->completed); + break; + case PROP_DELETED: + g_value_set_boolean (value, priv->deleted); + break; + case PROP_HIDDEN: + g_value_set_boolean (value, priv->hidden); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_tasks_task_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataTasksTask *self = GDATA_TASKS_TASK (object); + + switch (property_id) { + case PROP_NOTES: + gdata_tasks_task_set_notes (self, g_value_get_string (value)); + break; + case PROP_STATUS: + gdata_tasks_task_set_status (self, g_value_get_string (value)); + break; + case PROP_DUE: + gdata_tasks_task_set_due (self, g_value_get_int64 (value)); + break; + case PROP_COMPLETED: + gdata_tasks_task_set_completed (self, g_value_get_int64 (value)); + break; + case PROP_DELETED: + gdata_tasks_task_set_is_deleted (self, g_value_get_boolean (value)); + break; + case PROP_PARENT: + case PROP_POSITION: + case PROP_HIDDEN: + /* Read-only */ + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + gboolean success; + GDataTasksTask *self = GDATA_TASKS_TASK (parsable); + + if (gdata_parser_string_from_json_member (reader, "parent", P_DEFAULT, &(self->priv->parent), &success, error) == TRUE || + gdata_parser_string_from_json_member (reader, "position", P_DEFAULT, &(self->priv->position), &success, error) == TRUE || + gdata_parser_string_from_json_member (reader, "notes", P_DEFAULT, &(self->priv->notes), &success, error) == TRUE || + gdata_parser_string_from_json_member (reader, "status", P_DEFAULT, &(self->priv->status), &success, error) == TRUE || + gdata_parser_int64_time_from_json_member (reader, "due", P_DEFAULT, &(self->priv->due), &success, error) == TRUE || + gdata_parser_int64_time_from_json_member (reader, "completed", P_DEFAULT, &(self->priv->completed), &success, error) == TRUE || + gdata_parser_boolean_from_json_member (reader, "deleted", P_DEFAULT, &(self->priv->deleted), &success, error) == TRUE || + gdata_parser_boolean_from_json_member (reader, "hidden", P_DEFAULT, &(self->priv->hidden), &success, error) == TRUE) { + return success; + } else { + return GDATA_PARSABLE_CLASS (gdata_tasks_task_parent_class)->parse_json (parsable, reader, user_data, error); + } + + return TRUE; +} + +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + gchar *due; + gchar *completed; + GList *i; + GDataLink *_link; + GDataEntry *entry = GDATA_ENTRY (parsable); + GDataTasksTaskPrivate *priv = GDATA_TASKS_TASK (parsable)->priv; + + /* Add all the general JSON. We can’t chain up to #GDataEntry here + * because Google Tasks uses a different date format. */ + json_builder_set_member_name (builder, "title"); + json_builder_add_string_value (builder, gdata_entry_get_title (entry)); + + if (gdata_entry_get_id (entry)) { + json_builder_set_member_name (builder, "id"); + json_builder_add_string_value (builder, gdata_entry_get_id (entry)); + } + + if (gdata_entry_get_updated (entry) != -1) { + gchar *updated = gdata_parser_int64_to_iso8601_numeric_timezone (gdata_entry_get_updated (entry)); + json_builder_set_member_name (builder, "updated"); + json_builder_add_string_value (builder, updated); + g_free (updated); + } + + /* If we have a "kind" category, add that. */ + for (i = gdata_entry_get_categories (entry); i != NULL; i = i->next) { + GDataCategory *category = GDATA_CATEGORY (i->data); + + if (g_strcmp0 (gdata_category_get_scheme (category), "http://schemas.google.com/g/2005#kind") == 0) { + json_builder_set_member_name (builder, "kind"); + json_builder_add_string_value (builder, gdata_category_get_term (category)); + } + } + + /* Add the ETag, if available. */ + if (gdata_entry_get_etag (entry) != NULL) { + json_builder_set_member_name (builder, "etag"); + json_builder_add_string_value (builder, gdata_entry_get_etag (entry)); + } + + /* Add the self-link. */ + _link = gdata_entry_look_up_link (GDATA_ENTRY (parsable), GDATA_LINK_SELF); + if (_link != NULL) { + json_builder_set_member_name (builder, "selfLink"); + json_builder_add_string_value (builder, gdata_link_get_uri (_link)); + } + + /* Add all the task specific JSON */ + + if (priv->parent != NULL) { + json_builder_set_member_name (builder, "parent"); + json_builder_add_string_value (builder, priv->parent); + } + if (priv->position != NULL) { + json_builder_set_member_name (builder, "position"); + json_builder_add_string_value (builder, priv->position); + } + if (priv->notes != NULL) { + json_builder_set_member_name (builder, "notes"); + json_builder_add_string_value (builder, priv->notes); + } + if (priv->status != NULL) { + json_builder_set_member_name (builder, "status"); + json_builder_add_string_value (builder, priv->status); + } + if (priv->due != -1) { + due = gdata_parser_int64_to_iso8601_numeric_timezone (priv->due); + json_builder_set_member_name (builder, "due"); + json_builder_add_string_value (builder, due); + g_free (due); + } + if (priv->completed != -1) { + completed = gdata_parser_int64_to_iso8601_numeric_timezone (priv->completed); + json_builder_set_member_name (builder, "completed"); + json_builder_add_string_value (builder, completed); + g_free (completed); + } + + json_builder_set_member_name (builder, "deleted"); + json_builder_add_boolean_value (builder, priv->deleted); + + json_builder_set_member_name (builder, "hidden"); + json_builder_add_boolean_value (builder, priv->hidden); +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +/** + * gdata_tasks_task_new: + * @id: (allow-none): the task's ID, or %NULL + * + * Creates a new #GDataTasksTask with the given ID and default properties. + * + * Return value: a new #GDataTasksTask; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataTasksTask * +gdata_tasks_task_new (const gchar *id) +{ + return GDATA_TASKS_TASK (g_object_new (GDATA_TYPE_TASKS_TASK, "id", id, NULL)); +} + +/** + * gdata_tasks_task_get_parent: + * @self: a #GDataTasksTask + * + * Gets the #GDataTasksTask:parent property. + * + * Return value: (allow-none): the parent of the task, or %NULL + * + * Since: 0.15.0 + */ +const gchar * +gdata_tasks_task_get_parent (GDataTasksTask *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_TASK (self), NULL); + return self->priv->parent; +} + +/** + * gdata_tasks_task_get_position: + * @self: a #GDataTasksTask + * + * Gets the #GDataTasksTask:position property. + * + * Return value: (allow-none): the position of the task, or %NULL + * + * Since: 0.15.0 + */ +const gchar * +gdata_tasks_task_get_position (GDataTasksTask *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_TASK (self), NULL); + return self->priv->position; +} + +/** + * gdata_tasks_task_get_notes: + * @self: a #GDataTasksTask + * + * Gets the #GDataTasksTask:notes property. + * + * Return value: (allow-none): notes of the task, or %NULL + * + * Since: 0.15.0 + */ +const gchar * +gdata_tasks_task_get_notes (GDataTasksTask *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_TASK (self), NULL); + return self->priv->notes; +} + +/** + * gdata_tasks_task_set_notes: + * @self: a #GDataTasksTask + * @notes: (allow-none): a new notes of the task, or %NULL + * + * Sets the #GDataTasksTask:notes property to the new notes, @notes. + * + * Set @notes to %NULL to unset the property in the task. + * + * Since: 0.15.0 + */ +void +gdata_tasks_task_set_notes (GDataTasksTask *self, const gchar *notes) +{ + gchar *local_notes; + g_return_if_fail (GDATA_IS_TASKS_TASK (self)); + + local_notes = self->priv->notes; + self->priv->notes = g_strdup (notes); + g_free (local_notes); + g_object_notify (G_OBJECT (self), "notes"); +} + +/** + * gdata_tasks_task_get_status: + * @self: a #GDataTasksTask + * + * Gets the #GDataTasksTask:status property. + * + * Return value: (allow-none): the status of the task, or %NULL + * + * Since: 0.15.0 + */ +const gchar * +gdata_tasks_task_get_status (GDataTasksTask *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_TASK (self), NULL); + return self->priv->status; +} + +/** + * gdata_tasks_task_set_status: + * @self: a #GDataTasksTask + * @status: (allow-none): a new status of the task, or %NULL + * + * Sets the #GDataTasksTask:status property to the new status, @status. + * + * Set @status to %NULL to unset the property in the task. + * + * Since: 0.15.0 + */ +void +gdata_tasks_task_set_status (GDataTasksTask *self, const gchar *status) +{ + gchar *local_status; + g_return_if_fail (GDATA_IS_TASKS_TASK (self)); + + local_status = self->priv->status; + self->priv->status = g_strdup (status); + g_free (local_status); + g_object_notify (G_OBJECT (self), "status"); +} + +/** + * gdata_tasks_task_get_due: + * @self: a #GDataTasksTask + * + * Gets the #GDataTasksTask:due property. If the property is unset, -1 will be returned. + * + * Return value: the due property, or -1 + * + * Since: 0.15.0 + */ +gint64 +gdata_tasks_task_get_due (GDataTasksTask *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_TASK (self), -1); + return self->priv->due; +} + +/** + * gdata_tasks_task_set_due: + * @self: a #GDataTasksTask + * @due: due time of the task, or -1 + * + * Sets the #GDataTasksTask:due property of the #GDataTasksTask to the new due time of the task, @due. + * + * Set @due to -1 to unset the property in the due time of the task + * + * Since: 0.15.0 + */ +void +gdata_tasks_task_set_due (GDataTasksTask *self, gint64 due) +{ + g_return_if_fail (GDATA_IS_TASKS_TASK (self)); + g_return_if_fail (due >= -1); + + self->priv->due = due; + g_object_notify (G_OBJECT (self), "due"); +} + +/** + * gdata_tasks_task_get_completed: + * @self: a #GDataTasksTask + * + * Gets the #GDataTasksTask:completed property. If the property is unset, -1 will be returned. + * + * Return value: the completed property, or -1 + * + * Since: 0.15.0 + */ +gint64 +gdata_tasks_task_get_completed (GDataTasksTask *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_TASK (self), -1); + return self->priv->completed; +} + +/** + * gdata_tasks_task_set_completed: + * @self: a #GDataTasksTask + * @completed: completion time of the task, or -1 + * + * Sets the #GDataTasksTask:completed property of the #GDataTasksTask to the new completion time of the task, @completed. + * + * Set @completed to -1 to unset the property in the completion time of the task + * + * Since: 0.15.0 + */ +void +gdata_tasks_task_set_completed (GDataTasksTask *self, gint64 completed) +{ + g_return_if_fail (GDATA_IS_TASKS_TASK (self)); + g_return_if_fail (completed >= -1); + + self->priv->completed = completed; + g_object_notify (G_OBJECT (self), "completed"); +} + +/** + * gdata_tasks_task_is_deleted: + * @self: a #GDataTasksTask + * + * Gets the #GDataTasksTask:is-deleted property. + * + * Return value: %TRUE if task is deleted, %FALSE otherwise + * + * Since: 0.15.0 + */ +gboolean +gdata_tasks_task_is_deleted (GDataTasksTask *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_TASK (self), FALSE); + return self->priv->deleted; +} + +/** + * gdata_tasks_task_set_is_deleted: + * @self: a #GDataTasksTask + * @deleted: %TRUE if task is deleted, %FALSE otherwise + * + * Sets the #GDataTasksTask:is-deleted property to @deleted. + * + * Since: 0.15.0 + */ +void +gdata_tasks_task_set_is_deleted (GDataTasksTask *self, gboolean deleted) +{ + g_return_if_fail (GDATA_IS_TASKS_TASK (self)); + self->priv->deleted = deleted; + g_object_notify (G_OBJECT (self), "is-deleted"); +} + +/** + * gdata_tasks_task_is_hidden: + * @self: a #GDataTasksTask + * + * Gets the #GDataTasksTask:is-hidden property. + * + * Return value: %TRUE if task is hidden, %FALSE otherwise + * + * Since: 0.15.0 + */ +gboolean +gdata_tasks_task_is_hidden (GDataTasksTask *self) +{ + g_return_val_if_fail (GDATA_IS_TASKS_TASK (self), FALSE); + return self->priv->hidden; +} diff --git a/gdata/services/tasks/gdata-tasks-task.h b/gdata/services/tasks/gdata-tasks-task.h new file mode 100644 index 0000000..7ceb0bc --- /dev/null +++ b/gdata/services/tasks/gdata-tasks-task.h @@ -0,0 +1,116 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Peteris Krisjanis 2013 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_TASKS_TASK_H +#define GDATA_TASKS_TASK_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_TASKS_STATUS_NEEDS_ACTION: + * + * A value for #GDataTasksTask:status indicating the task still needs action + * before it is complete. + * + * Reference: + * + * Google Tasks documentation. + * + * Since: 0.16.0 + */ +#define GDATA_TASKS_STATUS_NEEDS_ACTION "needsAction" + +/** + * GDATA_TASKS_STATUS_COMPLETED: + * + * A value for #GDataTasksTask:status indicating the task has been completed. + * + * Reference: + * + * Google Tasks documentation. + * + * Since: 0.16.0 + */ +#define GDATA_TASKS_STATUS_COMPLETED "completed" + +#define GDATA_TYPE_TASKS_TASK (gdata_tasks_task_get_type ()) +#define GDATA_TASKS_TASK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_TASKS_TASK, GDataTasksTask)) +#define GDATA_TASKS_TASK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_TASKS_TASK, GDataTasksTaskClass)) +#define GDATA_IS_TASKS_TASK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_TASKS_TASK)) +#define GDATA_IS_TASKS_TASK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_TASKS_TASK)) +#define GDATA_TASKS_TASK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_TASKS_TASK, GDataTasksTaskClass)) + +typedef struct _GDataTasksTaskPrivate GDataTasksTaskPrivate; + +/** + * GDataTasksTask: + * + * All the fields in the #GDataTasksTask structure are private and should never be accessed directly. + * + * Since: 0.15.0 + */ +typedef struct { + GDataEntry parent; + GDataTasksTaskPrivate *priv; +} GDataTasksTask; + +/** + * GDataTasksTaskClass: + * + * All the fields in the #GDataTasksTaskClass structure are private and should never be accessed directly. + * + * Since: 0.15.0 + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataTasksTaskClass; + +GType gdata_tasks_task_get_type (void) G_GNUC_CONST; + +GDataTasksTask *gdata_tasks_task_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_tasks_task_get_parent (GDataTasksTask *self) G_GNUC_PURE; +const gchar *gdata_tasks_task_get_position (GDataTasksTask *self) G_GNUC_PURE; +const gchar *gdata_tasks_task_get_notes (GDataTasksTask *self) G_GNUC_PURE; +void gdata_tasks_task_set_notes (GDataTasksTask *self, const gchar *notes); +const gchar *gdata_tasks_task_get_status (GDataTasksTask *self) G_GNUC_PURE; +void gdata_tasks_task_set_status (GDataTasksTask *self, const gchar *status); +gint64 gdata_tasks_task_get_due (GDataTasksTask *self) G_GNUC_PURE; +void gdata_tasks_task_set_due (GDataTasksTask *self, gint64 due); +gint64 gdata_tasks_task_get_completed (GDataTasksTask *self) G_GNUC_PURE; +void gdata_tasks_task_set_completed (GDataTasksTask *self, gint64 completed); +gboolean gdata_tasks_task_is_deleted (GDataTasksTask *self) G_GNUC_PURE; +void gdata_tasks_task_set_is_deleted (GDataTasksTask *self, gboolean deleted); +gboolean gdata_tasks_task_is_hidden (GDataTasksTask *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_TASKS_TASK_H */ diff --git a/gdata/services/tasks/gdata-tasks-tasklist.c b/gdata/services/tasks/gdata-tasks-tasklist.c new file mode 100644 index 0000000..2fbc470 --- /dev/null +++ b/gdata/services/tasks/gdata-tasks-tasklist.c @@ -0,0 +1,134 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Peteris Krisjanis 2013 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-tasks-tasklist + * @short_description: GData Tasks tasklist object + * @stability: Stable + * @include: gdata/services/tasks/gdata-tasks-tasklist.h + * + * #GDataTasksTasklist is a subclass of #GDataEntry to represent a tasklist from Google Tasks. + * + * For more details of Google Tasks API, see the + * online documentation. + * + * Since: 0.15.0 + */ + +#include +#include +#include +#include + +#include "gdata-tasks-tasklist.h" +#include "gdata-private.h" +#include "gdata-types.h" + +static void get_json (GDataParsable *parsable, JsonBuilder *builder); +static const gchar *get_content_type (void); + +G_DEFINE_TYPE (GDataTasksTasklist, gdata_tasks_tasklist, GDATA_TYPE_ENTRY) + +static void +gdata_tasks_tasklist_class_init (GDataTasksTasklistClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + parsable_class->get_json = get_json; + parsable_class->get_content_type = get_content_type; + + entry_class->kind_term = "tasks#taskList"; +} + +static void +gdata_tasks_tasklist_init (GDataTasksTasklist *self) +{ + /* Empty */ +} + +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + GList *i; + GDataLink *_link; + GDataEntry *entry = GDATA_ENTRY (parsable); + + /* Add all the general JSON. We can’t chain up to #GDataEntry here + * because Google Tasks uses a different date format. */ + json_builder_set_member_name (builder, "title"); + json_builder_add_string_value (builder, gdata_entry_get_title (entry)); + + if (gdata_entry_get_id (entry)) { + json_builder_set_member_name (builder, "id"); + json_builder_add_string_value (builder, gdata_entry_get_id (entry)); + } + + if (gdata_entry_get_updated (entry) != -1) { + gchar *updated = gdata_parser_int64_to_iso8601_numeric_timezone (gdata_entry_get_updated (entry)); + json_builder_set_member_name (builder, "updated"); + json_builder_add_string_value (builder, updated); + g_free (updated); + } + + /* If we have a "kind" category, add that. */ + for (i = gdata_entry_get_categories (entry); i != NULL; i = i->next) { + GDataCategory *category = GDATA_CATEGORY (i->data); + + if (g_strcmp0 (gdata_category_get_scheme (category), "http://schemas.google.com/g/2005#kind") == 0) { + json_builder_set_member_name (builder, "kind"); + json_builder_add_string_value (builder, gdata_category_get_term (category)); + } + } + + /* Add the ETag, if available. */ + if (gdata_entry_get_etag (entry) != NULL) { + json_builder_set_member_name (builder, "etag"); + json_builder_add_string_value (builder, gdata_entry_get_etag (entry)); + } + + /* Add the self-link. */ + _link = gdata_entry_look_up_link (GDATA_ENTRY (parsable), GDATA_LINK_SELF); + if (_link != NULL) { + json_builder_set_member_name (builder, "selfLink"); + json_builder_add_string_value (builder, gdata_link_get_uri (_link)); + } +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +/** + * gdata_tasks_tasklist_new: + * @id: (allow-none): the tasklist's ID, or %NULL + * + * Creates a new #GDataTasksTasklist with the given ID and default properties. + * + * Return value: (transfer full): a new #GDataTasksTasklist; unref with g_object_unref() + * + * Since: 0.15.0 + */ +GDataTasksTasklist * +gdata_tasks_tasklist_new (const gchar *id) +{ + return GDATA_TASKS_TASKLIST (g_object_new (GDATA_TYPE_TASKS_TASKLIST, "id", id, NULL)); +} diff --git a/gdata/services/tasks/gdata-tasks-tasklist.h b/gdata/services/tasks/gdata-tasks-tasklist.h new file mode 100644 index 0000000..ea0c1ca --- /dev/null +++ b/gdata/services/tasks/gdata-tasks-tasklist.h @@ -0,0 +1,73 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Peteris Krisjanis 2013 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_TASKS_TASKLIST_H +#define GDATA_TASKS_TASKLIST_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_TASKS_TASKLIST (gdata_tasks_tasklist_get_type ()) +#define GDATA_TASKS_TASKLIST(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_TASKS_TASKLIST, GDataTasksTasklist)) +#define GDATA_TASKS_TASKLIST_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_TASKS_TASKLIST, GDataTasksTasklistClass)) +#define GDATA_IS_TASKS_TASKLIST(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_TASKS_TASKLIST)) +#define GDATA_IS_TASKS_TASKLIST_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_TASKS_TASKLIST)) +#define GDATA_TASKS_TASKLIST_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_TASKS_TASKLIST, GDataTasksTasklistClass)) + +/** + * GDataTasksTasklist: + * + * All the fields in the #GDataTasksTasklist structure are private and should never be accessed directly. + * + * Since: 0.15.0 + */ +typedef struct { + GDataEntry parent; +} GDataTasksTasklist; + +/** + * GDataTasksTasklistClass: + * + * All the fields in the #GDataTasksTasklistClass structure are private and should never be accessed directly. + * + * Since: 0.15.0 + */ + +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataTasksTasklistClass; + +GType gdata_tasks_tasklist_get_type (void) G_GNUC_CONST; + +GDataTasksTasklist *gdata_tasks_tasklist_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_TASKS_TASKLIST_H */ diff --git a/gdata/services/youtube/gdata-youtube-category.c b/gdata/services/youtube/gdata-youtube-category.c new file mode 100644 index 0000000..20af910 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-category.c @@ -0,0 +1,242 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-youtube-category + * @short_description: YouTube category element + * @stability: Stable + * @include: gdata/services/youtube/gdata-youtube-category.h + * + * #GDataYouTubeCategory represents the YouTube-specific customizations to #GDataCategory. For more information, + * see the + * online documentation. + * + * Since: 0.7.0 + */ + +#include +#include +#include + +#include "gdata-youtube-category.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" + +static void gdata_youtube_category_finalize (GObject *object); +static void gdata_youtube_category_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataYouTubeCategoryPrivate { + gboolean assignable; + gchar **browsable_regions; + /*gboolean deprecated; --- "Categories that are neither assignable or browsable are deprecated and are identified as such using the + * tag." */ +}; + +enum { + PROP_IS_ASSIGNABLE = 1, + PROP_IS_DEPRECATED +}; + +G_DEFINE_TYPE (GDataYouTubeCategory, gdata_youtube_category, GDATA_TYPE_CATEGORY) + +static void +gdata_youtube_category_class_init (GDataYouTubeCategoryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataYouTubeCategoryPrivate)); + + gobject_class->get_property = gdata_youtube_category_get_property; + gobject_class->finalize = gdata_youtube_category_finalize; + + parsable_class->parse_xml = parse_xml; + parsable_class->get_namespaces = get_namespaces; + + /** + * GDataYouTubeCategory:is-assignable: + * + * Whether new videos can be added to the category. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_ASSIGNABLE, + g_param_spec_boolean ("is-assignable", + "Assignable?", "Whether new videos can be added to the category.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeCategory:is-deprecated: + * + * Whether the category is deprecated. + * + * Since: 0.7.0 + */ + g_object_class_install_property (gobject_class, PROP_IS_DEPRECATED, + g_param_spec_boolean ("is-deprecated", + "Deprecated?", "Whether the category is deprecated.", + TRUE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_youtube_category_init (GDataYouTubeCategory *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_YOUTUBE_CATEGORY, GDataYouTubeCategoryPrivate); +} + +static void +gdata_youtube_category_finalize (GObject *object) +{ + GDataYouTubeCategoryPrivate *priv = GDATA_YOUTUBE_CATEGORY (object)->priv; + + g_strfreev (priv->browsable_regions); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_youtube_category_parent_class)->finalize (object); +} + +static void +gdata_youtube_category_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataYouTubeCategoryPrivate *priv = GDATA_YOUTUBE_CATEGORY (object)->priv; + + switch (property_id) { + case PROP_IS_ASSIGNABLE: + g_value_set_boolean (value, priv->assignable); + break; + case PROP_IS_DEPRECATED: + g_value_set_boolean (value, (priv->assignable == FALSE && priv->browsable_regions == NULL) ? TRUE : FALSE); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) +{ + GDataYouTubeCategory *self = GDATA_YOUTUBE_CATEGORY (parsable); + + if (gdata_parser_is_namespace (node, "http://gdata.youtube.com/schemas/2007") == TRUE) { + if (xmlStrcmp (node->name, (xmlChar*) "assignable") == 0) { + /* yt:assignable */ + self->priv->assignable = TRUE; + } else if (xmlStrcmp (node->name, (xmlChar*) "deprecated") == 0) { + /* yt:deprecated */ + self->priv->assignable = FALSE; + g_strfreev (self->priv->browsable_regions); + self->priv->browsable_regions = NULL; + } else if (xmlStrcmp (node->name, (xmlChar*) "browsable") == 0) { + /* yt:browsable */ + xmlChar *regions; + + regions = xmlGetProp (node, (xmlChar*) "regions"); + if (regions == NULL) + return gdata_parser_error_required_property_missing (node, "regions", error); + + self->priv->browsable_regions = g_strsplit ((gchar*) regions, " ", -1); + xmlFree (regions); + } else { + return GDATA_PARSABLE_CLASS (gdata_youtube_category_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + } else { + return GDATA_PARSABLE_CLASS (gdata_youtube_category_parent_class)->parse_xml (parsable, doc, node, user_data, error); + } + + return TRUE; +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_youtube_category_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "youtube", (gchar*) "http://gdata.youtube.com/schemas/2007"); +} + +/** + * gdata_youtube_category_is_assignable: + * @self: a #GDataYouTubeCategory + * + * Gets the #GDataYouTubeCategory:is-assignable property. + * + * Return value: whether new videos can be assigned to the category + * + * Since: 0.7.0 + */ +gboolean +gdata_youtube_category_is_assignable (GDataYouTubeCategory *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_CATEGORY (self), FALSE); + return self->priv->assignable; +} + +/** + * gdata_youtube_category_is_browsable: + * @self: a #GDataYouTubeCategory + * @region: a two-letter region ID + * + * Returns whether the category is browsable in the given @region. The list of supported region IDs is + * available online. + * + * Return value: whether the category is browsable in @region + * + * Since: 0.7.0 + */ +gboolean +gdata_youtube_category_is_browsable (GDataYouTubeCategory *self, const gchar *region) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_CATEGORY (self), FALSE); + g_return_val_if_fail (region != NULL && *region != '\0', FALSE); + + if (self->priv->browsable_regions != NULL) { + guint i; + + for (i = 0; self->priv->browsable_regions[i] != NULL; i++) { + if (strcmp (self->priv->browsable_regions[i], region) == 0) + return TRUE; + } + } + + return FALSE; +} + +/** + * gdata_youtube_category_is_deprecated: + * @self: a #GDataYouTubeCategory + * + * Gets the #GDataYouTubeCategory:is-deprecated property. + * + * Return value: whether the category is deprecated + * + * Since: 0.7.0 + */ +gboolean +gdata_youtube_category_is_deprecated (GDataYouTubeCategory *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_CATEGORY (self), TRUE); + return (self->priv->assignable == FALSE && self->priv->browsable_regions == NULL) ? TRUE : FALSE; +} diff --git a/gdata/services/youtube/gdata-youtube-category.h b/gdata/services/youtube/gdata-youtube-category.h new file mode 100644 index 0000000..7b10661 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-category.h @@ -0,0 +1,77 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_YOUTUBE_CATEGORY_H +#define GDATA_YOUTUBE_CATEGORY_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_YOUTUBE_CATEGORY (gdata_youtube_category_get_type ()) +#define GDATA_YOUTUBE_CATEGORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_CATEGORY, GDataYouTubeCategory)) +#define GDATA_YOUTUBE_CATEGORY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_CATEGORY, GDataYouTubeCategoryClass)) +#define GDATA_IS_YOUTUBE_CATEGORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_CATEGORY)) +#define GDATA_IS_YOUTUBE_CATEGORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_CATEGORY)) +#define GDATA_YOUTUBE_CATEGORY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_CATEGORY, GDataYouTubeCategoryClass)) + +typedef struct _GDataYouTubeCategoryPrivate GDataYouTubeCategoryPrivate; + +/** + * GDataYouTubeCategory: + * + * All the fields in the #GDataYouTubeCategory structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + GDataCategory parent; + GDataYouTubeCategoryPrivate *priv; +} GDataYouTubeCategory; + +/** + * GDataYouTubeCategoryClass: + * + * All the fields in the #GDataYouTubeCategoryClass structure are private and should never be accessed directly. + * + * Since: 0.7.0 + */ +typedef struct { + /*< private >*/ + GDataCategoryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataYouTubeCategoryClass; + +GType gdata_youtube_category_get_type (void) G_GNUC_CONST; + +gboolean gdata_youtube_category_is_assignable (GDataYouTubeCategory *self) G_GNUC_PURE; +gboolean gdata_youtube_category_is_browsable (GDataYouTubeCategory *self, const gchar *region) G_GNUC_PURE; +gboolean gdata_youtube_category_is_deprecated (GDataYouTubeCategory *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_CATEGORY_H */ diff --git a/gdata/services/youtube/gdata-youtube-comment.c b/gdata/services/youtube/gdata-youtube-comment.c new file mode 100644 index 0000000..7133e45 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-comment.c @@ -0,0 +1,576 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-youtube-comment + * @short_description: GData YouTube comment object + * @stability: Stable + * @include: gdata/services/youtube/gdata-youtube-comment.h + * + * #GDataYouTubeComment is a subclass of #GDataComment to represent a comment on a #GDataYouTubeVideo. It is returned by the #GDataCommentable + * interface implementation on #GDataYouTubeVideo. + * + * It's possible to query for and add #GDataYouTubeComments, but it is not possible to delete #GDataYouTubeComments from any video + * using the GData API. + * + * Comments on YouTube videos can be arranged in a hierarchy by their #GDataYouTubeComment:parent-comment-uris. If a + * #GDataYouTubeComment's parent comment URI is non-%NULL, it should match the %GDATA_LINK_SELF #GDataLink of another #GDataYouTubeComment on + * the same video (as retrieved using gdata_entry_look_up_link() on the comments). Comments with #GDataYouTubeComment:parent-comment-uri set to %NULL + * are top-level comments. + * + * Since: 0.10.0 + */ + +#include +#include + +#include "gdata-parser.h" +#include "gdata-private.h" +#include "gdata-youtube-comment.h" + +#define GDATA_LINK_PARENT_COMMENT_URI "http://gdata.youtube.com/schemas/2007#in-reply-to" + +static void gdata_youtube_comment_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void gdata_youtube_comment_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_youtube_comment_finalize (GObject *object); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static void get_json (GDataParsable *parsable, JsonBuilder *builder); +static const gchar *get_content_type (void); + +struct _GDataYouTubeCommentPrivate { + gchar *channel_id; /* owned */ + gchar *video_id; /* owned */ + gboolean can_reply; +}; + +enum { + PROP_PARENT_COMMENT_URI = 1, +}; + +G_DEFINE_TYPE (GDataYouTubeComment, gdata_youtube_comment, GDATA_TYPE_COMMENT) + +static void +gdata_youtube_comment_class_init (GDataYouTubeCommentClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataYouTubeCommentPrivate)); + + gobject_class->get_property = gdata_youtube_comment_get_property; + gobject_class->set_property = gdata_youtube_comment_set_property; + gobject_class->finalize = gdata_youtube_comment_finalize; + + parsable_class->parse_json = parse_json; + parsable_class->get_json = get_json; + parsable_class->get_content_type = get_content_type; + + entry_class->kind_term = "youtube#commentThread"; + + /** + * GDataYouTubeComment:parent-comment-uri: + * + * The URI of the parent comment to this one, or %NULL if this comment is a top-level comment. + * + * See the documentation for #GDataYouTubeComment for an explanation of the semantics of parent comment URIs. + * + * Since: 0.10.0 + */ + g_object_class_install_property (gobject_class, PROP_PARENT_COMMENT_URI, + g_param_spec_string ("parent-comment-uri", + "Parent comment URI", "The URI of the parent comment to this one.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_youtube_comment_init (GDataYouTubeComment *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_YOUTUBE_COMMENT, GDataYouTubeCommentPrivate); +} + +static void +gdata_youtube_comment_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataYouTubeComment *self = GDATA_YOUTUBE_COMMENT (object); + + switch (property_id) { + case PROP_PARENT_COMMENT_URI: + g_value_set_string (value, gdata_youtube_comment_get_parent_comment_uri (self)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_youtube_comment_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataYouTubeComment *self = GDATA_YOUTUBE_COMMENT (object); + + switch (property_id) { + case PROP_PARENT_COMMENT_URI: + gdata_youtube_comment_set_parent_comment_uri (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_youtube_comment_finalize (GObject *object) +{ + GDataYouTubeCommentPrivate *priv = GDATA_YOUTUBE_COMMENT (object)->priv; + + g_free (priv->channel_id); + g_free (priv->video_id); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_youtube_comment_parent_class)->finalize (object); +} + +/* Reference: https://developers.google.com/youtube/v3/docs/comments#resource */ +static gboolean +parse_comment (GDataParsable *parsable, JsonReader *reader, GError **error) +{ + GDataYouTubeComment *self = GDATA_YOUTUBE_COMMENT (parsable); + const gchar *id, *etag, *parent_id, *author_name, *author_uri; + const gchar *published_at, *updated_at; + gint64 published, updated; + + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + /* id */ + json_reader_read_member (reader, "id"); + id = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + /* Empty ID? */ + if (id == NULL || *id == '\0') { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + _gdata_entry_set_id (GDATA_ENTRY (parsable), id); + + /* etag */ + json_reader_read_member (reader, "etag"); + etag = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + /* Empty ETag? */ + if (etag != NULL && *id == '\0') { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + _gdata_entry_set_etag (GDATA_ENTRY (parsable), etag); + + /* snippet */ + json_reader_read_member (reader, "snippet"); + + if (!json_reader_is_object (reader)) { + json_reader_end_member (reader); + return gdata_parser_error_required_json_content_missing (reader, error); + } + + json_reader_read_member (reader, "textDisplay"); + gdata_entry_set_content (GDATA_ENTRY (self), + json_reader_get_string_value (reader)); + json_reader_end_member (reader); + + json_reader_read_member (reader, "parentId"); + parent_id = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + if (parent_id != NULL) { + gchar *uri = NULL; + + uri = _gdata_service_build_uri ("https://www.googleapis.com" + "/youtube/v3/comments" + "?part=snippet" + "&id=%s", parent_id); + gdata_youtube_comment_set_parent_comment_uri (self, uri); + g_free (uri); + } + + json_reader_read_member (reader, "authorDisplayName"); + author_name = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "authorChannelUrl"); + author_uri = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + if (author_name != NULL && *author_name != '\0') { + GDataAuthor *author = NULL; + + author = gdata_author_new (author_name, author_uri, NULL); + gdata_entry_add_author (GDATA_ENTRY (self), author); + } + + json_reader_read_member (reader, "publishedAt"); + published_at = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + if (published_at != NULL && + gdata_parser_int64_from_iso8601 (published_at, &published)) { + _gdata_entry_set_published (GDATA_ENTRY (self), published); + } else if (published_at != NULL) { + /* Error */ + gdata_parser_error_not_iso8601_format_json (reader, + published_at, + error); + json_reader_end_member (reader); + return FALSE; + } + + json_reader_read_member (reader, "updatedAt"); + updated_at = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + if (updated_at != NULL && + gdata_parser_int64_from_iso8601 (updated_at, &updated)) { + _gdata_entry_set_updated (GDATA_ENTRY (self), updated); + } else if (updated_at != NULL) { + /* Error */ + gdata_parser_error_not_iso8601_format_json (reader, + updated_at, + error); + json_reader_end_member (reader); + return FALSE; + } + + /* FIXME: Implement: + * - channelId + * - videoId + * - textOriginal + * - canRate + * - viewerRating + * - likeCount + * - moderationStatus + * - authorProfileImageUrl + * - authorChannelId + * - authorGoogleplusProfileUrl + */ + + json_reader_end_member (reader); + + return TRUE; +} + +/* Reference: https://developers.google.com/youtube/v3/docs/commentThreads#resource */ +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + gboolean success; + GDataYouTubeComment *self = GDATA_YOUTUBE_COMMENT (parsable); + GDataYouTubeCommentPrivate *priv = self->priv; + + if (g_strcmp0 (json_reader_get_member_name (reader), "snippet") == 0) { + guint i; + + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + for (i = 0; i < (guint) json_reader_count_members (reader); i++) { + json_reader_read_element (reader, i); + + if (gdata_parser_string_from_json_member (reader, "channelId", P_DEFAULT, &priv->channel_id, &success, error) || + gdata_parser_string_from_json_member (reader, "videoId", P_DEFAULT, &priv->video_id, &success, error) || + gdata_parser_boolean_from_json_member (reader, "canReply", P_DEFAULT, &priv->can_reply, &success, error)) { + /* Fall through. */ + } else if (g_strcmp0 (json_reader_get_member_name (reader), "topLevelComment") == 0) { + success = parse_comment (parsable, reader, error); + } + + json_reader_end_element (reader); + + if (!success) { + return FALSE; + } + } + + return TRUE; + } else { + return GDATA_PARSABLE_CLASS (gdata_youtube_comment_parent_class)->parse_json (parsable, reader, user_data, error); + } + + return TRUE; +} + +/* Reference: https://developers.google.com/youtube/v3/docs/comments#resource */ +static void +get_comment (GDataParsable *parsable, JsonBuilder *builder) +{ + GDataYouTubeComment *self = GDATA_YOUTUBE_COMMENT (parsable); + GDataEntry *entry = GDATA_ENTRY (parsable); + GDataYouTubeCommentPrivate *priv = GDATA_YOUTUBE_COMMENT (parsable)->priv; + + json_builder_set_member_name (builder, "kind"); + json_builder_add_string_value (builder, "youtube#comment"); + + if (gdata_entry_get_etag (entry) != NULL) { + json_builder_set_member_name (builder, "etag"); + json_builder_add_string_value (builder, + gdata_entry_get_etag (entry)); + } + + if (gdata_entry_get_id (entry) != NULL) { + json_builder_set_member_name (builder, "id"); + json_builder_add_string_value (builder, + gdata_entry_get_id (entry)); + } + + json_builder_set_member_name (builder, "snippet"); + json_builder_begin_object (builder); + + if (priv->channel_id != NULL) { + json_builder_set_member_name (builder, "channelId"); + json_builder_add_string_value (builder, priv->channel_id); + } + + if (priv->video_id != NULL) { + json_builder_set_member_name (builder, "videoId"); + json_builder_add_string_value (builder, priv->video_id); + } + + /* Note we build textOriginal and parse textDisplay. */ + if (gdata_entry_get_content (entry) != NULL) { + json_builder_set_member_name (builder, "textOriginal"); + json_builder_add_string_value (builder, + gdata_entry_get_content (entry)); + } + + if (gdata_youtube_comment_get_parent_comment_uri (self) != NULL) { + json_builder_set_member_name (builder, "parentId"); + json_builder_add_string_value (builder, + gdata_youtube_comment_get_parent_comment_uri (self)); + } + + json_builder_end_object (builder); +} + +/* Reference: https://developers.google.com/youtube/v3/docs/commentThreads#resource + * + * Sort of. If creating a new top-level comment, we need to create a + * commentThread; otherwise we need to create a comment. */ +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + GDataEntry *entry = GDATA_ENTRY (parsable); + GDataYouTubeCommentPrivate *priv = GDATA_YOUTUBE_COMMENT (parsable)->priv; + + /* Don’t chain up because it’s mostly irrelevant. */ + json_builder_set_member_name (builder, "kind"); + json_builder_add_string_value (builder, "youtube#commentThread"); + + if (gdata_entry_get_etag (entry) != NULL) { + json_builder_set_member_name (builder, "etag"); + json_builder_add_string_value (builder, + gdata_entry_get_etag (entry)); + } + + if (gdata_entry_get_id (entry) != NULL) { + json_builder_set_member_name (builder, "id"); + json_builder_add_string_value (builder, + gdata_entry_get_id (entry)); + } + + /* snippet object. */ + json_builder_set_member_name (builder, "snippet"); + json_builder_begin_object (builder); + + if (priv->channel_id != NULL) { + json_builder_set_member_name (builder, "channelId"); + json_builder_add_string_value (builder, priv->channel_id); + } + + if (priv->video_id != NULL) { + json_builder_set_member_name (builder, "videoId"); + json_builder_add_string_value (builder, priv->video_id); + } + + json_builder_set_member_name (builder, "topLevelComment"); + json_builder_begin_object (builder); + get_comment (parsable, builder); + json_builder_end_object (builder); + + json_builder_end_object (builder); +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +/** + * gdata_youtube_comment_new: + * @id: the comment's ID, or %NULL + * + * Creates a new #GDataYouTubeComment with the given ID and default properties. + * + * Return value: a new #GDataYouTubeComment; unref with g_object_unref() + * + * Since: 0.10.0 + */ +GDataYouTubeComment * +gdata_youtube_comment_new (const gchar *id) +{ + return GDATA_YOUTUBE_COMMENT (g_object_new (GDATA_TYPE_YOUTUBE_COMMENT, + "id", id, + NULL)); +} + +/** + * gdata_youtube_comment_get_parent_comment_uri: + * @self: a #GDataYouTubeComment + * + * Gets the #GDataYouTubeComment:parent-comment-uri property. + * + * Return value: the parent comment URI, or %NULL + * + * Since: 0.10.0 + */ +const gchar * +gdata_youtube_comment_get_parent_comment_uri (GDataYouTubeComment *self) +{ + GDataLink *link_; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_COMMENT (self), NULL); + + link_ = gdata_entry_look_up_link (GDATA_ENTRY (self), GDATA_LINK_PARENT_COMMENT_URI); + if (link_ == NULL) { + return NULL; + } + + return gdata_link_get_uri (link_); +} + +/** + * gdata_youtube_comment_set_parent_comment_uri: + * @self: a #GDataYouTubeComment + * @parent_comment_uri: a new parent comment URI, or %NULL + * + * Sets the #GDataYouTubeComment:parent-comment-uri property to @parent_comment_uri. + * + * Set @parent_comment_uri to %NULL to unset the #GDataYouTubeComment:parent-comment-uri property in the comment (i.e. make the comment a top-level + * comment). + * + * See the online + * documentation for more information. + * + * Since: 0.10.0 + */ +void +gdata_youtube_comment_set_parent_comment_uri (GDataYouTubeComment *self, const gchar *parent_comment_uri) +{ + GDataLink *link_; + + g_return_if_fail (GDATA_IS_YOUTUBE_COMMENT (self)); + g_return_if_fail (parent_comment_uri == NULL || *parent_comment_uri != '\0'); + + link_ = gdata_entry_look_up_link (GDATA_ENTRY (self), GDATA_LINK_PARENT_COMMENT_URI); + + if ((link_ == NULL && parent_comment_uri == NULL) || + (link_ != NULL && parent_comment_uri != NULL && g_strcmp0 (gdata_link_get_uri (link_), parent_comment_uri) == 0)) { + /* Nothing to do. */ + return; + } else if (link_ == NULL && parent_comment_uri != NULL) { + /* Add the new link. */ + link_ = gdata_link_new (parent_comment_uri, GDATA_LINK_PARENT_COMMENT_URI); + gdata_entry_add_link (GDATA_ENTRY (self), link_); + g_object_unref (link_); + } else if (link_ != NULL && parent_comment_uri == NULL) { + /* Remove the old link. */ + gdata_entry_remove_link (GDATA_ENTRY (self), link_); + } else if (link_ != NULL && parent_comment_uri != NULL) { + /* Update the existing link. */ + gdata_link_set_uri (link_, parent_comment_uri); + } + + g_object_notify (G_OBJECT (self), "parent-comment-uri"); +} + +G_GNUC_INTERNAL void +_gdata_youtube_comment_set_video_id (GDataYouTubeComment *self, + const gchar *video_id); +G_GNUC_INTERNAL void +_gdata_youtube_comment_set_channel_id (GDataYouTubeComment *self, + const gchar *channel_id); + +/** + * _gdata_youtube_comment_set_video_id: + * @self: a #GDataYouTubeComment + * @video_id: (nullable): the comment’s video ID, or %NULL + * + * Set the ID of the video the comment is attached to. This may be %NULL if the + * comment has not yet been inserted, or if it is just attached to a channel + * rather than a video. + * + * Since: 0.17.2 + */ +void +_gdata_youtube_comment_set_video_id (GDataYouTubeComment *self, + const gchar *video_id) +{ + GDataYouTubeCommentPrivate *priv; + + g_return_if_fail (GDATA_IS_YOUTUBE_COMMENT (self)); + g_return_if_fail (video_id == NULL || *video_id != '\0'); + + priv = self->priv; + + g_free (priv->video_id); + priv->video_id = g_strdup (video_id); +} + +/** + * _gdata_youtube_comment_set_channel_id: + * @self: a #GDataYouTubeComment + * @channel_id: (nullable): the comment’s channel ID, or %NULL + * + * Set the ID of the channel the comment is attached to. This may be %NULL if + * the comment has not yet been inserted, but must be set otherwise. + * + * Since: 0.17.2 + */ +void +_gdata_youtube_comment_set_channel_id (GDataYouTubeComment *self, + const gchar *channel_id) +{ + GDataYouTubeCommentPrivate *priv; + + g_return_if_fail (GDATA_IS_YOUTUBE_COMMENT (self)); + g_return_if_fail (channel_id == NULL || *channel_id != '\0'); + + priv = self->priv; + + g_free (priv->channel_id); + priv->channel_id = g_strdup (channel_id); +} diff --git a/gdata/services/youtube/gdata-youtube-comment.h b/gdata/services/youtube/gdata-youtube-comment.h new file mode 100644 index 0000000..f26bc27 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-comment.h @@ -0,0 +1,77 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_YOUTUBE_COMMENT_H +#define GDATA_YOUTUBE_COMMENT_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_YOUTUBE_COMMENT (gdata_youtube_comment_get_type ()) +#define GDATA_YOUTUBE_COMMENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_COMMENT, GDataYouTubeComment)) +#define GDATA_YOUTUBE_COMMENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_COMMENT, GDataYouTubeCommentClass)) +#define GDATA_IS_YOUTUBE_COMMENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_COMMENT)) +#define GDATA_IS_YOUTUBE_COMMENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_COMMENT)) +#define GDATA_YOUTUBE_COMMENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_COMMENT, GDataYouTubeCommentClass)) + +typedef struct _GDataYouTubeCommentPrivate GDataYouTubeCommentPrivate; + +/** + * GDataYouTubeComment: + * + * All the fields in the #GDataYouTubeComment structure are private and should never be accessed directly. + * + * Since: 0.10.0 + */ +typedef struct { + GDataComment parent; + GDataYouTubeCommentPrivate *priv; +} GDataYouTubeComment; + +/** + * GDataYouTubeCommentClass: + * + * All the fields in the #GDataYouTubeCommentClass structure are private and should never be accessed directly. + * + * Since: 0.10.0 + */ +typedef struct { + /*< private >*/ + GDataCommentClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataYouTubeCommentClass; + +GType gdata_youtube_comment_get_type (void) G_GNUC_CONST; + +GDataYouTubeComment *gdata_youtube_comment_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_youtube_comment_get_parent_comment_uri (GDataYouTubeComment *self) G_GNUC_PURE; +void gdata_youtube_comment_set_parent_comment_uri (GDataYouTubeComment *self, const gchar *parent_comment_uri); + +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_COMMENT_H */ diff --git a/gdata/services/youtube/gdata-youtube-content.c b/gdata/services/youtube/gdata-youtube-content.c new file mode 100644 index 0000000..3b9126e --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-content.c @@ -0,0 +1,157 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-youtube-content + * @short_description: YouTube content element + * @stability: Stable + * @include: gdata/services/youtube/gdata-youtube-content.h + * + * #GDataYouTubeContent represents the YouTube-specific customizations to #GDataMediaContent. For more information, + * see the + * online documentation. + * + * Since: 0.4.0 + * Deprecated: 0.17.0: Accessing YouTube video content directly is no longer + * supported by Google. There is no replacement. + */ + +#include +#include + +#include "gdata-youtube-content.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" +#include "gdata-youtube-enums.h" + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +static void gdata_youtube_content_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataYouTubeContentPrivate { + GDataYouTubeFormat format; +}; + +enum { + PROP_FORMAT = 1 +}; + +G_DEFINE_TYPE (GDataYouTubeContent, gdata_youtube_content, GDATA_TYPE_MEDIA_CONTENT) + +static void +gdata_youtube_content_class_init (GDataYouTubeContentClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataYouTubeContentPrivate)); + + gobject_class->get_property = gdata_youtube_content_get_property; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->get_namespaces = get_namespaces; + + /** + * GDataYouTubeContent:format: + * + * The video format of the video object. + * + * For more information, see the + * + * YouTube documentation. + * + * Since: 0.4.0 + * Deprecated: 0.17.0: Accessing YouTube video content directly is + * no longer supported by Google. There is no replacement. + */ + g_object_class_install_property (gobject_class, PROP_FORMAT, + g_param_spec_enum ("format", + "Format", "The video format of the video object.", + GDATA_TYPE_YOUTUBE_FORMAT, GDATA_YOUTUBE_FORMAT_UNKNOWN, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); +} + +static void +gdata_youtube_content_init (GDataYouTubeContent *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_YOUTUBE_CONTENT, GDataYouTubeContentPrivate); +} + +static void +gdata_youtube_content_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataYouTubeContentPrivate *priv = GDATA_YOUTUBE_CONTENT (object)->priv; + + switch (property_id) { + case PROP_FORMAT: + g_value_set_enum (value, priv->format); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + xmlChar *format; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_youtube_content_parent_class)->pre_parse_xml (parsable, doc, root_node, user_data, error); + + format = xmlGetProp (root_node, (xmlChar*) "format"); + GDATA_YOUTUBE_CONTENT (parsable)->priv->format = (format == NULL) ? GDATA_YOUTUBE_FORMAT_UNKNOWN : g_ascii_strtoull ((gchar*) format, NULL, 10); + + return TRUE; +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_youtube_content_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "youtube", (gchar*) "http://gdata.youtube.com/schemas/2007"); +} + +/** + * gdata_youtube_content_get_format: + * @self: a #GDataYouTubeContent + * + * Gets the #GDataYouTubeContent:format property. + * + * Return value: the video format, or %GDATA_YOUTUBE_FORMAT_UNKNOWN + * + * Since: 0.4.0 + * Deprecated: 0.17.0: Accessing YouTube video content directly is no longer + * supported by Google. There is no replacement. + */ +GDataYouTubeFormat +gdata_youtube_content_get_format (GDataYouTubeContent *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_CONTENT (self), GDATA_YOUTUBE_FORMAT_UNKNOWN); + return self->priv->format; +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/youtube/gdata-youtube-content.h b/gdata/services/youtube/gdata-youtube-content.h new file mode 100644 index 0000000..1a34d0d --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-content.h @@ -0,0 +1,108 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_YOUTUBE_CONTENT_H +#define GDATA_YOUTUBE_CONTENT_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#ifndef LIBGDATA_DISABLE_DEPRECATED + +/** + * GDataYouTubeFormat: + * @GDATA_YOUTUBE_FORMAT_UNKNOWN: retrieve videos in all formats when querying the service + * @GDATA_YOUTUBE_FORMAT_RTSP_H263_AMR: RTSP streaming URI for mobile video playback; H.263 video (up to 176×144) and AMR audio + * @GDATA_YOUTUBE_FORMAT_HTTP_SWF: HTTP URI to the embeddable player (SWF) for this video + * @GDATA_YOUTUBE_FORMAT_RTSP_MPEG4_AAC: RTSP streaming URI for mobile video playback; MPEG-4 SP video (up to 176×144) and AAC audio + * + * Video formats available on YouTube. For more information, see the + * online documentation. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: Accessing YouTube video content directly is no longer + * supported by Google. There is no replacement. + */ +typedef enum { + GDATA_YOUTUBE_FORMAT_UNKNOWN = 0, + GDATA_YOUTUBE_FORMAT_RTSP_H263_AMR = 1, + GDATA_YOUTUBE_FORMAT_HTTP_SWF = 5, + GDATA_YOUTUBE_FORMAT_RTSP_MPEG4_AAC = 6 +} GDataYouTubeFormat; + +#define GDATA_TYPE_YOUTUBE_CONTENT (gdata_youtube_content_get_type ()) +#define GDATA_YOUTUBE_CONTENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_CONTENT, GDataYouTubeContent)) +#define GDATA_YOUTUBE_CONTENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_CONTENT, GDataYouTubeContentClass)) +#define GDATA_IS_YOUTUBE_CONTENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_CONTENT)) +#define GDATA_IS_YOUTUBE_CONTENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_CONTENT)) +#define GDATA_YOUTUBE_CONTENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_CONTENT, GDataYouTubeContentClass)) + +typedef struct _GDataYouTubeContentPrivate GDataYouTubeContentPrivate G_GNUC_DEPRECATED; + +/** + * GDataYouTubeContent: + * + * All the fields in the #GDataYouTubeContent structure are private and should never be accessed directly. + * + * Since: 0.4.0 + * Deprecated: 0.17.0: Accessing YouTube video content directly is no longer + * supported by Google. There is no replacement. + */ +typedef struct { + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + GDataMediaContent parent; + GDataYouTubeContentPrivate *priv; + G_GNUC_END_IGNORE_DEPRECATIONS +} GDataYouTubeContent; + +/** + * GDataYouTubeContentClass: + * + * All the fields in the #GDataYouTubeContentClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + * Deprecated: 0.17.0: Accessing YouTube video content directly is no longer + * supported by Google. There is no replacement. + */ +typedef struct { + /*< private >*/ + GDataMediaContentClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataYouTubeContentClass; + +GType gdata_youtube_content_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +GDataYouTubeFormat gdata_youtube_content_get_format (GDataYouTubeContent *self) G_GNUC_PURE G_GNUC_DEPRECATED; +G_GNUC_END_IGNORE_DEPRECATIONS + +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_CONTENT_H */ diff --git a/gdata/services/youtube/gdata-youtube-credit.c b/gdata/services/youtube/gdata-youtube-credit.c new file mode 100644 index 0000000..b1b7f60 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-credit.c @@ -0,0 +1,179 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-youtube-credit + * @short_description: YouTube credit element + * @stability: Stable + * @include: gdata/services/youtube/gdata-youtube-credit.h + * + * #GDataYouTubeCredit represents the YouTube-specific customizations to #GDataMediaCredit. For more information, + * see the + * online documentation. + * + * Since: 0.4.0 + * Deprecated: 0.17.0: This is no longer supported by Google. There is no + * replacement. + */ + +#include +#include + +#include "gdata-youtube-credit.h" +#include "gdata-parsable.h" +#include "gdata-parser.h" + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +static void gdata_youtube_credit_finalize (GObject *object); +static void gdata_youtube_credit_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); +static void pre_get_xml (GDataParsable *parsable, GString *xml_string); +static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); + +struct _GDataYouTubeCreditPrivate { + gchar *entity_type; +}; + +enum { + PROP_ENTITY_TYPE = 1 +}; + +G_DEFINE_TYPE (GDataYouTubeCredit, gdata_youtube_credit, GDATA_TYPE_MEDIA_CREDIT) + +static void +gdata_youtube_credit_class_init (GDataYouTubeCreditClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataYouTubeCreditPrivate)); + + gobject_class->get_property = gdata_youtube_credit_get_property; + gobject_class->finalize = gdata_youtube_credit_finalize; + + parsable_class->pre_parse_xml = pre_parse_xml; + parsable_class->pre_get_xml = pre_get_xml; + parsable_class->get_namespaces = get_namespaces; + + /** + * GDataYouTubeCredit:entity-type: + * + * The type of entity who is credited. Currently this can only be %GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER, for a YouTube partner. + * + * For more information, see the + * + * YouTube documentation. + * + * Since: 0.4.0 + * Deprecated: 0.17.0: This is no longer supported by Google. There + * is no replacement. + */ + g_object_class_install_property (gobject_class, PROP_ENTITY_TYPE, + g_param_spec_string ("entity-type", + "Entity type", "The type of entity who is credited.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED)); +} + +static void +gdata_youtube_credit_init (GDataYouTubeCredit *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_YOUTUBE_CREDIT, GDataYouTubeCreditPrivate); +} + +static void +gdata_youtube_credit_finalize (GObject *object) +{ + GDataYouTubeCreditPrivate *priv = GDATA_YOUTUBE_CREDIT (object)->priv; + + g_free (priv->entity_type); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_youtube_credit_parent_class)->finalize (object); +} + +static void +gdata_youtube_credit_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataYouTubeCreditPrivate *priv = GDATA_YOUTUBE_CREDIT (object)->priv; + + switch (property_id) { + case PROP_ENTITY_TYPE: + g_value_set_string (value, priv->entity_type); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gboolean +pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) +{ + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_youtube_credit_parent_class)->pre_parse_xml (parsable, doc, root_node, user_data, error); + + GDATA_YOUTUBE_CREDIT (parsable)->priv->entity_type = (gchar*) xmlGetProp (root_node, (xmlChar*) "type"); + + return TRUE; +} + +static void +pre_get_xml (GDataParsable *parsable, GString *xml_string) +{ + GDataYouTubeCreditPrivate *priv = GDATA_YOUTUBE_CREDIT (parsable)->priv; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_youtube_credit_parent_class)->pre_get_xml (parsable, xml_string); + + if (priv->entity_type != NULL) + gdata_parser_string_append_escaped (xml_string, " type='", priv->entity_type, "'"); +} + +static void +get_namespaces (GDataParsable *parsable, GHashTable *namespaces) +{ + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_youtube_credit_parent_class)->get_namespaces (parsable, namespaces); + + g_hash_table_insert (namespaces, (gchar*) "youtube", (gchar*) "http://gdata.youtube.com/schemas/2007"); +} + +/** + * gdata_youtube_credit_get_entity_type: + * @self: a #GDataYouTubeCredit + * + * Gets the #GDataYouTubeCredit:entity-type property. + * + * Return value: the type of the credited user (e.g. %GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER), or %NULL + * + * Since: 0.4.0 + * Deprecated: 0.17.0: This is no longer supported by Google. There is no + * replacement. + */ +const gchar * +gdata_youtube_credit_get_entity_type (GDataYouTubeCredit *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_CREDIT (self), NULL); + return self->priv->entity_type; +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/youtube/gdata-youtube-credit.h b/gdata/services/youtube/gdata-youtube-credit.h new file mode 100644 index 0000000..da31630 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-credit.h @@ -0,0 +1,97 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_YOUTUBE_CREDIT_H +#define GDATA_YOUTUBE_CREDIT_H + +#include +#include + +#include +#include + +G_BEGIN_DECLS + +#ifndef LIBGDATA_DISABLE_DEPRECATED + +/** + * GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER: + * + * The credited entity is a YouTube partner. + * + * Since: 0.7.0 + * Deprecated: 0.17.0: This is no longer supported by Google. There is no + * replacement. + */ +#define GDATA_YOUTUBE_CREDIT_ENTITY_PARTNER "partner" + +#define GDATA_TYPE_YOUTUBE_CREDIT (gdata_youtube_credit_get_type ()) +#define GDATA_YOUTUBE_CREDIT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_CREDIT, GDataYouTubeCredit)) +#define GDATA_YOUTUBE_CREDIT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_CREDIT, GDataYouTubeCreditClass)) +#define GDATA_IS_YOUTUBE_CREDIT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_CREDIT)) +#define GDATA_IS_YOUTUBE_CREDIT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_CREDIT)) +#define GDATA_YOUTUBE_CREDIT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_CREDIT, GDataYouTubeCreditClass)) + +typedef struct _GDataYouTubeCreditPrivate GDataYouTubeCreditPrivate G_GNUC_DEPRECATED; + +/** + * GDataYouTubeCredit: + * + * All the fields in the #GDataYouTubeCredit structure are private and should never be accessed directly. + * + * Since: 0.4.0 + * Deprecated: 0.17.0: This is no longer supported by Google. There is no + * replacement. + */ +typedef struct { + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + GDataMediaCredit parent; + GDataYouTubeCreditPrivate *priv; + G_GNUC_END_IGNORE_DEPRECATIONS +} GDataYouTubeCredit; + +/** + * GDataYouTubeCreditClass: + * + * All the fields in the #GDataYouTubeCreditClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + * Deprecated: 0.17.0: This is no longer supported by Google. There is no + * replacement. + */ +typedef struct { + /*< private >*/ + GDataMediaCreditClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataYouTubeCreditClass; + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +GType gdata_youtube_credit_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED; +const gchar *gdata_youtube_credit_get_entity_type (GDataYouTubeCredit *self) G_GNUC_PURE G_GNUC_DEPRECATED; +G_GNUC_END_IGNORE_DEPRECATIONS + +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_CREDIT_H */ diff --git a/gdata/services/youtube/gdata-youtube-enums.c b/gdata/services/youtube/gdata-youtube-enums.c new file mode 100644 index 0000000..47d1ea6 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-enums.c @@ -0,0 +1,145 @@ + + + +#include "gdata-youtube-service.h" +#include "gdata-youtube-query.h" +#include "gdata-youtube-enums.h" + +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/youtube/gdata-youtube-content.h" */ +GType +gdata_youtube_format_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_YOUTUBE_FORMAT_UNKNOWN, "GDATA_YOUTUBE_FORMAT_UNKNOWN", "unknown" }, + { GDATA_YOUTUBE_FORMAT_RTSP_H263_AMR, "GDATA_YOUTUBE_FORMAT_RTSP_H263_AMR", "rtsp-h263-amr" }, + { GDATA_YOUTUBE_FORMAT_HTTP_SWF, "GDATA_YOUTUBE_FORMAT_HTTP_SWF", "http-swf" }, + { GDATA_YOUTUBE_FORMAT_RTSP_MPEG4_AAC, "GDATA_YOUTUBE_FORMAT_RTSP_MPEG4_AAC", "rtsp-mpeg4-aac" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataYouTubeFormat", values); + } + return etype; +} + +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/youtube/gdata-youtube-query.h" */ +GType +gdata_youtube_safe_search_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_YOUTUBE_SAFE_SEARCH_NONE, "GDATA_YOUTUBE_SAFE_SEARCH_NONE", "none" }, + { GDATA_YOUTUBE_SAFE_SEARCH_MODERATE, "GDATA_YOUTUBE_SAFE_SEARCH_MODERATE", "moderate" }, + { GDATA_YOUTUBE_SAFE_SEARCH_STRICT, "GDATA_YOUTUBE_SAFE_SEARCH_STRICT", "strict" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataYouTubeSafeSearch", values); + } + return etype; +} +GType +gdata_youtube_sort_order_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_YOUTUBE_SORT_NONE, "GDATA_YOUTUBE_SORT_NONE", "none" }, + { GDATA_YOUTUBE_SORT_ASCENDING, "GDATA_YOUTUBE_SORT_ASCENDING", "ascending" }, + { GDATA_YOUTUBE_SORT_DESCENDING, "GDATA_YOUTUBE_SORT_DESCENDING", "descending" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataYouTubeSortOrder", values); + } + return etype; +} +GType +gdata_youtube_age_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_YOUTUBE_AGE_ALL_TIME, "GDATA_YOUTUBE_AGE_ALL_TIME", "all-time" }, + { GDATA_YOUTUBE_AGE_TODAY, "GDATA_YOUTUBE_AGE_TODAY", "today" }, + { GDATA_YOUTUBE_AGE_THIS_WEEK, "GDATA_YOUTUBE_AGE_THIS_WEEK", "this-week" }, + { GDATA_YOUTUBE_AGE_THIS_MONTH, "GDATA_YOUTUBE_AGE_THIS_MONTH", "this-month" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataYouTubeAge", values); + } + return etype; +} +GType +gdata_youtube_uploader_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_YOUTUBE_UPLOADER_ALL, "GDATA_YOUTUBE_UPLOADER_ALL", "all" }, + { GDATA_YOUTUBE_UPLOADER_PARTNER, "GDATA_YOUTUBE_UPLOADER_PARTNER", "partner" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataYouTubeUploader", values); + } + return etype; +} + +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/youtube/gdata-youtube-service.h" */ +GType +gdata_youtube_standard_feed_type_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_YOUTUBE_TOP_RATED_FEED, "GDATA_YOUTUBE_TOP_RATED_FEED", "top-rated-feed" }, + { GDATA_YOUTUBE_TOP_FAVORITES_FEED, "GDATA_YOUTUBE_TOP_FAVORITES_FEED", "top-favorites-feed" }, + { GDATA_YOUTUBE_MOST_VIEWED_FEED, "GDATA_YOUTUBE_MOST_VIEWED_FEED", "most-viewed-feed" }, + { GDATA_YOUTUBE_MOST_POPULAR_FEED, "GDATA_YOUTUBE_MOST_POPULAR_FEED", "most-popular-feed" }, + { GDATA_YOUTUBE_MOST_RECENT_FEED, "GDATA_YOUTUBE_MOST_RECENT_FEED", "most-recent-feed" }, + { GDATA_YOUTUBE_MOST_DISCUSSED_FEED, "GDATA_YOUTUBE_MOST_DISCUSSED_FEED", "most-discussed-feed" }, + { GDATA_YOUTUBE_MOST_LINKED_FEED, "GDATA_YOUTUBE_MOST_LINKED_FEED", "most-linked-feed" }, + { GDATA_YOUTUBE_MOST_RESPONDED_FEED, "GDATA_YOUTUBE_MOST_RESPONDED_FEED", "most-responded-feed" }, + { GDATA_YOUTUBE_RECENTLY_FEATURED_FEED, "GDATA_YOUTUBE_RECENTLY_FEATURED_FEED", "recently-featured-feed" }, + { GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED, "GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED", "watch-on-mobile-feed" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataYouTubeStandardFeedType", values); + } + return etype; +} +GType +gdata_youtube_service_error_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_YOUTUBE_SERVICE_ERROR_API_QUOTA_EXCEEDED, "GDATA_YOUTUBE_SERVICE_ERROR_API_QUOTA_EXCEEDED", "api-quota-exceeded" }, + { GDATA_YOUTUBE_SERVICE_ERROR_ENTRY_QUOTA_EXCEEDED, "GDATA_YOUTUBE_SERVICE_ERROR_ENTRY_QUOTA_EXCEEDED", "entry-quota-exceeded" }, + { GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED, "GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED", "channel-required" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataYouTubeServiceError", values); + } + return etype; +} + +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/youtube/gdata-youtube-video.h" */ +GType +gdata_youtube_permission_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { GDATA_YOUTUBE_PERMISSION_ALLOWED, "GDATA_YOUTUBE_PERMISSION_ALLOWED", "allowed" }, + { GDATA_YOUTUBE_PERMISSION_DENIED, "GDATA_YOUTUBE_PERMISSION_DENIED", "denied" }, + { GDATA_YOUTUBE_PERMISSION_MODERATED, "GDATA_YOUTUBE_PERMISSION_MODERATED", "moderated" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static ("GDataYouTubePermission", values); + } + return etype; +} + + + diff --git a/gdata/services/youtube/gdata-youtube-enums.h b/gdata/services/youtube/gdata-youtube-enums.h new file mode 100644 index 0000000..d345a13 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-enums.h @@ -0,0 +1,35 @@ + + + +#ifndef GDATA_YOUTUBE_ENUMS_H +#define GDATA_YOUTUBE_ENUMS_H + +#include + +G_BEGIN_DECLS +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/youtube/gdata-youtube-content.h" */ +GType gdata_youtube_format_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_YOUTUBE_FORMAT (gdata_youtube_format_get_type()) +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/youtube/gdata-youtube-query.h" */ +GType gdata_youtube_safe_search_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_YOUTUBE_SAFE_SEARCH (gdata_youtube_safe_search_get_type()) +GType gdata_youtube_sort_order_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_YOUTUBE_SORT_ORDER (gdata_youtube_sort_order_get_type()) +GType gdata_youtube_age_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_YOUTUBE_AGE (gdata_youtube_age_get_type()) +GType gdata_youtube_uploader_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_YOUTUBE_UPLOADER (gdata_youtube_uploader_get_type()) +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/youtube/gdata-youtube-service.h" */ +GType gdata_youtube_standard_feed_type_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_YOUTUBE_STANDARD_FEED_TYPE (gdata_youtube_standard_feed_type_get_type()) +GType gdata_youtube_service_error_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_YOUTUBE_SERVICE_ERROR (gdata_youtube_service_error_get_type()) +/* enumerations from "/opt/gnome/source/libgdata/gdata/services/youtube/gdata-youtube-video.h" */ +GType gdata_youtube_permission_get_type (void) G_GNUC_CONST; +#define GDATA_TYPE_YOUTUBE_PERMISSION (gdata_youtube_permission_get_type()) +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_ENUMS_H */ + + + diff --git a/gdata/services/youtube/gdata-youtube-feed.c b/gdata/services/youtube/gdata-youtube-feed.c new file mode 100644 index 0000000..82d2f5e --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-feed.c @@ -0,0 +1,102 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-youtube-feed + * @short_description: GData YouTube feed object + * @stability: Stable + * @include: gdata/services/youtube/gdata-youtube-feed.h + * + * #GDataYouTubeFeed is a list of entries (#GDataYouTubeVideo subclasses) + * returned as the result of a query to a #GDataYouTubeService, or given as the + * input to another operation on the online service. + * + * Each #GDataYouTubeVideo represents a single video on YouTube, and the + * #GDataYouTubeFeed represents a collection of those objects. + * + * Since: 0.17.0 + */ + +#include +#include +#include +#include + +#include "gdata-youtube-feed.h" +#include "gdata-youtube-video.h" +#include "gdata-types.h" +#include "gdata-private.h" +#include "gdata-service.h" + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, + GError **error); + +G_DEFINE_TYPE (GDataYouTubeFeed, gdata_youtube_feed, GDATA_TYPE_FEED) + +static void +gdata_youtube_feed_class_init (GDataYouTubeFeedClass *klass) +{ + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + parsable_class->parse_json = parse_json; +} + +static void +gdata_youtube_feed_init (GDataYouTubeFeed *self) +{ + /* Move along now. */ +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, + GError **error) +{ + if (g_strcmp0 (json_reader_get_member_name (reader), "pageInfo") == 0) { + guint total_results, items_per_page; + const GError *child_error = NULL; + + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + /* https://developers.google.com/youtube/v3/docs/playlists/list/ */ + json_reader_read_member (reader, "totalResults"); + total_results = json_reader_get_int_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "resultsPerPage"); + items_per_page = json_reader_get_int_value (reader); + json_reader_end_member (reader); + + child_error = json_reader_get_error (reader); + if (child_error != NULL) { + return gdata_parser_error_from_json_error (reader, + child_error, + error); + } + + _gdata_feed_set_page_info (GDATA_FEED (parsable), total_results, + items_per_page); + + return TRUE; + } else { + return GDATA_PARSABLE_CLASS (gdata_youtube_feed_parent_class)->parse_json (parsable, reader, user_data, error); + } +} diff --git a/gdata/services/youtube/gdata-youtube-feed.h b/gdata/services/youtube/gdata-youtube-feed.h new file mode 100644 index 0000000..e78c7c2 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-feed.h @@ -0,0 +1,74 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_YOUTUBE_FEED_H +#define GDATA_YOUTUBE_FEED_H + +#include +#include +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_YOUTUBE_FEED (gdata_youtube_feed_get_type ()) +#define GDATA_YOUTUBE_FEED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_FEED, GDataYouTubeFeed)) +#define GDATA_YOUTUBE_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_FEED, GDataYouTubeFeedClass)) +#define GDATA_IS_YOUTUBE_FEED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_FEED)) +#define GDATA_IS_YOUTUBE_FEED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_FEED)) +#define GDATA_YOUTUBE_FEED_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_FEED, GDataYouTubeFeedClass)) + +typedef struct _GDataYouTubeFeedPrivate GDataYouTubeFeedPrivate; + +/** + * GDataYouTubeFeed: + * + * All the fields in the #GDataYouTubeFeed structure are private and should + * never be accessed directly. + * + * Since: 0.17.0 + */ +typedef struct { + /*< private >*/ + GDataFeed parent; + GDataYouTubeFeedPrivate *priv; +} GDataYouTubeFeed; + +/** + * GDataYouTubeFeedClass: + * + * All the fields in the #GDataYouTubeFeedClass structure are private and should + * never be accessed directly. + * + * Since: 0.17.0 + */ +typedef struct { + /*< private >*/ + GDataFeedClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataYouTubeFeedClass; + +GType gdata_youtube_feed_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_FEED_H */ diff --git a/gdata/services/youtube/gdata-youtube-query.c b/gdata/services/youtube/gdata-youtube-query.c new file mode 100644 index 0000000..99ae996 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-query.c @@ -0,0 +1,1127 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-youtube-query + * @short_description: GData YouTube query object + * @stability: Stable + * @include: gdata/services/youtube/gdata-youtube-query.h + * + * #GDataYouTubeQuery represents a collection of query parameters specific to the YouTube service, which go above and beyond + * those catered for by #GDataQuery. + * + * With the transition to version 3 of the YouTube, the #GDataQuery:author and + * #GDataQuery:start-index properties are no longer supported, and their values + * will be ignored. Use gdata_query_next_page() instead of the + * #GDataQuery:start-index API. + * + * For more information on the custom GData query parameters supported by #GDataYouTubeQuery, see the online documentation. + * + * Since: 0.3.0 + */ + +#include +#include +#include +#include + +#include "gdata-youtube-query.h" +#include "gdata-query.h" +#include "gdata-youtube-content.h" +#include "gdata-private.h" + +static void gdata_youtube_query_finalize (GObject *object); +static void gdata_youtube_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_youtube_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); + +struct _GDataYouTubeQueryPrivate { + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + GDataYouTubeFormat format; + GDataYouTubeSortOrder sort_order; + GDataYouTubeUploader uploader; + G_GNUC_END_IGNORE_DEPRECATIONS + + gdouble latitude; + gdouble longitude; + gdouble location_radius; + gboolean has_location; + gchar *language; + gchar *order_by; + gchar *restriction; + GDataYouTubeSafeSearch safe_search; + GDataYouTubeAge age; + gchar *license; +}; + +enum { + PROP_FORMAT = 1, + PROP_LATITUDE, + PROP_LONGITUDE, + PROP_LOCATION_RADIUS, + PROP_HAS_LOCATION, + PROP_LANGUAGE, + PROP_ORDER_BY, + PROP_RESTRICTION, + PROP_SAFE_SEARCH, + PROP_SORT_ORDER, + PROP_AGE, + PROP_UPLOADER, + PROP_LICENSE, +}; + +G_DEFINE_TYPE (GDataYouTubeQuery, gdata_youtube_query, GDATA_TYPE_QUERY) + +static void +gdata_youtube_query_class_init (GDataYouTubeQueryClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataYouTubeQueryPrivate)); + + gobject_class->set_property = gdata_youtube_query_set_property; + gobject_class->get_property = gdata_youtube_query_get_property; + gobject_class->finalize = gdata_youtube_query_finalize; + + query_class->get_query_uri = get_query_uri; + + /** + * GDataYouTubeQuery:format: + * + * Specifies that videos must be available in a particular video format. Use %GDATA_YOUTUBE_FORMAT_UNKNOWN to + * retrieve videos irrespective of their format availability. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ + g_object_class_install_property (gobject_class, PROP_FORMAT, + g_param_spec_enum ("format", + "Format", "Specifies that videos must be available in a particular video format.", + GDATA_TYPE_YOUTUBE_FORMAT, GDATA_YOUTUBE_FORMAT_UNKNOWN, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + + /** + * GDataYouTubeQuery:latitude: + * + * The latitude of a particular location of which videos should be found. This should be used in conjunction with + * #GDataYouTubeQuery:longitude; if either property is outside the valid range, neither will be used. Valid latitudes + * are between -90 and 900 degrees; any values of this property outside that range + * will unset the property in the query URI. + * + * If #GDataYouTubeQuery:location-radius is a non-0 value, this will define a circle from which videos should be + * found. + * + * As it is deprecated, the value of #GDataYouTubeQuery:has-location is + * ignored. + * + * For more information, see the online documentation. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_LATITUDE, + g_param_spec_double ("latitude", + "Latitude", "The latitude of a particular location of which videos should be found.", + -G_MAXDOUBLE, G_MAXDOUBLE, G_MAXDOUBLE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeQuery:longitude: + * + * The longitude of a particular location of which videos should be found. This should be used in conjunction with + * #GDataYouTubeQuery:latitude; if either property is outside the valid range, neither will be used. Valid longitudes + * are between -180 and 180 degrees; any values of this property outside that + * range will unset the property in the query URI. + * + * For more information, see the documentation for #GDataYouTubeQuery:latitude. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_LONGITUDE, + g_param_spec_double ("longitude", + "Longitude", "The longitude of a particular location of which videos should be found.", + -G_MAXDOUBLE, G_MAXDOUBLE, G_MAXDOUBLE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeQuery:location-radius: + * + * The radius, in metres, of a circle from within which videos should be returned. The circle is centred on the latitude and + * longitude given in #GDataYouTubeQuery:latitude and #GDataYouTubeQuery:longitude. + * + * Set this property to 0 to search for specific coordinates, rather than within a given radius. + * + * For more information, see the documentation for #GDataYouTubeQuery:latitude. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_LOCATION_RADIUS, + g_param_spec_double ("location-radius", + "Location radius", "The radius, in metres, of a circle to search within.", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeQuery:has-location: + * + * Whether to restrict search results to videos with specific coordinates associated with them. If used with a given + * #GDataYouTubeQuery:latitude and #GDataYouTubeQuery:longitude, only videos with specific coordinates (not those with merely + * a descriptive address) will be returned. If used without a latitude and longitude set, only videos with specific coordinates + * (regardless of those coordinates) will be returned. + * + * For more information, see the documentation for #GDataYouTubeQuery:latitude. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. + */ + g_object_class_install_property (gobject_class, PROP_HAS_LOCATION, + g_param_spec_boolean ("has-location", + "Has location?", "Whether to restrict results to videos with specific coordinates.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + + /** + * GDataYouTubeQuery:language: + * + * Restricts the search to videos that have a title, description or keywords in a specified language. The language code should + * be a two-letter ISO 639-1 code; or you can use zh-Hans for simplified Chinese and zh-Hant + * for traditional Chinese. + * + * For more information, see the online documentation. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ + g_object_class_install_property (gobject_class, PROP_LANGUAGE, + g_param_spec_string ("language", + "Language", "Restricts the search to videos described in the given language.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + + /** + * GDataYouTubeQuery:order-by: + * + * Specifies the order of entries in a feed. Supported values are relevance, + * published, viewCount and rating. + * + * Additionally, results most relevant to a specific language can be returned by setting the property + * to relevance_lang_languageCode, where + * languageCode is an ISO 639-1 language code, as used in #GDataYouTubeQuery:language. + * + * For more information, see the online documentation. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_ORDER_BY, + g_param_spec_string ("order-by", + "Order by", "Specifies the order of entries in a feed.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeQuery:restriction: + * + * An ISO 3166 two-letter country code that should be used to filter + * videos playable only in specific countries. + * + * Previously, this property could also accept the client’s IP address + * for country lookup. This feature is no longer supported by Google, + * and will result in an error from the server if used. Use a country + * code instead. + * + * For more information, see the online documentation. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_RESTRICTION, + g_param_spec_string ("restriction", + "Restriction", "The country code to filter videos playable only in specific countries.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeQuery:safe-search: + * + * Whether the search results should include restricted content as well as standard content. + * + * For more information, see the online documentation. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_SAFE_SEARCH, + g_param_spec_enum ("safe-search", + "Safe search", "Whether the search results should include restricted content.", + GDATA_TYPE_YOUTUBE_SAFE_SEARCH, GDATA_YOUTUBE_SAFE_SEARCH_MODERATE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeQuery:sort-order: + * + * Specifies the direction of sorting. To use the default sort order, set the property to %GDATA_YOUTUBE_SORT_NONE. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ + g_object_class_install_property (gobject_class, PROP_SORT_ORDER, + g_param_spec_enum ("sort-order", + "Sort order", "Specifies the direction of sorting.", + GDATA_TYPE_YOUTUBE_SORT_ORDER, GDATA_YOUTUBE_SORT_NONE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + + /** + * GDataYouTubeQuery:age: + * + * Restricts the search to videos uploaded within the specified time period. To retrieve videos irrespective of their + * age, set the property to %GDATA_YOUTUBE_AGE_ALL_TIME. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_AGE, + g_param_spec_enum ("age", + "Age", "Restricts the search to videos uploaded within the specified time period.", + GDATA_TYPE_YOUTUBE_AGE, GDATA_YOUTUBE_AGE_ALL_TIME, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeQuery:uploader: + * + * Restricts the search to videos from the specified type of uploader. Currently, this can only be used to restrict + * searches to videos from YouTube partners. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ + g_object_class_install_property (gobject_class, PROP_UPLOADER, + g_param_spec_enum ("uploader", + "Uploader", "Restricts the search to videos from the specified type of uploader.", + GDATA_TYPE_YOUTUBE_UPLOADER, GDATA_YOUTUBE_UPLOADER_ALL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + + /** + * GDataYouTubeQuery:license: + * + * The content license which should be used to filter search results. If set to, for example, %GDATA_YOUTUBE_LICENSE_CC, only videos which + * are Creative Commons licensed will be returned in search results. Set this to %NULL to return videos under any license. + * + * For more information, see the online documentation. + * + * Since: 0.11.0 + */ + g_object_class_install_property (gobject_class, PROP_LICENSE, + g_param_spec_string ("license", + "License", "The content license which should be used to filter search results.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + +} + +static void +gdata_youtube_query_init (GDataYouTubeQuery *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_YOUTUBE_QUERY, GDataYouTubeQueryPrivate); + + self->priv->latitude = G_MAXDOUBLE; + self->priv->longitude = G_MAXDOUBLE; + + /* https://developers.google.com/youtube/v3/docs/search/list#pageToken */ + _gdata_query_set_pagination_type (GDATA_QUERY (self), + GDATA_QUERY_PAGINATION_TOKENS); +} + +static void +gdata_youtube_query_finalize (GObject *object) +{ + GDataYouTubeQueryPrivate *priv = GDATA_YOUTUBE_QUERY (object)->priv; + + g_free (priv->language); + g_free (priv->order_by); + g_free (priv->restriction); + g_free (priv->license); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_youtube_query_parent_class)->finalize (object); +} + +static void +gdata_youtube_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataYouTubeQueryPrivate *priv = GDATA_YOUTUBE_QUERY (object)->priv; + + switch (property_id) { + case PROP_FORMAT: + g_value_set_enum (value, priv->format); + break; + case PROP_LATITUDE: + g_value_set_double (value, priv->latitude); + break; + case PROP_LONGITUDE: + g_value_set_double (value, priv->longitude); + break; + case PROP_LOCATION_RADIUS: + g_value_set_double (value, priv->location_radius); + break; + case PROP_HAS_LOCATION: + g_value_set_boolean (value, priv->has_location); + break; + case PROP_LANGUAGE: + g_value_set_string (value, priv->language); + break; + case PROP_ORDER_BY: + g_value_set_string (value, priv->order_by); + break; + case PROP_RESTRICTION: + g_value_set_string (value, priv->restriction); + break; + case PROP_SAFE_SEARCH: + g_value_set_enum (value, priv->safe_search); + break; + case PROP_SORT_ORDER: + g_value_set_enum (value, priv->sort_order); + break; + case PROP_AGE: + g_value_set_enum (value, priv->age); + break; + case PROP_UPLOADER: + g_value_set_enum (value, priv->uploader); + break; + case PROP_LICENSE: + g_value_set_string (value, priv->license); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_youtube_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataYouTubeQuery *self = GDATA_YOUTUBE_QUERY (object); + + switch (property_id) { + case PROP_FORMAT: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + gdata_youtube_query_set_format (self, g_value_get_enum (value)); + G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_LATITUDE: + self->priv->latitude = g_value_get_double (value); + break; + case PROP_LONGITUDE: + self->priv->longitude = g_value_get_double (value); + break; + case PROP_LOCATION_RADIUS: + self->priv->location_radius = g_value_get_double (value); + break; + case PROP_HAS_LOCATION: + self->priv->has_location = g_value_get_boolean (value); + break; + case PROP_LANGUAGE: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + gdata_youtube_query_set_language (self, g_value_get_string (value)); + G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_ORDER_BY: + gdata_youtube_query_set_order_by (self, g_value_get_string (value)); + break; + case PROP_RESTRICTION: + gdata_youtube_query_set_restriction (self, g_value_get_string (value)); + break; + case PROP_SAFE_SEARCH: + gdata_youtube_query_set_safe_search (self, g_value_get_enum (value)); + break; + case PROP_SORT_ORDER: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + gdata_youtube_query_set_sort_order (self, g_value_get_enum (value)); + G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_AGE: + gdata_youtube_query_set_age (self, g_value_get_enum (value)); + break; + case PROP_UPLOADER: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + gdata_youtube_query_set_uploader (self, g_value_get_enum (value)); + G_GNUC_END_IGNORE_DEPRECATIONS + break; + case PROP_LICENSE: + gdata_youtube_query_set_license (self, g_value_get_string (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/* Convert from a v2 order-by parameter value to a v3 order parameter value. + * Reference: + * v2: https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters#orderbysp + * v3: https://developers.google.com/youtube/v3/docs/search/list#order + */ +static const gchar * +get_v3_order (const gchar *v2_order_by) +{ + const struct { + const gchar *v2_order_by; + const gchar *v3_order; + } mapping[] = { + { "relevance", "relevance" }, + { "published", "date" }, + { "viewCount", "viewCount" }, + { "rating", "rating" }, + }; + guint i; + + for (i = 0; i < G_N_ELEMENTS (mapping); i++) { + if (g_strcmp0 (v2_order_by, mapping[i].v2_order_by) == 0) { + return mapping[i].v3_order; + } + } + + /* Special case for ‘relevance_lang_*’. */ + if (g_str_has_prefix (v2_order_by, "relevance_lang_")) { + return "relevance"; + } + + return NULL; +} + +/* Convert from a v2 license parameter value to a v3 videoLicense parameter + * value. Reference: + * v2: https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters#licensesp + * v3: https://developers.google.com/youtube/v3/docs/search/list#videoLicense + */ +static const gchar * +get_v3_video_license (const gchar *v2_license) +{ + if (g_strcmp0 (v2_license, "cc") == 0) { + return "creativeCommon"; + } else if (g_strcmp0 (v2_license, "youtube") == 0) { + return "youtube"; + } else { + return NULL; + } +} + +static void +get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) +{ + GDataYouTubeQueryPrivate *priv = GDATA_YOUTUBE_QUERY (self)->priv; + + #define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; + + /* NOTE: We do not chain up because the parent class implements a lot + * of deprecated API. */ + + /* Categories */ + if (gdata_query_get_categories (self) != NULL) { + APPEND_SEP + g_string_append (query_uri, "videoCategoryId="); + g_string_append_uri_escaped (query_uri, + gdata_query_get_categories (self), + NULL, + FALSE); + } + + /* q param */ + if (gdata_query_get_q (self) != NULL) { + APPEND_SEP + g_string_append (query_uri, "q="); + g_string_append_uri_escaped (query_uri, + gdata_query_get_q (self), NULL, + FALSE); + } + + if (gdata_query_get_max_results (self) > 0) { + APPEND_SEP + g_string_append_printf (query_uri, "maxResults=%u", + gdata_query_get_max_results (self)); + } + + if (priv->age != GDATA_YOUTUBE_AGE_ALL_TIME) { + gchar *after; + GTimeVal tv = { 0, }; + + g_get_current_time (&tv); + + /* Squash the microseconds; they’re not useful. */ + tv.tv_usec = 0; + + switch (priv->age) { + case GDATA_YOUTUBE_AGE_TODAY: + tv.tv_sec -= 24 * 60 * 60; + break; + case GDATA_YOUTUBE_AGE_THIS_WEEK: + tv.tv_sec -= 7 * 24 * 60 * 60; + break; + case GDATA_YOUTUBE_AGE_THIS_MONTH: + tv.tv_sec -= 31 * 24 * 60 * 60; + break; + case GDATA_YOUTUBE_AGE_ALL_TIME: + default: + g_assert_not_reached (); + } + + APPEND_SEP + + after = g_time_val_to_iso8601 (&tv); + g_string_append_printf (query_uri, "publishedAfter=%s", after); + g_free (after); + } + + /* We don’t need to use APPEND_SEP below here, as this parameter is + * always included */ + APPEND_SEP + switch (priv->safe_search) { + case GDATA_YOUTUBE_SAFE_SEARCH_NONE: + g_string_append (query_uri, "safeSearch=none"); + break; + case GDATA_YOUTUBE_SAFE_SEARCH_MODERATE: + g_string_append (query_uri, "safeSearch=moderate"); + break; + case GDATA_YOUTUBE_SAFE_SEARCH_STRICT: + g_string_append (query_uri, "safeSearch=strict"); + break; + default: + g_assert_not_reached (); + } + + if (priv->latitude >= -90.0 && priv->latitude <= 90.0 && + priv->longitude >= -180.0 && priv->longitude <= 180.0) { + gchar latitude[G_ASCII_DTOSTR_BUF_SIZE]; + gchar longitude[G_ASCII_DTOSTR_BUF_SIZE]; + + g_string_append_printf (query_uri, "&location=%s,%s", + g_ascii_dtostr (latitude, + sizeof (latitude), + priv->latitude), + g_ascii_dtostr (longitude, + sizeof (longitude), + priv->longitude)); + + if (priv->location_radius >= 0.0) { + gchar radius[G_ASCII_DTOSTR_BUF_SIZE]; + g_string_append_printf (query_uri, "&locationRadius=%sm", + g_ascii_dtostr (radius, + sizeof (radius), + priv->location_radius)); + } + } + + if (priv->order_by != NULL) { + const gchar *v3_order_by = get_v3_order (priv->order_by); + + if (v3_order_by != NULL) { + g_string_append (query_uri, "&order="); + g_string_append_uri_escaped (query_uri, v3_order_by, + NULL, FALSE); + } + } + + if (priv->restriction != NULL) { + g_string_append (query_uri, "®ionCode="); + g_string_append_uri_escaped (query_uri, priv->restriction, NULL, FALSE); + } + + if (priv->license != NULL) { + const gchar *v3_video_license; + + v3_video_license = get_v3_video_license (priv->license); + + if (v3_video_license != NULL) { + g_string_append (query_uri, "&videoLicense="); + g_string_append_uri_escaped (query_uri, + v3_video_license, NULL, + FALSE); + } + } +} + +/** + * gdata_youtube_query_new: + * @q: (allow-none): a query string, or %NULL + * + * Creates a new #GDataYouTubeQuery with its #GDataQuery:q property set to @q. + * + * Return value: a new #GDataYouTubeQuery + * + * Since: 0.3.0 + */ +GDataYouTubeQuery * +gdata_youtube_query_new (const gchar *q) +{ + return g_object_new (GDATA_TYPE_YOUTUBE_QUERY, "q", q, NULL); +} + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_query_get_format: + * @self: a #GDataYouTubeQuery + * + * Gets the #GDataYouTubeQuery:format property. + * + * Return value: the format property + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ +GDataYouTubeFormat +gdata_youtube_query_get_format (GDataYouTubeQuery *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_QUERY (self), GDATA_YOUTUBE_FORMAT_UNKNOWN); + return self->priv->format; +} + +/** + * gdata_youtube_query_set_format: + * @self: a #GDataYouTubeQuery + * @format: the requested video format + * + * Sets the #GDataYouTubeQuery:format property of the #GDataYouTubeQuery to @format. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ +void +gdata_youtube_query_set_format (GDataYouTubeQuery *self, GDataYouTubeFormat format) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + self->priv->format = format; + g_object_notify (G_OBJECT (self), "format"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +G_GNUC_END_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_query_get_location: + * @self: a #GDataYouTubeQuery + * @latitude: (out caller-allocates) (allow-none): a location in which to return the latitude, or %NULL + * @longitude: (out caller-allocates) (allow-none): a location in which to return the longitude, or %NULL + * @radius: (out caller-allocates) (allow-none): a location in which to return the location radius, or %NULL + * @has_location: (out caller-allocates) (allow-none): a location in which to return %TRUE if the query is searching for videos with a specific + * location, %FALSE otherwise, or %NULL + * + * Gets the location-based properties of the #GDataYouTubeQuery: #GDataYouTubeQuery:latitude, #GDataYouTubeQuery:longitude, + * #GDataYouTubeQuery:location-radius and #GDataYouTubeQuery:has-location. + * + * Since: 0.3.0 + */ +void +gdata_youtube_query_get_location (GDataYouTubeQuery *self, gdouble *latitude, gdouble *longitude, gdouble *radius, gboolean *has_location) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + + if (latitude != NULL) + *latitude = self->priv->latitude; + if (longitude != NULL) + *longitude = self->priv->longitude; + if (radius != NULL) + *radius = self->priv->location_radius; + if (has_location != NULL) + *has_location = self->priv->has_location; +} + +/** + * gdata_youtube_query_set_location: + * @self: a #GDataYouTubeQuery + * @latitude: the new latitude, or %G_MAXDOUBLE + * @longitude: the new longitude, or %G_MAXDOUBLE + * @radius: the new location radius, or 0 + * @has_location: %TRUE if the query is for videos with a specific location, %FALSE otherwise + * + * Sets the location-based properties of the #GDataYouTubeQuery: #GDataYouTubeQuery:latitude, #GDataYouTubeQuery:longitude, + * #GDataYouTubeQuery:location-radius and #GDataYouTubeQuery:has-location. + * + * Since: 0.3.0 + */ +void +gdata_youtube_query_set_location (GDataYouTubeQuery *self, gdouble latitude, gdouble longitude, gdouble radius, gboolean has_location) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + + self->priv->latitude = latitude; + self->priv->longitude = longitude; + self->priv->location_radius = radius; + self->priv->has_location = has_location; + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "latitude"); + g_object_notify (G_OBJECT (self), "longitude"); + g_object_notify (G_OBJECT (self), "location-radius"); + g_object_notify (G_OBJECT (self), "has-location"); + g_object_thaw_notify (G_OBJECT (self)); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_youtube_query_get_language: + * @self: a #GDataYouTubeQuery + * + * Gets the #GDataYouTubeQuery:language property. + * + * Return value: the language property, or %NULL if it is unset + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ +const gchar * +gdata_youtube_query_get_language (GDataYouTubeQuery *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_QUERY (self), NULL); + return self->priv->language; +} + +/** + * gdata_youtube_query_set_language: + * @self: a #GDataYouTubeQuery + * @language: (allow-none): a new language name, or %NULL + * + * Sets the #GDataYouTubeQuery:language property of the #GDataYouTubeQuery to the new language, @language. + * + * Set @language to %NULL to unset the property in the query URI. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ +void +gdata_youtube_query_set_language (GDataYouTubeQuery *self, const gchar *language) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + g_free (self->priv->language); + self->priv->language = g_strdup (language); + g_object_notify (G_OBJECT (self), "language"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_youtube_query_get_order_by: + * @self: a #GDataYouTubeQuery + * + * Gets the #GDataYouTubeQuery:order-by property. + * + * Return value: the order by property, or %NULL if it is unset + * + * Since: 0.3.0 + */ +const gchar * +gdata_youtube_query_get_order_by (GDataYouTubeQuery *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_QUERY (self), NULL); + return self->priv->order_by; +} + +/** + * gdata_youtube_query_set_order_by: + * @self: a #GDataYouTubeQuery + * @order_by: (allow-none): a new order by string, or %NULL + * + * Sets the #GDataYouTubeQuery:order-by property of the #GDataYouTubeQuery to the new order by string, @order_by. + * + * Set @order_by to %NULL to unset the property in the query URI. + * + * Since: 0.3.0 + */ +void +gdata_youtube_query_set_order_by (GDataYouTubeQuery *self, const gchar *order_by) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + + g_free (self->priv->order_by); + self->priv->order_by = g_strdup (order_by); + g_object_notify (G_OBJECT (self), "order-by"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_youtube_query_get_restriction: + * @self: a #GDataYouTubeQuery + * + * Gets the #GDataYouTubeQuery:restriction property. + * + * Return value: the restriction property, or %NULL if it is unset + * + * Since: 0.3.0 + */ +const gchar * +gdata_youtube_query_get_restriction (GDataYouTubeQuery *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_QUERY (self), NULL); + return self->priv->restriction; +} + +/** + * gdata_youtube_query_set_restriction: + * @self: a #GDataYouTubeQuery + * @restriction: (allow-none): a new restriction string, or %NULL + * + * Sets the #GDataYouTubeQuery:restriction property of the #GDataYouTubeQuery to the new restriction string, @restriction. + * + * Set @restriction to %NULL to unset the property in the query URI. + * + * Since: 0.3.0 + */ +void +gdata_youtube_query_set_restriction (GDataYouTubeQuery *self, const gchar *restriction) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + g_free (self->priv->restriction); + self->priv->restriction = g_strdup (restriction); + g_object_notify (G_OBJECT (self), "restriction"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +/** + * gdata_youtube_query_get_safe_search: + * @self: a #GDataYouTubeQuery + * + * Gets the #GDataYouTubeQuery:safe-search property. + * + * Return value: the safe search property + * + * Since: 0.3.0 + */ +GDataYouTubeSafeSearch +gdata_youtube_query_get_safe_search (GDataYouTubeQuery *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_QUERY (self), GDATA_YOUTUBE_SAFE_SEARCH_MODERATE); + return self->priv->safe_search; +} + +/** + * gdata_youtube_query_set_safe_search: + * @self: a #GDataYouTubeQuery + * @safe_search: a new safe search level + * + * Sets the #GDataYouTubeQuery:safe-search property of the #GDataYouTubeQuery to @safe_search. + * + * Since: 0.3.0 + */ +void +gdata_youtube_query_set_safe_search (GDataYouTubeQuery *self, GDataYouTubeSafeSearch safe_search) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + self->priv->safe_search = safe_search; + g_object_notify (G_OBJECT (self), "safe-search"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_query_get_sort_order: + * @self: a #GDataYouTubeQuery + * + * Gets the #GDataYouTubeQuery:sort-order property. + * + * Return value: the sort order property + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ +GDataYouTubeSortOrder +gdata_youtube_query_get_sort_order (GDataYouTubeQuery *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_QUERY (self), GDATA_YOUTUBE_SORT_NONE); + return self->priv->sort_order; +} + +/** + * gdata_youtube_query_set_sort_order: + * @self: a #GDataYouTubeQuery + * @sort_order: the new sort order + * + * Sets the #GDataYouTubeQuery:sort-order property of the #GDataYouTubeQuery to @sort_order. + * + * Set @sort_order to %GDATA_YOUTUBE_SORT_NONE to unset the property in the query URI. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ +void +gdata_youtube_query_set_sort_order (GDataYouTubeQuery *self, GDataYouTubeSortOrder sort_order) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + self->priv->sort_order = sort_order; + g_object_notify (G_OBJECT (self), "sort-order"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +G_GNUC_END_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_query_get_age: + * @self: a #GDataYouTubeQuery + * + * Gets the #GDataYouTubeQuery:age property. + * + * Return value: the age property + * + * Since: 0.3.0 + */ +GDataYouTubeAge +gdata_youtube_query_get_age (GDataYouTubeQuery *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_QUERY (self), GDATA_YOUTUBE_AGE_ALL_TIME); + return self->priv->age; +} + +/** + * gdata_youtube_query_set_age: + * @self: a #GDataYouTubeQuery + * @age: the new age + * + * Sets the #GDataYouTubeQuery:age property of the #GDataYouTubeQuery to @age. + * + * Since: 0.3.0 + */ +void +gdata_youtube_query_set_age (GDataYouTubeQuery *self, GDataYouTubeAge age) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + self->priv->age = age; + g_object_notify (G_OBJECT (self), "age"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_query_get_uploader: + * @self: a #GDataYouTubeQuery + * + * Gets the #GDataYouTubeQuery:uploader property. + * + * Return value: the uploader property + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ +GDataYouTubeUploader +gdata_youtube_query_get_uploader (GDataYouTubeQuery *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_QUERY (self), GDATA_YOUTUBE_UPLOADER_ALL); + return self->priv->uploader; +} + +/** + * gdata_youtube_query_set_uploader: + * @self: a #GDataYouTubeQuery + * @uploader: the new uploader + * + * Sets the #GDataYouTubeQuery:uploader property of the #GDataYouTubeQuery to @uploader. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. The value of + * this property will be unused in queries. There is no replacement. + */ +void +gdata_youtube_query_set_uploader (GDataYouTubeQuery *self, GDataYouTubeUploader uploader) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + self->priv->uploader = uploader; + g_object_notify (G_OBJECT (self), "uploader"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} + +G_GNUC_END_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_query_get_license: + * @self: a #GDataYouTubeQuery + * + * Gets the #GDataYouTubeQuery:license property. + * + * Return value: the license property, or %NULL if it is unset + * + * Since: 0.11.0 + */ +const gchar * +gdata_youtube_query_get_license (GDataYouTubeQuery *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_QUERY (self), NULL); + return self->priv->license; +} + +/** + * gdata_youtube_query_set_license: + * @self: a #GDataYouTubeQuery + * @license: (allow-none): a new license value, or %NULL + * + * Sets the #GDataYouTubeQuery:license property of the #GDataYouTubeQuery to the new license value, @license. + * + * Set @license to %NULL to unset the property in the query URI. + * + * Since: 0.11.0 + */ +void +gdata_youtube_query_set_license (GDataYouTubeQuery *self, const gchar *license) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_QUERY (self)); + g_free (self->priv->license); + self->priv->license = g_strdup (license); + g_object_notify (G_OBJECT (self), "license"); + + /* Our current ETag will no longer be relevant */ + gdata_query_set_etag (GDATA_QUERY (self), NULL); +} diff --git a/gdata/services/youtube/gdata-youtube-query.h b/gdata/services/youtube/gdata-youtube-query.h new file mode 100644 index 0000000..32924a1 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-query.h @@ -0,0 +1,197 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_YOUTUBE_QUERY_H +#define GDATA_YOUTUBE_QUERY_H + +#include +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDataYouTubeSafeSearch: + * @GDATA_YOUTUBE_SAFE_SEARCH_NONE: YouTube will not perform any filtering on the search result set + * @GDATA_YOUTUBE_SAFE_SEARCH_MODERATE: YouTube will filter some content from search results and, at the least, + * will filter content that is restricted in your locale + * @GDATA_YOUTUBE_SAFE_SEARCH_STRICT: YouTube will try to exclude all restricted content from the search result set + * + * Safe search levels for removing restricted entries from query results. For more information, see the + * online documentation. + * + * Since: 0.3.0 + */ +typedef enum { + GDATA_YOUTUBE_SAFE_SEARCH_NONE = 0, + GDATA_YOUTUBE_SAFE_SEARCH_MODERATE, + GDATA_YOUTUBE_SAFE_SEARCH_STRICT +} GDataYouTubeSafeSearch; + +#ifndef LIBGDATA_DISABLE_DEPRECATED +/** + * GDataYouTubeSortOrder: + * @GDATA_YOUTUBE_SORT_NONE: do not explicitly sort in any sense + * @GDATA_YOUTUBE_SORT_ASCENDING: sort results in ascending order of the order field + * @GDATA_YOUTUBE_SORT_DESCENDING: sort results in descending order of the order field + * + * Sort orders for the search results from queries. They specify the order of the designated order field. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. There is no + * replacement. + */ +typedef enum { + GDATA_YOUTUBE_SORT_NONE = 0, + GDATA_YOUTUBE_SORT_ASCENDING, + GDATA_YOUTUBE_SORT_DESCENDING +} GDataYouTubeSortOrder; +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +/** + * GDataYouTubeAge: + * @GDATA_YOUTUBE_AGE_ALL_TIME: retrieve all videos, regardless of the date they were uploaded + * @GDATA_YOUTUBE_AGE_TODAY: retrieve only videos uploaded in the past day + * @GDATA_YOUTUBE_AGE_THIS_WEEK: retrieve only videos uploaded in the past week + * @GDATA_YOUTUBE_AGE_THIS_MONTH: retrieve only videos uploaded in the past month + * + * Video ages, allowing queries to be limited to videos uploaded in a recent time period. + * + * Since: 0.3.0 + */ +typedef enum { + GDATA_YOUTUBE_AGE_ALL_TIME = 0, + GDATA_YOUTUBE_AGE_TODAY, + GDATA_YOUTUBE_AGE_THIS_WEEK, + GDATA_YOUTUBE_AGE_THIS_MONTH +} GDataYouTubeAge; + +#ifndef LIBGDATA_DISABLE_DEPRECATED +/** + * GDataYouTubeUploader: + * @GDATA_YOUTUBE_UPLOADER_ALL: retrieve all videos, regardless of who uploaded them + * @GDATA_YOUTUBE_UPLOADER_PARTNER: retrieve only videos uploaded by YouTube partners + * + * Video uploaders, allowing queries to be limited to returning videos uploaded by YouTube partners. + * + * Since: 0.3.0 + * Deprecated: 0.17.0: No longer supported by Google. There is no + * replacement. + */ +typedef enum { + GDATA_YOUTUBE_UPLOADER_ALL = 0, + GDATA_YOUTUBE_UPLOADER_PARTNER +} GDataYouTubeUploader; +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +/** + * GDATA_YOUTUBE_LICENSE_CC: + * + * Value for #GDataYouTubeQuery:license to restrict search results to only videos which are Creative Commons licensed. Specifically, the license + * is the Creative Commons Attribution 3.0 Unported license; see the + * YouTube Help for more information. + * + * Since: 0.11.0 + */ +#define GDATA_YOUTUBE_LICENSE_CC "cc" + +/** + * GDATA_YOUTUBE_LICENSE_STANDARD: + * + * Value for #GDataYouTubeQuery:license to restrict search results to only videos which are under the standard YouTube license. + * + * Since: 0.11.0 + */ +#define GDATA_YOUTUBE_LICENSE_STANDARD "youtube" + +#define GDATA_TYPE_YOUTUBE_QUERY (gdata_youtube_query_get_type ()) +#define GDATA_YOUTUBE_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_QUERY, GDataYouTubeQuery)) +#define GDATA_YOUTUBE_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_QUERY, GDataYouTubeQueryClass)) +#define GDATA_IS_YOUTUBE_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_QUERY)) +#define GDATA_IS_YOUTUBE_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_QUERY)) +#define GDATA_YOUTUBE_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_QUERY, GDataYouTubeQueryClass)) + +typedef struct _GDataYouTubeQueryPrivate GDataYouTubeQueryPrivate; + +/** + * GDataYouTubeQuery: + * + * All the fields in the #GDataYouTubeQuery structure are private and should never be accessed directly. + * + * Since: 0.3.0 + */ +typedef struct { + GDataQuery parent; + GDataYouTubeQueryPrivate *priv; +} GDataYouTubeQuery; + +/** + * GDataYouTubeQueryClass: + * + * All the fields in the #GDataYouTubeQueryClass structure are private and should never be accessed directly. + * + * Since: 0.3.0 + */ +typedef struct { + /*< private >*/ + GDataQueryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataYouTubeQueryClass; + +GType gdata_youtube_query_get_type (void) G_GNUC_CONST; + +GDataYouTubeQuery *gdata_youtube_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +void gdata_youtube_query_get_location (GDataYouTubeQuery *self, gdouble *latitude, gdouble *longitude, gdouble *radius, gboolean *has_location); +void gdata_youtube_query_set_location (GDataYouTubeQuery *self, gdouble latitude, gdouble longitude, gdouble radius, gboolean has_location); +const gchar *gdata_youtube_query_get_order_by (GDataYouTubeQuery *self) G_GNUC_PURE; +void gdata_youtube_query_set_order_by (GDataYouTubeQuery *self, const gchar *order_by); +const gchar *gdata_youtube_query_get_restriction (GDataYouTubeQuery *self) G_GNUC_PURE; +void gdata_youtube_query_set_restriction (GDataYouTubeQuery *self, const gchar *restriction); +GDataYouTubeSafeSearch gdata_youtube_query_get_safe_search (GDataYouTubeQuery *self) G_GNUC_PURE; +void gdata_youtube_query_set_safe_search (GDataYouTubeQuery *self, GDataYouTubeSafeSearch safe_search); +GDataYouTubeAge gdata_youtube_query_get_age (GDataYouTubeQuery *self) G_GNUC_PURE; +void gdata_youtube_query_set_age (GDataYouTubeQuery *self, GDataYouTubeAge age); +const gchar *gdata_youtube_query_get_license (GDataYouTubeQuery *self) G_GNUC_PURE; +void gdata_youtube_query_set_license (GDataYouTubeQuery *self, const gchar *license); + +#ifndef LIBGDATA_DISABLE_DEPRECATED +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +GDataYouTubeFormat gdata_youtube_query_get_format (GDataYouTubeQuery *self) G_GNUC_PURE G_GNUC_DEPRECATED; +void gdata_youtube_query_set_format (GDataYouTubeQuery *self, GDataYouTubeFormat format) G_GNUC_DEPRECATED; +const gchar *gdata_youtube_query_get_language (GDataYouTubeQuery *self) G_GNUC_PURE G_GNUC_DEPRECATED; +void gdata_youtube_query_set_language (GDataYouTubeQuery *self, const gchar *language) G_GNUC_DEPRECATED; +GDataYouTubeSortOrder gdata_youtube_query_get_sort_order (GDataYouTubeQuery *self) G_GNUC_PURE G_GNUC_DEPRECATED; +void gdata_youtube_query_set_sort_order (GDataYouTubeQuery *self, GDataYouTubeSortOrder sort_order) G_GNUC_DEPRECATED; +GDataYouTubeUploader gdata_youtube_query_get_uploader (GDataYouTubeQuery *self) G_GNUC_PURE G_GNUC_DEPRECATED; +void gdata_youtube_query_set_uploader (GDataYouTubeQuery *self, GDataYouTubeUploader uploader) G_GNUC_DEPRECATED; +G_GNUC_END_IGNORE_DEPRECATIONS +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_QUERY_H */ diff --git a/gdata/services/youtube/gdata-youtube-service.c b/gdata/services/youtube/gdata-youtube-service.c new file mode 100644 index 0000000..e408b2e --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-service.c @@ -0,0 +1,1229 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008–2010, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-youtube-service + * @short_description: GData YouTube service object + * @stability: Stable + * @include: gdata/services/youtube/gdata-youtube-service.h + * + * #GDataYouTubeService is a subclass of #GDataService for communicating with the GData API of YouTube. It supports querying for and + * uploading videos using version 3 of the API. + * + * The YouTube API supports returning different sets of properties for + * #GDataYouTubeVideos depending on the specific query. For search results, only + * ‘snippet’ properties are returned (including #GDataEntry:title, + * #GDataEntry:summary and the set of thumbnails). For querying single videos, + * a more complete set of properties are returned — so use + * gdata_service_query_single_entry_async() to get further details on a video. + * + * For more details of YouTube's GData API, see the + * online documentation. + * + * + * Getting a Localized List of YouTube Categories + * + * GDataYouTubeService *service; + * GDataAPPCategories *app_categories; + * GList *categories, *i; + * + * /* Create a service and set its locale to Italian, which localizes the categories to Italian */ + * service = create_youtube_service (); + * gdata_service_set_locale (GDATA_SERVICE (service), "it"); + * + * /* Query the server for the current list of YouTube categories (in Italian) */ + * app_categories = gdata_youtube_service_get_categories (service, NULL, NULL); + * categories = gdata_app_categories_get_categories (app_categories); + * + * /* Iterate through the categories */ + * for (i = categories; i != NULL; i = i->next) { + * GDataYouTubeCategory *category = GDATA_YOUTUBE_CATEGORY (i->data); + * + * if (gdata_youtube_category_is_deprecated (category) == FALSE && gdata_youtube_category_is_browsable (category, "IT") == TRUE) { + * /* Do something with the category here, as it's not deprecated, and is browsable in the given region */ + * add_to_ui (gdata_category_get_term (GDATA_CATEGORY (category)), gdata_category_get_label (GDATA_CATEGORY (category))); + * } + * } + * + * g_object_unref (app_categories); + * g_object_unref (service); + * + * + * + * + * Uploading a Video from Disk + * + * GDataYouTubeService *service; + * GDataYouTubeVideo *video, *uploaded_video; + * GDataMediaCategory *category; + * const gchar * const tags[] = { "tag1", "tag2", NULL }; + * GFile *video_file; + * GFileInfo *file_info; + * const gchar *slug, *content_type; + * GFileInputStream *file_stream; + * GDataUploadStream *upload_stream; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_youtube_service (); + * + * /* Get the video file to upload */ + * video_file = g_file_new_for_path ("sample.ogg"); + * + * /* Get the file's display name and content type */ + * file_info = g_file_query_info (video_file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, + * G_FILE_QUERY_INFO_NONE, NULL, &error); + * + * if (error != NULL) { + * g_error ("Error getting video file information: %s", error->message); + * g_error_free (error); + * g_object_unref (video_file); + * g_object_unref (service); + * return; + * } + * + * slug = g_file_info_get_display_name (file_info); + * content_type = g_file_info_get_content_type (file_info); + * + * /* Get an input stream for the file */ + * file_stream = g_file_read (video_file, NULL, &error); + * + * g_object_unref (video_file); + * + * if (error != NULL) { + * g_error ("Error getting video file stream: %s", error->message); + * g_error_free (error); + * g_object_unref (file_info); + * g_object_unref (service); + * return; + * } + * + * /* Create the video to upload */ + * video = gdata_youtube_video_new (NULL); + * + * gdata_entry_set_title (GDATA_ENTRY (video), "Video Title"); + * gdata_youtube_video_set_description (video, "Video description."); + * gdata_youtube_video_set_keywords (video, video_tags); + * + * category = gdata_media_category_new ("People", "http://gdata.youtube.com/schemas/2007/categories.cat", NULL); + * gdata_youtube_video_set_category (video, category); + * g_object_unref (category); + * + * /* Get an upload stream for the video */ + * upload_stream = gdata_youtube_service_upload_video (service, video, slug, content_type, NULL, &error); + * + * g_object_unref (video); + * g_object_unref (file_info); + * + * if (error != NULL) { + * g_error ("Error getting upload stream: %s", error->message); + * g_error_free (error); + * g_object_unref (file_stream); + * g_object_unref (service); + * return; + * } + * + * /* Upload the video. This is a blocking operation, and should normally be done asynchronously. */ + * g_output_stream_splice (G_OUTPUT_STREAM (upload_stream), G_INPUT_STREAM (file_stream), + * G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error); + * + * g_object_unref (file_stream); + * + * if (error != NULL) { + * g_error ("Error splicing streams: %s", error->message); + * g_error_free (error); + * g_object_unref (upload_stream); + * g_object_unref (service); + * return; + * } + * + * /* Finish off the upload by parsing the returned updated video entry */ + * uploaded_video = gdata_youtube_service_finish_video_upload (service, upload_stream, &error); + * + * g_object_unref (upload_stream); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error uploading video: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Do something with the uploaded video */ + * + * g_object_unref (uploaded_video); + * + * + * + * + * Querying for Videos from a Standard Feed + * + * GDataYouTubeService *service; + * GDataFeed *feed; + * GList *i; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_youtube_service (); + * + * /* Query for the top page of videos in the most popular feed */ + * feed = gdata_youtube_service_query_standard_feed (service, GDATA_YOUTUBE_MOST_POPULAR_FEED, NULL, NULL, NULL, NULL, &error); + * + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error querying for most popular videos: %s", error->message); + * g_error_free (error); + * return; + * } + * + * /* Iterate through the videos */ + * for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { + * GDataYouTubeVideo *video = GDATA_YOUTUBE_VIDEO (i->data); + * + * /* Do something with the video, like insert it into the UI */ + * } + * + * g_object_unref (feed); + * + * + * + * + * Querying for Videos using Search Terms + * + * GDataYouTubeService *service; + * GDataYouTubeQuery *query; + * GDataFeed *feed; + * GList *i; + * GError *error = NULL; + * + * /* Create a service */ + * service = create_youtube_service (); + * + * /* Build a query with the given search terms, also matching only videos which are CC-licensed */ + * query = gdata_youtube_query_new (my_space_separated_search_terms); + * gdata_youtube_query_set_license (query, GDATA_YOUTUBE_LICENSE_CC); + * + * /* Query for the videos matching the query parameters */ + * feed = gdata_youtube_service_query_videos (service, query, NULL, NULL, NULL, &error); + * + * g_object_unref (query); + * g_object_unref (service); + * + * if (error != NULL) { + * g_error ("Error querying for videos matching search terms ‘%s’: %s", my_space_separated_search_terms, error->message); + * g_error_free (error); + * return; + * } + * + * /* Iterate through the videos */ + * for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { + * GDataYouTubeVideo *video = GDATA_YOUTUBE_VIDEO (i->data); + * + * /* Do something with the video, like insert it into the UI */ + * } + * + * g_object_unref (feed); + * + * + */ + +#include +#include +#include +#include +#include + +#include "gdata-youtube-service.h" +#include "gdata-youtube-feed.h" +#include "gdata-service.h" +#include "gdata-private.h" +#include "gdata-parser.h" +#include "atom/gdata-link.h" +#include "gdata-upload-stream.h" +#include "gdata-youtube-category.h" +#include "gdata-batchable.h" + +/* Standards reference here: https://developers.google.com/youtube/v3/docs/ */ + +GQuark +gdata_youtube_service_error_quark (void) +{ + return g_quark_from_static_string ("gdata-youtube-service-error-quark"); +} + +static void gdata_youtube_service_batchable_init (GDataBatchableIface *iface); +static void gdata_youtube_service_finalize (GObject *object); +static void gdata_youtube_service_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_youtube_service_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void append_query_headers (GDataService *self, GDataAuthorizationDomain *domain, SoupMessage *message); +static void parse_error_response (GDataService *self, GDataOperationType operation_type, guint status, const gchar *reason_phrase, + const gchar *response_body, gint length, GError **error); + +static GList *get_authorization_domains (void); + +struct _GDataYouTubeServicePrivate { + gchar *developer_key; +}; + +enum { + PROP_DEVELOPER_KEY = 1 +}; + +/* Reference: https://developers.google.com/youtube/v3/guides/authentication */ +_GDATA_DEFINE_AUTHORIZATION_DOMAIN (youtube, "youtube", + "https://www.googleapis.com/auth/youtube") +_GDATA_DEFINE_AUTHORIZATION_DOMAIN (youtube_force_ssl, "youtube-force-ssl", + "https://www.googleapis.com/auth/youtube.force-ssl") +G_DEFINE_TYPE_WITH_CODE (GDataYouTubeService, gdata_youtube_service, GDATA_TYPE_SERVICE, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_BATCHABLE, + gdata_youtube_service_batchable_init)) + +static void +gdata_youtube_service_class_init (GDataYouTubeServiceClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataServiceClass *service_class = GDATA_SERVICE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataYouTubeServicePrivate)); + + gobject_class->set_property = gdata_youtube_service_set_property; + gobject_class->get_property = gdata_youtube_service_get_property; + gobject_class->finalize = gdata_youtube_service_finalize; + + service_class->feed_type = GDATA_TYPE_YOUTUBE_FEED; + service_class->append_query_headers = append_query_headers; + service_class->parse_error_response = parse_error_response; + service_class->get_authorization_domains = get_authorization_domains; + + /** + * GDataYouTubeService:developer-key: + * + * The developer key your application has registered with the YouTube API. For more information, see the online documentation. + * + * With the port from v2 to v3 of the YouTube API in libgdata + * 0.17.0, it might be necessary to update your application’s + * developer key. + */ + g_object_class_install_property (gobject_class, PROP_DEVELOPER_KEY, + g_param_spec_string ("developer-key", + "Developer key", "Your YouTube developer API key.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static gboolean +gdata_youtube_service_batchable_is_supported (GDataBatchOperationType operation_type) +{ + /* Batch operation support was removed with v3 of the API: + * https://developers.google.com/youtube/v3/guides/implementation/deprecated#Batch_Processing */ + return FALSE; +} + +static void +gdata_youtube_service_batchable_init (GDataBatchableIface *iface) +{ + iface->is_supported = gdata_youtube_service_batchable_is_supported; +} + +static void +gdata_youtube_service_init (GDataYouTubeService *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_YOUTUBE_SERVICE, GDataYouTubeServicePrivate); +} + +static void +gdata_youtube_service_finalize (GObject *object) +{ + GDataYouTubeServicePrivate *priv = GDATA_YOUTUBE_SERVICE (object)->priv; + + g_free (priv->developer_key); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_youtube_service_parent_class)->finalize (object); +} + +static void +gdata_youtube_service_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataYouTubeServicePrivate *priv = GDATA_YOUTUBE_SERVICE (object)->priv; + + switch (property_id) { + case PROP_DEVELOPER_KEY: + g_value_set_string (value, priv->developer_key); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_youtube_service_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataYouTubeServicePrivate *priv = GDATA_YOUTUBE_SERVICE (object)->priv; + + switch (property_id) { + case PROP_DEVELOPER_KEY: + priv->developer_key = g_value_dup_string (value); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +append_query_headers (GDataService *self, GDataAuthorizationDomain *domain, + SoupMessage *message) +{ + GDataYouTubeServicePrivate *priv = GDATA_YOUTUBE_SERVICE (self)->priv; + + g_assert (message != NULL); + + if (priv->developer_key != NULL && + !gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_youtube_authorization_domain ())) { + const gchar *query; + SoupURI *uri; + + uri = soup_message_get_uri (message); + query = soup_uri_get_query (uri); + + /* Set the key on every unauthorised request: + * https://developers.google.com/youtube/v3/docs/standard_parameters#key */ + if (query != NULL) { + GString *new_query; + + new_query = g_string_new (query); + + g_string_append (new_query, "&key="); + g_string_append_uri_escaped (new_query, + priv->developer_key, NULL, + FALSE); + + soup_uri_set_query (uri, new_query->str); + g_string_free (new_query, TRUE); + } + } + + /* Chain up to the parent class */ + GDATA_SERVICE_CLASS (gdata_youtube_service_parent_class)->append_query_headers (self, domain, message); +} + +/* Reference: https://developers.google.com/youtube/v3/docs/errors + * + * Example response: + * { + * "error": { + * "errors": [ + * { + * "domain": "youtube.parameter", + * "reason": "missingRequiredParameter", + * "message": "No filter selected.", + * "locationType": "parameter", + * "location": "" + * } + * ], + * "code": 400, + * "message": "No filter selected." + * } + * } + */ +/* FIXME: Factor this out into a common JSON error parser helper which simply + * takes a map of expected error codes. */ +static void +parse_error_response (GDataService *self, GDataOperationType operation_type, + guint status, const gchar *reason_phrase, + const gchar *response_body, gint length, GError **error) +{ + JsonParser *parser = NULL; /* owned */ + JsonReader *reader = NULL; /* owned */ + gint i; + GError *child_error = NULL; + + if (response_body == NULL) { + goto parent; + } + + if (length == -1) { + length = strlen (response_body); + } + + parser = json_parser_new (); + if (!json_parser_load_from_data (parser, response_body, length, + &child_error)) { + goto parent; + } + + reader = json_reader_new (json_parser_get_root (parser)); + + /* Check that the outermost node is an object. */ + if (!json_reader_is_object (reader)) { + goto parent; + } + + /* Grab the ‘error’ member, then its ‘errors’ member. */ + if (!json_reader_read_member (reader, "error") || + !json_reader_is_object (reader) || + !json_reader_read_member (reader, "errors") || + !json_reader_is_array (reader)) { + goto parent; + } + + /* Parse each of the errors. Return the first one, and print out any + * others. */ + for (i = 0; i < json_reader_count_elements (reader); i++) { + const gchar *domain, *reason, *message, *extended_help; + const gchar *location_type, *location; + + /* Parse the error. */ + if (!json_reader_read_element (reader, i) || + !json_reader_is_object (reader)) { + goto parent; + } + + json_reader_read_member (reader, "domain"); + domain = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "reason"); + reason = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "message"); + message = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "extendedHelp"); + extended_help = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "locationType"); + location_type = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "location"); + location = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + /* End the error element. */ + json_reader_end_element (reader); + + /* Create an error message, but only for the first error */ + if (error == NULL || *error == NULL) { + if (g_strcmp0 (domain, "usageLimits") == 0 && + g_strcmp0 (reason, + "dailyLimitExceededUnreg") == 0) { + /* Daily Limit for Unauthenticated Use + * Exceeded. */ + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_API_QUOTA_EXCEEDED, + _("You have made too many API " + "calls recently. Please wait a " + "few minutes and try again.")); + } else if (g_strcmp0 (reason, + "rateLimitExceeded") == 0) { + g_set_error (error, GDATA_YOUTUBE_SERVICE_ERROR, + GDATA_YOUTUBE_SERVICE_ERROR_ENTRY_QUOTA_EXCEEDED, + _("You have exceeded your entry " + "quota. Please delete some " + "entries and try again.")); + } else if (g_strcmp0 (domain, "global") == 0 && + (g_strcmp0 (reason, "authError") == 0 || + g_strcmp0 (reason, "required") == 0)) { + /* Authentication problem */ + g_set_error (error, GDATA_SERVICE_ERROR, + GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to " + "do this.")); + } else if (g_strcmp0 (reason, + "youtubeSignupRequired") == 0) { + /* Tried to authenticate with a Google Account which hasn't yet had a YouTube channel created for it. */ + g_set_error (error, GDATA_YOUTUBE_SERVICE_ERROR, + GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED, + /* Translators: the parameter is a URI. */ + _("Your Google Account must be " + "associated with a YouTube " + "channel to do this. Visit %s " + "to create one."), + "https://www.youtube.com/create_channel"); + } else { + /* Unknown or validation (protocol) error. Fall + * back to working off the HTTP status code. */ + g_warning ("Unknown error code ‘%s’ in domain " + "‘%s’ received with location type " + "‘%s’, location ‘%s’, extended help " + "‘%s’ and message ‘%s’.", + reason, domain, location_type, + location, extended_help, message); + + goto parent; + } + } else { + /* For all errors after the first, log the error in the + * terminal. */ + g_debug ("Error message received in response: domain " + "‘%s’, reason ‘%s’, extended help ‘%s’, " + "message ‘%s’, location type ‘%s’, location " + "‘%s’.", + domain, reason, extended_help, message, + location_type, location); + } + } + + /* End the ‘errors’ and ‘error’ members. */ + json_reader_end_element (reader); + json_reader_end_element (reader); + + g_clear_object (&reader); + g_clear_object (&parser); + + /* Ensure we’ve actually set an error message. */ + g_assert (error == NULL || *error != NULL); + + return; + +parent: + g_clear_object (&reader); + g_clear_object (&parser); + + /* Chain up to the parent class */ + GDATA_SERVICE_CLASS (gdata_youtube_service_parent_class)->parse_error_response (self, operation_type, status, reason_phrase, + response_body, length, error); +} + +static GList * +get_authorization_domains (void) +{ + GList *authorization_domains = NULL; + + authorization_domains = g_list_prepend (authorization_domains, get_youtube_authorization_domain ()); + authorization_domains = g_list_prepend (authorization_domains, get_youtube_force_ssl_authorization_domain ()); + + return authorization_domains; +} + +/** + * gdata_youtube_service_new: + * @developer_key: your application's developer API key + * @authorizer: (allow-none): a #GDataAuthorizer to authorize the service's requests, or %NULL + * + * Creates a new #GDataYouTubeService using the given #GDataAuthorizer. If @authorizer is %NULL, all requests are made as an unauthenticated user. + * The @developer_key must be unique for your application, and as + * registered with Google. + * + * Return value: a new #GDataYouTubeService, or %NULL; unref with g_object_unref() + * + * Since: 0.9.0 + */ +GDataYouTubeService * +gdata_youtube_service_new (const gchar *developer_key, GDataAuthorizer *authorizer) +{ + g_return_val_if_fail (developer_key != NULL, NULL); + g_return_val_if_fail (authorizer == NULL || GDATA_IS_AUTHORIZER (authorizer), NULL); + + return g_object_new (GDATA_TYPE_YOUTUBE_SERVICE, + "developer-key", developer_key, + "authorizer", authorizer, + NULL); +} + +/** + * gdata_youtube_service_get_primary_authorization_domain: + * + * The primary #GDataAuthorizationDomain for interacting with YouTube. This will not normally need to be used, as it's used internally + * by the #GDataYouTubeService methods. However, if using the plain #GDataService methods to implement custom queries or requests which libgdata + * does not support natively, then this domain may be needed to authorize the requests. + * + * The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. + * + * Return value: (transfer none): the service's authorization domain + * + * Since: 0.9.0 + */ +GDataAuthorizationDomain * +gdata_youtube_service_get_primary_authorization_domain (void) +{ + return get_youtube_authorization_domain (); +} + +static gchar * +standard_feed_type_to_feed_uri (GDataYouTubeStandardFeedType feed_type) +{ + switch (feed_type) { + case GDATA_YOUTUBE_MOST_POPULAR_FEED: + return _gdata_service_build_uri ("https://www.googleapis.com/youtube/v3/videos" + "?part=snippet" + "&chart=mostPopular"); + case GDATA_YOUTUBE_TOP_RATED_FEED: + case GDATA_YOUTUBE_TOP_FAVORITES_FEED: + case GDATA_YOUTUBE_MOST_VIEWED_FEED: + case GDATA_YOUTUBE_MOST_RECENT_FEED: + case GDATA_YOUTUBE_MOST_DISCUSSED_FEED: + case GDATA_YOUTUBE_MOST_LINKED_FEED: + case GDATA_YOUTUBE_MOST_RESPONDED_FEED: + case GDATA_YOUTUBE_RECENTLY_FEATURED_FEED: + case GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED: { + gchar *date, *out; + GTimeVal tv; + + /* All feed types except MOST_POPULAR have been deprecated for + * a while, and fall back to MOST_POPULAR on the server anyway. + * See: https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds#Standard_feeds */ + g_get_current_time (&tv); + tv.tv_sec -= 24 * 60 * 60; /* 1 day ago */ + date = g_time_val_to_iso8601 (&tv); + out = _gdata_service_build_uri ("https://www.googleapis.com/youtube/v3/videos" + "?part=snippet" + "&chart=mostPopular" + "&publishedAfter=%s", date); + g_free (date); + + return out; + } + default: + g_assert_not_reached (); + } +} + +/** + * gdata_youtube_service_query_standard_feed: + * @self: a #GDataYouTubeService + * @feed_type: the feed type to query, from #GDataYouTubeStandardFeedType + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service's standard @feed_type feed to build a #GDataFeed. + * + * Note that with the port from v2 to v3 of the YouTube API in libgdata + * 0.17.0, all feed types except %GDATA_YOUTUBE_MOST_POPULAR_FEED have been + * deprecated. Other feed types will now transparently return + * %GDATA_YOUTUBE_MOST_POPULAR_FEED, limited to the past 24 hours. + * + * Parameters and errors are as for gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results, or %NULL; unref with g_object_unref() + */ +GDataFeed * +gdata_youtube_service_query_standard_feed (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) +{ + gchar *query_uri; + GDataFeed *feed; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_SERVICE (self), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* TODO: Support the "time" parameter, as well as category- and region-specific feeds */ + query_uri = standard_feed_type_to_feed_uri (feed_type); + feed = gdata_service_query (GDATA_SERVICE (self), + get_youtube_authorization_domain (), + query_uri, query, GDATA_TYPE_YOUTUBE_VIDEO, + cancellable, progress_callback, + progress_user_data, error); + g_free (query_uri); + + return feed; +} + +/** + * gdata_youtube_service_query_standard_feed_async: + * @self: a #GDataService + * @feed_type: the feed type to query, from #GDataYouTubeStandardFeedType + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service's standard @feed_type feed to build a #GDataFeed. @self and + * @query are both reffed when this function is called, so can safely be freed after this function returns. + * + * For more details, see gdata_youtube_service_query_standard_feed(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_service_query_finish() + * to get the results of the operation. + * + * Since: 0.9.1 + */ +void +gdata_youtube_service_query_standard_feed_async (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *query_uri; + + g_return_if_fail (GDATA_IS_YOUTUBE_SERVICE (self)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + query_uri = standard_feed_type_to_feed_uri (feed_type); + gdata_service_query_async (GDATA_SERVICE (self), + get_youtube_authorization_domain (), + query_uri, query, GDATA_TYPE_YOUTUBE_VIDEO, + cancellable, progress_callback, + progress_user_data, + destroy_progress_user_data, callback, + user_data); + g_free (query_uri); +} + +/** + * gdata_youtube_service_query_videos: + * @self: a #GDataYouTubeService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service for videos matching the parameters set on the #GDataQuery. This searches site-wide, and imposes no other restrictions or + * parameters on the query. + * + * Parameters and errors are as for gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results, or %NULL; unref with g_object_unref() + */ +GDataFeed * +gdata_youtube_service_query_videos (GDataYouTubeService *self, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_SERVICE (self), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + return gdata_service_query (GDATA_SERVICE (self), + get_youtube_authorization_domain (), + "https://www.googleapis.com/youtube/v3/search" + "?part=snippet" + "&type=video", + query, GDATA_TYPE_YOUTUBE_VIDEO, + cancellable, progress_callback, + progress_user_data, error); +} + +/** + * gdata_youtube_service_query_videos_async: + * @self: a #GDataService + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service for videos matching the parameters set on the #GDataQuery. This searches site-wide, and imposes no other restrictions or + * parameters on the query. @self and @query are both reffed when this function is called, so can safely be freed after this function returns. + * + * For more details, see gdata_youtube_service_query_videos(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_service_query_finish() + * to get the results of the operation. + * + * Since: 0.9.1 + */ +void +gdata_youtube_service_query_videos_async (GDataYouTubeService *self, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_SERVICE (self)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + gdata_service_query_async (GDATA_SERVICE (self), + get_youtube_authorization_domain (), + "https://www.googleapis.com/youtube/v3/search" + "?part=snippet" + "&type=video", + query, GDATA_TYPE_YOUTUBE_VIDEO, cancellable, + progress_callback, progress_user_data, + destroy_progress_user_data, callback, + user_data); +} + +/** + * gdata_youtube_service_query_related: + * @self: a #GDataYouTubeService + * @video: a #GDataYouTubeVideo for which to find related videos + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @error: a #GError, or %NULL + * + * Queries the service for videos related to @video. The algorithm determining which videos are related is on the server side. + * + * Parameters and other errors are as for gdata_service_query(). + * + * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() + */ +GDataFeed * +gdata_youtube_service_query_related (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) +{ + GDataFeed *feed; + gchar *uri; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (video), NULL); + g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Execute the query */ + uri = _gdata_service_build_uri ("https://www.googleapis.com/youtube/v3/search" + "?part=snippet" + "&type=video" + "&relatedToVideoId=%s", + gdata_entry_get_id (GDATA_ENTRY (video))); + feed = gdata_service_query (GDATA_SERVICE (self), + get_youtube_authorization_domain (), uri, + query, GDATA_TYPE_YOUTUBE_VIDEO, + cancellable, progress_callback, + progress_user_data, error); + g_free (uri); + + return feed; +} + +/** + * gdata_youtube_service_query_related_async: + * @self: a #GDataService + * @video: a #GDataYouTubeVideo for which to find related videos + * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL + * @progress_user_data: (closure): data to pass to the @progress_callback function + * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be + * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. + * @callback: a #GAsyncReadyCallback to call when authentication is finished + * @user_data: (closure): data to pass to the @callback function + * + * Queries the service for videos related to @video. The algorithm determining which videos are related is on the server side. + * @self and @query are both reffed when this function is called, so can safely be freed after this function returns. + * + * For more details, see gdata_youtube_service_query_related(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_service_query_finish() + * to get the results of the operation. + * + * Since: 0.9.1 + */ +void +gdata_youtube_service_query_related_async (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data) +{ + gchar *uri; + + g_return_if_fail (GDATA_IS_YOUTUBE_SERVICE (self)); + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (video)); + g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + uri = _gdata_service_build_uri ("https://www.googleapis.com/youtube/v3/search" + "?part=snippet" + "&type=video" + "&relatedToVideoId=%s", + gdata_entry_get_id (GDATA_ENTRY (video))); + gdata_service_query_async (GDATA_SERVICE (self), + get_youtube_authorization_domain (), uri, + query, GDATA_TYPE_YOUTUBE_VIDEO, cancellable, + progress_callback, progress_user_data, + destroy_progress_user_data, callback, + user_data); + g_free (uri); +} + +/** + * gdata_youtube_service_upload_video: + * @self: a #GDataYouTubeService + * @video: a #GDataYouTubeVideo to insert + * @slug: the filename to give to the uploaded file + * @content_type: the content type of the uploaded data + * @cancellable: (allow-none): a #GCancellable for the entire upload stream, or %NULL + * @error: a #GError, or %NULL + * + * Uploads a video to YouTube, using the properties from @video and the file data written to the resulting #GDataUploadStream. + * + * If @video has already been inserted, a %GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED error will be returned. If no user is authenticated + * with the service, %GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED will be returned. + * + * The stream returned by this function should be written to using the standard #GOutputStream methods, asychronously or synchronously. Once the stream + * is closed (using g_output_stream_close()), gdata_youtube_service_finish_video_upload() should be called on it to parse and return the updated + * #GDataYouTubeVideo for the uploaded video. This must be done, as @video isn't updated in-place. + * + * In order to cancel the upload, a #GCancellable passed in to @cancellable must be cancelled using g_cancellable_cancel(). Cancelling the individual + * #GOutputStream operations on the #GDataUploadStream will not cancel the entire upload; merely the write or close operation in question. See the + * #GDataUploadStream:cancellable for more details. + * + * Any upload errors will be thrown by the stream methods, and may come from the #GDataServiceError domain. + * + * Return value: (transfer full): a #GDataUploadStream to write the video data to, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataUploadStream * +gdata_youtube_service_upload_video (GDataYouTubeService *self, GDataYouTubeVideo *video, const gchar *slug, const gchar *content_type, + GCancellable *cancellable, GError **error) +{ + GOutputStream *stream = NULL; /* owned */ + + g_return_val_if_fail (GDATA_IS_YOUTUBE_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (video), NULL); + g_return_val_if_fail (slug != NULL && *slug != '\0', NULL); + g_return_val_if_fail (content_type != NULL && *content_type != '\0', NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + if (gdata_entry_is_inserted (GDATA_ENTRY (video)) == TRUE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED, + _("The entry has already been inserted.")); + return NULL; + } + + /* FIXME: Could be more cunning about domains here; see scope on + * https://developers.google.com/youtube/v3/guides/authentication */ + if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), + get_youtube_authorization_domain ()) == FALSE) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, + _("You must be authenticated to upload a video.")); + return NULL; + } + + /* FIXME: Add support for resumable uploads. That means a new + * gdata_youtube_service_upload_video_resumable() method a la + * Documents. */ + stream = gdata_upload_stream_new (GDATA_SERVICE (self), + get_youtube_authorization_domain (), + SOUP_METHOD_POST, + "https://www.googleapis.com/upload/youtube/v3/videos" + "?part=snippet,status," + "recordingDetails", + GDATA_ENTRY (video), slug, + content_type, + cancellable); + + return GDATA_UPLOAD_STREAM (stream); +} + +/** + * gdata_youtube_service_finish_video_upload: + * @self: a #GDataYouTubeService + * @upload_stream: the #GDataUploadStream from the operation + * @error: a #GError, or %NULL + * + * Finish off a video upload operation started by gdata_youtube_service_upload_video(), parsing the result and returning the new #GDataYouTubeVideo. + * + * If an error occurred during the upload operation, it will have been returned during the operation (e.g. by g_output_stream_splice() or one + * of the other stream methods). In such a case, %NULL will be returned but @error will remain unset. @error is only set in the case that the server + * indicates that the operation was successful, but an error is encountered in parsing the result sent by the server. + * + * Return value: (transfer full): the new #GDataYouTubeVideo, or %NULL; unref with g_object_unref() + * + * Since: 0.8.0 + */ +GDataYouTubeVideo * +gdata_youtube_service_finish_video_upload (GDataYouTubeService *self, GDataUploadStream *upload_stream, GError **error) +{ + const gchar *response_body; + gssize response_length; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_SERVICE (self), NULL); + g_return_val_if_fail (GDATA_IS_UPLOAD_STREAM (upload_stream), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Get the response from the server */ + response_body = gdata_upload_stream_get_response (upload_stream, &response_length); + if (response_body == NULL || response_length == 0) + return NULL; + + /* Parse the response to produce a GDataYouTubeVideo */ + return GDATA_YOUTUBE_VIDEO (gdata_parsable_new_from_json (GDATA_TYPE_YOUTUBE_VIDEO, + response_body, + (gint) response_length, + error)); +} + +/** + * gdata_youtube_service_get_developer_key: + * @self: a #GDataYouTubeService + * + * Gets the #GDataYouTubeService:developer-key property from the #GDataYouTubeService. + * + * Return value: the developer key property + */ +const gchar * +gdata_youtube_service_get_developer_key (GDataYouTubeService *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_SERVICE (self), NULL); + return self->priv->developer_key; +} + +/** + * gdata_youtube_service_get_categories: + * @self: a #GDataYouTubeService + * @cancellable: (allow-none): a #GCancellable, or %NULL + * @error: a #GError, or %NULL + * + * Gets a list of the categories currently in use on YouTube. The returned #GDataAPPCategories contains a list of #GDataYouTubeCategorys which + * enumerate the current YouTube categories. + * + * The category labels (#GDataCategory:label) are localised based on the value of #GDataService:locale. + * + * Return value: (transfer full): a #GDataAPPCategories, or %NULL; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataAPPCategories * +gdata_youtube_service_get_categories (GDataYouTubeService *self, GCancellable *cancellable, GError **error) +{ + const gchar *locale; + gchar *uri; + SoupMessage *message; + GDataAPPCategories *categories; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_SERVICE (self), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + /* Download the category list. Note that this is (service) + * locale-dependent, and a locale must always be specified. */ + locale = gdata_service_get_locale (GDATA_SERVICE (self)); + if (locale == NULL) { + locale = "US"; + } + + uri = _gdata_service_build_uri ("https://www.googleapis.com/youtube/v3/videoCategories" + "?part=snippet" + "®ionCode=%s", + locale); + message = _gdata_service_query (GDATA_SERVICE (self), + get_youtube_authorization_domain (), + uri, NULL, cancellable, error); + g_free (uri); + + if (message == NULL) + return NULL; + + g_assert (message->response_body->data != NULL); + categories = GDATA_APP_CATEGORIES (_gdata_parsable_new_from_json (GDATA_TYPE_APP_CATEGORIES, + message->response_body->data, + message->response_body->length, + GSIZE_TO_POINTER (GDATA_TYPE_YOUTUBE_CATEGORY), + error)); + g_object_unref (message); + + return categories; +} + +static void +get_categories_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) +{ + GDataYouTubeService *service = GDATA_YOUTUBE_SERVICE (source_object); + g_autoptr(GDataAPPCategories) categories = NULL; + g_autoptr(GError) error = NULL; + + /* Get the categories and return */ + categories = gdata_youtube_service_get_categories (service, cancellable, &error); + if (error != NULL) + g_task_return_error (task, g_steal_pointer (&error)); + else + g_task_return_pointer (task, g_steal_pointer (&categories), g_object_unref); +} + +/** + * gdata_youtube_service_get_categories_async: + * @self: a #GDataYouTubeService + * @cancellable: (allow-none): optional #GCancellable object, or %NULL + * @callback: a #GAsyncReadyCallback to call when the request is finished + * @user_data: (closure): data to pass to the @callback function + * + * Gets a list of the categories currently in use on YouTube. @self is reffed when this function is called, so can safely be unreffed after this + * function returns. + * + * For more details, see gdata_youtube_service_get_categories(), which is the synchronous version of this function. + * + * When the operation is finished, @callback will be called. You can then call gdata_youtube_service_get_categories_finish() to get the results of the + * operation. + * + * Since: 0.7.0 + */ +void +gdata_youtube_service_get_categories_async (GDataYouTubeService *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + + g_return_if_fail (GDATA_IS_YOUTUBE_SERVICE (self)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (callback != NULL); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, gdata_youtube_service_get_categories_async); + g_task_run_in_thread (task, get_categories_thread); +} + +/** + * gdata_youtube_service_get_categories_finish: + * @self: a #GDataYouTubeService + * @async_result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous request for a list of categories on YouTube, as started with gdata_youtube_service_get_categories_async(). + * + * Return value: (transfer full): a #GDataAPPCategories, or %NULL; unref with g_object_unref() + * + * Since: 0.7.0 + */ +GDataAPPCategories * +gdata_youtube_service_get_categories_finish (GDataYouTubeService *self, GAsyncResult *async_result, GError **error) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_SERVICE (self), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); + g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_youtube_service_get_categories_async), NULL); + + return g_task_propagate_pointer (G_TASK (async_result), error); +} diff --git a/gdata/services/youtube/gdata-youtube-service.h b/gdata/services/youtube/gdata-youtube-service.h new file mode 100644 index 0000000..7471067 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-service.h @@ -0,0 +1,201 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008-2009, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_YOUTUBE_SERVICE_H +#define GDATA_YOUTUBE_SERVICE_H + +#include +#include +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDataYouTubeStandardFeedType: + * @GDATA_YOUTUBE_TOP_RATED_FEED: This feed contains the most highly rated + * YouTube videos. Deprecated: 0.17.0: Google no longer supports this feed + * type, and it will return results equivalent to + * %GDATA_YOUTUBE_MOST_POPULAR_FEED. + * @GDATA_YOUTUBE_TOP_FAVORITES_FEED: This feed contains videos most frequently + * flagged as favorite videos. Deprecated: 0.17.0: Google no longer + * supports this feed type, and it will return results equivalent to + * %GDATA_YOUTUBE_MOST_POPULAR_FEED. + * @GDATA_YOUTUBE_MOST_VIEWED_FEED: This feed contains the most frequently + * watched YouTube videos. Deprecated: 0.17.0: Google no longer supports + * this feed type, and it will return results equivalent to + * %GDATA_YOUTUBE_MOST_POPULAR_FEED. + * @GDATA_YOUTUBE_MOST_POPULAR_FEED: This feed contains the most popular YouTube + * videos, selected using an algorithm that combines many different signals to + * determine overall popularity. As of version 0.17.0, this is the only + * supported feed type. + * @GDATA_YOUTUBE_MOST_RECENT_FEED: This feed contains the videos most recently + * submitted to YouTube. Deprecated: 0.17.0: Google no longer supports + * this feed type, and it will return results equivalent to + * %GDATA_YOUTUBE_MOST_POPULAR_FEED. + * @GDATA_YOUTUBE_MOST_DISCUSSED_FEED: This feed contains the YouTube videos + * that have received the most comments. Deprecated: 0.17.0: Google no + * longer supports this feed type, and it will return results equivalent to + * %GDATA_YOUTUBE_MOST_POPULAR_FEED. + * @GDATA_YOUTUBE_MOST_LINKED_FEED: This feed contains the YouTube videos that + * receive the most links from other websites. Deprecated: 0.17.0: Google + * no longer supports this feed type, and it will return results equivalent to + * %GDATA_YOUTUBE_MOST_POPULAR_FEED. + * @GDATA_YOUTUBE_MOST_RESPONDED_FEED: This feed contains YouTube videos that + * receive the most video responses. Deprecated: 0.17.0: Google no longer + * supports this feed type, and it will return results equivalent to + * %GDATA_YOUTUBE_MOST_POPULAR_FEED. + * @GDATA_YOUTUBE_RECENTLY_FEATURED_FEED: This feed contains videos recently + * featured on the YouTube home page or featured videos tab. Deprecated: + * 0.17.0: Google no longer supports this feed type, and it will return + * results equivalent to %GDATA_YOUTUBE_MOST_POPULAR_FEED. + * @GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED: This feed contains videos suitable for + * playback on mobile devices. Deprecated: 0.17.0: Google no longer + * supports this feed type, and it will return results equivalent to + * %GDATA_YOUTUBE_MOST_POPULAR_FEED. + * + * Standard feed types for standard feed queries with + * gdata_youtube_service_query_standard_feed(). For more information, see the + * online + * documentation. + */ +typedef enum { + GDATA_YOUTUBE_TOP_RATED_FEED, + GDATA_YOUTUBE_TOP_FAVORITES_FEED, + GDATA_YOUTUBE_MOST_VIEWED_FEED, + GDATA_YOUTUBE_MOST_POPULAR_FEED, + GDATA_YOUTUBE_MOST_RECENT_FEED, + GDATA_YOUTUBE_MOST_DISCUSSED_FEED, + GDATA_YOUTUBE_MOST_LINKED_FEED, + GDATA_YOUTUBE_MOST_RESPONDED_FEED, + GDATA_YOUTUBE_RECENTLY_FEATURED_FEED, + GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED +} GDataYouTubeStandardFeedType; + +/** + * GDataYouTubeServiceError: + * @GDATA_YOUTUBE_SERVICE_ERROR_API_QUOTA_EXCEEDED: the API request quota for this developer account has been exceeded + * @GDATA_YOUTUBE_SERVICE_ERROR_ENTRY_QUOTA_EXCEEDED: the entry (e.g. video) quota for this user account has been exceeded + * @GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED: the currently authenticated user doesn't have a YouTube channel, but the current action requires one; + * if this error is received, inform the user that they need a YouTube channel, and provide a link to + * https://www.youtube.com/create_channel + * + * Error codes for #GDataYouTubeService operations. + */ +typedef enum { + GDATA_YOUTUBE_SERVICE_ERROR_API_QUOTA_EXCEEDED, + GDATA_YOUTUBE_SERVICE_ERROR_ENTRY_QUOTA_EXCEEDED, + GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED, +} GDataYouTubeServiceError; + +#define GDATA_TYPE_YOUTUBE_SERVICE (gdata_youtube_service_get_type ()) +#define GDATA_YOUTUBE_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_SERVICE, GDataYouTubeService)) +#define GDATA_YOUTUBE_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_SERVICE, GDataYouTubeServiceClass)) +#define GDATA_IS_YOUTUBE_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_SERVICE)) +#define GDATA_IS_YOUTUBE_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_SERVICE)) +#define GDATA_YOUTUBE_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_SERVICE, GDataYouTubeServiceClass)) + +#define GDATA_YOUTUBE_SERVICE_ERROR gdata_youtube_service_error_quark () + +typedef struct _GDataYouTubeServicePrivate GDataYouTubeServicePrivate; + +/** + * GDataYouTubeService: + * + * All the fields in the #GDataYouTubeService structure are private and should never be accessed directly. + */ +typedef struct { + GDataService parent; + GDataYouTubeServicePrivate *priv; +} GDataYouTubeService; + +/** + * GDataYouTubeServiceClass: + * + * All the fields in the #GDataYouTubeServiceClass structure are private and should never be accessed directly. + */ +typedef struct { + /*< private >*/ + GDataServiceClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +} GDataYouTubeServiceClass; + +GType gdata_youtube_service_get_type (void) G_GNUC_CONST; +GQuark gdata_youtube_service_error_quark (void) G_GNUC_CONST; + +GDataYouTubeService *gdata_youtube_service_new (const gchar *developer_key, GDataAuthorizer *authorizer) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +GDataAuthorizationDomain *gdata_youtube_service_get_primary_authorization_domain (void) G_GNUC_CONST; + +GDataFeed *gdata_youtube_service_query_standard_feed (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_youtube_service_query_standard_feed_async (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query, + GCancellable *cancellable, + GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); + +GDataFeed *gdata_youtube_service_query_videos (GDataYouTubeService *self, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_youtube_service_query_videos_async (GDataYouTubeService *self, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); + +GDataFeed *gdata_youtube_service_query_related (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_youtube_service_query_related_async (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query, + GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, + GDestroyNotify destroy_progress_user_data, + GAsyncReadyCallback callback, gpointer user_data); + +GDataUploadStream *gdata_youtube_service_upload_video (GDataYouTubeService *self, GDataYouTubeVideo *video, const gchar *slug, + const gchar *content_type, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataYouTubeVideo *gdata_youtube_service_finish_video_upload (GDataYouTubeService *self, GDataUploadStream *upload_stream, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +const gchar *gdata_youtube_service_get_developer_key (GDataYouTubeService *self) G_GNUC_PURE; + +GDataAPPCategories *gdata_youtube_service_get_categories (GDataYouTubeService *self, GCancellable *cancellable, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +void gdata_youtube_service_get_categories_async (GDataYouTubeService *self, GCancellable *cancellable, GAsyncReadyCallback callback, + gpointer user_data); +GDataAPPCategories *gdata_youtube_service_get_categories_finish (GDataYouTubeService *self, GAsyncResult *async_result, + GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_SERVICE_H */ diff --git a/gdata/services/youtube/gdata-youtube-state.c b/gdata/services/youtube/gdata-youtube-state.c new file mode 100644 index 0000000..be1fa0f --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-state.c @@ -0,0 +1,285 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009–2010, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-youtube-state + * @short_description: YouTube state element + * @stability: Stable + * @include: gdata/services/youtube/gdata-youtube-state.h + * + * #GDataYouTubeState represents a "state" element from the + * YouTube namespace. + * + * Since: 0.4.0 + */ + +#include + +#include "gdata-youtube-state.h" +#include "gdata-parsable.h" + +static void gdata_youtube_state_finalize (GObject *object); +static void gdata_youtube_state_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void +gdata_youtube_state_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); + +struct _GDataYouTubeStatePrivate { + gchar *name; + gchar *reason_code; + gchar *help_uri; + gchar *message; +}; + +enum { + PROP_NAME = 1, + PROP_REASON_CODE, + PROP_HELP_URI, + PROP_MESSAGE +}; + +G_DEFINE_TYPE (GDataYouTubeState, gdata_youtube_state, GDATA_TYPE_PARSABLE) + +static void +gdata_youtube_state_class_init (GDataYouTubeStateClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataYouTubeStatePrivate)); + + gobject_class->get_property = gdata_youtube_state_get_property; + gobject_class->set_property = gdata_youtube_state_set_property; + gobject_class->finalize = gdata_youtube_state_finalize; + + /** + * GDataYouTubeState:name: + * + * The name of the status of the unpublished video. Valid values are: "processing", "restricted", "deleted", "rejected" and "failed". + * + * For more information, see the + * online documentation. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_NAME, + g_param_spec_string ("name", + "Name", "The name of the status of the unpublished video.", + NULL, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeState:reason-code: + * + * The reason code explaining why the video failed to upload. + * + * For more information, see the + * online documentation. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_REASON_CODE, + g_param_spec_string ("reason-code", + "Reason code", "The reason code explaining why the video failed to upload.", + NULL, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeState:help-uri: + * + * A URI for a YouTube Help Center page that may help the developer or the video owner to diagnose + * the reason that an upload failed or was rejected. + * + * For more information, see the + * online documentation. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_HELP_URI, + g_param_spec_string ("help-uri", + "Help URI", "A URI for a YouTube Help Center page.", + NULL, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeState:message: + * + * A human-readable description of why the video failed to upload. + * + * For more information, see the + * online documentation. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_MESSAGE, + g_param_spec_string ("message", + "Message", "A human-readable description of why the video failed to upload.", + NULL, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_youtube_state_init (GDataYouTubeState *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_YOUTUBE_STATE, GDataYouTubeStatePrivate); +} + +static void +gdata_youtube_state_finalize (GObject *object) +{ + GDataYouTubeStatePrivate *priv = GDATA_YOUTUBE_STATE (object)->priv; + + g_free (priv->name); + g_free (priv->reason_code); + g_free (priv->help_uri); + g_free (priv->message); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_youtube_state_parent_class)->finalize (object); +} + +static void +gdata_youtube_state_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataYouTubeStatePrivate *priv = GDATA_YOUTUBE_STATE (object)->priv; + + switch (property_id) { + case PROP_NAME: + g_value_set_string (value, priv->name); + break; + case PROP_REASON_CODE: + g_value_set_string (value, priv->reason_code); + break; + case PROP_HELP_URI: + g_value_set_string (value, priv->help_uri); + break; + case PROP_MESSAGE: + g_value_set_string (value, priv->message); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_youtube_state_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + GDataYouTubeStatePrivate *priv = GDATA_YOUTUBE_STATE (object)->priv; + + switch (property_id) { + case PROP_NAME: + priv->name = g_value_dup_string (value); + break; + case PROP_REASON_CODE: + priv->reason_code = g_value_dup_string (value); + break; + case PROP_HELP_URI: + priv->help_uri = g_value_dup_string (value); + break; + case PROP_MESSAGE: + priv->message = g_value_dup_string (value); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/** + * gdata_youtube_state_get_name: + * @self: a #GDataYouTubeState + * + * Gets the #GDataYouTubeState:name property. + * + * Return value: the status name + * + * Since: 0.4.0 + */ +const gchar * +gdata_youtube_state_get_name (GDataYouTubeState *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_STATE (self), NULL); + return self->priv->name; +} + +/** + * gdata_youtube_state_get_reason_code: + * @self: a #GDataYouTubeState + * + * Gets the #GDataYouTubeState:reason-code property. + * + * Return value: the status reason code, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_youtube_state_get_reason_code (GDataYouTubeState *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_STATE (self), NULL); + return self->priv->reason_code; +} + +/** + * gdata_youtube_state_get_help_uri: + * @self: a #GDataYouTubeState + * + * Gets the #GDataYouTubeState:help-uri property. + * + * Return value: the help URI, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_youtube_state_get_help_uri (GDataYouTubeState *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_STATE (self), NULL); + return self->priv->help_uri; +} + +/** + * gdata_youtube_state_get_message: + * @self: a #GDataYouTubeState + * + * Gets the #GDataYouTubeState:message property. + * + * Return value: the status message, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_youtube_state_get_message (GDataYouTubeState *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_STATE (self), NULL); + return self->priv->message; +} diff --git a/gdata/services/youtube/gdata-youtube-state.h b/gdata/services/youtube/gdata-youtube-state.h new file mode 100644 index 0000000..a820e24 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-state.h @@ -0,0 +1,75 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_YOUTUBE_STATE_H +#define GDATA_YOUTUBE_STATE_H + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GDATA_TYPE_YOUTUBE_STATE (gdata_youtube_state_get_type ()) +#define GDATA_YOUTUBE_STATE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_STATE, GDataYouTubeState)) +#define GDATA_YOUTUBE_STATE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_STATE, GDataYouTubeStateClass)) +#define GDATA_IS_YOUTUBE_STATE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_STATE)) +#define GDATA_IS_YOUTUBE_STATE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_STATE)) +#define GDATA_YOUTUBE_STATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_STATE, GDataYouTubeStateClass)) + +typedef struct _GDataYouTubeStatePrivate GDataYouTubeStatePrivate; + +/** + * GDataYouTubeState: + * + * All the fields in the #GDataYouTubeState structure are private and should never be accessed directly. + */ +typedef struct { + GDataParsable parent; + GDataYouTubeStatePrivate *priv; +} GDataYouTubeState; + +/** + * GDataYouTubeStateClass: + * + * All the fields in the #GDataYouTubeStateClass structure are private and should never be accessed directly. + * + * Since: 0.4.0 + */ +typedef struct { + /*< private >*/ + GDataParsableClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataYouTubeStateClass; + +GType gdata_youtube_state_get_type (void) G_GNUC_CONST; + +const gchar *gdata_youtube_state_get_name (GDataYouTubeState *self) G_GNUC_PURE; +const gchar *gdata_youtube_state_get_reason_code (GDataYouTubeState *self) G_GNUC_PURE; +const gchar *gdata_youtube_state_get_help_uri (GDataYouTubeState *self) G_GNUC_PURE; +const gchar *gdata_youtube_state_get_message (GDataYouTubeState *self) G_GNUC_PURE; + +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_STATE_H */ diff --git a/gdata/services/youtube/gdata-youtube-video.c b/gdata/services/youtube/gdata-youtube-video.c new file mode 100644 index 0000000..18b0340 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-video.c @@ -0,0 +1,2477 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008–2010, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/** + * SECTION:gdata-youtube-video + * @short_description: GData YouTube video object + * @stability: Stable + * @include: gdata/services/youtube/gdata-youtube-video.h + * + * #GDataYouTubeVideo is a subclass of #GDataEntry to represent a single video on YouTube, either when uploading or querying. + * + * #GDataYouTubeVideo implements #GDataCommentable, allowing comments on videos + * to be queried and added. + * + * For more details of YouTube’s GData API, see the + * + * online documentation. + * + * + * Getting Basic Video Data + * + * GDataYouTubeVideo *video; + * const gchar *video_id, *title, *player_uri, *description, *video_uri = NULL; + * gint64 updated, published; + * GDataMediaContent *content; + * GList *thumbnails; + * + * video = gdata_youtube_service_query_single_video (service, NULL, "R-9gzmQHoe0", NULL, NULL); + * + * video_id = gdata_entry_get_id (GDATA_ENTRY (video)); /* e.g. "R-9gzmQHoe0" */ + * title = gdata_entry_get_title (GDATA_ENTRY (video)); /* e.g. "Korpiklaani Vodka (official video 2009)" */ + * player_uri = gdata_youtube_video_get_player_uri (video); /* e.g. "http://www.youtube.com/watch?v=ZTUVgYoeN_b" */ + * description = gdata_youtube_video_get_description (video); /* e.g. "Vodka is the first single from the album..." */ + * published = gdata_entry_get_published (GDATA_ENTRY (video)); /* Date and time the video was originally published */ + * updated = gdata_entry_get_updated (GDATA_ENTRY (video)); /* When the video was most recently updated by the author */ + * + * /* Get a list of GDataMediaThumbnails for the video */ + * for (thumbnails = gdata_youtube_video_get_thumbnails (video); thumbnails != NULL; thumbnails = thumbnails->next) + * download_and_do_something_with_thumbnail (gdata_media_thumbnail_get_uri (thumbnail)); + * + * g_object_unref (video); + * + * + */ + +#include +#include +#include +#include +#include + +#include "gdata-youtube-video.h" +#include "gdata-private.h" +#include "gdata-service.h" +#include "gdata-parser.h" +#include "media/gdata-media-category.h" +#include "media/gdata-media-thumbnail.h" +#include "gdata-types.h" +#include "gdata-youtube-enums.h" +#include "gdata-commentable.h" +#include "gdata-youtube-comment.h" +#include "gdata-youtube-service.h" + +static void gdata_youtube_video_dispose (GObject *object); +static void gdata_youtube_video_finalize (GObject *object); +static void gdata_youtube_video_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void gdata_youtube_video_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); +static gboolean post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error); +static void get_json (GDataParsable *parsable, JsonBuilder *builder); +static const gchar *get_content_type (void); +static gchar *get_entry_uri (const gchar *id) G_GNUC_WARN_UNUSED_RESULT; +static void gdata_youtube_video_commentable_init (GDataCommentableInterface *iface); +static GDataAuthorizationDomain *get_authorization_domain (GDataCommentable *self) G_GNUC_CONST; +static gchar *get_query_comments_uri (GDataCommentable *self) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; +static gchar *get_insert_comment_uri (GDataCommentable *self, GDataComment *comment_) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; +static gboolean is_comment_deletable (GDataCommentable *self, GDataComment *comment_); + +struct _GDataYouTubeVideoPrivate { + guint view_count; + guint favorite_count; + gchar *location; + GHashTable/**/ *access_controls; + + /* gd:rating attributes */ + struct { + guint min; + guint max; + guint count; + gdouble average; + } rating; + + gchar **keywords; + gchar *player_uri; + gchar **region_restriction_allowed; + gchar **region_restriction_blocked; + GHashTable *content_ratings; /* owned string → owned string */ + GList *thumbnails; /* GDataMediaThumbnail */ + GDataMediaCategory *category; + guint duration; + gboolean is_private; + gchar *channel_id; /* owned */ + + /* Location. */ + gdouble latitude; + gdouble longitude; + + /* Other properties */ + gchar *rejection_reason; + gchar *processing_status; + gchar *upload_status; + gchar *failure_reason; + GDataYouTubeState *upload_state; /* owned */ + + gint64 recorded; + + /* State for parse_json(). */ + gboolean parsing_in_video_list_response; +}; + +enum { + PROP_VIEW_COUNT = 1, + PROP_FAVORITE_COUNT, + PROP_LOCATION, + PROP_MIN_RATING, + PROP_MAX_RATING, + PROP_RATING_COUNT, + PROP_AVERAGE_RATING, + PROP_KEYWORDS, + PROP_PLAYER_URI, + PROP_CATEGORY, + PROP_CREDIT, + PROP_DESCRIPTION, + PROP_DURATION, + PROP_IS_PRIVATE, + PROP_UPLOADED, + PROP_VIDEO_ID, + PROP_IS_DRAFT, + PROP_STATE, + PROP_RECORDED, + PROP_ASPECT_RATIO, + PROP_LATITUDE, + PROP_LONGITUDE +}; + +G_DEFINE_TYPE_WITH_CODE (GDataYouTubeVideo, gdata_youtube_video, GDATA_TYPE_ENTRY, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_COMMENTABLE, gdata_youtube_video_commentable_init)) + +static void +gdata_youtube_video_class_init (GDataYouTubeVideoClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); + GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataYouTubeVideoPrivate)); + + gobject_class->get_property = gdata_youtube_video_get_property; + gobject_class->set_property = gdata_youtube_video_set_property; + gobject_class->dispose = gdata_youtube_video_dispose; + gobject_class->finalize = gdata_youtube_video_finalize; + + parsable_class->parse_json = parse_json; + parsable_class->post_parse_json = post_parse_json; + parsable_class->get_json = get_json; + parsable_class->get_content_type = get_content_type; + + entry_class->get_entry_uri = get_entry_uri; + entry_class->kind_term = "youtube#video"; /* also: youtube#searchResult */ + + /** + * GDataYouTubeVideo:view-count: + * + * The number of times the video has been viewed. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_VIEW_COUNT, + g_param_spec_uint ("view-count", + "View count", "The number of times the video has been viewed.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:favorite-count: + * + * The number of users who have added the video to their favorites. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_FAVORITE_COUNT, + g_param_spec_uint ("favorite-count", + "Favorite count", "The number of users who have added the video to their favorites.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:location: + * + * Descriptive text about the location where the video was taken. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_LOCATION, + g_param_spec_string ("location", + "Location", "Descriptive text about the location where the video was taken.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:min-rating: + * + * The minimum allowed rating for the video. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_MIN_RATING, + g_param_spec_uint ("min-rating", + "Minimum rating", "The minimum allowed rating for the video.", + 0, G_MAXUINT, 1, /* defaults to 1 */ + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:max-rating: + * + * The maximum allowed rating for the video. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_MAX_RATING, + g_param_spec_uint ("max-rating", + "Maximum rating", "The maximum allowed rating for the video.", + 0, G_MAXUINT, 5, /* defaults to 5 */ + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:rating-count: + * + * The number of times the video has been rated. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_RATING_COUNT, + g_param_spec_uint ("rating-count", + "Rating count", "The number of times the video has been rated.", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:average-rating: + * + * The average rating of the video, over all the ratings it's received. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_AVERAGE_RATING, + g_param_spec_double ("average-rating", + "Average rating", "The average rating of the video.", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:keywords: + * + * A %NULL-terminated array of words associated with the video. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_KEYWORDS, + g_param_spec_boxed ("keywords", + "Keywords", "A NULL-terminated array of words associated with the video.", + G_TYPE_STRV, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:player-uri: + * + * A URI for a browser-based media player for the full-length video (i.e. the video's page on YouTube). + */ + g_object_class_install_property (gobject_class, PROP_PLAYER_URI, + g_param_spec_string ("player-uri", + "Player URI", "A URI for a browser-based media player for the full-length video.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:category: + * + * Specifies a genre or developer tag that describes the video. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_CATEGORY, + g_param_spec_object ("category", + "Category", "Specifies a genre or developer tag that describes the video.", + GDATA_TYPE_MEDIA_CATEGORY, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + + /** + * GDataYouTubeVideo:credit: + * + * Identifies the owner of the video. + * + * Deprecated: 0.17.0: This is no longer supported by Google, and + * will always be %NULL. There is no replacement. + */ + g_object_class_install_property (gobject_class, PROP_CREDIT, + g_param_spec_object ("credit", + "Credit", "Identifies the owner of the video.", + GDATA_TYPE_YOUTUBE_CREDIT, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + + G_GNUC_END_IGNORE_DEPRECATIONS + + /** + * GDataYouTubeVideo:description: + * + * A summary or description of the video. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_DESCRIPTION, + g_param_spec_string ("description", + "Description", "A summary or description of the video.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:duration: + * + * The duration of the video in seconds. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_DURATION, + g_param_spec_uint ("duration", + "Duration", "The duration of the video in seconds.", + 0, G_MAXINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:private: + * + * Indicates whether the video is private, meaning that it will not be publicly visible on YouTube's website. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_IS_PRIVATE, + g_param_spec_boolean ("is-private", + "Private?", "Indicates whether the video is private.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:uploaded: + * + * Specifies the time the video was originally uploaded to YouTube. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_UPLOADED, + g_param_spec_int64 ("uploaded", + "Uploaded", "Specifies the time the video was originally uploaded to YouTube.", + -1, G_MAXINT64, -1, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:video-id: + * + * Specifies a unique ID which YouTube uses to identify the video. For example: qz8EfkS4KK0. + * + * For more information, see the online documentation. + * + * Deprecated: 0.17.0: This is now equal to #GDataEntry:id. + */ + g_object_class_install_property (gobject_class, PROP_VIDEO_ID, + g_param_spec_string ("video-id", + "Video ID", "Specifies a unique ID which YouTube uses to identify the video.", + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + + /** + * GDataYouTubeVideo:is-draft: + * + * Indicates whether the video is in draft, or unpublished, status. + * + * Deprecated: 0.17.0: This is now equal to + * #GDataYouTubeVideo:is-private. + */ + g_object_class_install_property (gobject_class, PROP_IS_DRAFT, + g_param_spec_boolean ("is-draft", + "Draft?", "Indicates whether the video is in draft, or unpublished, status.", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED)); + + /** + * GDataYouTubeVideo:state: + * + * Information describing the state of the video. If this is non-%NULL, the video is not playable. + * It points to a #GDataYouTubeState. + * + * For more information, see the online documentation. + */ + g_object_class_install_property (gobject_class, PROP_STATE, + g_param_spec_object ("state", + "State", "Information describing the state of the video.", + GDATA_TYPE_YOUTUBE_STATE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:recorded: + * + * Specifies the time the video was originally recorded. + * + * For more information, see the online documentation. + * + * Since: 0.3.0 + */ + g_object_class_install_property (gobject_class, PROP_RECORDED, + g_param_spec_int64 ("recorded", + "Recorded", "Specifies the time the video was originally recorded.", + -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:aspect-ratio: + * + * The aspect ratio of the video. A %NULL value means the aspect ratio is unknown (it could still be a widescreen video). A value of + * %GDATA_YOUTUBE_ASPECT_RATIO_WIDESCREEN means the video is definitely widescreen. + * + * Since: 0.4.0 + */ + g_object_class_install_property (gobject_class, PROP_ASPECT_RATIO, + g_param_spec_string ("aspect-ratio", + "Aspect Ratio", "The aspect ratio of the video.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:latitude: + * + * The location as a latitude coordinate associated with this video. Valid latitudes range from -90.0 + * to 90.0 inclusive. Set to a value + * outside this range to unset the location. + * + * For more information, see the + * + * online documentation. + * + * Since: 0.8.0 + */ + g_object_class_install_property (gobject_class, PROP_LATITUDE, + g_param_spec_double ("latitude", + "Latitude", "The location as a latitude coordinate associated with this video.", + G_MINDOUBLE, G_MAXDOUBLE, G_MAXDOUBLE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GDataYouTubeVideo:longitude: + * + * The location as a longitude coordinate associated with this video. Valid longitudes range from -180.0 + * to 180.0 inclusive. Set to a value + * outside this range to unset the location. + * + * For more information, see the + * + * online documentation. + * + * Since: 0.8.0 + */ + g_object_class_install_property (gobject_class, PROP_LONGITUDE, + g_param_spec_double ("longitude", + "Longitude", "The location as a longitude coordinate associated with this video.", + G_MINDOUBLE, G_MAXDOUBLE, G_MAXDOUBLE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gdata_youtube_video_commentable_init (GDataCommentableInterface *iface) +{ + iface->comment_type = GDATA_TYPE_YOUTUBE_COMMENT; + iface->get_authorization_domain = get_authorization_domain; + iface->get_query_comments_uri = get_query_comments_uri; + iface->get_insert_comment_uri = get_insert_comment_uri; + iface->is_comment_deletable = is_comment_deletable; +} + +static void +gdata_youtube_video_init (GDataYouTubeVideo *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_YOUTUBE_VIDEO, GDataYouTubeVideoPrivate); + self->priv->recorded = -1; + self->priv->access_controls = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL); + self->priv->latitude = G_MAXDOUBLE; + self->priv->longitude = G_MAXDOUBLE; +} + +static void +gdata_youtube_video_dispose (GObject *object) +{ + GDataYouTubeVideoPrivate *priv = GDATA_YOUTUBE_VIDEO (object)->priv; + + g_clear_object (&priv->category); + g_list_free_full (priv->thumbnails, (GDestroyNotify) g_object_unref); + g_clear_object (&priv->upload_state); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_youtube_video_parent_class)->dispose (object); +} + +static void +gdata_youtube_video_finalize (GObject *object) +{ + GDataYouTubeVideoPrivate *priv = GDATA_YOUTUBE_VIDEO (object)->priv; + + g_free (priv->location); + g_hash_table_destroy (priv->access_controls); + g_strfreev (priv->keywords); + g_free (priv->channel_id); + g_free (priv->player_uri); + g_strfreev (priv->region_restriction_allowed); + g_strfreev (priv->region_restriction_blocked); + g_clear_pointer (&priv->content_ratings, (GDestroyNotify) g_hash_table_unref); + g_free (priv->rejection_reason); + g_free (priv->processing_status); + g_free (priv->upload_status); + g_free (priv->failure_reason); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_youtube_video_parent_class)->finalize (object); +} + +static void +gdata_youtube_video_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GDataYouTubeVideoPrivate *priv = GDATA_YOUTUBE_VIDEO (object)->priv; + + switch (property_id) { + case PROP_VIEW_COUNT: + g_value_set_uint (value, priv->view_count); + break; + case PROP_FAVORITE_COUNT: + g_value_set_uint (value, priv->favorite_count); + break; + case PROP_LOCATION: + g_value_set_string (value, priv->location); + break; + case PROP_MIN_RATING: + g_value_set_uint (value, priv->rating.min); + break; + case PROP_MAX_RATING: + g_value_set_uint (value, priv->rating.max); + break; + case PROP_RATING_COUNT: + g_value_set_uint (value, priv->rating.count); + break; + case PROP_AVERAGE_RATING: + g_value_set_double (value, priv->rating.average); + break; + case PROP_KEYWORDS: + g_value_set_boxed (value, priv->keywords); + break; + case PROP_PLAYER_URI: + g_value_set_string (value, gdata_youtube_video_get_player_uri (GDATA_YOUTUBE_VIDEO (object))); + break; + case PROP_CATEGORY: + g_value_set_object (value, priv->category); + break; + case PROP_CREDIT: + g_value_set_object (value, NULL); + break; + case PROP_DESCRIPTION: + g_value_set_string (value, gdata_entry_get_summary (GDATA_ENTRY (object))); + break; + case PROP_DURATION: + g_value_set_uint (value, priv->duration); + break; + case PROP_IS_PRIVATE: + g_value_set_boolean (value, priv->is_private); + break; + case PROP_UPLOADED: + g_value_set_int64 (value, gdata_entry_get_published (GDATA_ENTRY (object))); + break; + case PROP_VIDEO_ID: + g_value_set_string (value, gdata_entry_get_id (GDATA_ENTRY (object))); + break; + case PROP_IS_DRAFT: + g_value_set_boolean (value, gdata_youtube_video_is_private (GDATA_YOUTUBE_VIDEO (object))); + break; + case PROP_STATE: + g_value_set_object (value, gdata_youtube_video_get_state (GDATA_YOUTUBE_VIDEO (object))); + break; + case PROP_RECORDED: + g_value_set_int64 (value, priv->recorded); + break; + case PROP_ASPECT_RATIO: + g_value_set_string (value, gdata_youtube_video_get_aspect_ratio (GDATA_YOUTUBE_VIDEO (object))); + break; + case PROP_LATITUDE: + g_value_set_double (value, priv->latitude); + break; + case PROP_LONGITUDE: + g_value_set_double (value, priv->longitude); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gdata_youtube_video_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GDataYouTubeVideo *self = GDATA_YOUTUBE_VIDEO (object); + + switch (property_id) { + case PROP_LOCATION: + gdata_youtube_video_set_location (self, g_value_get_string (value)); + break; + case PROP_KEYWORDS: + gdata_youtube_video_set_keywords (self, g_value_get_boxed (value)); + break; + case PROP_CATEGORY: + gdata_youtube_video_set_category (self, g_value_get_object (value)); + break; + case PROP_DESCRIPTION: + gdata_youtube_video_set_description (self, g_value_get_string (value)); + break; + case PROP_IS_PRIVATE: + gdata_youtube_video_set_is_private (self, g_value_get_boolean (value)); + break; + case PROP_IS_DRAFT: + gdata_youtube_video_set_is_private (self, g_value_get_boolean (value)); + break; + case PROP_RECORDED: + gdata_youtube_video_set_recorded (self, g_value_get_int64 (value)); + break; + case PROP_ASPECT_RATIO: + gdata_youtube_video_set_aspect_ratio (self, g_value_get_string (value)); + break; + case PROP_LATITUDE: + gdata_youtube_video_set_coordinates (self, + g_value_get_double (value), + self->priv->longitude); + break; + case PROP_LONGITUDE: + gdata_youtube_video_set_coordinates (self, + self->priv->latitude, + g_value_get_double (value)); + break; + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +/* https://developers.google.com/youtube/v3/docs/videos#contentDetails.duration + * + * Note that it can also include an ‘hours’ component, as specified in ISO 8601, + * but not in the Google documentation. */ +static gboolean +duration_from_json_member (JsonReader *reader, const gchar *member_name, + GDataParserOptions options, guint *output, + gboolean *success, GError **error) +{ + gchar *duration_str = NULL, *i = NULL, *new_i = NULL; + guint64 seconds; + gboolean child_success = FALSE; + + if (!gdata_parser_string_from_json_member (reader, member_name, options, + &duration_str, + &child_success, error)) { + return FALSE; + } + + *success = child_success; + *output = 0; + + if (!child_success) { + return TRUE; + } + + /* Parse the string. Format: ‘PT(hH)?(mM)?(sS)?’, where ‘h’, ‘m’ and ‘s’ + * are integer numbers of hours, minutes and seconds. Each element may + * not be present. */ + i = duration_str; + if (strncmp (duration_str, "PT", 2) != 0) { + goto error; + } + + i += 2; /* PT */ + + seconds = 0; + + while (*i != '\0') { + guint64 element; + gchar designator; + + element = g_ascii_strtoull (i, &new_i, 10); + if (new_i == i) { + goto error; + } + + i = new_i; + + designator = i[0]; + if (designator == 'H') { + seconds += 60 * 60 * element; + } else if (designator == 'M') { + seconds += 60 * element; + } else if (designator == 'S') { + seconds += element; + } else { + goto error; + } + + i += 1; + } + + *output = seconds; + *success = child_success; + + g_free (duration_str); + + return TRUE; + +error: + gdata_parser_error_not_iso8601_format_json (reader, duration_str, + error); + g_free (duration_str); + + return TRUE; +} + +/* https://developers.google.com/youtube/v3/docs/videos#snippet.thumbnails */ +static gboolean +thumbnails_from_json_member (JsonReader *reader, const gchar *member_name, + GDataParserOptions options, GList **output, + gboolean *success, GError **error) +{ + guint i, len; + GList *thumbnails = NULL; + const GError *child_error = NULL; + + /* Check if there's such element */ + if (g_strcmp0 (json_reader_get_member_name (reader), + member_name) != 0) { + return FALSE; + } + + /* Check if the output string has already been set. The JSON parser + * guarantees this can't happen. */ + g_assert (!(options & P_NO_DUPES) || *output == NULL); + + len = json_reader_count_members (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + goto done; + } + + for (i = 0; i < len; i++) { + GDataParsable *thumbnail = NULL; /* GDataMediaThumbnail */ + + json_reader_read_element (reader, i); + thumbnail = _gdata_parsable_new_from_json_node (GDATA_TYPE_MEDIA_THUMBNAIL, + reader, NULL, + error); + json_reader_end_element (reader); + + if (thumbnail == NULL) { + *success = FALSE; + goto done; + } + + thumbnails = g_list_prepend (thumbnails, thumbnail); + } + + /* Success! */ + *output = thumbnails; + thumbnails = NULL; + *success = TRUE; + +done: + g_list_free_full (thumbnails, (GDestroyNotify) g_object_unref); + + return TRUE; +} + +/* https://developers.google.com/youtube/v3/docs/videos#contentDetails.regionRestriction */ +static gboolean +restricted_countries_from_json_member (JsonReader *reader, + const gchar *member_name, + GDataParserOptions options, + gchar ***output_allowed, + gchar ***output_blocked, + gboolean *success, GError **error) +{ + guint i, len; + const GError *child_error = NULL; + + /* Check if there's such element */ + if (g_strcmp0 (json_reader_get_member_name (reader), + member_name) != 0) { + return FALSE; + } + + /* Check if the output string has already been set. The JSON parser guarantees this can't happen. */ + g_assert (!(options & P_NO_DUPES) || + (*output_allowed == NULL && *output_blocked == NULL)); + + len = json_reader_count_members (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + return TRUE; + } + + for (i = 0; i < len; i++) { + json_reader_read_element (reader, i); + + if (gdata_parser_strv_from_json_member (reader, "allowed", + P_DEFAULT, + output_allowed, success, + error) || + gdata_parser_strv_from_json_member (reader, "blocked", + P_DEFAULT, + output_blocked, success, + error)) { + /* Nothing to do. */ + } + + json_reader_end_element (reader); + } + + /* Success! */ + *success = TRUE; + + return TRUE; +} + +/* https://developers.google.com/youtube/v3/docs/videos#contentDetails.contentRating */ +static gboolean +content_rating_from_json_member (JsonReader *reader, + const gchar *member_name, + GDataParserOptions options, + GHashTable **output, + gboolean *success, GError **error) +{ + guint i, len; + const GError *child_error = NULL; + + /* Check if there's such element */ + if (g_strcmp0 (json_reader_get_member_name (reader), + member_name) != 0) { + return FALSE; + } + + /* Check if the output string has already been set. The JSON parser + * guarantees this can't happen. */ + g_assert (!(options & P_NO_DUPES) || *output == NULL); + + len = json_reader_count_members (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + *success = gdata_parser_error_from_json_error (reader, + child_error, + error); + return TRUE; + } + + *output = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, g_free); + + for (i = 0; i < len; i++) { + const gchar *scheme, *rating; + + json_reader_read_element (reader, i); + + scheme = json_reader_get_member_name (reader); + rating = json_reader_get_string_value (reader); + + /* Ignore errors. */ + if (rating != NULL) { + g_hash_table_insert (*output, g_strdup (scheme), + g_strdup (rating)); + } + + json_reader_end_element (reader); + } + + /* Success! */ + *success = TRUE; + + return TRUE; +} + +static guint64 +parse_uint64_from_json_string_member (JsonReader *reader, + const gchar *member_name, + GError **error) +{ + const gchar *str_val, *end_ptr; + guint64 out; + const GError *child_error = NULL; + + /* Grab the string. */ + json_reader_read_member (reader, member_name); + + str_val = json_reader_get_string_value (reader); + child_error = json_reader_get_error (reader); + + if (child_error != NULL) { + gdata_parser_error_from_json_error (reader, child_error, error); + out = 0; + goto done; + } + + /* Try and parse it as an integer. */ + out = g_ascii_strtoull (str_val, (gchar **) &end_ptr, 10); + + if (*end_ptr != '\0') { + gdata_parser_error_required_json_content_missing (reader, + error); + out = 0; + goto done; + } + +done: + json_reader_end_member (reader); + + return out; +} + +static gboolean +parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) +{ + gboolean success; + GDataYouTubeVideo *self = GDATA_YOUTUBE_VIDEO (parsable); + GDataYouTubeVideoPrivate *priv = self->priv; + + /* HACK: When called with gdata_service_query_single_entry(), the video + * list endpoint returns a 0–1 item list of results as a normal feed. + * (See: https://developers.google.com/youtube/v3/docs/videos/list) + * This differs from the v2 API, which returned just the entry. + * + * So, we need a hack to extract the single entry from the feed without + * being able to invoke the parsing machinery in GDataFeed, because + * gdata_service_query_single_entry() can’t do that. Do that by checking + * the kind, and then ignoring all subsequent members until we reach the + * items member. Recursively parse in there, then break out again. + * This all assumes that we see the kind member before items. */ + if (g_strcmp0 (json_reader_get_member_name (reader), "kind") == 0 && + g_strcmp0 (json_reader_get_string_value (reader), + "youtube#videoListResponse") == 0) { + priv->parsing_in_video_list_response = TRUE; + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), "items") == 0 && + priv->parsing_in_video_list_response) { + guint i; + + /* Instead of a 404 when searching for an invalid ID, the server + * returns an empty results list. */ + if (json_reader_count_elements (reader) != 1) { + g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NOT_FOUND, + /* Translators: the parameter is an error message returned by the server. */ + _("The requested resource was not found: %s"), + "items"); + return TRUE; + } + + /* Parse the first (and only) array element. */ + json_reader_read_element (reader, 0); + priv->parsing_in_video_list_response = FALSE; + + /* Parse all its properties. */ + for (i = 0; i < (guint) json_reader_count_members (reader); i++) { + g_return_val_if_fail (json_reader_read_element (reader, i), FALSE); + + if (GDATA_PARSABLE_GET_CLASS (self)->parse_json (GDATA_PARSABLE (self), reader, user_data, error) == FALSE) { + json_reader_end_element (reader); + g_object_unref (parsable); + break; + } + + json_reader_end_element (reader); + } + + priv->parsing_in_video_list_response = TRUE; + json_reader_end_element (reader); + + return TRUE; /* handled */ + } else if (priv->parsing_in_video_list_response) { + /* Ignore the member. */ + return TRUE; + } + + /* Actual video property parsing. */ + if (g_strcmp0 (json_reader_get_member_name (reader), "id") == 0) { + const gchar *id = NULL; + + /* If this is a youtube#searchResult, the id will be an object: + * https://developers.google.com/youtube/v3/docs/search#resource + * If it is a youtube#video, the id will be a string: + * https://developers.google.com/youtube/v3/docs/videos#resource + */ + + if (json_reader_is_value (reader)) { + id = json_reader_get_string_value (reader); + } else if (json_reader_is_object (reader)) { + json_reader_read_member (reader, "videoId"); + id = json_reader_get_string_value (reader); + json_reader_end_member (reader); + } + + /* Empty ID? */ + if (id == NULL || *id == '\0') { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + _gdata_entry_set_id (GDATA_ENTRY (parsable), id); + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), + "snippet") == 0) { + guint i; + + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + for (i = 0; i < (guint) json_reader_count_members (reader); i++) { + gint64 published_at; + gchar *title = NULL, *description = NULL; + gchar *category_id = NULL; + + json_reader_read_element (reader, i); + + if (gdata_parser_int64_time_from_json_member (reader, "publishedAt", P_DEFAULT, &published_at, &success, error)) { + if (success) { + _gdata_entry_set_published (GDATA_ENTRY (parsable), + published_at); + } + } else if (gdata_parser_string_from_json_member (reader, "title", P_DEFAULT, &title, &success, error)) { + if (success) { + gdata_entry_set_title (GDATA_ENTRY (parsable), + title); + } + + g_free (title); + } else if (gdata_parser_string_from_json_member (reader, "description", P_DEFAULT, &description, &success, error)) { + if (success) { + gdata_entry_set_summary (GDATA_ENTRY (parsable), + description); + } + + g_free (description); + } else if (gdata_parser_strv_from_json_member (reader, "tags", P_DEFAULT, &priv->keywords, &success, error) || + thumbnails_from_json_member (reader, "thumbnails", P_DEFAULT, &priv->thumbnails, &success, error) || + gdata_parser_string_from_json_member (reader, "channelId", P_DEFAULT, &priv->channel_id, &success, error)) { + /* Fall through. */ + } else if (gdata_parser_string_from_json_member (reader, "categoryId", P_DEFAULT, &category_id, &success, error)) { + if (success) { + priv->category = gdata_media_category_new (category_id, + NULL, + NULL); + } + + g_free (category_id); + } + + json_reader_end_element (reader); + + if (!success) { + return FALSE; + } + } + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), + "contentDetails") == 0) { + guint i; + + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + for (i = 0; i < (guint) json_reader_count_members (reader); i++) { + json_reader_read_element (reader, i); + + if (duration_from_json_member (reader, "duration", P_DEFAULT, &priv->duration, &success, error) || + restricted_countries_from_json_member (reader, "regionRestriction", P_DEFAULT, &priv->region_restriction_allowed, &priv->region_restriction_blocked, &success, error) || + content_rating_from_json_member (reader, "contentRating", P_DEFAULT, &priv->content_ratings, &success, error)) { + /* Fall through. */ + } + + json_reader_end_element (reader); + + if (!success) { + return FALSE; + } + } + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), + "status") == 0) { + const gchar *privacy_status; + + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + json_reader_read_member (reader, "privacyStatus"); + privacy_status = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + if (g_strcmp0 (privacy_status, "private") == 0) { + priv->is_private = TRUE; + } else if (g_strcmp0 (privacy_status, "public") == 0) { + priv->is_private = FALSE; + g_hash_table_insert (priv->access_controls, + g_strdup ("list"), + GINT_TO_POINTER (GDATA_YOUTUBE_PERMISSION_ALLOWED)); + } else if (g_strcmp0 (privacy_status, "unlisted") == 0) { + /* See: ‘list’ on + * https://developers.google.com/youtube/2.0/reference?csw=1#youtube_data_api_tag_yt:accessControl */ + priv->is_private = FALSE; + g_hash_table_insert (priv->access_controls, + g_strdup ("list"), + GINT_TO_POINTER (GDATA_YOUTUBE_PERMISSION_DENIED)); + } + + json_reader_read_member (reader, "embeddable"); + g_hash_table_insert (priv->access_controls, + g_strdup (GDATA_YOUTUBE_ACTION_EMBED), + GINT_TO_POINTER (json_reader_get_boolean_value (reader) ? + GDATA_YOUTUBE_PERMISSION_ALLOWED : + GDATA_YOUTUBE_PERMISSION_DENIED)); + json_reader_end_member (reader); + + json_reader_read_member (reader, "uploadStatus"); + priv->upload_status = g_strdup (json_reader_get_string_value (reader)); + json_reader_end_member (reader); + + json_reader_read_member (reader, "failureReason"); + priv->rejection_reason = g_strdup (json_reader_get_string_value (reader)); + json_reader_end_member (reader); + + json_reader_read_member (reader, "rejectionReason"); + priv->rejection_reason = g_strdup (json_reader_get_string_value (reader)); + json_reader_end_member (reader); + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), + "statistics") == 0) { + gint64 likes, dislikes; + GError *child_error = NULL; + + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + /* Views and favourites. For some unknown reason, the feed + * returns them as a string, even though they’re documented as + * being unsigned longs. + * + * Reference: https://developers.google.com/youtube/v3/docs/videos#statistics */ + priv->view_count = parse_uint64_from_json_string_member (reader, "viewCount", &child_error); + if (child_error != NULL) { + g_propagate_error (error, child_error); + return FALSE; + } + + priv->favorite_count = parse_uint64_from_json_string_member (reader, "favoriteCount", &child_error); + if (child_error != NULL) { + g_propagate_error (error, child_error); + return FALSE; + } + + /* The new ratings API (total likes, total dislikes) doesn’t + * really match with the old API (collection of integer ratings + * between 1 and 5). Try and return something appropriate. */ + likes = parse_uint64_from_json_string_member (reader, "likeCount", &child_error); + if (child_error != NULL) { + g_propagate_error (error, child_error); + return FALSE; + } + + dislikes = parse_uint64_from_json_string_member (reader, "dislikeCount", &child_error); + if (child_error != NULL) { + g_propagate_error (error, child_error); + return FALSE; + } + + priv->rating.min = 0; + priv->rating.max = 1; + priv->rating.count = likes + dislikes; + if (likes + dislikes == 0) { + priv->rating.average = 0.0; /* basically undefined */ + } else { + priv->rating.average = (gdouble) likes / (gdouble) (likes + dislikes); + } + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), + "processingDetails") == 0) { + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + json_reader_read_member (reader, "processingStatus"); + priv->processing_status = g_strdup (json_reader_get_string_value (reader)); + json_reader_end_member (reader); + + return TRUE; + } else if (g_strcmp0 (json_reader_get_member_name (reader), + "recordingDetails") == 0) { + const gchar *recording_date; + const GError *child_error = NULL; + + /* Check this is an object. */ + if (!json_reader_is_object (reader)) { + return gdata_parser_error_required_json_content_missing (reader, error); + } + + json_reader_read_member (reader, "recordingDate"); + recording_date = json_reader_get_string_value (reader); + json_reader_end_member (reader); + + if (recording_date != NULL && + !gdata_parser_int64_from_date (recording_date, + &priv->recorded)) { + /* Error */ + gdata_parser_error_not_iso8601_format_json (reader, + recording_date, + error); + return FALSE; + } + + json_reader_read_member (reader, "locationDescription"); + priv->location = g_strdup (json_reader_get_string_value (reader)); + json_reader_end_member (reader); + + if (json_reader_read_member (reader, "location")) { + json_reader_read_member (reader, "latitude"); + priv->latitude = json_reader_get_double_value (reader); + json_reader_end_member (reader); + + json_reader_read_member (reader, "longitude"); + priv->longitude = json_reader_get_double_value (reader); + json_reader_end_member (reader); + } + + json_reader_end_member (reader); + + child_error = json_reader_get_error (reader); + if (child_error != NULL) { + return gdata_parser_error_from_json_error (reader, + child_error, + error); + } + + return TRUE; + } else { + return GDATA_PARSABLE_CLASS (gdata_youtube_video_parent_class)->parse_json (parsable, reader, user_data, error); + } + + return TRUE; +} + +static gboolean +post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error) +{ + GDataLink *_link = NULL; /* owned */ + const gchar *id; + gchar *uri = NULL; /* owned */ + + /* Set the self link, which is needed for + * gdata_service_delete_entry(). */ + id = gdata_entry_get_id (GDATA_ENTRY (parsable)); + + if (id == NULL) { + return TRUE; + } + + uri = _gdata_service_build_uri ("https://www.googleapis.com" + "/youtube/v3/videos" + "?id=%s", id); + _link = gdata_link_new (uri, GDATA_LINK_SELF); + gdata_entry_add_link (GDATA_ENTRY (parsable), _link); + g_object_unref (_link); + g_free (uri); + + return TRUE; +} + +static void +get_json (GDataParsable *parsable, JsonBuilder *builder) +{ + GDataEntry *entry = GDATA_ENTRY (parsable); + GDataYouTubeVideoPrivate *priv = GDATA_YOUTUBE_VIDEO (parsable)->priv; + guint i; + gpointer permission_ptr; + + /* Chain up to the parent class */ + GDATA_PARSABLE_CLASS (gdata_youtube_video_parent_class)->get_json (parsable, builder); + + /* Add the video-specific JSON. + * Reference: + * https://developers.google.com/youtube/v3/docs/videos/insert#request_body */ + /* snippet object. */ + json_builder_set_member_name (builder, "snippet"); + json_builder_begin_object (builder); + + if (gdata_entry_get_title (entry) != NULL) { + json_builder_set_member_name (builder, "title"); + json_builder_add_string_value (builder, + gdata_entry_get_title (entry)); + } + + if (gdata_entry_get_summary (entry) != NULL) { + json_builder_set_member_name (builder, "description"); + json_builder_add_string_value (builder, + gdata_entry_get_summary (entry)); + } + + if (priv->keywords != NULL) { + json_builder_set_member_name (builder, "tags"); + json_builder_begin_array (builder); + + for (i = 0; priv->keywords[i] != NULL; i++) { + json_builder_add_string_value (builder, + priv->keywords[i]); + } + + json_builder_end_array (builder); + } + + if (priv->category != NULL) { + json_builder_set_member_name (builder, "categoryId"); + json_builder_add_string_value (builder, + gdata_media_category_get_category (priv->category)); + } + + json_builder_end_object (builder); + + /* status object. */ + json_builder_set_member_name (builder, "status"); + json_builder_begin_object (builder); + + json_builder_set_member_name (builder, "privacyStatus"); + + if (!priv->is_private && + g_hash_table_lookup_extended (priv->access_controls, + "list", NULL, + &permission_ptr)) { + GDataYouTubePermission perm; + + perm = GPOINTER_TO_INT (permission_ptr); + + /* See the ‘list’ documentation on: + * https://developers.google.com/youtube/2.0/reference?csw=1#youtube_data_api_tag_yt:accessControl */ + json_builder_add_string_value (builder, + (perm == GDATA_YOUTUBE_PERMISSION_ALLOWED) ? "public" : "unlisted"); + } else { + json_builder_add_string_value (builder, + priv->is_private ? "private" : "public"); + } + + if (g_hash_table_lookup_extended (priv->access_controls, + GDATA_YOUTUBE_ACTION_EMBED, NULL, + &permission_ptr)) { + GDataYouTubePermission perm; + + perm = GPOINTER_TO_INT (permission_ptr); + + json_builder_set_member_name (builder, "embeddable"); + json_builder_add_boolean_value (builder, + perm == GDATA_YOUTUBE_PERMISSION_ALLOWED); + } + + /* FIXME: add support for: + * publicStatsViewable + * publishAt + * license + */ + + json_builder_end_object (builder); + + /* recordingDetails object. */ + json_builder_set_member_name (builder, "recordingDetails"); + json_builder_begin_object (builder); + + if (priv->location != NULL) { + json_builder_set_member_name (builder, "locationDescription"); + json_builder_add_string_value (builder, priv->location); + } + + if (priv->latitude >= -90.0 && priv->latitude <= 90.0 && + priv->longitude >= -180.0 && priv->longitude <= 180.0) { + json_builder_set_member_name (builder, "location"); + json_builder_begin_object (builder); + + json_builder_set_member_name (builder, "latitude"); + json_builder_add_double_value (builder, priv->latitude); + + json_builder_set_member_name (builder, "longitude"); + json_builder_add_double_value (builder, priv->longitude); + + json_builder_end_object (builder); + } + + if (priv->recorded != -1) { + gchar *recorded = gdata_parser_date_from_int64 (priv->recorded); + json_builder_set_member_name (builder, "recordingDate"); + json_builder_add_string_value (builder, recorded); + g_free (recorded); + } + + json_builder_end_object (builder); +} + +static const gchar * +get_content_type (void) +{ + return "application/json"; +} + +static gchar * +get_entry_uri (const gchar *id) +{ + const gchar *old_prefix = "tag:youtube.com,2008:video:"; + + /* For compatibility with previous video ID formats, strip off the v2 + * ID prefix. */ + if (g_str_has_prefix (id, old_prefix)) { + id += strlen (old_prefix); + } + + /* Build the query URI for a single video. This is a bit of a pain, + * because it actually returns a list containing a single video, but + * there seems no other way to do it. See parsing_in_video_list_response + * in parse_json() for the fallout. + * + * Reference: https://developers.google.com/youtube/v3/docs/videos/list#part */ + return _gdata_service_build_uri ("https://www.googleapis.com/youtube/v3/videos" + "?part=contentDetails,id," + "recordingDetails,snippet," + "status,statistics" + "&id=%s", id); +} + +static GDataAuthorizationDomain * +get_authorization_domain (GDataCommentable *self) +{ + return gdata_youtube_service_get_primary_authorization_domain (); +} + +static gchar * +get_query_comments_uri (GDataCommentable *self) +{ + const gchar *video_id; + + video_id = gdata_entry_get_id (GDATA_ENTRY (self)); + + /* https://developers.google.com/youtube/v3/docs/commentThreads/list */ + return _gdata_service_build_uri ("https://www.googleapis.com" + "/youtube/v3/commentThreads" + "?part=snippet" + "&videoId=%s", video_id); +} + +G_GNUC_INTERNAL void +_gdata_youtube_comment_set_video_id (GDataYouTubeComment *self, + const gchar *video_id); +G_GNUC_INTERNAL void +_gdata_youtube_comment_set_channel_id (GDataYouTubeComment *self, + const gchar *channel_id); + +static gchar * +get_insert_comment_uri (GDataCommentable *self, GDataComment *comment_) +{ + const gchar *video_id, *channel_id; + GDataYouTubeVideoPrivate *priv = GDATA_YOUTUBE_VIDEO (self)->priv; + + video_id = gdata_entry_get_id (GDATA_ENTRY (self)); + channel_id = priv->channel_id; + + /* https://developers.google.com/youtube/v3/docs/commentThreads/insert + * + * We have to set the video ID on the @comment_. */ + _gdata_youtube_comment_set_video_id (GDATA_YOUTUBE_COMMENT (comment_), + video_id); + _gdata_youtube_comment_set_channel_id (GDATA_YOUTUBE_COMMENT (comment_), + channel_id); + + return _gdata_service_build_uri ("https://www.googleapis.com" + "/youtube/v3/commentThreads" + "?part=snippet" + "&shareOnGooglePlus=false"); +} + +static gboolean +is_comment_deletable (GDataCommentable *self, GDataComment *comment_) +{ + /* FIXME: Currently unsupported: + * https://developers.google.com/youtube/v3/migration-guide#to_be_migrated + * https://developers.google.com/youtube/v3/guides/implementation/comments#comments-delete */ + return FALSE; +} + +/** + * gdata_youtube_video_new: + * @id: (allow-none): the video's ID, or %NULL + * + * Creates a new #GDataYouTubeVideo with the given ID and default properties. + * + * Return value: a new #GDataYouTubeVideo; unref with g_object_unref() + */ +GDataYouTubeVideo * +gdata_youtube_video_new (const gchar *id) +{ + return g_object_new (GDATA_TYPE_YOUTUBE_VIDEO, "id", id, NULL); +} + +/** + * gdata_youtube_video_get_view_count: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:view-count property. + * + * Return value: the number of times the video has been viewed + */ +guint +gdata_youtube_video_get_view_count (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), 0); + return self->priv->view_count; +} + +/** + * gdata_youtube_video_get_favorite_count: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:favorite-count property. + * + * Return value: the number of users who have added the video to their favorites list + */ +guint +gdata_youtube_video_get_favorite_count (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), 0); + return self->priv->favorite_count; +} + +/** + * gdata_youtube_video_get_location: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:location property. + * + * Return value: a string describing the video's location, or %NULL + */ +const gchar * +gdata_youtube_video_get_location (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + return self->priv->location; +} + +/** + * gdata_youtube_video_set_location: + * @self: a #GDataYouTubeVideo + * @location: (allow-none): a new location, or %NULL + * + * Sets the #GDataYouTubeVideo:location property to the new location string, @location. + * + * Set @location to %NULL to unset the property in the video. + */ +void +gdata_youtube_video_set_location (GDataYouTubeVideo *self, const gchar *location) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + + g_free (self->priv->location); + self->priv->location = g_strdup (location); + g_object_notify (G_OBJECT (self), "location"); +} + +/** + * gdata_youtube_video_get_access_control: + * @self: a #GDataYouTubeVideo + * @action: the action whose permission should be returned + * + * Gets the permission associated with the given @action on the #GDataYouTubeVideo. If the given @action + * doesn't have a permission set on the video, %GDATA_YOUTUBE_PERMISSION_DENIED is returned. + * + * Return value: the permission associated with @action, or %GDATA_YOUTUBE_PERMISSION_DENIED + * + * Since: 0.7.0 + */ +GDataYouTubePermission +gdata_youtube_video_get_access_control (GDataYouTubeVideo *self, const gchar *action) +{ + gpointer value; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), GDATA_YOUTUBE_PERMISSION_DENIED); + g_return_val_if_fail (action != NULL, GDATA_YOUTUBE_PERMISSION_DENIED); + + if (g_hash_table_lookup_extended (self->priv->access_controls, action, NULL, &value) == FALSE) + return GDATA_YOUTUBE_PERMISSION_DENIED; + return GPOINTER_TO_INT (value); +} + +/** + * gdata_youtube_video_set_access_control: + * @self: a #GDataYouTubeVideo + * @action: the action whose permission is being set + * @permission: the permission to give to the action + * + * Sets the permission associated with @action on the #GDataYouTubeVideo, allowing restriction or derestriction of various + * operations on YouTube videos. + * + * Note that only %GDATA_YOUTUBE_ACTION_RATE and %GDATA_YOUTUBE_ACTION_COMMENT actions can have the %GDATA_YOUTUBE_PERMISSION_MODERATED permission. + * + * Since: 0.7.0 + */ +void +gdata_youtube_video_set_access_control (GDataYouTubeVideo *self, const gchar *action, GDataYouTubePermission permission) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + g_return_if_fail (action != NULL); + + g_hash_table_replace (self->priv->access_controls, g_strdup (action), GINT_TO_POINTER (permission)); +} + +/** + * gdata_youtube_video_get_rating: + * @self: a #GDataYouTubeVideo + * @min: (out caller-allocates) (allow-none): return location for the minimum rating value, or %NULL + * @max: (out caller-allocates) (allow-none): return location for the maximum rating value, or %NULL + * @count: (out caller-allocates) (allow-none): return location for the number of ratings, or %NULL + * @average: (out caller-allocates) (allow-none): return location for the average rating value, or %NULL + * + * Gets various properties of the ratings on the video. + * + * Note that this property may not be retrieved when querying for multiple + * videos at once, but is guaranteed to be retrieved when querying with + * gdata_service_query_single_entry_async(). + */ +void +gdata_youtube_video_get_rating (GDataYouTubeVideo *self, guint *min, guint *max, guint *count, gdouble *average) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + if (min != NULL) + *min = self->priv->rating.min; + if (max != NULL) + *max = self->priv->rating.max; + if (count != NULL) + *count = self->priv->rating.count; + if (average != NULL) + *average = self->priv->rating.average; +} + +/** + * gdata_youtube_video_get_keywords: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:keywords property. + * + * Return value: (array zero-terminated=1) (transfer none): a %NULL-terminated array of words associated with the video + */ +const gchar * const * +gdata_youtube_video_get_keywords (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + return (const gchar * const *) self->priv->keywords; +} + +/** + * gdata_youtube_video_set_keywords: + * @self: a #GDataYouTubeVideo + * @keywords: (array zero-terminated=1): a new %NULL-terminated array of keywords + * + * Sets the #GDataYouTubeVideo:keywords property to the new keyword list, @keywords. + * + * @keywords must not be %NULL. For more information, see the online documentation. + */ +void +gdata_youtube_video_set_keywords (GDataYouTubeVideo *self, const gchar * const *keywords) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + g_return_if_fail (keywords != NULL); + + g_strfreev (self->priv->keywords); + self->priv->keywords = g_strdupv ((gchar **) keywords); + g_object_notify (G_OBJECT (self), "keywords"); +} + +/** + * gdata_youtube_video_get_player_uri: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:player-uri property. + * + * Return value: a URI where the video is playable in a web browser, or %NULL + */ +const gchar * +gdata_youtube_video_get_player_uri (GDataYouTubeVideo *self) +{ + GDataYouTubeVideoPrivate *priv; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + + priv = self->priv; + + /* Generate and cache the player URI. */ + if (priv->player_uri == NULL) { + priv->player_uri = _gdata_service_build_uri ("https://www.youtube.com/watch?v=%s", + gdata_entry_get_id (GDATA_ENTRY (self))); + } + + return priv->player_uri; +} + +static gboolean +strv_contains (const gchar * const *strv, const gchar *key) +{ + guint i; + + for (i = 0; strv != NULL && strv[i] != NULL; i++) { + if (g_strcmp0 (strv[i], key) == 0) { + return TRUE; + } + } + + return FALSE; +} + +/** + * gdata_youtube_video_is_restricted_in_country: + * @self: a #GDataYouTubeVideo + * @country: an ISO 3166 two-letter country code to check + * + * Checks whether viewing of the video is restricted in @country, either by its content rating, or by the request of the producer. + * The return value from this function is purely informational, and no obligation is assumed. + * + * Return value: %TRUE if the video is restricted in @country, %FALSE otherwise + * + * Since: 0.4.0 + */ +gboolean +gdata_youtube_video_is_restricted_in_country (GDataYouTubeVideo *self, const gchar *country) +{ + GDataYouTubeVideoPrivate *priv; + gboolean allowed_present, allowed_empty; + gboolean in_allowed, in_blocked; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), FALSE); + g_return_val_if_fail (country != NULL && *country != '\0', FALSE); + + priv = self->priv; + + allowed_present = (priv->region_restriction_allowed != NULL); + allowed_empty = (allowed_present && + priv->region_restriction_allowed[0] == NULL); + + in_allowed = strv_contains ((const gchar * const *) priv->region_restriction_allowed, country); + in_blocked = strv_contains ((const gchar * const *) priv->region_restriction_blocked, country); + + return ((allowed_present && !in_allowed) || + allowed_empty || + (in_blocked && !in_allowed)); +} + +/* References: + * v2: https://developers.google.com/youtube/2.0/reference#youtube_data_api_tag_media:rating + * v3: https://developers.google.com/youtube/v3/docs/videos#contentDetails.contentRating.mpaaRating + */ +static const gchar * +convert_mpaa_rating (const gchar *v3_rating) +{ + if (g_strcmp0 (v3_rating, "mpaaG") == 0) { + return "g"; + } else if (g_strcmp0 (v3_rating, "mpaaNc17") == 0) { + return "nc-17"; + } else if (g_strcmp0 (v3_rating, "mpaaPg") == 0) { + return "pg"; + } else if (g_strcmp0 (v3_rating, "mpaaPg13") == 0) { + return "pg-13"; + } else if (g_strcmp0 (v3_rating, "mpaaR") == 0) { + return "r"; + } else { + return NULL; + } +} + +/* References: + * v2: https://developers.google.com/youtube/2.0/reference#youtube_data_api_tag_media:rating + * v3: https://developers.google.com/youtube/v3/docs/videos#contentDetails.contentRating.tvpgRating + */ +static const gchar * +convert_tvpg_rating (const gchar *v3_rating) +{ + if (g_strcmp0 (v3_rating, "pg14") == 0) { + return "tv-14"; + } else if (g_strcmp0 (v3_rating, "tvpgG") == 0) { + return "tv-g"; + } else if (g_strcmp0 (v3_rating, "tvpgMa") == 0) { + return "tv-ma"; + } else if (g_strcmp0 (v3_rating, "tvpgPg") == 0) { + return "tv-pg"; + } else if (g_strcmp0 (v3_rating, "tvpgY") == 0) { + return "tv-y"; + } else if (g_strcmp0 (v3_rating, "tvpgY7") == 0) { + return "tv-y7"; + } else if (g_strcmp0 (v3_rating, "tvpgY7Fv") == 0) { + return "tv-y7-fv"; + } else { + return NULL; + } +} + +/** + * gdata_youtube_video_get_media_rating: + * @self: a #GDataYouTubeVideo + * @rating_type: the type of rating to retrieve + * + * Returns the rating of the given type for the video, if one exists. For example, this could be a film rating awarded by the MPAA; or a simple + * rating specifying whether the video contains adult content. + * + * The valid values for @rating_type are: %GDATA_YOUTUBE_RATING_TYPE_MPAA and %GDATA_YOUTUBE_RATING_TYPE_V_CHIP. + * Further values may be added in future; if an unknown rating type is passed to the function, %NULL will be returned. + * + * The possible return values depend on what's passed to @rating_type. Valid values for each rating type are listed in the documentation for the + * rating types. + * + * Return value: the rating of the video for the given @rating_type, or %NULL if the video isn't rated with that type (or the type is unknown) + * + * Since: 0.10.0 + */ +const gchar * +gdata_youtube_video_get_media_rating (GDataYouTubeVideo *self, const gchar *rating_type) +{ + const gchar *rating; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + g_return_val_if_fail (rating_type != NULL && *rating_type != '\0', NULL); + + /* All ratings are unknown. */ + if (self->priv->content_ratings == NULL) { + return NULL; + } + + /* Compatibility with the old API. */ + if (g_strcmp0 (rating_type, "simple") == 0) { + /* Not supported any more. */ + return NULL; + } else if (g_strcmp0 (rating_type, "mpaa") == 0) { + rating = g_hash_table_lookup (self->priv->content_ratings, + "mpaaRating"); + return convert_mpaa_rating (rating); + } else if (g_strcmp0 (rating_type, "v-chip") == 0) { + rating = g_hash_table_lookup (self->priv->content_ratings, + "tvpgRating"); + return convert_tvpg_rating (rating); + } + + return g_hash_table_lookup (self->priv->content_ratings, rating_type); +} + +/** + * gdata_youtube_video_get_category: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:category property. + * + * Return value: (transfer none): a #GDataMediaCategory giving the video's single and mandatory category + */ +GDataMediaCategory * +gdata_youtube_video_get_category (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + return self->priv->category; +} + +/** + * gdata_youtube_video_set_category: + * @self: a #GDataYouTubeVideo + * @category: a new #GDataMediaCategory + * + * Sets the #GDataYouTubeVideo:category property to the new category, @category, and increments its reference count. + * + * @category must not be %NULL. For more information, see the online documentation. + */ +void +gdata_youtube_video_set_category (GDataYouTubeVideo *self, GDataMediaCategory *category) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + g_return_if_fail (GDATA_IS_MEDIA_CATEGORY (category)); + + g_object_ref (category); + g_clear_object (&self->priv->category); + self->priv->category = category; + g_object_notify (G_OBJECT (self), "category"); +} + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_video_get_credit: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:credit property. + * + * Return value: (transfer none): a #GDataMediaCredit giving information on whom to credit for the video, or %NULL + * Deprecated: 0.17.0: This is no longer supported by Google, and will + * always return %NULL. There is no replacement. + */ +GDataYouTubeCredit * +gdata_youtube_video_get_credit (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + return NULL; +} + +G_GNUC_END_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_video_get_description: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:description property. + * + * Return value: the video's long text description, or %NULL + */ +const gchar * +gdata_youtube_video_get_description (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + return gdata_entry_get_summary (GDATA_ENTRY (self)); +} + +/** + * gdata_youtube_video_set_description: + * @self: a #GDataYouTubeVideo + * @description: (allow-none): the video's new description, or %NULL + * + * Sets the #GDataYouTubeVideo:description property to the new description, @description. + * + * Set @description to %NULL to unset the video's description. + */ +void +gdata_youtube_video_set_description (GDataYouTubeVideo *self, const gchar *description) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + gdata_entry_set_summary (GDATA_ENTRY (self), description); + g_object_notify (G_OBJECT (self), "description"); +} + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_video_look_up_content: + * @self: a #GDataYouTubeVideo + * @type: the MIME type of the content desired + * + * Looks up a #GDataYouTubeContent from the video with the given MIME type. The video's list of contents is + * a list of URIs to various formats of the video itself, such as its SWF URI or RTSP stream. + * + * Return value: (transfer none): a #GDataYouTubeContent matching @type, or %NULL + * Deprecated: 0.17.0: This is no longer supported by Google, and will + * always return %NULL. To view a video, open the URI returned by + * gdata_youtube_video_get_player_uri() in a web browser. + */ +GDataYouTubeContent * +gdata_youtube_video_look_up_content (GDataYouTubeVideo *self, const gchar *type) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + g_return_val_if_fail (type != NULL, NULL); + + /* Not supported in the v3 API. */ + return NULL; +} + +G_GNUC_END_IGNORE_DEPRECATIONS + +/** + * gdata_youtube_video_get_thumbnails: + * @self: a #GDataYouTubeVideo + * + * Gets a list of the thumbnails available for the video. + * + * Return value: (element-type GData.MediaThumbnail) (transfer none): a #GList of #GDataMediaThumbnails, or %NULL + */ +GList * +gdata_youtube_video_get_thumbnails (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + return self->priv->thumbnails; +} + +/** + * gdata_youtube_video_get_duration: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:duration property. + * + * Return value: the video duration in seconds, or 0 if unknown + */ +guint +gdata_youtube_video_get_duration (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), 0); + return self->priv->duration; +} + +/** + * gdata_youtube_video_is_private: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:is-private property. + * + * Return value: %TRUE if the video is private, %FALSE otherwise + */ +gboolean +gdata_youtube_video_is_private (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), FALSE); + return self->priv->is_private; +} + +/** + * gdata_youtube_video_set_is_private: + * @self: a #GDataYouTubeVideo + * @is_private: whether the video is private + * + * Sets the #GDataYouTubeVideo:is-private property to decide whether the video is publicly viewable. + */ +void +gdata_youtube_video_set_is_private (GDataYouTubeVideo *self, gboolean is_private) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + self->priv->is_private = is_private; + g_object_notify (G_OBJECT (self), "is-private"); +} + +/** + * gdata_youtube_video_get_uploaded: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:uploaded property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the video was uploaded, or -1 + */ +gint64 +gdata_youtube_video_get_uploaded (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), -1); + return gdata_entry_get_published (GDATA_ENTRY (self)); +} + +/** + * gdata_youtube_video_get_video_id: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:video-id property. + * + * Return value: the video's unique and permanent ID + * Deprecated: 0.17.0: This is now equal to #GDataEntry:id. + */ +const gchar * +gdata_youtube_video_get_video_id (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + return gdata_entry_get_id (GDATA_ENTRY (self)); +} + +/** + * gdata_youtube_video_is_draft: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:is-draft property. + * + * Return value: %TRUE if the video is a draft, %FALSE otherwise + * Deprecated: 0.17.0: This is now equal to + * gdata_youtube_video_is_private(). + */ +gboolean +gdata_youtube_video_is_draft (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), FALSE); + return gdata_youtube_video_is_private (self); +} + +/** + * gdata_youtube_video_set_is_draft: + * @self: a #GDataYouTubeVideo + * @is_draft: whether the video is a draft + * + * Sets the #GDataYouTubeVideo:is-draft property to decide whether the video is a draft. + * + * Deprecated: 0.17.0: This is now equivalent to + * gdata_youtube_video_set_is_private(). + */ +void +gdata_youtube_video_set_is_draft (GDataYouTubeVideo *self, gboolean is_draft) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + gdata_youtube_video_set_is_private (self, is_draft); + g_object_notify (G_OBJECT (self), "is-draft"); +} + +/* Convert from v3 to v2 API video upload state. References: + * v2: https://developers.google.com/youtube/2.0/reference?csw=1#youtube_data_api_tag_yt:state + * v3: https://developers.google.com/youtube/v3/docs/videos#processingDetails.processingStatus + * https://developers.google.com/youtube/v3/docs/videos#status.uploadStatus + */ +static const gchar * +convert_state_name (const gchar *v3_processing_status, + const gchar *v3_upload_status) +{ + if (g_strcmp0 (v3_upload_status, "deleted") == 0 || + g_strcmp0 (v3_upload_status, "failed") == 0 || + g_strcmp0 (v3_upload_status, "rejected") == 0) { + return v3_upload_status; + } else if (g_strcmp0 (v3_processing_status, "processing") == 0) { + return v3_processing_status; + } + + return NULL; +} + +/* References: + * v2: https://developers.google.com/youtube/2.0/reference?csw=1#youtube_data_api_tag_yt:state + * v3: https://developers.google.com/youtube/v3/docs/videos#status.failureReason + * https://developers.google.com/youtube/v3/docs/videos#status.rejectionReason + */ +static const gchar * +convert_state_reason_code (const gchar *v2_name, + const gchar *v3_failure_reason, + const gchar *v3_rejection_reason) +{ + if (v2_name == NULL || + g_strcmp0 (v2_name, "processing") == 0 || + g_strcmp0 (v2_name, "deleted") == 0) { + /* Explicitly unset if unknown, processing or deleted. */ + return NULL; + } else if (g_strcmp0 (v2_name, "restricted") == 0) { + /* Unsupported conversion; convert_state_name() can never return + * ‘restricted’ anyway. */ + return NULL; + } else if (g_strcmp0 (v2_name, "rejected") == 0) { + if (g_strcmp0 (v3_rejection_reason, "claim") == 0 || + g_strcmp0 (v3_rejection_reason, "copyright") == 0 || + g_strcmp0 (v3_rejection_reason, "trademark") == 0) { + return "copyright"; + } else if (g_strcmp0 (v3_rejection_reason, "duplicate") == 0) { + return "duplicate"; + } else if (g_strcmp0 (v3_rejection_reason, + "inappropriate") == 0) { + return "inappropriate"; + } else if (g_strcmp0 (v3_rejection_reason, "length") == 0) { + return "tooLong"; + } else if (g_strcmp0 (v3_rejection_reason, "termsOfUse") == 0) { + return "termsOfUse"; + } else if (g_strcmp0 (v3_rejection_reason, + "uploaderAccountClosed") == 0 || + g_strcmp0 (v3_rejection_reason, + "uploaderAccountSuspended") == 0) { + return "duplicate"; + } else { + /* Generic fallback. */ + return "termsOfUse"; + } + } else if (g_strcmp0 (v2_name, "failed") == 0) { + if (g_strcmp0 (v3_failure_reason, "codec") == 0) { + return "unsupportedCodec"; + } else if (g_strcmp0 (v3_failure_reason, "conversion") == 0) { + return "invalidFormat"; + } else if (g_strcmp0 (v3_failure_reason, "emptyFile") == 0) { + return "empty"; + } else if (g_strcmp0 (v3_failure_reason, "tooSmall") == 0) { + return "tooSmall"; + } else { + return "cantProcess"; + } + } + + return NULL; +} + +/** + * gdata_youtube_video_get_state: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:state property. + * + * For more information, see the online documentation. + * + * Return value: (transfer none): a #GDataYouTubeState showing the state of the video, or %NULL + */ +GDataYouTubeState * +gdata_youtube_video_get_state (GDataYouTubeVideo *self) +{ + GDataYouTubeVideoPrivate *priv; + + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + + priv = self->priv; + + /* Lazily create the state object. */ + if (priv->upload_state == NULL) { + const gchar *name, *reason_code; + + name = convert_state_name (priv->processing_status, + priv->upload_status); + reason_code = convert_state_reason_code (name, + priv->failure_reason, + priv->rejection_reason); + + priv->upload_state = g_object_new (GDATA_TYPE_YOUTUBE_STATE, + "name", name, + "reason-code", reason_code, + "help-uri", NULL, + "message", NULL, + NULL); + } + + return priv->upload_state; +} + +/** + * gdata_youtube_video_get_recorded: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:recorded property. If the property is unset, -1 will be returned. + * + * Return value: the UNIX timestamp for the time the video was recorded, or -1 + * + * Since: 0.3.0 + */ +gint64 +gdata_youtube_video_get_recorded (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), -1); + return self->priv->recorded; +} + +/** + * gdata_youtube_video_set_recorded: + * @self: a #GDataYouTubeVideo + * @recorded: the video's new recorded time, or -1 + * + * Sets the #GDataYouTubeVideo:recorded property to the new recorded time, @recorded. + * + * Set @recorded to -1 to unset the video's recorded time. + * + * Since: 0.3.0 + */ +void +gdata_youtube_video_set_recorded (GDataYouTubeVideo *self, gint64 recorded) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + g_return_if_fail (recorded >= -1); + + self->priv->recorded = recorded; + g_object_notify (G_OBJECT (self), "recorded"); +} + +/** + * gdata_youtube_video_get_video_id_from_uri: + * @video_uri: a YouTube video player URI + * + * Extracts a video ID from a YouTube video player URI. The video ID is in the same form as returned by + * gdata_youtube_video_get_video_id(), and the @video_uri should be in the same form as returned by + * gdata_youtube_video_get_player_uri(). + * + * The function will validate whether the URI actually points to a hostname containing youtube + * (e.g. youtube.com), and will return %NULL if it doesn't. + * + * For example: + * + * video_id = gdata_youtube_video_get_video_id_from_uri ("http://www.youtube.com/watch?v=BH_vwsyCrTc&feature=featured"); + * g_message ("Video ID: %s", video_id); /* Should print: BH_vwsyCrTc */ + * g_free (video_id); + * + * + * Since: 0.4.0 + * + * Return value: the video ID, or %NULL; free with g_free() + */ +gchar * +gdata_youtube_video_get_video_id_from_uri (const gchar *video_uri) +{ + gchar *video_id = NULL; + SoupURI *uri; + + g_return_val_if_fail (video_uri != NULL && *video_uri != '\0', NULL); + + /* Extract the query string from the URI */ + uri = soup_uri_new (video_uri); + if (uri == NULL) + return NULL; + else if (uri->host == NULL || strstr (uri->host, "youtube") == NULL) { + soup_uri_free (uri); + return NULL; + } + + /* Try the "v" parameter (e.g. format is: http://www.youtube.com/watch?v=ylLzyHk54Z0) */ + if (uri->query != NULL) { + GHashTable *params = soup_form_decode (uri->query); + video_id = g_strdup (g_hash_table_lookup (params, "v")); + g_hash_table_destroy (params); + } + + /* Try the "v" fragment component (e.g. format is: http://www.youtube.com/watch#!v=ylLzyHk54Z0). + * YouTube introduced this new URI format in March 2010: + * http://apiblog.youtube.com/2010/03/upcoming-change-to-youtube-video-page.html */ + if (video_id == NULL && uri->fragment != NULL) { + gchar **components, **i; + + components = g_strsplit (uri->fragment, "!", -1); + for (i = components; *i != NULL; i++) { + if (**i == 'v' && *((*i) + 1) == '=') { + video_id = g_strdup ((*i) + 2); + break; + } + } + g_strfreev (components); + } + + soup_uri_free (uri); + + return video_id; +} + +/** + * gdata_youtube_video_get_aspect_ratio: + * @self: a #GDataYouTubeVideo + * + * Gets the #GDataYouTubeVideo:aspect-ratio property. + * + * Return value: the aspect ratio property, or %NULL + * + * Since: 0.4.0 + */ +const gchar * +gdata_youtube_video_get_aspect_ratio (GDataYouTubeVideo *self) +{ + g_return_val_if_fail (GDATA_IS_YOUTUBE_VIDEO (self), NULL); + + /* Permanently NULL for the moment, but let’s not deprecate the property + * because it looks like it might come in useful in future. */ + return NULL; +} + +/** + * gdata_youtube_video_set_aspect_ratio: + * @self: a #GDataYouTubeVideo + * @aspect_ratio: (allow-none): the aspect ratio property, or %NULL + * + * Sets the #GDataYouTubeVideo:aspect-ratio property to specify the video's aspect ratio. + * If @aspect_ratio is %NULL, the property will be unset. + * + * Since: 0.4.0 + */ +void +gdata_youtube_video_set_aspect_ratio (GDataYouTubeVideo *self, const gchar *aspect_ratio) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + + /* Ignore it. See note in gdata_youtube_video_get_aspect_ratio(), + * above. */ +} + +/** + * gdata_youtube_video_get_coordinates: + * @self: a #GDataYouTubeVideo + * @latitude: (out caller-allocates) (allow-none): return location for the latitude, or %NULL + * @longitude: (out caller-allocates) (allow-none): return location for the longitude, or %NULL + * + * Gets the #GDataYouTubeVideo:latitude and #GDataYouTubeVideo:longitude properties, setting the out parameters to them. If either latitude or + * longitude is %NULL, that parameter will not be set. If the coordinates are unset, @latitude and @longitude will be set to %G_MAXDOUBLE. + * + * Since: 0.8.0 + */ +void +gdata_youtube_video_get_coordinates (GDataYouTubeVideo *self, gdouble *latitude, gdouble *longitude) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + + if (latitude != NULL) { + *latitude = self->priv->latitude; + } + if (longitude != NULL) { + *longitude = self->priv->longitude; + } +} + +/** + * gdata_youtube_video_set_coordinates: + * @self: a #GDataYouTubeVideo + * @latitude: the video's new latitude coordinate, or %G_MAXDOUBLE + * @longitude: the video's new longitude coordinate, or %G_MAXDOUBLE + * + * Sets the #GDataYouTubeVideo:latitude and #GDataYouTubeVideo:longitude properties to @latitude and @longitude respectively. + * + * Since: 0.8.0 + */ +void +gdata_youtube_video_set_coordinates (GDataYouTubeVideo *self, gdouble latitude, gdouble longitude) +{ + g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self)); + + self->priv->latitude = latitude; + self->priv->longitude = longitude; + + g_object_freeze_notify (G_OBJECT (self)); + g_object_notify (G_OBJECT (self), "latitude"); + g_object_notify (G_OBJECT (self), "longitude"); + g_object_thaw_notify (G_OBJECT (self)); +} diff --git a/gdata/services/youtube/gdata-youtube-video.h b/gdata/services/youtube/gdata-youtube-video.h new file mode 100644 index 0000000..da52633 --- /dev/null +++ b/gdata/services/youtube/gdata-youtube-video.h @@ -0,0 +1,238 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008-2009, 2015 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_YOUTUBE_VIDEO_H +#define GDATA_YOUTUBE_VIDEO_H + +#include +#include + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +/** + * GDATA_YOUTUBE_ASPECT_RATIO_WIDESCREEN: + * + * The aspect ratio for widescreen (16:9) videos. + * + * For more information, see the + * online documentation. + * + * Since: 0.7.0 + */ +#define GDATA_YOUTUBE_ASPECT_RATIO_WIDESCREEN "widescreen" + +/** + * GDATA_YOUTUBE_ACTION_RATE: + * + * An action to rate a video, for use with gdata_youtube_video_set_access_control(). + * + * Since: 0.7.0 + */ +#define GDATA_YOUTUBE_ACTION_RATE "rate" + +/** + * GDATA_YOUTUBE_ACTION_COMMENT: + * + * An action to comment on a video, for use with gdata_youtube_video_set_access_control(). + * + * Since: 0.7.0 + */ +#define GDATA_YOUTUBE_ACTION_COMMENT "comment" + +/** + * GDATA_YOUTUBE_ACTION_COMMENT_VOTE: + * + * An action to rate other users' comments on a video, for use with gdata_youtube_video_set_access_control(). + * + * Since: 0.7.0 + */ +#define GDATA_YOUTUBE_ACTION_COMMENT_VOTE "commentVote" + +/** + * GDATA_YOUTUBE_ACTION_VIDEO_RESPOND: + * + * An action to add a video response to a video, for use with gdata_youtube_video_set_access_control(). + * + * Since: 0.7.0 + */ +#define GDATA_YOUTUBE_ACTION_VIDEO_RESPOND "videoRespond" + +/** + * GDATA_YOUTUBE_ACTION_EMBED: + * + * An action to embed a video on third-party websites, for use with gdata_youtube_video_set_access_control(). + * + * Since: 0.7.0 + */ +#define GDATA_YOUTUBE_ACTION_EMBED "embed" + +/** + * GDATA_YOUTUBE_ACTION_SYNDICATE: + * + * An action allowing YouTube to show the video on mobile phones and televisions, for use with gdata_youtube_video_set_access_control(). + * + * Since: 0.7.0 + */ +#define GDATA_YOUTUBE_ACTION_SYNDICATE "syndicate" + +#ifndef LIBGDATA_DISABLE_DEPRECATED +/** + * GDATA_YOUTUBE_RATING_TYPE_SIMPLE: + * + * A rating type to pass to gdata_youtube_video_get_media_rating() for “simple” ratings. The values which can be returned for such ratings are: + * adult and nonadult. + * + * Since: 0.10.0 + * Deprecated: 0.17.0: No longer supported by Google. Calling + * gdata_youtube_video_get_media_rating() with this rating type will always + * return %NULL. + */ +#define GDATA_YOUTUBE_RATING_TYPE_SIMPLE "simple" +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +/** + * GDATA_YOUTUBE_RATING_TYPE_MPAA: + * + * A rating type to pass to gdata_youtube_video_get_media_rating() for ratings by the MPAA. The + * values which can be returned for such ratings are: g, pg, + * pg-13, r and nc-17. + * + * Since: 0.10.0 + */ +#define GDATA_YOUTUBE_RATING_TYPE_MPAA "mpaa" + +/** + * GDATA_YOUTUBE_RATING_TYPE_V_CHIP: + * + * A rating type to pass to gdata_youtube_video_get_media_rating() for ratings following the FCC + * V-Chip system. The values which can be returned for such ratings are: + * tv-y, tv-y7, tv-y7-fv, tv-g, + * tv-pg, tv-14 and tv-ma. + * + * Since: 0.10.0 + */ +#define GDATA_YOUTUBE_RATING_TYPE_V_CHIP "v-chip" + +/** + * GDataYouTubePermission: + * @GDATA_YOUTUBE_PERMISSION_ALLOWED: the action is allowed for everyone + * @GDATA_YOUTUBE_PERMISSION_DENIED: the action is denied for everyone + * @GDATA_YOUTUBE_PERMISSION_MODERATED: the action is moderated by the video owner + * + * Permissions for actions which can be set on a #GDataYouTubeVideo using gdata_youtube_video_set_access_control(). + * + * The only actions which can have the %GDATA_YOUTUBE_PERMISSION_MODERATED permission are + * %GDATA_YOUTUBE_ACTION_RATE and %GDATA_YOUTUBE_ACTION_COMMENT. + * + * Since: 0.7.0 + */ +typedef enum { + GDATA_YOUTUBE_PERMISSION_ALLOWED, + GDATA_YOUTUBE_PERMISSION_DENIED, + GDATA_YOUTUBE_PERMISSION_MODERATED +} GDataYouTubePermission; + +#define GDATA_TYPE_YOUTUBE_VIDEO (gdata_youtube_video_get_type ()) +#define GDATA_YOUTUBE_VIDEO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_VIDEO, GDataYouTubeVideo)) +#define GDATA_YOUTUBE_VIDEO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_VIDEO, GDataYouTubeVideoClass)) +#define GDATA_IS_YOUTUBE_VIDEO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_VIDEO)) +#define GDATA_IS_YOUTUBE_VIDEO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_VIDEO)) +#define GDATA_YOUTUBE_VIDEO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_VIDEO, GDataYouTubeVideoClass)) + +typedef struct _GDataYouTubeVideoPrivate GDataYouTubeVideoPrivate; + +/** + * GDataYouTubeVideo: + * + * All the fields in the #GDataYouTubeVideo structure are private and should never be accessed directly. + */ +typedef struct { + GDataEntry parent; + GDataYouTubeVideoPrivate *priv; +} GDataYouTubeVideo; + +/** + * GDataYouTubeVideoClass: + * + * All the fields in the #GDataYouTubeVideoClass structure are private and should never be accessed directly. + */ +typedef struct { + /*< private >*/ + GDataEntryClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataYouTubeVideoClass; + +GType gdata_youtube_video_get_type (void) G_GNUC_CONST; + +GDataYouTubeVideo *gdata_youtube_video_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +guint gdata_youtube_video_get_view_count (GDataYouTubeVideo *self) G_GNUC_PURE; +guint gdata_youtube_video_get_favorite_count (GDataYouTubeVideo *self) G_GNUC_PURE; +const gchar *gdata_youtube_video_get_location (GDataYouTubeVideo *self) G_GNUC_PURE; +void gdata_youtube_video_set_location (GDataYouTubeVideo *self, const gchar *location); +GDataYouTubePermission gdata_youtube_video_get_access_control (GDataYouTubeVideo *self, const gchar *action) G_GNUC_PURE; +void gdata_youtube_video_set_access_control (GDataYouTubeVideo *self, const gchar *action, GDataYouTubePermission permission); +void gdata_youtube_video_get_rating (GDataYouTubeVideo *self, guint *min, guint *max, guint *count, gdouble *average); +const gchar * const *gdata_youtube_video_get_keywords (GDataYouTubeVideo *self) G_GNUC_PURE; +void gdata_youtube_video_set_keywords (GDataYouTubeVideo *self, const gchar * const *keywords); +const gchar *gdata_youtube_video_get_player_uri (GDataYouTubeVideo *self) G_GNUC_PURE; +gboolean gdata_youtube_video_is_restricted_in_country (GDataYouTubeVideo *self, const gchar *country) G_GNUC_PURE; +const gchar *gdata_youtube_video_get_media_rating (GDataYouTubeVideo *self, const gchar *rating_type) G_GNUC_PURE; +GDataMediaCategory *gdata_youtube_video_get_category (GDataYouTubeVideo *self) G_GNUC_PURE; +void gdata_youtube_video_set_category (GDataYouTubeVideo *self, GDataMediaCategory *category); +const gchar *gdata_youtube_video_get_description (GDataYouTubeVideo *self) G_GNUC_PURE; +void gdata_youtube_video_set_description (GDataYouTubeVideo *self, const gchar *description); +GList *gdata_youtube_video_get_thumbnails (GDataYouTubeVideo *self) G_GNUC_PURE; +guint gdata_youtube_video_get_duration (GDataYouTubeVideo *self) G_GNUC_PURE; +gboolean gdata_youtube_video_is_private (GDataYouTubeVideo *self) G_GNUC_PURE; +void gdata_youtube_video_set_is_private (GDataYouTubeVideo *self, gboolean is_private); +gint64 gdata_youtube_video_get_uploaded (GDataYouTubeVideo *self); +GDataYouTubeState *gdata_youtube_video_get_state (GDataYouTubeVideo *self) G_GNUC_PURE; +gint64 gdata_youtube_video_get_recorded (GDataYouTubeVideo *self); +void gdata_youtube_video_set_recorded (GDataYouTubeVideo *self, gint64 recorded); +const gchar *gdata_youtube_video_get_aspect_ratio (GDataYouTubeVideo *self) G_GNUC_PURE; +void gdata_youtube_video_set_aspect_ratio (GDataYouTubeVideo *self, const gchar *aspect_ratio); +void gdata_youtube_video_get_coordinates (GDataYouTubeVideo *self, gdouble *latitude, gdouble *longitude); +void gdata_youtube_video_set_coordinates (GDataYouTubeVideo *self, gdouble latitude, gdouble longitude); + +gchar *gdata_youtube_video_get_video_id_from_uri (const gchar *video_uri) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +#ifndef LIBGDATA_DISABLE_DEPRECATED +const gchar *gdata_youtube_video_get_video_id (GDataYouTubeVideo *self) G_GNUC_PURE G_GNUC_DEPRECATED_FOR(gdata_entry_get_id); +GDataYouTubeContent *gdata_youtube_video_look_up_content (GDataYouTubeVideo *self, const gchar *type) G_GNUC_PURE G_GNUC_DEPRECATED_FOR(gdata_youtube_video_get_player_uri); + +gboolean gdata_youtube_video_is_draft (GDataYouTubeVideo *self) G_GNUC_PURE G_GNUC_DEPRECATED_FOR(gdata_youtube_video_is_private); +void gdata_youtube_video_set_is_draft (GDataYouTubeVideo *self, gboolean is_draft) G_GNUC_DEPRECATED_FOR(gdata_youtube_video_set_is_private); + +GDataYouTubeCredit *gdata_youtube_video_get_credit (GDataYouTubeVideo *self) G_GNUC_PURE G_GNUC_DEPRECATED; +#endif /* !LIBGDATA_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* !GDATA_YOUTUBE_VIDEO_H */ diff --git a/gdata/tests/Makefile.am b/gdata/tests/Makefile.am new file mode 100644 index 0000000..d5a1de5 --- /dev/null +++ b/gdata/tests/Makefile.am @@ -0,0 +1,409 @@ +include $(top_srcdir)/glib-tap.mk + +installed_testdir = $(libexecdir)/installed-tests/$(PACKAGE_TARNAME) +installed_test_metadir = $(datadir)/installed-tests/$(PACKAGE_TARNAME) + +# Helper library. +test_ltlibraries = libgdata-test.la + +libgdata_test_la_SOURCES = \ + common.c \ + common.h \ + gdata-dummy-authorizer.c \ + gdata-dummy-authorizer.h \ + $(NULL) + +libgdata_test_la_LIBADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(UHTTPMOCK_LIBS) \ + $(NULL) + +# Flags for the helper library and all test binaries +AM_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"libgdata\" \ + $(DISABLE_DEPRECATED) \ + $(NULL) +AM_CFLAGS = \ + $(GDK_PIXBUF_CFLAGS) \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(UHTTPMOCK_CFLAGS) \ + $(NULL) +AM_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(NULL) + +LDADD = \ + libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la \ + $(GDK_PIXBUF_LIBS) \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(UHTTPMOCK_LIBS) \ + $(NULL) + +test_programs = \ + buffer \ + general \ + calendar \ + contacts \ + tasks \ + perf \ + authorization \ + oauth1-authorizer \ + oauth2-authorizer \ + streams \ + youtube \ + $(NULL) + +# FIXME: Temporarily disabled until they are ported for the changes in the v2 +# to v3 API transitions. +#all_test_programs += documents + +# PicasaWeb does not work since Google made the API read-only: +# https://developers.google.com/picasa-web/docs/3.0/releasenotes#picasa-is-retiring-february-12-2016 +#all_test_programs += picasaweb + +dist_test_data = \ + photo.jpg \ + sample.ogg \ + test.doc \ + test.ods \ + test.odt \ + test.ppt \ + test.xls \ + test_updated.odt \ + test_updated_file.ppt \ + cert.pem \ + key.pem \ + \ + traces/calendar/access-rule-delete \ + traces/calendar/access-rule-get \ + traces/calendar/access-rule-insert \ + traces/calendar/access-rule-update \ + traces/calendar/authentication \ + traces/calendar/authentication-async \ + traces/calendar/authentication-async-cancellation \ + traces/calendar/event-insert \ + traces/calendar/event_insert-async \ + traces/calendar/event_insert-async-cancellation \ + traces/calendar/global-authentication \ + traces/calendar/query-all-calendars \ + traces/calendar/query_all_calendars-async \ + traces/calendar/query_all_calendars-async-cancellation \ + traces/calendar/query-all-calendars-async-progress-closure \ + traces/calendar/query-events \ + traces/calendar/query_events-async \ + traces/calendar/query_events-async-cancellation \ + traces/calendar/query-events-async-progress-closure \ + traces/calendar/query-own-calendars \ + traces/calendar/query_own_calendars-async \ + traces/calendar/query_own_calendars-async-cancellation \ + traces/calendar/query-own-calendars-async-progress-closure \ + traces/calendar/setup-query-calendars \ + traces/calendar/setup-query-events \ + traces/calendar/setup-temp-calendar \ + traces/calendar/setup-temp-calendar-acls \ + traces/calendar/teardown-insert-event \ + traces/calendar/teardown-query-calendars \ + traces/calendar/teardown-query-events \ + traces/calendar/teardown-temp-calendar \ + traces/calendar/teardown-temp-calendar-acls \ + \ + traces/contacts/authentication \ + traces/contacts/authentication-async \ + traces/contacts/authentication-async-cancellation \ + traces/contacts/batch \ + traces/contacts/batch-async \ + traces/contacts/batch-async-cancellation \ + traces/contacts/contact-insert \ + traces/contacts/contact-update \ + traces/contacts/global-authentication \ + traces/contacts/group-insert \ + traces/contacts/group_insert-async \ + traces/contacts/group_insert-async-cancellation \ + traces/contacts/photo-add \ + traces/contacts/photo_add-async \ + traces/contacts/photo_add-async-cancellation \ + traces/contacts/photo-delete \ + traces/contacts/photo_delete-async \ + traces/contacts/photo_delete-async-cancellation \ + traces/contacts/photo-get \ + traces/contacts/photo_get-async \ + traces/contacts/photo_get-async-cancellation \ + traces/contacts/query-all-contacts \ + traces/contacts/query_all_contacts-async \ + traces/contacts/query_all_contacts-async-cancellation \ + traces/contacts/query-all-contacts-async-progress-closure \ + traces/contacts/query-all-groups \ + traces/contacts/query_all_groups-async \ + traces/contacts/query_all_groups-async-cancellation \ + traces/contacts/query-all-groups-async-progress-closure \ + traces/contacts/setup-batch-async \ + traces/contacts/setup-query-all-contacts \ + traces/contacts/setup-query-all-groups \ + traces/contacts/setup-temp-contact \ + traces/contacts/setup-temp-contact-with-photo \ + traces/contacts/teardown-batch-async \ + traces/contacts/teardown-insert \ + traces/contacts/teardown-insert-group \ + traces/contacts/teardown-query-all-contacts \ + traces/contacts/teardown-query-all-groups \ + traces/contacts/teardown-temp-contact \ + \ + traces/documents/access-rule-insert \ + traces/documents/authentication \ + traces/documents/authentication-async \ + traces/documents/authentication-async-cancellation \ + traces/documents/batch \ + traces/documents/batch-async \ + traces/documents/batch-async-cancellation \ + traces/documents/copy-document \ + traces/documents/delete-document \ + traces/documents/delete-folder \ + traces/documents/download-document \ + traces/documents/folders-add-to-folder \ + traces/documents/folders_add_to_folder-async \ + traces/documents/folders_add_to_folder-async-cancellation \ + traces/documents/folders-remove-from-folder \ + traces/documents/folders_remove_from_folder-async \ + traces/documents/folders_remove_from_folder-async-cancellation \ + traces/documents/folders_remove_from_folder-async-epilogue \ + traces/documents/global-authentication \ + traces/documents/query-all-documents \ + traces/documents/query_all_documents-async \ + traces/documents/query_all_documents-async-cancellation \ + traces/documents/query-all-documents-async-progress-closure \ + traces/documents/query-all-documents-with-folder \ + traces/documents/setup-batch-async \ + traces/documents/setup-folders-add-to-folder \ + traces/documents/setup-folders-remove-from-folder \ + traces/documents/setup-temp-documents \ + traces/documents/setup-temp-document-spreadsheet \ + traces/documents/setup-temp-folder \ + traces/documents/setup-update-document_content-and-metadata-non-resumable \ + traces/documents/setup-update-document_content-and-metadata-resumable \ + traces/documents/setup-update-document_content-only-non-resumable \ + traces/documents/setup-update-document_content-only-resumable \ + traces/documents/setup-update-document_metadata-only-non-resumable \ + traces/documents/setup-upload-document_content-and-metadata-in-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-bin-no-convert \ + traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-odt-convert \ + traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-odt-no-convert \ + traces/documents/setup-upload-document_content-and-metadata-root-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-bin-no-convert \ + traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-odt-convert \ + traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-odt-no-convert \ + traces/documents/setup-upload-document_content-only-in-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_content-only-in-folder-resumable-bin-no-convert \ + traces/documents/setup-upload-document_content-only-in-folder-resumable-odt-convert \ + traces/documents/setup-upload-document_content-only-in-folder-resumable-odt-no-convert \ + traces/documents/setup-upload-document_content-only-root-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_content-only-root-folder-resumable-bin-no-convert \ + traces/documents/setup-upload-document_content-only-root-folder-resumable-odt-convert \ + traces/documents/setup-upload-document_content-only-root-folder-resumable-odt-no-convert \ + traces/documents/setup-upload-document_metadata-only-in-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_metadata-only-root-folder-non-resumable-odt-convert \ + traces/documents/teardown-batch-async \ + traces/documents/teardown-copy-document \ + traces/documents/teardown-folders-add-to-folder \ + traces/documents/teardown-temp-document \ + traces/documents/teardown-temp-documents \ + traces/documents/teardown-temp-folder \ + traces/documents/teardown-update-document_content-and-metadata-non-resumable \ + traces/documents/teardown-update-document_content-and-metadata-resumable \ + traces/documents/teardown-update-document_content-only-non-resumable \ + traces/documents/teardown-update-document_content-only-resumable \ + traces/documents/teardown-update-document_metadata-only-non-resumable \ + traces/documents/teardown-upload-document_content-and-metadata-in-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-bin-no-convert \ + traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-odt-no-convert \ + traces/documents/teardown-upload-document_content-and-metadata-root-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-bin-no-convert \ + traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-odt-no-convert \ + traces/documents/teardown-upload-document_content-only-in-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-only-in-folder-resumable-bin-no-convert \ + traces/documents/teardown-upload-document_content-only-in-folder-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-only-in-folder-resumable-odt-no-convert \ + traces/documents/teardown-upload-document_content-only-root-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-only-root-folder-resumable-bin-no-convert \ + traces/documents/teardown-upload-document_content-only-root-folder-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-only-root-folder-resumable-odt-no-convert \ + traces/documents/teardown-upload-document_metadata-only-in-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_metadata-only-root-folder-non-resumable-odt-convert \ + traces/documents/update_content-and-metadata-non-resumable \ + traces/documents/update_content-and-metadata-resumable \ + traces/documents/update_content-only-non-resumable \ + traces/documents/update_content-only-resumable \ + traces/documents/update_metadata-only-non-resumable \ + traces/documents/upload_content-and-metadata-in-folder-non-resumable-odt-convert \ + traces/documents/upload_content-and-metadata-in-folder-resumable-bin-no-convert \ + traces/documents/upload_content-and-metadata-in-folder-resumable-odt-convert \ + traces/documents/upload_content-and-metadata-in-folder-resumable-odt-no-convert \ + traces/documents/upload_content-and-metadata-root-folder-non-resumable-odt-convert \ + traces/documents/upload_content-and-metadata-root-folder-resumable-bin-no-convert \ + traces/documents/upload_content-and-metadata-root-folder-resumable-odt-convert \ + traces/documents/upload_content-and-metadata-root-folder-resumable-odt-no-convert \ + traces/documents/upload_content-only-in-folder-non-resumable-odt-convert \ + traces/documents/upload_content-only-in-folder-resumable-bin-no-convert \ + traces/documents/upload_content-only-in-folder-resumable-odt-convert \ + traces/documents/upload_content-only-in-folder-resumable-odt-no-convert \ + traces/documents/upload_content-only-root-folder-non-resumable-odt-convert \ + traces/documents/upload_content-only-root-folder-resumable-bin-no-convert \ + traces/documents/upload_content-only-root-folder-resumable-odt-convert \ + traces/documents/upload_content-only-root-folder-resumable-odt-no-convert \ + traces/documents/upload_metadata-only-in-folder-non-resumable-odt-convert \ + traces/documents/upload_metadata-only-root-folder-non-resumable-odt-convert \ + \ + traces/oauth1-authorizer/oauth1-authorizer-interactive-data-bad-credentials \ + traces/oauth1-authorizer/oauth1-authorizer-refresh-authorization \ + traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-async \ + traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-async-cancellation \ + traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-sync \ + traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-sync-cancellation \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async-bad-credentials \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async-cancellation \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync-bad-credentials \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync-cancellation \ + traces/oauth1-authorizer/setup-oauth1-authorizer-data-authenticated \ + traces/oauth1-authorizer/setup-oauth1-authorizer-interactive-data \ + \ + traces/oauth2-authorizer/oauth2-authorizer-refresh-authorization-authorized \ + traces/oauth2-authorizer/oauth2-authorizer-refresh-authorization-unauthorized \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async-bad-credentials \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async-cancellation \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync-bad-credentials \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync-cancellation \ + traces/oauth2-authorizer/setup-oauth2-authorizer-data-authenticated \ + \ + traces/picasaweb/authentication \ + traces/picasaweb/authentication-async \ + traces/picasaweb/authentication-async-cancellation \ + traces/picasaweb/comment-delete \ + traces/picasaweb/comment_delete-async \ + traces/picasaweb/comment_delete-async-cancellation \ + traces/picasaweb/comment-insert \ + traces/picasaweb/comment_insert-async \ + traces/picasaweb/comment_insert-async-cancellation \ + traces/picasaweb/comment-query \ + traces/picasaweb/comment_query-async \ + traces/picasaweb/comment_query-async-cancellation \ + traces/picasaweb/comment-query-async-progress-closure \ + traces/picasaweb/download-photo \ + traces/picasaweb/download-thumbnails \ + traces/picasaweb/global-authentication \ + traces/picasaweb/insert-album \ + traces/picasaweb/insert_album-async \ + traces/picasaweb/insert_album-async-cancellation \ + traces/picasaweb/query-all-albums \ + traces/picasaweb/query_all_albums-async \ + traces/picasaweb/query_all_albums-async-cancellation \ + traces/picasaweb/query-all-albums-async-progress-closure \ + traces/picasaweb/query-all-albums-with-limits \ + traces/picasaweb/query-files \ + traces/picasaweb/query_files-async \ + traces/picasaweb/query_files-async-cancellation \ + traces/picasaweb/query-files-async-progress-closure \ + traces/picasaweb/query-files-single \ + traces/picasaweb/query-user \ + traces/picasaweb/query_user-async \ + traces/picasaweb/query_user-async-cancellation \ + traces/picasaweb/query_user_by_username-async \ + traces/picasaweb/query_user_by_username-async-cancellation \ + traces/picasaweb/setup-query-all-albums \ + traces/picasaweb/setup-query-comments \ + traces/picasaweb/setup-query-files \ + traces/picasaweb/setup-upload \ + traces/picasaweb/teardown-insert-album \ + traces/picasaweb/teardown-insert-comment \ + traces/picasaweb/teardown-query-all-albums \ + traces/picasaweb/teardown-query-comments \ + traces/picasaweb/teardown-query-files \ + traces/picasaweb/teardown-upload \ + traces/picasaweb/upload-default-album \ + traces/picasaweb/upload_default_album-async \ + traces/picasaweb/upload_default_album-async-cancellation \ + \ + traces/youtube/authentication \ + traces/youtube/authentication-async \ + traces/youtube/authentication-async-cancellation \ + traces/youtube/batch \ + traces/youtube/batch-async \ + traces/youtube/batch-async-cancellation \ + traces/youtube/categories \ + traces/youtube/categories-async \ + traces/youtube/categories-async-cancellation \ + traces/youtube/comment-delete \ + traces/youtube/comment_delete-async \ + traces/youtube/comment_delete-async-cancellation \ + traces/youtube/comment-insert \ + traces/youtube/comment_insert-async \ + traces/youtube/comment_insert-async-cancellation \ + traces/youtube/comment-query \ + traces/youtube/comment_query-async \ + traces/youtube/comment_query-async-cancellation \ + traces/youtube/comment-query-async-progress-closure \ + traces/youtube/global-authentication \ + traces/youtube/query-related \ + traces/youtube/query_related-async \ + traces/youtube/query_related-async-cancellation \ + traces/youtube/query-related-async-progress-closure \ + traces/youtube/query-single \ + traces/youtube/query_single-async \ + traces/youtube/query_single-async-cancellation \ + traces/youtube/query-standard-feed \ + traces/youtube/query_standard_feed-async \ + traces/youtube/query_standard_feed-async-cancellation \ + traces/youtube/query-standard-feed-async-progress-closure \ + traces/youtube/query-standard-feeds \ + traces/youtube/query-standard-feed-with-query \ + traces/youtube/setup-batch \ + traces/youtube/setup-comment \ + traces/youtube/setup-insert-comment \ + traces/youtube/teardown-insert-comment \ + traces/youtube/teardown-upload \ + traces/youtube/upload-async \ + traces/youtube/upload-async-cancellation \ + traces/youtube/upload-simple \ + \ + traces/tasks/authentication \ + traces/tasks/global-authentication \ + traces/tasks/setup-delete-task \ + traces/tasks/setup-delete-tasklist \ + traces/tasks/setup-insert-task \ + traces/tasks/setup-list-task \ + traces/tasks/setup-list-tasklist \ + traces/tasks/setup-update-task \ + traces/tasks/setup-update-tasklist \ + traces/tasks/task-delete \ + traces/tasks/task-insert \ + traces/tasks/task-list \ + traces/tasks/tasklist-delete \ + traces/tasks/tasklist-insert \ + traces/tasks/tasklist-insert-unauthorised \ + traces/tasks/tasklist-list \ + traces/tasks/tasklist-update \ + traces/tasks/task-update \ + traces/tasks/teardown-delete-task \ + traces/tasks/teardown-insert-task \ + traces/tasks/teardown-insert-tasklist \ + traces/tasks/teardown-list-task \ + traces/tasks/teardown-list-tasklist \ + traces/tasks/teardown-update-task \ + traces/tasks/teardown-update-tasklist \ + $(NULL) + +# Clang code coverage +DISTCLEANFILES += default.profraw + +-include $(top_srcdir)/git.mk diff --git a/gdata/tests/Makefile.in b/gdata/tests/Makefile.in new file mode 100644 index 0000000..73ee040 --- /dev/null +++ b/gdata/tests/Makefile.in @@ -0,0 +1,2020 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# GLIB - Library of useful C routines + + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +TESTS = $(am__EXEEXT_2) +installed_test_PROGRAMS = $(am__EXEEXT_5) +noinst_PROGRAMS = $(am__EXEEXT_6) +check_PROGRAMS = $(am__EXEEXT_4) +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_1 = $(all_test_ltlibs) +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_2 = $(all_test_programs) +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_3 = $(all_test_scripts) +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_4 = $(all_test_data) +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_5 = $(all_test_ltlibs) +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_6 = $(all_test_programs) +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_7 = $(all_test_scripts) +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_8 = $(all_test_data) +@ENABLE_INSTALLED_TESTS_TRUE@am__append_9 = $(test_programs) $(installed_test_programs) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(test_extra_programs) $(installed_test_extra_programs) + +@ENABLE_INSTALLED_TESTS_TRUE@am__append_10 = $(test_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(installed_test_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(test_extra_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(test_installed_extra_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(dist_test_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(dist_test_extra_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(dist_installed_test_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(dist_installed_test_extra_scripts) +@ENABLE_INSTALLED_TESTS_TRUE@am__append_11 = $(test_data) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(installed_test_data) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(dist_test_data) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(dist_installed_test_data) +@ENABLE_INSTALLED_TESTS_TRUE@am__append_12 = $(test_ltlibraries) $(installed_test_ltlibraries) +@ENABLE_INSTALLED_TESTS_TRUE@am__append_13 = $(installed_test_meta_DATA) +subdir = gdata/tests +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_append_link_flags.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_check_link_flag.m4 \ + $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_compiler_flags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_cflags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_cxxflags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_gir.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_ldflags.m4 \ + $(top_srcdir)/m4/ax_generate_changelog.m4 \ + $(top_srcdir)/m4/ax_is_release.m4 \ + $(top_srcdir)/m4/ax_require_defined.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(installed_testdir)" \ + "$(DESTDIR)$(installed_testdir)" \ + "$(DESTDIR)$(installed_testdir)" \ + "$(DESTDIR)$(installed_test_metadir)" \ + "$(DESTDIR)$(installed_testdir)" +LTLIBRARIES = $(installed_test_LTLIBRARIES) $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgdata_test_la_DEPENDENCIES = $(top_builddir)/gdata/libgdata.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__objects_1 = +am_libgdata_test_la_OBJECTS = common.lo gdata-dummy-authorizer.lo \ + $(am__objects_1) +libgdata_test_la_OBJECTS = $(am_libgdata_test_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am_libgdata_test_la_rpath = +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am_libgdata_test_la_rpath = +@ENABLE_INSTALLED_TESTS_TRUE@am_libgdata_test_la_rpath = -rpath \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(installed_testdir) +am__EXEEXT_1 = +am__EXEEXT_2 = buffer$(EXEEXT) general$(EXEEXT) calendar$(EXEEXT) \ + contacts$(EXEEXT) tasks$(EXEEXT) perf$(EXEEXT) \ + authorization$(EXEEXT) oauth1-authorizer$(EXEEXT) \ + oauth2-authorizer$(EXEEXT) streams$(EXEEXT) youtube$(EXEEXT) \ + $(am__EXEEXT_1) +am__EXEEXT_3 = $(am__EXEEXT_2) +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__EXEEXT_4 = $(am__EXEEXT_3) +@ENABLE_INSTALLED_TESTS_TRUE@am__EXEEXT_5 = $(am__EXEEXT_2) +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__EXEEXT_6 = $(am__EXEEXT_3) +PROGRAMS = $(installed_test_PROGRAMS) $(noinst_PROGRAMS) +authorization_SOURCES = authorization.c +authorization_OBJECTS = authorization.$(OBJEXT) +authorization_LDADD = $(LDADD) +authorization_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +buffer_SOURCES = buffer.c +buffer_OBJECTS = buffer.$(OBJEXT) +buffer_LDADD = $(LDADD) +buffer_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +calendar_SOURCES = calendar.c +calendar_OBJECTS = calendar.$(OBJEXT) +calendar_LDADD = $(LDADD) +calendar_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +contacts_SOURCES = contacts.c +contacts_OBJECTS = contacts.$(OBJEXT) +contacts_LDADD = $(LDADD) +contacts_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +general_SOURCES = general.c +general_OBJECTS = general.$(OBJEXT) +general_LDADD = $(LDADD) +general_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +oauth1_authorizer_SOURCES = oauth1-authorizer.c +oauth1_authorizer_OBJECTS = oauth1-authorizer.$(OBJEXT) +oauth1_authorizer_LDADD = $(LDADD) +oauth1_authorizer_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +oauth2_authorizer_SOURCES = oauth2-authorizer.c +oauth2_authorizer_OBJECTS = oauth2-authorizer.$(OBJEXT) +oauth2_authorizer_LDADD = $(LDADD) +oauth2_authorizer_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +perf_SOURCES = perf.c +perf_OBJECTS = perf.$(OBJEXT) +perf_LDADD = $(LDADD) +perf_DEPENDENCIES = libgdata-test.la $(top_builddir)/gdata/libgdata.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +streams_SOURCES = streams.c +streams_OBJECTS = streams.$(OBJEXT) +streams_LDADD = $(LDADD) +streams_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +tasks_SOURCES = tasks.c +tasks_OBJECTS = tasks.$(OBJEXT) +tasks_LDADD = $(LDADD) +tasks_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +youtube_SOURCES = youtube.c +youtube_OBJECTS = youtube.$(OBJEXT) +youtube_LDADD = $(LDADD) +youtube_DEPENDENCIES = libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +SCRIPTS = $(installed_test_SCRIPTS) $(noinst_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgdata_test_la_SOURCES) authorization.c buffer.c \ + calendar.c contacts.c general.c oauth1-authorizer.c \ + oauth2-authorizer.c perf.c streams.c tasks.c youtube.c +DIST_SOURCES = $(libgdata_test_la_SOURCES) authorization.c buffer.c \ + calendar.c contacts.c general.c oauth1-authorizer.c \ + oauth2-authorizer.c perf.c streams.c tasks.c youtube.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(installed_test_meta_DATA) $(nobase_installed_test_DATA) \ + $(noinst_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/test-driver $(top_srcdir)/glib-tap.mk +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_CFLAGS = \ + $(GDK_PIXBUF_CFLAGS) \ + $(WARN_CFLAGS) \ + $(GDATA_CFLAGS) \ + $(GNOME_CFLAGS) \ + $(UHTTPMOCK_CFLAGS) \ + $(NULL) + + +# Flags for the helper library and all test binaries +AM_CPPFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/gdata \ + -DG_LOG_DOMAIN=\"libgdata\" \ + $(DISABLE_DEPRECATED) \ + $(NULL) + +AM_CXXFLAGS = @AM_CXXFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_LDFLAGS = \ + $(WARN_LDFLAGS) \ + $(NULL) + +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_ALWAYS_BUILD_TESTS = @ENABLE_ALWAYS_BUILD_TESTS@ +ENABLE_INSTALLED_TESTS = @ENABLE_INSTALLED_TESTS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GDATA_API_VERSION = @GDATA_API_VERSION@ +GDATA_API_VERSION_MAJOR = @GDATA_API_VERSION_MAJOR@ +GDATA_API_VERSION_MINOR = @GDATA_API_VERSION_MINOR@ +GDATA_CFLAGS = @GDATA_CFLAGS@ +GDATA_LIBS = @GDATA_LIBS@ +GDATA_LT_VERSION = @GDATA_LT_VERSION@ +GDATA_PACKAGES = @GDATA_PACKAGES@ +GDATA_PACKAGES_PRIVATE = @GDATA_PACKAGES_PRIVATE@ +GDATA_PACKAGES_PUBLIC = @GDATA_PACKAGES_PUBLIC@ +GDATA_VERSION_MAJOR = @GDATA_VERSION_MAJOR@ +GDATA_VERSION_MICRO = @GDATA_VERSION_MICRO@ +GDATA_VERSION_MINOR = @GDATA_VERSION_MINOR@ +GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@ +GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@ +GENHTML = @GENHTML@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIT = @GIT@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GNOME_CFLAGS = @GNOME_CFLAGS@ +GNOME_LIBS = @GNOME_LIBS@ +GNOME_PACKAGES = @GNOME_PACKAGES@ +GNOME_PACKAGES_PRIVATE = @GNOME_PACKAGES_PRIVATE@ +GNOME_PACKAGES_PUBLIC = @GNOME_PACKAGES_PUBLIC@ +GOA_ENABLED = @GOA_ENABLED@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LCOV = @LCOV@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ +LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UHTTPMOCK_CFLAGS = @UHTTPMOCK_CFLAGS@ +UHTTPMOCK_LIBS = @UHTTPMOCK_LIBS@ +USE_NLS = @USE_NLS@ +VAPIGEN = @VAPIGEN@ +VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ +VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CXXFLAGS = @WARN_CXXFLAGS@ +WARN_LDFLAGS = @WARN_LDFLAGS@ +WARN_SCANNERFLAGS = @WARN_SCANNERFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TESTS_ENVIRONMENT = \ + G_TEST_SRCDIR="$(abs_srcdir)" \ + G_TEST_BUILDDIR="$(abs_builddir)" \ + G_DEBUG=gc-friendly \ + MALLOC_CHECK_=2 \ + MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) + +LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh +LOG_COMPILER = $(top_srcdir)/tap-test +NULL = + +# initialize variables for unconditional += appending +BUILT_SOURCES = +BUILT_EXTRA_DIST = +CLEANFILES = *.log *.trs $(am__append_13) + +# Clang code coverage +DISTCLEANFILES = default.profraw +MAINTAINERCLEANFILES = +EXTRA_DIST = $(all_dist_test_scripts) $(all_dist_test_data) +installed_test_LTLIBRARIES = $(am__append_12) +installed_test_SCRIPTS = $(am__append_10) +nobase_installed_test_DATA = $(am__append_11) +noinst_LTLIBRARIES = $(am__append_1) +noinst_SCRIPTS = $(am__append_3) +noinst_DATA = $(am__append_4) +check_LTLIBRARIES = $(am__append_5) +check_SCRIPTS = $(am__append_7) +check_DATA = $(am__append_8) + +# Note: build even the installed-only targets during 'make check' to ensure that they still work. +# We need to do a bit of trickery here and manage disting via EXTRA_DIST instead of using dist_ prefixes to +# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were +# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'. +all_test_programs = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \ + $(test_extra_programs) $(uninstalled_test_extra_programs) $(installed_test_extra_programs) + +all_test_scripts = $(test_scripts) $(uninstalled_test_scripts) \ + $(installed_test_scripts) $(test_extra_scripts) \ + $(uninstalled_test_extra_scripts) \ + $(installed_test_extra_scripts) $(all_dist_test_scripts) +all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) \ + $(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) $(dist_installed_test_extra_scripts) + +all_test_data = $(test_data) $(uninstalled_test_data) \ + $(installed_test_data) $(all_dist_test_data) +all_dist_test_data = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data) +all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries) +@ENABLE_INSTALLED_TESTS_TRUE@installed_testcases = $(test_programs) $(installed_test_programs) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(test_scripts) $(installed_test_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(dist_test_scripts) $(dist_installed_test_scripts) + +@ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test) +installed_testdir = $(libexecdir)/installed-tests/$(PACKAGE_TARNAME) +installed_test_metadir = $(datadir)/installed-tests/$(PACKAGE_TARNAME) + +# Helper library. +test_ltlibraries = libgdata-test.la +libgdata_test_la_SOURCES = \ + common.c \ + common.h \ + gdata-dummy-authorizer.c \ + gdata-dummy-authorizer.h \ + $(NULL) + +libgdata_test_la_LIBADD = \ + $(top_builddir)/gdata/libgdata.la \ + $(GDATA_LIBS) \ + $(UHTTPMOCK_LIBS) \ + $(NULL) + +LDADD = \ + libgdata-test.la \ + $(top_builddir)/gdata/libgdata.la \ + $(GDK_PIXBUF_LIBS) \ + $(GDATA_LIBS) \ + $(GNOME_LIBS) \ + $(UHTTPMOCK_LIBS) \ + $(NULL) + +test_programs = \ + buffer \ + general \ + calendar \ + contacts \ + tasks \ + perf \ + authorization \ + oauth1-authorizer \ + oauth2-authorizer \ + streams \ + youtube \ + $(NULL) + + +# FIXME: Temporarily disabled until they are ported for the changes in the v2 +# to v3 API transitions. +#all_test_programs += documents + +# PicasaWeb does not work since Google made the API read-only: +# https://developers.google.com/picasa-web/docs/3.0/releasenotes#picasa-is-retiring-february-12-2016 +#all_test_programs += picasaweb +dist_test_data = \ + photo.jpg \ + sample.ogg \ + test.doc \ + test.ods \ + test.odt \ + test.ppt \ + test.xls \ + test_updated.odt \ + test_updated_file.ppt \ + cert.pem \ + key.pem \ + \ + traces/calendar/access-rule-delete \ + traces/calendar/access-rule-get \ + traces/calendar/access-rule-insert \ + traces/calendar/access-rule-update \ + traces/calendar/authentication \ + traces/calendar/authentication-async \ + traces/calendar/authentication-async-cancellation \ + traces/calendar/event-insert \ + traces/calendar/event_insert-async \ + traces/calendar/event_insert-async-cancellation \ + traces/calendar/global-authentication \ + traces/calendar/query-all-calendars \ + traces/calendar/query_all_calendars-async \ + traces/calendar/query_all_calendars-async-cancellation \ + traces/calendar/query-all-calendars-async-progress-closure \ + traces/calendar/query-events \ + traces/calendar/query_events-async \ + traces/calendar/query_events-async-cancellation \ + traces/calendar/query-events-async-progress-closure \ + traces/calendar/query-own-calendars \ + traces/calendar/query_own_calendars-async \ + traces/calendar/query_own_calendars-async-cancellation \ + traces/calendar/query-own-calendars-async-progress-closure \ + traces/calendar/setup-query-calendars \ + traces/calendar/setup-query-events \ + traces/calendar/setup-temp-calendar \ + traces/calendar/setup-temp-calendar-acls \ + traces/calendar/teardown-insert-event \ + traces/calendar/teardown-query-calendars \ + traces/calendar/teardown-query-events \ + traces/calendar/teardown-temp-calendar \ + traces/calendar/teardown-temp-calendar-acls \ + \ + traces/contacts/authentication \ + traces/contacts/authentication-async \ + traces/contacts/authentication-async-cancellation \ + traces/contacts/batch \ + traces/contacts/batch-async \ + traces/contacts/batch-async-cancellation \ + traces/contacts/contact-insert \ + traces/contacts/contact-update \ + traces/contacts/global-authentication \ + traces/contacts/group-insert \ + traces/contacts/group_insert-async \ + traces/contacts/group_insert-async-cancellation \ + traces/contacts/photo-add \ + traces/contacts/photo_add-async \ + traces/contacts/photo_add-async-cancellation \ + traces/contacts/photo-delete \ + traces/contacts/photo_delete-async \ + traces/contacts/photo_delete-async-cancellation \ + traces/contacts/photo-get \ + traces/contacts/photo_get-async \ + traces/contacts/photo_get-async-cancellation \ + traces/contacts/query-all-contacts \ + traces/contacts/query_all_contacts-async \ + traces/contacts/query_all_contacts-async-cancellation \ + traces/contacts/query-all-contacts-async-progress-closure \ + traces/contacts/query-all-groups \ + traces/contacts/query_all_groups-async \ + traces/contacts/query_all_groups-async-cancellation \ + traces/contacts/query-all-groups-async-progress-closure \ + traces/contacts/setup-batch-async \ + traces/contacts/setup-query-all-contacts \ + traces/contacts/setup-query-all-groups \ + traces/contacts/setup-temp-contact \ + traces/contacts/setup-temp-contact-with-photo \ + traces/contacts/teardown-batch-async \ + traces/contacts/teardown-insert \ + traces/contacts/teardown-insert-group \ + traces/contacts/teardown-query-all-contacts \ + traces/contacts/teardown-query-all-groups \ + traces/contacts/teardown-temp-contact \ + \ + traces/documents/access-rule-insert \ + traces/documents/authentication \ + traces/documents/authentication-async \ + traces/documents/authentication-async-cancellation \ + traces/documents/batch \ + traces/documents/batch-async \ + traces/documents/batch-async-cancellation \ + traces/documents/copy-document \ + traces/documents/delete-document \ + traces/documents/delete-folder \ + traces/documents/download-document \ + traces/documents/folders-add-to-folder \ + traces/documents/folders_add_to_folder-async \ + traces/documents/folders_add_to_folder-async-cancellation \ + traces/documents/folders-remove-from-folder \ + traces/documents/folders_remove_from_folder-async \ + traces/documents/folders_remove_from_folder-async-cancellation \ + traces/documents/folders_remove_from_folder-async-epilogue \ + traces/documents/global-authentication \ + traces/documents/query-all-documents \ + traces/documents/query_all_documents-async \ + traces/documents/query_all_documents-async-cancellation \ + traces/documents/query-all-documents-async-progress-closure \ + traces/documents/query-all-documents-with-folder \ + traces/documents/setup-batch-async \ + traces/documents/setup-folders-add-to-folder \ + traces/documents/setup-folders-remove-from-folder \ + traces/documents/setup-temp-documents \ + traces/documents/setup-temp-document-spreadsheet \ + traces/documents/setup-temp-folder \ + traces/documents/setup-update-document_content-and-metadata-non-resumable \ + traces/documents/setup-update-document_content-and-metadata-resumable \ + traces/documents/setup-update-document_content-only-non-resumable \ + traces/documents/setup-update-document_content-only-resumable \ + traces/documents/setup-update-document_metadata-only-non-resumable \ + traces/documents/setup-upload-document_content-and-metadata-in-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-bin-no-convert \ + traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-odt-convert \ + traces/documents/setup-upload-document_content-and-metadata-in-folder-resumable-odt-no-convert \ + traces/documents/setup-upload-document_content-and-metadata-root-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-bin-no-convert \ + traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-odt-convert \ + traces/documents/setup-upload-document_content-and-metadata-root-folder-resumable-odt-no-convert \ + traces/documents/setup-upload-document_content-only-in-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_content-only-in-folder-resumable-bin-no-convert \ + traces/documents/setup-upload-document_content-only-in-folder-resumable-odt-convert \ + traces/documents/setup-upload-document_content-only-in-folder-resumable-odt-no-convert \ + traces/documents/setup-upload-document_content-only-root-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_content-only-root-folder-resumable-bin-no-convert \ + traces/documents/setup-upload-document_content-only-root-folder-resumable-odt-convert \ + traces/documents/setup-upload-document_content-only-root-folder-resumable-odt-no-convert \ + traces/documents/setup-upload-document_metadata-only-in-folder-non-resumable-odt-convert \ + traces/documents/setup-upload-document_metadata-only-root-folder-non-resumable-odt-convert \ + traces/documents/teardown-batch-async \ + traces/documents/teardown-copy-document \ + traces/documents/teardown-folders-add-to-folder \ + traces/documents/teardown-temp-document \ + traces/documents/teardown-temp-documents \ + traces/documents/teardown-temp-folder \ + traces/documents/teardown-update-document_content-and-metadata-non-resumable \ + traces/documents/teardown-update-document_content-and-metadata-resumable \ + traces/documents/teardown-update-document_content-only-non-resumable \ + traces/documents/teardown-update-document_content-only-resumable \ + traces/documents/teardown-update-document_metadata-only-non-resumable \ + traces/documents/teardown-upload-document_content-and-metadata-in-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-bin-no-convert \ + traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-and-metadata-in-folder-resumable-odt-no-convert \ + traces/documents/teardown-upload-document_content-and-metadata-root-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-bin-no-convert \ + traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-and-metadata-root-folder-resumable-odt-no-convert \ + traces/documents/teardown-upload-document_content-only-in-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-only-in-folder-resumable-bin-no-convert \ + traces/documents/teardown-upload-document_content-only-in-folder-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-only-in-folder-resumable-odt-no-convert \ + traces/documents/teardown-upload-document_content-only-root-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-only-root-folder-resumable-bin-no-convert \ + traces/documents/teardown-upload-document_content-only-root-folder-resumable-odt-convert \ + traces/documents/teardown-upload-document_content-only-root-folder-resumable-odt-no-convert \ + traces/documents/teardown-upload-document_metadata-only-in-folder-non-resumable-odt-convert \ + traces/documents/teardown-upload-document_metadata-only-root-folder-non-resumable-odt-convert \ + traces/documents/update_content-and-metadata-non-resumable \ + traces/documents/update_content-and-metadata-resumable \ + traces/documents/update_content-only-non-resumable \ + traces/documents/update_content-only-resumable \ + traces/documents/update_metadata-only-non-resumable \ + traces/documents/upload_content-and-metadata-in-folder-non-resumable-odt-convert \ + traces/documents/upload_content-and-metadata-in-folder-resumable-bin-no-convert \ + traces/documents/upload_content-and-metadata-in-folder-resumable-odt-convert \ + traces/documents/upload_content-and-metadata-in-folder-resumable-odt-no-convert \ + traces/documents/upload_content-and-metadata-root-folder-non-resumable-odt-convert \ + traces/documents/upload_content-and-metadata-root-folder-resumable-bin-no-convert \ + traces/documents/upload_content-and-metadata-root-folder-resumable-odt-convert \ + traces/documents/upload_content-and-metadata-root-folder-resumable-odt-no-convert \ + traces/documents/upload_content-only-in-folder-non-resumable-odt-convert \ + traces/documents/upload_content-only-in-folder-resumable-bin-no-convert \ + traces/documents/upload_content-only-in-folder-resumable-odt-convert \ + traces/documents/upload_content-only-in-folder-resumable-odt-no-convert \ + traces/documents/upload_content-only-root-folder-non-resumable-odt-convert \ + traces/documents/upload_content-only-root-folder-resumable-bin-no-convert \ + traces/documents/upload_content-only-root-folder-resumable-odt-convert \ + traces/documents/upload_content-only-root-folder-resumable-odt-no-convert \ + traces/documents/upload_metadata-only-in-folder-non-resumable-odt-convert \ + traces/documents/upload_metadata-only-root-folder-non-resumable-odt-convert \ + \ + traces/oauth1-authorizer/oauth1-authorizer-interactive-data-bad-credentials \ + traces/oauth1-authorizer/oauth1-authorizer-refresh-authorization \ + traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-async \ + traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-async-cancellation \ + traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-sync \ + traces/oauth1-authorizer/oauth1-authorizer-request-authentication-uri-sync-cancellation \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async-bad-credentials \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-async-cancellation \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync-bad-credentials \ + traces/oauth1-authorizer/oauth1-authorizer-request-authorization-sync-cancellation \ + traces/oauth1-authorizer/setup-oauth1-authorizer-data-authenticated \ + traces/oauth1-authorizer/setup-oauth1-authorizer-interactive-data \ + \ + traces/oauth2-authorizer/oauth2-authorizer-refresh-authorization-authorized \ + traces/oauth2-authorizer/oauth2-authorizer-refresh-authorization-unauthorized \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async-bad-credentials \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-async-cancellation \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync-bad-credentials \ + traces/oauth2-authorizer/oauth2-authorizer-request-authorization-sync-cancellation \ + traces/oauth2-authorizer/setup-oauth2-authorizer-data-authenticated \ + \ + traces/picasaweb/authentication \ + traces/picasaweb/authentication-async \ + traces/picasaweb/authentication-async-cancellation \ + traces/picasaweb/comment-delete \ + traces/picasaweb/comment_delete-async \ + traces/picasaweb/comment_delete-async-cancellation \ + traces/picasaweb/comment-insert \ + traces/picasaweb/comment_insert-async \ + traces/picasaweb/comment_insert-async-cancellation \ + traces/picasaweb/comment-query \ + traces/picasaweb/comment_query-async \ + traces/picasaweb/comment_query-async-cancellation \ + traces/picasaweb/comment-query-async-progress-closure \ + traces/picasaweb/download-photo \ + traces/picasaweb/download-thumbnails \ + traces/picasaweb/global-authentication \ + traces/picasaweb/insert-album \ + traces/picasaweb/insert_album-async \ + traces/picasaweb/insert_album-async-cancellation \ + traces/picasaweb/query-all-albums \ + traces/picasaweb/query_all_albums-async \ + traces/picasaweb/query_all_albums-async-cancellation \ + traces/picasaweb/query-all-albums-async-progress-closure \ + traces/picasaweb/query-all-albums-with-limits \ + traces/picasaweb/query-files \ + traces/picasaweb/query_files-async \ + traces/picasaweb/query_files-async-cancellation \ + traces/picasaweb/query-files-async-progress-closure \ + traces/picasaweb/query-files-single \ + traces/picasaweb/query-user \ + traces/picasaweb/query_user-async \ + traces/picasaweb/query_user-async-cancellation \ + traces/picasaweb/query_user_by_username-async \ + traces/picasaweb/query_user_by_username-async-cancellation \ + traces/picasaweb/setup-query-all-albums \ + traces/picasaweb/setup-query-comments \ + traces/picasaweb/setup-query-files \ + traces/picasaweb/setup-upload \ + traces/picasaweb/teardown-insert-album \ + traces/picasaweb/teardown-insert-comment \ + traces/picasaweb/teardown-query-all-albums \ + traces/picasaweb/teardown-query-comments \ + traces/picasaweb/teardown-query-files \ + traces/picasaweb/teardown-upload \ + traces/picasaweb/upload-default-album \ + traces/picasaweb/upload_default_album-async \ + traces/picasaweb/upload_default_album-async-cancellation \ + \ + traces/youtube/authentication \ + traces/youtube/authentication-async \ + traces/youtube/authentication-async-cancellation \ + traces/youtube/batch \ + traces/youtube/batch-async \ + traces/youtube/batch-async-cancellation \ + traces/youtube/categories \ + traces/youtube/categories-async \ + traces/youtube/categories-async-cancellation \ + traces/youtube/comment-delete \ + traces/youtube/comment_delete-async \ + traces/youtube/comment_delete-async-cancellation \ + traces/youtube/comment-insert \ + traces/youtube/comment_insert-async \ + traces/youtube/comment_insert-async-cancellation \ + traces/youtube/comment-query \ + traces/youtube/comment_query-async \ + traces/youtube/comment_query-async-cancellation \ + traces/youtube/comment-query-async-progress-closure \ + traces/youtube/global-authentication \ + traces/youtube/query-related \ + traces/youtube/query_related-async \ + traces/youtube/query_related-async-cancellation \ + traces/youtube/query-related-async-progress-closure \ + traces/youtube/query-single \ + traces/youtube/query_single-async \ + traces/youtube/query_single-async-cancellation \ + traces/youtube/query-standard-feed \ + traces/youtube/query_standard_feed-async \ + traces/youtube/query_standard_feed-async-cancellation \ + traces/youtube/query-standard-feed-async-progress-closure \ + traces/youtube/query-standard-feeds \ + traces/youtube/query-standard-feed-with-query \ + traces/youtube/setup-batch \ + traces/youtube/setup-comment \ + traces/youtube/setup-insert-comment \ + traces/youtube/teardown-insert-comment \ + traces/youtube/teardown-upload \ + traces/youtube/upload-async \ + traces/youtube/upload-async-cancellation \ + traces/youtube/upload-simple \ + \ + traces/tasks/authentication \ + traces/tasks/global-authentication \ + traces/tasks/setup-delete-task \ + traces/tasks/setup-delete-tasklist \ + traces/tasks/setup-insert-task \ + traces/tasks/setup-list-task \ + traces/tasks/setup-list-tasklist \ + traces/tasks/setup-update-task \ + traces/tasks/setup-update-tasklist \ + traces/tasks/task-delete \ + traces/tasks/task-insert \ + traces/tasks/task-list \ + traces/tasks/tasklist-delete \ + traces/tasks/tasklist-insert \ + traces/tasks/tasklist-insert-unauthorised \ + traces/tasks/tasklist-list \ + traces/tasks/tasklist-update \ + traces/tasks/task-update \ + traces/tasks/teardown-delete-task \ + traces/tasks/teardown-insert-task \ + traces/tasks/teardown-insert-tasklist \ + traces/tasks/teardown-list-task \ + traces/tasks/teardown-list-tasklist \ + traces/tasks/teardown-update-task \ + traces/tasks/teardown-update-tasklist \ + $(NULL) + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/glib-tap.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gdata/tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu gdata/tests/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/glib-tap.mk $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkLTLIBRARIES: + -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) + @list='$(check_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +install-installed_testLTLIBRARIES: $(installed_test_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(installed_test_LTLIBRARIES)'; test -n "$(installed_testdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(installed_testdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(installed_testdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(installed_testdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(installed_testdir)"; \ + } + +uninstall-installed_testLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(installed_test_LTLIBRARIES)'; test -n "$(installed_testdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(installed_testdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(installed_testdir)/$$f"; \ + done + +clean-installed_testLTLIBRARIES: + -test -z "$(installed_test_LTLIBRARIES)" || rm -f $(installed_test_LTLIBRARIES) + @list='$(installed_test_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgdata-test.la: $(libgdata_test_la_OBJECTS) $(libgdata_test_la_DEPENDENCIES) $(EXTRA_libgdata_test_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libgdata_test_la_rpath) $(libgdata_test_la_OBJECTS) $(libgdata_test_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-installed_testPROGRAMS: $(installed_test_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(installed_test_PROGRAMS)'; test -n "$(installed_testdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(installed_testdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(installed_testdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(installed_testdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(installed_testdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-installed_testPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(installed_test_PROGRAMS)'; test -n "$(installed_testdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(installed_testdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(installed_testdir)" && rm -f $$files + +clean-installed_testPROGRAMS: + @list='$(installed_test_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +authorization$(EXEEXT): $(authorization_OBJECTS) $(authorization_DEPENDENCIES) $(EXTRA_authorization_DEPENDENCIES) + @rm -f authorization$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(authorization_OBJECTS) $(authorization_LDADD) $(LIBS) + +buffer$(EXEEXT): $(buffer_OBJECTS) $(buffer_DEPENDENCIES) $(EXTRA_buffer_DEPENDENCIES) + @rm -f buffer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(buffer_OBJECTS) $(buffer_LDADD) $(LIBS) + +calendar$(EXEEXT): $(calendar_OBJECTS) $(calendar_DEPENDENCIES) $(EXTRA_calendar_DEPENDENCIES) + @rm -f calendar$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(calendar_OBJECTS) $(calendar_LDADD) $(LIBS) + +contacts$(EXEEXT): $(contacts_OBJECTS) $(contacts_DEPENDENCIES) $(EXTRA_contacts_DEPENDENCIES) + @rm -f contacts$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(contacts_OBJECTS) $(contacts_LDADD) $(LIBS) + +general$(EXEEXT): $(general_OBJECTS) $(general_DEPENDENCIES) $(EXTRA_general_DEPENDENCIES) + @rm -f general$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(general_OBJECTS) $(general_LDADD) $(LIBS) + +oauth1-authorizer$(EXEEXT): $(oauth1_authorizer_OBJECTS) $(oauth1_authorizer_DEPENDENCIES) $(EXTRA_oauth1_authorizer_DEPENDENCIES) + @rm -f oauth1-authorizer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oauth1_authorizer_OBJECTS) $(oauth1_authorizer_LDADD) $(LIBS) + +oauth2-authorizer$(EXEEXT): $(oauth2_authorizer_OBJECTS) $(oauth2_authorizer_DEPENDENCIES) $(EXTRA_oauth2_authorizer_DEPENDENCIES) + @rm -f oauth2-authorizer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oauth2_authorizer_OBJECTS) $(oauth2_authorizer_LDADD) $(LIBS) + +perf$(EXEEXT): $(perf_OBJECTS) $(perf_DEPENDENCIES) $(EXTRA_perf_DEPENDENCIES) + @rm -f perf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(perf_OBJECTS) $(perf_LDADD) $(LIBS) + +streams$(EXEEXT): $(streams_OBJECTS) $(streams_DEPENDENCIES) $(EXTRA_streams_DEPENDENCIES) + @rm -f streams$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(streams_OBJECTS) $(streams_LDADD) $(LIBS) + +tasks$(EXEEXT): $(tasks_OBJECTS) $(tasks_DEPENDENCIES) $(EXTRA_tasks_DEPENDENCIES) + @rm -f tasks$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tasks_OBJECTS) $(tasks_LDADD) $(LIBS) + +youtube$(EXEEXT): $(youtube_OBJECTS) $(youtube_DEPENDENCIES) $(EXTRA_youtube_DEPENDENCIES) + @rm -f youtube$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(youtube_OBJECTS) $(youtube_LDADD) $(LIBS) +install-installed_testSCRIPTS: $(installed_test_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(installed_test_SCRIPTS)'; test -n "$(installed_testdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(installed_testdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(installed_testdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(installed_testdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(installed_testdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-installed_testSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(installed_test_SCRIPTS)'; test -n "$(installed_testdir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(installed_testdir)'; $(am__uninstall_files_from_dir) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authorization.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calendar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contacts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdata-dummy-authorizer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/general.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oauth1-authorizer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oauth2-authorizer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/streams.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tasks.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/youtube.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-installed_test_metaDATA: $(installed_test_meta_DATA) + @$(NORMAL_INSTALL) + @list='$(installed_test_meta_DATA)'; test -n "$(installed_test_metadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(installed_test_metadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(installed_test_metadir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(installed_test_metadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(installed_test_metadir)" || exit $$?; \ + done + +uninstall-installed_test_metaDATA: + @$(NORMAL_UNINSTALL) + @list='$(installed_test_meta_DATA)'; test -n "$(installed_test_metadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(installed_test_metadir)'; $(am__uninstall_files_from_dir) +install-nobase_installed_testDATA: $(nobase_installed_test_DATA) + @$(NORMAL_INSTALL) + @list='$(nobase_installed_test_DATA)'; test -n "$(installed_testdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(installed_testdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(installed_testdir)" || exit 1; \ + fi; \ + $(am__nobase_list) | while read dir files; do \ + xfiles=; for file in $$files; do \ + if test -f "$$file"; then xfiles="$$xfiles $$file"; \ + else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ + test -z "$$xfiles" || { \ + test "x$$dir" = x. || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(installed_testdir)/$$dir'"; \ + $(MKDIR_P) "$(DESTDIR)$(installed_testdir)/$$dir"; }; \ + echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(installed_testdir)/$$dir'"; \ + $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(installed_testdir)/$$dir" || exit $$?; }; \ + done + +uninstall-nobase_installed_testDATA: + @$(NORMAL_UNINSTALL) + @list='$(nobase_installed_test_DATA)'; test -n "$(installed_testdir)" || list=; \ + $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ + dir='$(DESTDIR)$(installed_testdir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_LTLIBRARIES) $(check_PROGRAMS) $(check_SCRIPTS) $(check_DATA) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +buffer.log: buffer$(EXEEXT) + @p='buffer$(EXEEXT)'; \ + b='buffer'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +general.log: general$(EXEEXT) + @p='general$(EXEEXT)'; \ + b='general'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +calendar.log: calendar$(EXEEXT) + @p='calendar$(EXEEXT)'; \ + b='calendar'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +contacts.log: contacts$(EXEEXT) + @p='contacts$(EXEEXT)'; \ + b='contacts'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tasks.log: tasks$(EXEEXT) + @p='tasks$(EXEEXT)'; \ + b='tasks'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +perf.log: perf$(EXEEXT) + @p='perf$(EXEEXT)'; \ + b='perf'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +authorization.log: authorization$(EXEEXT) + @p='authorization$(EXEEXT)'; \ + b='authorization'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +oauth1-authorizer.log: oauth1-authorizer$(EXEEXT) + @p='oauth1-authorizer$(EXEEXT)'; \ + b='oauth1-authorizer'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +oauth2-authorizer.log: oauth2-authorizer$(EXEEXT) + @p='oauth2-authorizer$(EXEEXT)'; \ + b='oauth2-authorizer'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +streams.log: streams$(EXEEXT) + @p='streams$(EXEEXT)'; \ + b='streams'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +youtube.log: youtube$(EXEEXT) + @p='youtube$(EXEEXT)'; \ + b='youtube'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS) \ + $(check_SCRIPTS) $(check_DATA) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(installed_test_metadir)" "$(DESTDIR)$(installed_testdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \ + clean-installed_testLTLIBRARIES clean-installed_testPROGRAMS \ + clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-installed_testLTLIBRARIES \ + install-installed_testPROGRAMS install-installed_testSCRIPTS \ + install-installed_test_metaDATA \ + install-nobase_installed_testDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-installed_testLTLIBRARIES \ + uninstall-installed_testPROGRAMS \ + uninstall-installed_testSCRIPTS \ + uninstall-installed_test_metaDATA \ + uninstall-nobase_installed_testDATA + +.MAKE: all check check-am install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ + clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \ + clean-installed_testLTLIBRARIES clean-installed_testPROGRAMS \ + clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-installed_testLTLIBRARIES \ + install-installed_testPROGRAMS install-installed_testSCRIPTS \ + install-installed_test_metaDATA install-man \ + install-nobase_installed_testDATA install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-installed_testLTLIBRARIES \ + uninstall-installed_testPROGRAMS \ + uninstall-installed_testSCRIPTS \ + uninstall-installed_test_metaDATA \ + uninstall-nobase_installed_testDATA + +.PRECIOUS: Makefile + + +@ENABLE_INSTALLED_TESTS_TRUE@%.test: %$(EXEEXT) Makefile +@ENABLE_INSTALLED_TESTS_TRUE@ $(AM_V_GEN) (echo '[Test]' > $@.tmp; \ +@ENABLE_INSTALLED_TESTS_TRUE@ echo 'Type=session' >> $@.tmp; \ +@ENABLE_INSTALLED_TESTS_TRUE@ echo 'Exec=$(installed_testdir)/$(notdir $<) --tap' >> $@.tmp; \ +@ENABLE_INSTALLED_TESTS_TRUE@ echo 'Output=TAP' >> $@.tmp; \ +@ENABLE_INSTALLED_TESTS_TRUE@ mv $@.tmp $@) + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gdata/tests/authorization.c b/gdata/tests/authorization.c new file mode 100644 index 0000000..61e49e4 --- /dev/null +++ b/gdata/tests/authorization.c @@ -0,0 +1,793 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2011 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#include +#include +#include + +#include "common.h" + +/* Used as common "testing domains" to simplify test code. */ +static GDataAuthorizationDomain *test_domain1 = NULL; +static GDataAuthorizationDomain *test_domain2 = NULL; + +static void +test_authorization_domain_properties (void) +{ + GDataAuthorizationDomain *domain; + gchar *service_name, *scope; + + /* NOTE: It's not expected that client code will normally get hold of GDataAuthorizationDomain instances this way. + * This is just for testing purposes. */ + domain = GDATA_AUTHORIZATION_DOMAIN (g_object_new (GDATA_TYPE_AUTHORIZATION_DOMAIN, + "service-name", "service-name", + "scope", "scope", + NULL)); + + g_assert_cmpstr (gdata_authorization_domain_get_service_name (domain), ==, "service-name"); + g_assert_cmpstr (gdata_authorization_domain_get_scope (domain), ==, "scope"); + + g_object_get (domain, + "service-name", &service_name, + "scope", &scope, + NULL); + + g_assert_cmpstr (service_name, ==, "service-name"); + g_assert_cmpstr (scope, ==, "scope"); + + g_free (service_name); + g_free (scope); +} + +/* Simple implementation of GDataAuthorizer for test purposes */ +#define TYPE_SIMPLE_AUTHORIZER (simple_authorizer_get_type ()) +#define SIMPLE_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SIMPLE_TYPE_AUTHORIZER, SimpleAuthorizer)) +#define SIMPLE_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SIMPLE_TYPE_AUTHORIZER, SimpleAuthorizerClass)) +#define IS_SIMPLE_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SIMPLE_TYPE_AUTHORIZER)) +#define IS_SIMPLE_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SIMPLE_TYPE_AUTHORIZER)) +#define SIMPLE_AUTHORIZER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), SIMPLE_TYPE_AUTHORIZER, SimpleAuthorizerClass)) + +typedef struct { + GObject parent; +} SimpleAuthorizer; + +typedef struct { + GObjectClass parent; +} SimpleAuthorizerClass; + +static GType simple_authorizer_get_type (void) G_GNUC_CONST; +static void simple_authorizer_authorizer_init (GDataAuthorizerInterface *iface); + +G_DEFINE_TYPE_WITH_CODE (SimpleAuthorizer, simple_authorizer, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_AUTHORIZER, simple_authorizer_authorizer_init)) + +static void +simple_authorizer_class_init (SimpleAuthorizerClass *klass) +{ + /* Nothing to see here */ +} + +static void +simple_authorizer_init (SimpleAuthorizer *self) +{ + /* Nothing to see here */ +} + +static void +simple_authorizer_process_request (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message) +{ + SoupURI *test_uri; + + /* Check that the domain and message are as expected */ + g_assert (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain)); + if (domain != NULL) { + g_assert_cmpstr (gdata_authorization_domain_get_scope (domain), ==, "scope1"); + } + + g_assert (message != NULL); + g_assert (SOUP_IS_MESSAGE (message)); + test_uri = soup_uri_new ("http://example.com/"); + g_assert (soup_uri_equal (soup_message_get_uri (message), test_uri) == TRUE); + soup_uri_free (test_uri); + + /* Check that this is the first time we've touched the message, and if so, flag the message as touched */ + if (domain != NULL) { + g_assert (soup_message_headers_get_one (message->request_headers, "process_request") == NULL); + soup_message_headers_append (message->request_headers, "process_request", "1"); + } else { + soup_message_headers_append (message->request_headers, "process_request_null", "1"); + } +} + +static gboolean +simple_authorizer_is_authorized_for_domain (GDataAuthorizer *self, GDataAuthorizationDomain *domain) +{ + gboolean is_test_domain1, is_test_domain2; + + /* Check that the domain is as expected */ + g_assert (domain != NULL); + g_assert (GDATA_IS_AUTHORIZATION_DOMAIN (domain)); + + is_test_domain1 = (strcmp (gdata_authorization_domain_get_scope (domain), "scope1") == 0) ? TRUE : FALSE; + is_test_domain2 = (strcmp (gdata_authorization_domain_get_scope (domain), "scope2") == 0) ? TRUE : FALSE; + + g_assert (is_test_domain1 == TRUE || is_test_domain2 == TRUE); + + /* Increment the counter on the domain so we know if this function's been called more than once on each domain */ + g_object_set_data (G_OBJECT (domain), "counter", GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (domain), "counter")) + 1)); + + /* Only authorise test_domain1 */ + return is_test_domain1; +} + +static void +simple_authorizer_authorizer_init (GDataAuthorizerInterface *iface) +{ + iface->process_request = simple_authorizer_process_request; + iface->is_authorized_for_domain = simple_authorizer_is_authorized_for_domain; +} + +/* Normal implementation of GDataAuthorizer for test purposes */ +#define TYPE_NORMAL_AUTHORIZER (normal_authorizer_get_type ()) +#define NORMAL_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NORMAL_TYPE_AUTHORIZER, NormalAuthorizer)) +#define NORMAL_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NORMAL_TYPE_AUTHORIZER, NormalAuthorizerClass)) +#define IS_NORMAL_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NORMAL_TYPE_AUTHORIZER)) +#define IS_NORMAL_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NORMAL_TYPE_AUTHORIZER)) +#define NORMAL_AUTHORIZER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NORMAL_TYPE_AUTHORIZER, NormalAuthorizerClass)) + +typedef struct { + GObject parent; +} NormalAuthorizer; + +typedef struct { + GObjectClass parent; +} NormalAuthorizerClass; + +static GType normal_authorizer_get_type (void) G_GNUC_CONST; +static void normal_authorizer_authorizer_init (GDataAuthorizerInterface *iface); + +G_DEFINE_TYPE_WITH_CODE (NormalAuthorizer, normal_authorizer, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_AUTHORIZER, normal_authorizer_authorizer_init)) + +static void +normal_authorizer_class_init (NormalAuthorizerClass *klass) +{ + /* Nothing to see here */ +} + +static void +normal_authorizer_init (NormalAuthorizer *self) +{ + /* Nothing to see here */ +} + +static gboolean +normal_authorizer_refresh_authorization (GDataAuthorizer *self, GCancellable *cancellable, GError **error) +{ + /* Check the inputs */ + g_assert (GDATA_IS_AUTHORIZER (self)); + g_assert (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_assert (error == NULL || *error == NULL); + + /* Increment the counter on the authorizer so we know if this function's been called more than once */ + g_object_set_data (G_OBJECT (self), "counter", GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (self), "counter")) + 1)); + + /* If we're instructed to set an error, do so (with an arbitrary error code) */ + if (g_object_get_data (G_OBJECT (self), "error") != NULL) { + g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, "Error message"); + return FALSE; + } + + return TRUE; +} + +static void +normal_authorizer_authorizer_init (GDataAuthorizerInterface *iface) +{ + /* Use the same implementation as SimpleAuthorizer for process_request() and is_authorized_for_domain(). */ + iface->process_request = simple_authorizer_process_request; + iface->is_authorized_for_domain = simple_authorizer_is_authorized_for_domain; + + /* Unlike SimpleAuthorizer, also implement refresh_authorization() (but not the async versions). */ + iface->refresh_authorization = normal_authorizer_refresh_authorization; +} + +/* Complex implementation of GDataAuthorizer for test purposes */ +#define TYPE_COMPLEX_AUTHORIZER (complex_authorizer_get_type ()) +#define COMPLEX_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), COMPLEX_TYPE_AUTHORIZER, ComplexAuthorizer)) +#define COMPLEX_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), COMPLEX_TYPE_AUTHORIZER, ComplexAuthorizerClass)) +#define IS_COMPLEX_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), COMPLEX_TYPE_AUTHORIZER)) +#define IS_COMPLEX_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), COMPLEX_TYPE_AUTHORIZER)) +#define COMPLEX_AUTHORIZER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), COMPLEX_TYPE_AUTHORIZER, ComplexAuthorizerClass)) + +typedef struct { + GObject parent; +} ComplexAuthorizer; + +typedef struct { + GObjectClass parent; +} ComplexAuthorizerClass; + +static GType complex_authorizer_get_type (void) G_GNUC_CONST; +static void complex_authorizer_authorizer_init (GDataAuthorizerInterface *iface); + +G_DEFINE_TYPE_WITH_CODE (ComplexAuthorizer, complex_authorizer, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_AUTHORIZER, complex_authorizer_authorizer_init)) + +static void +complex_authorizer_class_init (ComplexAuthorizerClass *klass) +{ + /* Nothing to see here */ +} + +static void +complex_authorizer_init (ComplexAuthorizer *self) +{ + /* Nothing to see here */ +} + +static void +complex_authorizer_refresh_authorization_async (GDataAuthorizer *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +{ + g_autoptr(GTask) task = NULL; + g_autoptr(GError) error = NULL; + + /* Check the inputs */ + g_assert (GDATA_IS_AUTHORIZER (self)); + g_assert (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_source_tag (task, complex_authorizer_refresh_authorization_async); + + /* Increment the async counter on the authorizer so we know if this function's been called more than once */ + g_object_set_data (G_OBJECT (self), "async-counter", + GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (self), "async-counter")) + 1)); + + if (g_cancellable_set_error_if_cancelled (cancellable, &error) == TRUE) { + /* Handle cancellation */ + g_task_return_error (task, g_steal_pointer (&error)); + } else if (g_object_get_data (G_OBJECT (self), "error") != NULL) { + /* If we're instructed to set an error, do so (with an arbitrary error code) */ + g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NETWORK_ERROR, "%s", "Error message"); + } else { + g_task_return_boolean (task, TRUE); + } +} + +static gboolean +complex_authorizer_refresh_authorization_finish (GDataAuthorizer *self, GAsyncResult *async_result, GError **error) +{ + /* Check the inputs */ + g_assert (GDATA_IS_AUTHORIZER (self)); + g_assert (G_IS_ASYNC_RESULT (async_result)); + g_assert (error == NULL || *error == NULL); + g_assert (g_task_is_valid (async_result, self)); + g_assert (g_async_result_is_tagged (async_result, complex_authorizer_refresh_authorization_async)); + + /* Assert that the async function's already been called (once) */ + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (self), "async-counter")), ==, 1); + + /* Increment the finish counter on the authorizer so we know if this function's been called more than once */ + g_object_set_data (G_OBJECT (self), "finish-counter", + GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (self), "finish-counter")) + 1)); + + return g_task_propagate_boolean (G_TASK (async_result), error); +} + +static void +complex_authorizer_authorizer_init (GDataAuthorizerInterface *iface) +{ + /* Use the same implementation as SimpleAuthorizer/NormalAuthorizer for process_request(), is_authorized_for_domain() and + * refresh_authorization(). */ + iface->process_request = simple_authorizer_process_request; + iface->is_authorized_for_domain = simple_authorizer_is_authorized_for_domain; + iface->refresh_authorization = normal_authorizer_refresh_authorization; + + /* Unlike NormalAuthorizer, also implement the async versions of refresh_authorization(). */ + iface->refresh_authorization_async = complex_authorizer_refresh_authorization_async; + iface->refresh_authorization_finish = complex_authorizer_refresh_authorization_finish; +} + +/* Testing data for generic GDataAuthorizer interface tests */ +typedef struct { + GDataAuthorizer *authorizer; +} AuthorizerData; + +static void +set_up_simple_authorizer_data (AuthorizerData *data, gconstpointer user_data) +{ + data->authorizer = GDATA_AUTHORIZER (g_object_new (TYPE_SIMPLE_AUTHORIZER, NULL)); +} + +static void +set_up_normal_authorizer_data (AuthorizerData *data, gconstpointer user_data) +{ + data->authorizer = GDATA_AUTHORIZER (g_object_new (TYPE_NORMAL_AUTHORIZER, NULL)); +} + +static void +set_up_complex_authorizer_data (AuthorizerData *data, gconstpointer user_data) +{ + data->authorizer = GDATA_AUTHORIZER (g_object_new (TYPE_COMPLEX_AUTHORIZER, NULL)); +} + +static void +tear_down_authorizer_data (AuthorizerData *data, gconstpointer user_data) +{ + g_object_unref (data->authorizer); +} + +/* Test that calling gdata_authorizer_process_request() happens correctly */ +static void +test_authorizer_process_request (AuthorizerData *data, gconstpointer user_data) +{ + SoupMessage *message; + + message = soup_message_new (SOUP_METHOD_GET, "http://example.com/"); + + gdata_authorizer_process_request (data->authorizer, test_domain1, message); + g_assert_cmpstr (soup_message_headers_get_one (message->request_headers, "process_request"), ==, "1"); + g_assert (soup_message_headers_get_one (message->request_headers, "process_request_null") == NULL); + + g_object_unref (message); +} + +/* Test that calling gdata_authorizer_process_request() happens correctly for a NULL domain */ +static void +test_authorizer_process_request_null (AuthorizerData *data, gconstpointer user_data) +{ + SoupMessage *message; + + message = soup_message_new (SOUP_METHOD_GET, "http://example.com/"); + + gdata_authorizer_process_request (data->authorizer, NULL, message); + g_assert (soup_message_headers_get_one (message->request_headers, "process_request") == NULL); + g_assert_cmpstr (soup_message_headers_get_one (message->request_headers, "process_request_null"), ==, "1"); + + g_object_unref (message); +} + +/* Test that calling gdata_authorizer_is_authorized_for_domain() happens correctly */ +static void +test_authorizer_is_authorized_for_domain (AuthorizerData *data, gconstpointer user_data) +{ + /* Set some counters on the test domains to check that the interface implementation is only called once per domain */ + g_object_set_data (G_OBJECT (test_domain1), "counter", GUINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (test_domain2), "counter", GUINT_TO_POINTER (0)); + + g_assert (gdata_authorizer_is_authorized_for_domain (data->authorizer, test_domain1) == TRUE); + g_assert (gdata_authorizer_is_authorized_for_domain (data->authorizer, test_domain2) == FALSE); + + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (test_domain1), "counter")), ==, 1); + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (test_domain2), "counter")), ==, 1); +} + +/* Test that calling gdata_authorizer_is_authorized_for_domain() with a NULL authorizer always returns FALSE */ +static void +test_authorizer_is_authorized_for_domain_null (AuthorizerData *data, gconstpointer user_data) +{ + g_assert (gdata_authorizer_is_authorized_for_domain (NULL, test_domain1) == FALSE); + g_assert (gdata_authorizer_is_authorized_for_domain (NULL, test_domain2) == FALSE); +} + +/* Test that calling refresh_authorization() on an authorizer which implements it returns TRUE without error, and only calls the implementation + * once */ +static void +test_authorizer_refresh_authorization (AuthorizerData *data, gconstpointer user_data) +{ + gboolean success; + GError *error = NULL; + + /* Set a counter on the authoriser to check that the interface implementation is only called once */ + g_object_set_data (G_OBJECT (data->authorizer), "counter", GUINT_TO_POINTER (0)); + + success = gdata_authorizer_refresh_authorization (data->authorizer, NULL, &error); + g_assert_no_error (error); + g_assert (success == TRUE); + g_clear_error (&error); + + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "counter")), ==, 1); +} + +/* Test that calling refresh_authorization() on an authorizer which implements it with errors returns FALSE with an error, and only calls the + * implementation once */ +static void +test_authorizer_refresh_authorization_error (AuthorizerData *data, gconstpointer user_data) +{ + gboolean success; + GError *error = NULL; + + /* Set a counter on the authoriser to check that the interface implementation is only called once */ + g_object_set_data (G_OBJECT (data->authorizer), "counter", GUINT_TO_POINTER (0)); + + /* Set a flag on the authoriser to make the NormalAuthorizer implementation return an error for refresh_authorization() */ + g_object_set_data (G_OBJECT (data->authorizer), "error", GUINT_TO_POINTER (TRUE)); + + success = gdata_authorizer_refresh_authorization (data->authorizer, NULL, &error); + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR); + g_assert (success == FALSE); + g_clear_error (&error); + + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "counter")), ==, 1); +} + +/* Test that calling refresh_authorization() on an authorizer which doesn't implement it returns FALSE without an error */ +static void +test_authorizer_refresh_authorization_unimplemented (AuthorizerData *data, gconstpointer user_data) +{ + gboolean success; + GError *error = NULL; + + success = gdata_authorizer_refresh_authorization (data->authorizer, NULL, &error); + g_assert_no_error (error); + g_assert (success == FALSE); + g_clear_error (&error); +} + +/* Test that calling refresh_authorization() on an authorizer which doesn't implement it, then cancelling the call returns FALSE without an error + * (not even a cancellation error) */ +static void +test_authorizer_refresh_authorization_cancellation_unimplemented (AuthorizerData *data, gconstpointer user_data) +{ + GCancellable *cancellable; + gboolean success; + GError *error = NULL; + + cancellable = g_cancellable_new (); + g_cancellable_cancel (cancellable); + + success = gdata_authorizer_refresh_authorization (data->authorizer, cancellable, &error); + g_assert_no_error (error); + g_assert (success == FALSE); + g_clear_error (&error); + + g_object_unref (cancellable); +} + +/* Set of standard async callback functions for refresh_authorization_async() which check various combinations of success and error value */ +static void +test_authorizer_refresh_authorization_async_success_no_error_cb (GDataAuthorizer *authorizer, GAsyncResult *async_result, GMainLoop *main_loop) +{ + gboolean success; + GError *error = NULL; + + success = gdata_authorizer_refresh_authorization_finish (authorizer, async_result, &error); + g_assert_no_error (error); + g_assert (success == TRUE); + g_clear_error (&error); + + g_main_loop_quit (main_loop); +} + +static void +test_authorizer_refresh_authorization_async_failure_no_error_cb (GDataAuthorizer *authorizer, GAsyncResult *async_result, GMainLoop *main_loop) +{ + gboolean success; + GError *error = NULL; + + success = gdata_authorizer_refresh_authorization_finish (authorizer, async_result, &error); + g_assert_no_error (error); + g_assert (success == FALSE); + g_clear_error (&error); + + g_main_loop_quit (main_loop); +} + +static void +test_authorizer_refresh_authorization_async_network_error_cb (GDataAuthorizer *authorizer, GAsyncResult *async_result, GMainLoop *main_loop) +{ + gboolean success; + GError *error = NULL; + + success = gdata_authorizer_refresh_authorization_finish (authorizer, async_result, &error); + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NETWORK_ERROR); + g_assert (success == FALSE); + g_clear_error (&error); + + g_main_loop_quit (main_loop); +} + +static void +test_authorizer_refresh_authorization_async_protocol_error_cb (GDataAuthorizer *authorizer, GAsyncResult *async_result, GMainLoop *main_loop) +{ + gboolean success; + GError *error = NULL; + + success = gdata_authorizer_refresh_authorization_finish (authorizer, async_result, &error); + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR); + g_assert (success == FALSE); + g_clear_error (&error); + + g_main_loop_quit (main_loop); +} + +static void +test_authorizer_refresh_authorization_async_cancelled_error_cb (GDataAuthorizer *authorizer, GAsyncResult *async_result, GMainLoop *main_loop) +{ + gboolean success; + GError *error = NULL; + + success = gdata_authorizer_refresh_authorization_finish (authorizer, async_result, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); + g_assert (success == FALSE); + g_clear_error (&error); + + g_main_loop_quit (main_loop); +} + +/* Test that calling refresh_authorization_async() on an authorizer which implements it returns TRUE without an error */ +static void +test_authorizer_refresh_authorization_async (AuthorizerData *data, gconstpointer user_data) +{ + GMainLoop *main_loop; + + /* Set counters on the authoriser to check that the interface implementations are only called once */ + g_object_set_data (G_OBJECT (data->authorizer), "counter", GUINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (data->authorizer), "async-counter", GUINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (data->authorizer), "finish-counter", GUINT_TO_POINTER (0)); + + main_loop = g_main_loop_new (NULL, FALSE); + + gdata_authorizer_refresh_authorization_async (data->authorizer, NULL, + (GAsyncReadyCallback) test_authorizer_refresh_authorization_async_success_no_error_cb, + main_loop); + + g_main_loop_run (main_loop); + + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "counter")), ==, 0); + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "async-counter")), ==, 1); + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "finish-counter")), ==, 1); + + g_main_loop_unref (main_loop); +} + +/* Test that calling refresh_authorization_async() on an authorizer which implements it with an error returns FALSE with the appropriate error */ +static void +test_authorizer_refresh_authorization_async_error (AuthorizerData *data, gconstpointer user_data) +{ + GMainLoop *main_loop; + + /* Set counters on the authoriser to check that the interface implementations are only called once */ + g_object_set_data (G_OBJECT (data->authorizer), "counter", GUINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (data->authorizer), "async-counter", GUINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (data->authorizer), "finish-counter", GUINT_TO_POINTER (0)); + + /* Set a flag on the authoriser to make the ComplexAuthorizer implementation return an error for refresh_authorization_async() */ + g_object_set_data (G_OBJECT (data->authorizer), "error", GUINT_TO_POINTER (TRUE)); + + main_loop = g_main_loop_new (NULL, FALSE); + + gdata_authorizer_refresh_authorization_async (data->authorizer, NULL, + (GAsyncReadyCallback) test_authorizer_refresh_authorization_async_network_error_cb, main_loop); + + g_main_loop_run (main_loop); + + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "counter")), ==, 0); + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "async-counter")), ==, 1); + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "finish-counter")), ==, 1); + + g_main_loop_unref (main_loop); +} + +/* Test that calling refresh_authorization_async() on an authorizer which implements it, then cancelling the call returns FALSE with a cancellation + * error */ +static void +test_authorizer_refresh_authorization_async_cancellation (AuthorizerData *data, gconstpointer user_data) +{ + GCancellable *cancellable; + GMainLoop *main_loop; + + /* Set counters on the authoriser to check that the interface implementations are only called once */ + g_object_set_data (G_OBJECT (data->authorizer), "counter", GUINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (data->authorizer), "async-counter", GUINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (data->authorizer), "finish-counter", GUINT_TO_POINTER (0)); + + main_loop = g_main_loop_new (NULL, FALSE); + + cancellable = g_cancellable_new (); + g_cancellable_cancel (cancellable); + + gdata_authorizer_refresh_authorization_async (data->authorizer, cancellable, + (GAsyncReadyCallback) test_authorizer_refresh_authorization_async_cancelled_error_cb, + main_loop); + + g_main_loop_run (main_loop); + + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "counter")), ==, 0); + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "async-counter")), ==, 1); + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "finish-counter")), ==, 1); + + g_object_unref (cancellable); + g_main_loop_unref (main_loop); +} + +/* Test that calling refresh_authorization_async() on an authorizer which doesn't implement it, but does implement refresh_authorization(), returns + * TRUE without an error */ +static void +test_authorizer_refresh_authorization_async_simulated (AuthorizerData *data, gconstpointer user_data) +{ + GMainLoop *main_loop; + + /* Set a counter on the authoriser to check that the interface implementation is only called once */ + g_object_set_data (G_OBJECT (data->authorizer), "counter", GUINT_TO_POINTER (0)); + + main_loop = g_main_loop_new (NULL, FALSE); + + gdata_authorizer_refresh_authorization_async (data->authorizer, NULL, + (GAsyncReadyCallback) test_authorizer_refresh_authorization_async_success_no_error_cb, + main_loop); + + g_main_loop_run (main_loop); + + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "counter")), ==, 1); + + g_main_loop_unref (main_loop); +} + +/* Test that calling refresh_authorization_async() on an authorizer which doesn't implement it, but does implement refresh_authorization() with an + * error, returns FALSE with the appropriate error */ +static void +test_authorizer_refresh_authorization_async_error_simulated (AuthorizerData *data, gconstpointer user_data) +{ + GMainLoop *main_loop; + + /* Set a counter on the authoriser to check that the interface implementation is only called once */ + g_object_set_data (G_OBJECT (data->authorizer), "counter", GUINT_TO_POINTER (0)); + + /* Set a flag on the authoriser to make the NormalAuthorizer implementation return an error for refresh_authorization() */ + g_object_set_data (G_OBJECT (data->authorizer), "error", GUINT_TO_POINTER (TRUE)); + + main_loop = g_main_loop_new (NULL, FALSE); + + gdata_authorizer_refresh_authorization_async (data->authorizer, NULL, + (GAsyncReadyCallback) test_authorizer_refresh_authorization_async_protocol_error_cb, main_loop); + + g_main_loop_run (main_loop); + + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->authorizer), "counter")), ==, 1); + + g_main_loop_unref (main_loop); +} + +/* Test that calling refresh_authorization_async() on an authorizer which doesn't implement it, but does implement refresh_authorization(), then + * cancelling the call returns FALSE with a cancellation error */ +static void +test_authorizer_refresh_authorization_async_cancellation_simulated (AuthorizerData *data, gconstpointer user_data) +{ + GCancellable *cancellable; + GMainLoop *main_loop; + + main_loop = g_main_loop_new (NULL, FALSE); + + cancellable = g_cancellable_new (); + g_cancellable_cancel (cancellable); + + /* Note we don't count how many times the implementation of refresh_authorization() is called, since cancellation can legitimately be + * handled by the gdata_authorizer_refresh_authorization_async() code before refresh_authorization() is ever called. */ + gdata_authorizer_refresh_authorization_async (data->authorizer, cancellable, + (GAsyncReadyCallback) test_authorizer_refresh_authorization_async_cancelled_error_cb, + main_loop); + + g_main_loop_run (main_loop); + + g_object_unref (cancellable); + g_main_loop_unref (main_loop); +} + +/* Test that calling refresh_authorization_async() on an authorizer which doesn't implement it returns FALSE without an error */ +static void +test_authorizer_refresh_authorization_async_unimplemented (AuthorizerData *data, gconstpointer user_data) +{ + GMainLoop *main_loop; + + main_loop = g_main_loop_new (NULL, FALSE); + + gdata_authorizer_refresh_authorization_async (data->authorizer, NULL, + (GAsyncReadyCallback) test_authorizer_refresh_authorization_async_failure_no_error_cb, + main_loop); + + g_main_loop_run (main_loop); + + g_main_loop_unref (main_loop); +} + +/* Test that calling refresh_authorization_async() on an authorizer which doesn't implement it, then cancelling the call returns FALSE without an + * error (not even a cancellation error) */ +static void +test_authorizer_refresh_authorization_async_cancellation_unimplemented (AuthorizerData *data, gconstpointer user_data) +{ + GCancellable *cancellable; + GMainLoop *main_loop; + + main_loop = g_main_loop_new (NULL, FALSE); + + cancellable = g_cancellable_new (); + g_cancellable_cancel (cancellable); + + gdata_authorizer_refresh_authorization_async (data->authorizer, cancellable, + (GAsyncReadyCallback) test_authorizer_refresh_authorization_async_failure_no_error_cb, + main_loop); + + g_main_loop_run (main_loop); + + g_object_unref (cancellable); + g_main_loop_unref (main_loop); +} + +int +main (int argc, char *argv[]) +{ + int retval; + + gdata_test_init (argc, argv); + + /* Note: This is not how GDataAuthorizationDomains are meant to be constructed. Client code is not expected to do this. */ + test_domain1 = g_object_new (GDATA_TYPE_AUTHORIZATION_DOMAIN, + "service-name", "service-name1", + "scope", "scope1", + NULL); + test_domain2 = g_object_new (GDATA_TYPE_AUTHORIZATION_DOMAIN, + "service-name", "service-name2", + "scope", "scope2", + NULL); + + /* GDataAuthorizationDomain tests */ + g_test_add_func ("/authorization-domain/properties", test_authorization_domain_properties); + + /* GDataAuthorizer interface tests */ + g_test_add ("/authorizer/process-request", AuthorizerData, NULL, set_up_simple_authorizer_data, test_authorizer_process_request, + tear_down_authorizer_data); + g_test_add ("/authorizer/process-request/null", AuthorizerData, NULL, set_up_simple_authorizer_data, test_authorizer_process_request_null, + tear_down_authorizer_data); + g_test_add ("/authorizer/is-authorized-for-domain", AuthorizerData, NULL, set_up_simple_authorizer_data, + test_authorizer_is_authorized_for_domain, tear_down_authorizer_data); + g_test_add ("/authorizer/is-authorized-for-domain/null", AuthorizerData, NULL, set_up_simple_authorizer_data, + test_authorizer_is_authorized_for_domain_null, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization", AuthorizerData, NULL, set_up_normal_authorizer_data, + test_authorizer_refresh_authorization, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/error", AuthorizerData, NULL, set_up_normal_authorizer_data, + test_authorizer_refresh_authorization_error, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/unimplemented", AuthorizerData, NULL, set_up_simple_authorizer_data, + test_authorizer_refresh_authorization_unimplemented, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/cancellation/unimplemented", AuthorizerData, NULL, set_up_simple_authorizer_data, + test_authorizer_refresh_authorization_cancellation_unimplemented, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/async", AuthorizerData, NULL, set_up_complex_authorizer_data, + test_authorizer_refresh_authorization_async, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/async/error", AuthorizerData, NULL, set_up_complex_authorizer_data, + test_authorizer_refresh_authorization_async_error, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/async/cancellation", AuthorizerData, NULL, set_up_complex_authorizer_data, + test_authorizer_refresh_authorization_async_cancellation, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/async/simulated", AuthorizerData, NULL, set_up_normal_authorizer_data, + test_authorizer_refresh_authorization_async_simulated, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/async/error/simulated", AuthorizerData, NULL, set_up_normal_authorizer_data, + test_authorizer_refresh_authorization_async_error_simulated, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/async/cancellation/simulated", AuthorizerData, NULL, set_up_normal_authorizer_data, + test_authorizer_refresh_authorization_async_cancellation_simulated, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/async/unimplemented", AuthorizerData, NULL, set_up_simple_authorizer_data, + test_authorizer_refresh_authorization_async_unimplemented, tear_down_authorizer_data); + g_test_add ("/authorizer/refresh-authorization/async/cancellation/unimplemented", AuthorizerData, NULL, set_up_simple_authorizer_data, + test_authorizer_refresh_authorization_async_cancellation_unimplemented, tear_down_authorizer_data); + + retval = g_test_run (); + + g_object_unref (test_domain2); + g_object_unref (test_domain1); + + return retval; +} diff --git a/gdata/tests/buffer.c b/gdata/tests/buffer.c new file mode 100644 index 0000000..c4e9d13 --- /dev/null +++ b/gdata/tests/buffer.c @@ -0,0 +1,165 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2016 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#include "config.h" + +#include +#include + +#include "gdata.h" +#include "common.h" + +/* gdata-buffer.h is private, so just include the C file for easy testing. */ +#include "gdata-buffer.c" + + +typedef struct { + gpointer unused; +} Fixture; + + +static void +set_up (Fixture *f, gconstpointer user_data) +{ + /* Abort if we end up blocking. */ + alarm (30); +} + +static void +tear_down (Fixture *f, gconstpointer user_data) +{ + /* Reset the alarm. */ + alarm (0); +} + +static void +test_buffer_construction (Fixture *f, gconstpointer user_data) +{ + GDataBuffer *buffer = NULL; /* owned */ + + buffer = gdata_buffer_new (); + gdata_buffer_free (buffer); +} + +static void +test_buffer_instant_eof (Fixture *f, gconstpointer user_data) +{ + GDataBuffer *buffer = NULL; /* owned */ + gboolean reached_eof = FALSE; + guint8 buf[1]; + + buffer = gdata_buffer_new (); + + g_assert_false (gdata_buffer_push_data (buffer, NULL, 0)); + g_assert_cmpuint (gdata_buffer_pop_data (buffer, buf, sizeof (buf), + &reached_eof, NULL), ==, 0); + g_assert_true (reached_eof); + + gdata_buffer_free (buffer); +} + +static gpointer +test_buffer_thread_eof_func (gpointer user_data) +{ + GDataBuffer *buffer = user_data; + + /* HACK: Wait for a while to be sure that gdata_buffer_pop_data() has + * been already called. */ + g_usleep (G_USEC_PER_SEC / 2); + + g_assert_false (gdata_buffer_push_data (buffer, NULL, 0)); + + return NULL; +} + +/* The test needs to call gdata_buffer_push_data() from another thread only + * once gdata_buffer_pop_data() has reached its blocking loop. */ +static void +test_buffer_thread_eof (Fixture *f, gconstpointer user_data) +{ + GDataBuffer *buffer = NULL; /* owned */ + gboolean reached_eof = FALSE; + guint8 buf[1]; + + g_test_bug ("769727"); + + buffer = gdata_buffer_new (); + + g_thread_new (NULL, test_buffer_thread_eof_func, buffer); + g_assert_cmpuint (gdata_buffer_pop_data (buffer, buf, sizeof (buf), + &reached_eof, NULL), ==, 0); + g_assert_true (reached_eof); + + gdata_buffer_free (buffer); +} + +static void +test_buffer_basic (Fixture *f, gconstpointer user_data) +{ + GDataBuffer *buffer = NULL; /* owned */ + gboolean reached_eof = FALSE; + guint8 buf[100]; + guint8 buf2[100]; + gsize i; + + buffer = gdata_buffer_new (); + + for (i = 0; i < sizeof (buf); i++) + buf[i] = i; + + g_assert_true (gdata_buffer_push_data (buffer, buf, sizeof (buf))); + g_assert_false (gdata_buffer_push_data (buffer, NULL, 0)); + + g_assert_cmpuint (gdata_buffer_pop_data (buffer, buf2, + sizeof (buf2) / 2, + &reached_eof, NULL), ==, + sizeof (buf2) / 2); + g_assert_false (reached_eof); + g_assert_cmpuint (gdata_buffer_pop_data (buffer, + buf2 + sizeof (buf2) / 2, + sizeof (buf2) / 2, + &reached_eof, NULL), ==, + sizeof (buf2) / 2); + g_assert_true (reached_eof); + + for (i = 0; i < sizeof (buf); i++) + g_assert_cmpuint (buf[i], ==, buf2[i]); + + gdata_buffer_free (buffer); +} + +int +main (int argc, char *argv[]) +{ + gdata_test_init (argc, argv); + + /* Only print out headers, since we're sending a lot of data. */ + g_setenv ("LIBGDATA_DEBUG", "2" /* GDATA_LOG_HEADERS */, TRUE); + + g_test_add ("/buffer/construction", Fixture, NULL, + set_up, test_buffer_construction, tear_down); + g_test_add ("/buffer/instant-eof", Fixture, NULL, + set_up, test_buffer_instant_eof, tear_down); + g_test_add ("/buffer/thread-eof", Fixture, NULL, + set_up, test_buffer_thread_eof, tear_down); + g_test_add ("/buffer/basic", Fixture, NULL, + set_up, test_buffer_basic, tear_down); + + return g_test_run (); +} diff --git a/gdata/tests/calendar.c b/gdata/tests/calendar.c new file mode 100644 index 0000000..4d70d1b --- /dev/null +++ b/gdata/tests/calendar.c @@ -0,0 +1,1595 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2010, 2014, 2015, 2017 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#include +#include +#include + +#include "gdata.h" +#include "common.h" +#include "gdata-dummy-authorizer.h" + +static UhmServer *mock_server = NULL; + +#undef CLIENT_ID /* from common.h */ + +#define CLIENT_ID "352818697630-nqu2cmt5quqd6lr17ouoqmb684u84l1f.apps.googleusercontent.com" +#define CLIENT_SECRET "-fA4pHQJxR3zJ-FyAMPQsikg" +#define REDIRECT_URI "urn:ietf:wg:oauth:2.0:oob" + +typedef struct { + GDataCalendarCalendar *calendar; +} TempCalendarData; + +static void +set_up_temp_calendar (TempCalendarData *data, gconstpointer service) +{ + GDataCalendarCalendar *calendar; + GDataColor colour; + + gdata_test_mock_server_start_trace (mock_server, "setup-temp-calendar"); + + g_assert (gdata_color_from_hexadecimal ("#7A367A", &colour) == TRUE); + + /* Create a single temporary test calendar */ + calendar = gdata_calendar_calendar_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (calendar), "Temp Test Calendar"); + gdata_calendar_calendar_set_color (calendar, &colour); + data->calendar = GDATA_CALENDAR_CALENDAR (gdata_service_insert_entry (GDATA_SERVICE (service), + gdata_calendar_service_get_primary_authorization_domain (), + "https://www.googleapis.com/calendar/v3/calendars", + GDATA_ENTRY (calendar), NULL, NULL)); + g_assert (GDATA_IS_CALENDAR_CALENDAR (data->calendar)); + g_object_unref (calendar); + + uhm_server_end_trace (mock_server); +} + +static void +tear_down_temp_calendar (TempCalendarData *data, gconstpointer service) +{ + gdata_test_mock_server_start_trace (mock_server, "teardown-temp-calendar"); + + /* Delete the calendar */ + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->calendar), NULL, NULL) == TRUE); + g_object_unref (data->calendar); + + uhm_server_end_trace (mock_server); +} + +static void +test_authentication (void) +{ + GDataOAuth2Authorizer *authorizer = NULL; /* owned */ + gchar *authentication_uri, *authorisation_code; + + gdata_test_mock_server_start_trace (mock_server, "authentication"); + + authorizer = gdata_oauth2_authorizer_new (CLIENT_ID, CLIENT_SECRET, + REDIRECT_URI, + GDATA_TYPE_CALENDAR_SERVICE); + + /* Get an authentication URI. */ + authentication_uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, NULL, FALSE); + g_assert (authentication_uri != NULL); + + /* Get the authorisation code off the user. */ + if (uhm_server_get_enable_online (mock_server)) { + authorisation_code = gdata_test_query_user_for_verifier (authentication_uri); + } else { + /* Hard coded, extracted from the trace file. */ + authorisation_code = g_strdup ("4/OEX-S1iMbOA_dOnNgUlSYmGWh3TK.QrR73axcNMkWoiIBeO6P2m_su7cwkQI"); + } + + g_free (authentication_uri); + + if (authorisation_code == NULL) { + /* Skip tests. */ + goto skip_test; + } + + /* Authorise the token */ + g_assert (gdata_oauth2_authorizer_request_authorization (authorizer, authorisation_code, NULL, NULL) == TRUE); + + /* Check all is as it should be */ + g_assert (gdata_authorizer_is_authorized_for_domain (GDATA_AUTHORIZER (authorizer), + gdata_calendar_service_get_primary_authorization_domain ()) == TRUE); + +skip_test: + g_free (authorisation_code); + g_object_unref (authorizer); + + uhm_server_end_trace (mock_server); +} + +typedef struct { + GDataCalendarCalendar *calendar1; + GDataCalendarCalendar *calendar2; +} QueryCalendarsData; + +static void +set_up_query_calendars (QueryCalendarsData *data, gconstpointer service) +{ + GDataCalendarCalendar *calendar; + GDataColor colour; + + gdata_test_mock_server_start_trace (mock_server, "setup-query-calendars"); + + g_assert (gdata_color_from_hexadecimal ("#7A367A", &colour) == TRUE); + + /* Create some new calendars for queries */ + calendar = gdata_calendar_calendar_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (calendar), "Test Calendar 1"); + gdata_calendar_calendar_set_color (calendar, &colour); + data->calendar1 = GDATA_CALENDAR_CALENDAR (gdata_service_insert_entry (GDATA_SERVICE (service), + gdata_calendar_service_get_primary_authorization_domain (), + "https://www.googleapis.com/calendar/v3/calendars", + GDATA_ENTRY (calendar), NULL, NULL)); + g_assert (GDATA_IS_CALENDAR_CALENDAR (data->calendar1)); + g_object_unref (calendar); + + calendar = gdata_calendar_calendar_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (calendar), "Test Calendar 2"); + gdata_calendar_calendar_set_color (calendar, &colour); + data->calendar2 = GDATA_CALENDAR_CALENDAR (gdata_service_insert_entry (GDATA_SERVICE (service), + gdata_calendar_service_get_primary_authorization_domain (), + "https://www.googleapis.com/calendar/v3/calendars", + GDATA_ENTRY (calendar), NULL, NULL)); + g_assert (GDATA_IS_CALENDAR_CALENDAR (data->calendar2)); + g_object_unref (calendar); + + uhm_server_end_trace (mock_server); +} + +static void +tear_down_query_calendars (QueryCalendarsData *data, gconstpointer service) +{ + gdata_test_mock_server_start_trace (mock_server, "teardown-query-calendars"); + + /* Delete the calendars */ + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->calendar1), NULL, NULL) == TRUE); + g_object_unref (data->calendar1); + + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->calendar2), NULL, NULL) == TRUE); + g_object_unref (data->calendar2); + + uhm_server_end_trace (mock_server); +} + +static void +test_query_all_calendars (QueryCalendarsData *data, gconstpointer service) +{ + GDataFeed *feed; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "query-all-calendars"); + + feed = gdata_calendar_service_query_all_calendars (GDATA_CALENDAR_SERVICE (service), NULL, NULL, NULL, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CALENDAR_FEED (feed)); + g_clear_error (&error); + + /* TODO: check entries and feed properties */ + + g_object_unref (feed); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_CLOSURE_FUNCTIONS (query_calendars, QueryCalendarsData); + +GDATA_ASYNC_TEST_FUNCTIONS (query_all_calendars, QueryCalendarsData, +G_STMT_START { + gdata_calendar_service_query_all_calendars_async (GDATA_CALENDAR_SERVICE (service), NULL, cancellable, NULL, + NULL, NULL, async_ready_callback, async_data); +} G_STMT_END, +G_STMT_START { + GDataFeed *feed; + + feed = gdata_service_query_finish (GDATA_SERVICE (obj), async_result, &error); + + if (error == NULL) { + /* TODO: Tests? */ + g_assert (GDATA_IS_CALENDAR_FEED (feed)); + + g_object_unref (feed); + } else { + g_assert (feed == NULL); + } +} G_STMT_END); + +static void +test_query_all_calendars_async_progress_closure (QueryCalendarsData *query_data, gconstpointer service) +{ + GDataAsyncProgressClosure *data = g_slice_new0 (GDataAsyncProgressClosure); + + gdata_test_mock_server_start_trace (mock_server, "query-all-calendars-async-progress-closure"); + + data->main_loop = g_main_loop_new (NULL, TRUE); + + gdata_calendar_service_query_all_calendars_async (GDATA_CALENDAR_SERVICE (service), NULL, NULL, + (GDataQueryProgressCallback) gdata_test_async_progress_callback, + data, (GDestroyNotify) gdata_test_async_progress_closure_free, + (GAsyncReadyCallback) gdata_test_async_progress_finish_callback, data); + + g_main_loop_run (data->main_loop); + g_main_loop_unref (data->main_loop); + + /* Check that both callbacks were called exactly once */ + g_assert_cmpuint (data->progress_destroy_notify_count, ==, 1); + g_assert_cmpuint (data->async_ready_notify_count, ==, 1); + + g_slice_free (GDataAsyncProgressClosure, data); + + uhm_server_end_trace (mock_server); +} + +static void +test_query_own_calendars (QueryCalendarsData *data, gconstpointer service) +{ + GDataFeed *feed; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "query-own-calendars"); + + feed = gdata_calendar_service_query_own_calendars (GDATA_CALENDAR_SERVICE (service), NULL, NULL, NULL, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CALENDAR_FEED (feed)); + g_clear_error (&error); + + /* TODO: check entries and feed properties */ + + g_object_unref (feed); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_TEST_FUNCTIONS (query_own_calendars, QueryCalendarsData, +G_STMT_START { + gdata_calendar_service_query_own_calendars_async (GDATA_CALENDAR_SERVICE (service), NULL, cancellable, NULL, + NULL, NULL, async_ready_callback, async_data); +} G_STMT_END, +G_STMT_START { + GDataFeed *feed; + + feed = gdata_service_query_finish (GDATA_SERVICE (obj), async_result, &error); + + if (error == NULL) { + g_assert (GDATA_IS_CALENDAR_FEED (feed)); + /* TODO: Tests? */ + + g_object_unref (feed); + } else { + g_assert (feed == NULL); + } +} G_STMT_END); + +static void +test_query_own_calendars_async_progress_closure (QueryCalendarsData *query_data, gconstpointer service) +{ + GDataAsyncProgressClosure *data = g_slice_new0 (GDataAsyncProgressClosure); + + gdata_test_mock_server_start_trace (mock_server, "query-own-calendars-async-progress-closure"); + + data->main_loop = g_main_loop_new (NULL, TRUE); + + gdata_calendar_service_query_own_calendars_async (GDATA_CALENDAR_SERVICE (service), NULL, NULL, + (GDataQueryProgressCallback) gdata_test_async_progress_callback, + data, (GDestroyNotify) gdata_test_async_progress_closure_free, + (GAsyncReadyCallback) gdata_test_async_progress_finish_callback, data); + + g_main_loop_run (data->main_loop); + g_main_loop_unref (data->main_loop); + + /* Check that both callbacks were called exactly once */ + g_assert_cmpuint (data->progress_destroy_notify_count, ==, 1); + g_assert_cmpuint (data->async_ready_notify_count, ==, 1); + + g_slice_free (GDataAsyncProgressClosure, data); + + uhm_server_end_trace (mock_server); +} + +typedef struct { + TempCalendarData parent; + GDataCalendarEvent *event1; + GDataCalendarEvent *event2; + GDataCalendarEvent *event3; +} QueryEventsData; + +static void +set_up_query_events (QueryEventsData *data, gconstpointer service) +{ + GDataCalendarEvent *event; + GDataGDWhen *when; + GError *error = NULL; + + /* Set up a temporary calendar */ + set_up_temp_calendar ((TempCalendarData*) data, service); + + gdata_test_mock_server_start_trace (mock_server, "setup-query-events"); + + /* Add some test events to it */ + event = gdata_calendar_event_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (event), "Test Event 1"); + + when = gdata_gd_when_new (1419113727, 1419113728, FALSE); + gdata_calendar_event_add_time (event, when); + g_object_unref (when); + + data->event1 = gdata_calendar_service_insert_calendar_event (GDATA_CALENDAR_SERVICE (service), data->parent.calendar, event, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CALENDAR_EVENT (data->event1)); + g_object_unref (event); + + event = gdata_calendar_event_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (event), "Test Event 2"); + + when = gdata_gd_when_new (1419113000, 1419114000, FALSE); + gdata_calendar_event_add_time (event, when); + g_object_unref (when); + + data->event2 = gdata_calendar_service_insert_calendar_event (GDATA_CALENDAR_SERVICE (service), data->parent.calendar, event, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CALENDAR_EVENT (data->event2)); + g_object_unref (event); + + event = gdata_calendar_event_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (event), "Test Event 3"); + + when = gdata_gd_when_new (1419110000, 1419120000, TRUE); + gdata_calendar_event_add_time (event, when); + g_object_unref (when); + + data->event3 = gdata_calendar_service_insert_calendar_event (GDATA_CALENDAR_SERVICE (service), data->parent.calendar, event, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CALENDAR_EVENT (data->event3)); + g_object_unref (event); + + uhm_server_end_trace (mock_server); +} + +static void +tear_down_query_events (QueryEventsData *data, gconstpointer service) +{ + gdata_test_mock_server_start_trace (mock_server, "teardown-query-events"); + + /* Delete the events */ + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->event1), NULL, NULL) == TRUE); + g_object_unref (data->event1); + + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->event2), NULL, NULL) == TRUE); + g_object_unref (data->event2); + + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->event3), NULL, NULL) == TRUE); + g_object_unref (data->event3); + + uhm_server_end_trace (mock_server); + + /* Delete the calendar */ + tear_down_temp_calendar ((TempCalendarData*) data, service); +} + +static void +test_query_events (QueryEventsData *data, gconstpointer service) +{ + GDataFeed *feed; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "query-events"); + + /* Get the entry feed */ + feed = gdata_calendar_service_query_events (GDATA_CALENDAR_SERVICE (service), data->parent.calendar, NULL, NULL, NULL, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CALENDAR_FEED (feed)); + g_clear_error (&error); + + /* TODO: check entries and feed properties */ + + g_object_unref (feed); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_CLOSURE_FUNCTIONS (query_events, QueryEventsData); + +GDATA_ASYNC_TEST_FUNCTIONS (query_events, QueryEventsData, +G_STMT_START { + gdata_calendar_service_query_events_async (GDATA_CALENDAR_SERVICE (service), data->parent.calendar, NULL, cancellable, NULL, NULL, NULL, + async_ready_callback, async_data); +} G_STMT_END, +G_STMT_START { + GDataFeed *feed; + + feed = gdata_service_query_finish (GDATA_SERVICE (obj), async_result, &error); + + if (error == NULL) { + g_assert (GDATA_IS_CALENDAR_FEED (feed)); + + g_object_unref (feed); + } else { + g_assert (feed == NULL); + } +} G_STMT_END); + +static void +test_query_events_async_progress_closure (QueryEventsData *query_data, gconstpointer service) +{ + GDataAsyncProgressClosure *data = g_slice_new0 (GDataAsyncProgressClosure); + + gdata_test_mock_server_start_trace (mock_server, "query-events-async-progress-closure"); + + data->main_loop = g_main_loop_new (NULL, TRUE); + + gdata_calendar_service_query_events_async (GDATA_CALENDAR_SERVICE (service), query_data->parent.calendar, NULL, NULL, + (GDataQueryProgressCallback) gdata_test_async_progress_callback, + data, (GDestroyNotify) gdata_test_async_progress_closure_free, + (GAsyncReadyCallback) gdata_test_async_progress_finish_callback, data); + + g_main_loop_run (data->main_loop); + g_main_loop_unref (data->main_loop); + + /* Check that both callbacks were called exactly once */ + g_assert_cmpuint (data->progress_destroy_notify_count, ==, 1); + g_assert_cmpuint (data->async_ready_notify_count, ==, 1); + + g_slice_free (GDataAsyncProgressClosure, data); + + uhm_server_end_trace (mock_server); +} + +typedef struct { + TempCalendarData parent; + GDataCalendarEvent *new_event; +} InsertEventData; + +static void +set_up_insert_event (InsertEventData *data, gconstpointer service) +{ + set_up_temp_calendar ((TempCalendarData*) data, service); + data->new_event = NULL; +} + +static void +tear_down_insert_event (InsertEventData *data, gconstpointer service) +{ + gdata_test_mock_server_start_trace (mock_server, "teardown-insert-event"); + + /* Delete the new event */ + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->new_event), NULL, NULL) == TRUE); + g_object_unref (data->new_event); + + uhm_server_end_trace (mock_server); + + /* Delete the calendar too */ + tear_down_temp_calendar ((TempCalendarData*) data, service); +} + +static void +test_event_insert (InsertEventData *data, gconstpointer service) +{ + GDataCalendarEvent *event, *new_event; + GDataGDWhere *where; + GDataGDWho *who; + GDataGDWhen *when; + GTimeVal start_time, end_time; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "event-insert"); + + event = gdata_calendar_event_new (NULL); + + gdata_entry_set_title (GDATA_ENTRY (event), "Tennis with Beth"); + gdata_entry_set_content (GDATA_ENTRY (event), "Meet for a quick lesson."); + gdata_calendar_event_set_transparency (event, GDATA_GD_EVENT_TRANSPARENCY_OPAQUE); + gdata_calendar_event_set_status (event, GDATA_GD_EVENT_STATUS_CONFIRMED); + where = gdata_gd_where_new (NULL, "Rolling Lawn Courts", NULL); + gdata_calendar_event_add_place (event, where); + g_object_unref (where); + who = gdata_gd_who_new (GDATA_GD_WHO_EVENT_ORGANIZER, "John Smith‽", "john.smith@example.com"); + gdata_calendar_event_add_person (event, who); + g_object_unref (who); + g_time_val_from_iso8601 ("2009-04-17T15:00:00.000Z", &start_time); + g_time_val_from_iso8601 ("2009-04-17T17:00:00.000Z", &end_time); + when = gdata_gd_when_new (start_time.tv_sec, end_time.tv_sec, FALSE); + gdata_calendar_event_add_time (event, when); + g_object_unref (when); + + /* Insert the event */ + new_event = data->new_event = gdata_calendar_service_insert_calendar_event (GDATA_CALENDAR_SERVICE (service), + data->parent.calendar, event, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CALENDAR_EVENT (new_event)); + g_clear_error (&error); + + /* TODO: check entries and feed properties */ + + g_object_unref (event); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_CLOSURE_FUNCTIONS (insert_event, InsertEventData); + +GDATA_ASYNC_TEST_FUNCTIONS (event_insert, InsertEventData, +G_STMT_START { + GDataCalendarEvent *event; + GDataGDWhere *where; + GDataGDWho *who; + GDataGDWhen *when; + GTimeVal start_time; + GTimeVal end_time; + + event = gdata_calendar_event_new (NULL); + + gdata_entry_set_title (GDATA_ENTRY (event), "Tennis with Beth"); + gdata_entry_set_content (GDATA_ENTRY (event), "Meet for a quick lesson."); + gdata_calendar_event_set_transparency (event, GDATA_GD_EVENT_TRANSPARENCY_OPAQUE); + gdata_calendar_event_set_status (event, GDATA_GD_EVENT_STATUS_CONFIRMED); + where = gdata_gd_where_new (NULL, "Rolling Lawn Courts", NULL); + gdata_calendar_event_add_place (event, where); + g_object_unref (where); + who = gdata_gd_who_new (GDATA_GD_WHO_EVENT_ORGANIZER, "John Smith‽", "john.smith@example.com"); + gdata_calendar_event_add_person (event, who); + g_object_unref (who); + g_time_val_from_iso8601 ("2009-04-17T15:00:00.000Z", &start_time); + g_time_val_from_iso8601 ("2009-04-17T17:00:00.000Z", &end_time); + when = gdata_gd_when_new (start_time.tv_sec, end_time.tv_sec, FALSE); + gdata_calendar_event_add_time (event, when); + g_object_unref (when); + + /* Insert the event */ + gdata_calendar_service_insert_calendar_event_async (GDATA_CALENDAR_SERVICE (service), + data->parent.calendar, event, cancellable, + async_ready_callback, async_data); + + g_object_unref (event); +} G_STMT_END, +G_STMT_START { + GDataEntry *event; + event = gdata_service_insert_entry_finish (GDATA_SERVICE (obj), async_result, &error); + if (error == NULL) { + g_assert (GDATA_IS_CALENDAR_EVENT (event)); + data->new_event = GDATA_CALENDAR_EVENT (event); + g_assert_cmpstr (gdata_entry_get_title (event), ==, "Tennis with Beth"); + } else { + g_assert (event == NULL); + } +} G_STMT_END); + +static void +test_event_json (void) +{ + GDataCalendarEvent *event; + GDataGDWhere *where; + GDataGDWho *who; + GDataGDWhen *when; + GTimeVal start_time, end_time; + + event = gdata_calendar_event_new (NULL); + + gdata_entry_set_title (GDATA_ENTRY (event), "Tennis with Beth"); + gdata_entry_set_content (GDATA_ENTRY (event), "Meet for a quick lesson."); + gdata_calendar_event_set_transparency (event, GDATA_GD_EVENT_TRANSPARENCY_OPAQUE); + gdata_calendar_event_set_status (event, GDATA_GD_EVENT_STATUS_CONFIRMED); + where = gdata_gd_where_new (NULL, "Rolling Lawn Courts", NULL); + gdata_calendar_event_add_place (event, where); + g_object_unref (where); + who = gdata_gd_who_new (GDATA_GD_WHO_EVENT_ORGANIZER, "John Smith‽", "john.smith@example.com"); + gdata_calendar_event_add_person (event, who); + g_object_unref (who); + g_time_val_from_iso8601 ("2009-04-17T15:00:00.000Z", &start_time); + g_time_val_from_iso8601 ("2009-04-17T17:00:00.000Z", &end_time); + when = gdata_gd_when_new (start_time.tv_sec, end_time.tv_sec, FALSE); + gdata_calendar_event_add_time (event, when); + g_object_unref (when); + + /* Check the JSON */ + gdata_test_assert_json (event, "{" + "'summary': 'Tennis with Beth'," + "'description': 'Meet for a quick lesson.'," + "'kind': 'calendar#event'," + "'status': 'confirmed'," + "'transparency': 'opaque'," + "'guestsCanModify': false," + "'guestsCanInviteOthers': false," + "'guestsCanSeeOtherGuests': false," + "'anyoneCanAddSelf': false," + "'start': {" + "'dateTime': '2009-04-17T15:00:00Z'," + "'timeZone': 'UTC'" + "}," + "'end': {" + "'dateTime': '2009-04-17T17:00:00Z'," + "'timeZone': 'UTC'" + "}," + "'attendees': [" + "{" + "'email': 'john.smith@example.com'," + "'displayName': 'John Smith‽'," + "'organizer': true" + "}" + "]," + "'organizer': {" + "'email': 'john.smith@example.com'," + "'displayName': 'John Smith‽'" + "}," + "'location': 'Rolling Lawn Courts'" + "}"); +} + +static void +test_event_json_attendees (void) +{ + GDataCalendarEvent *event; + GList/**/ *l; + guint n_people; + const struct { + const gchar *relation_type; + const gchar *value_string; + const gchar *email_address; + } expected[] = { + { GDATA_GD_WHO_EVENT_ATTENDEE, "Joe Hibbs", "person1@gmail.com" }, + { GDATA_GD_WHO_EVENT_ATTENDEE, "Me McMeeson", "me@gmail.com" }, + { GDATA_GD_WHO_EVENT_ATTENDEE, NULL, "person2@gmail.com" }, + { GDATA_GD_WHO_EVENT_ATTENDEE, "Example Person 3", "person3@gmail.com" }, + { GDATA_GD_WHO_EVENT_ATTENDEE, NULL, "person4@gmail.com" }, + { GDATA_GD_WHO_EVENT_ORGANIZER, "Ruth Pettut", "blah@example.com" }, + }; + GError *error = NULL; + + event = GDATA_CALENDAR_EVENT (gdata_parsable_new_from_json (GDATA_TYPE_CALENDAR_EVENT, "{" + "'kind': 'calendar#event'," + "'id': 'some-id'," + "'created': '2017-02-04T17:53:47.000Z'," + "'summary': 'Duff this'," + "'organizer': {" + "'email': 'blah@example.com'," + "'displayName': 'Ruth Pettut'" + "}," + "'attendees': [" + "{" + "'email': 'person1@gmail.com'," + "'displayName': 'Joe Hibbs'," + "'responseStatus': 'accepted'" + "}," + "{" + "'email': 'me@gmail.com'," + "'displayName': 'Me McMeeson'," + "'self': true," + "'responseStatus': 'needsAction'" + "}," + "{" + "'email': 'person2@gmail.com'," + "'responseStatus': 'needsAction'" + "}," + "{" + "'email': 'person3@gmail.com'," + "'displayName': 'Example Person 3'," + "'responseStatus': 'tentative'," + "'comment': 'Some poor excuse about not coming.'" + "}," + "{" + "'email': 'person4@gmail.com'," + "'responseStatus': 'accepted'" + "}," + "{" + "'email': 'blah@example.com'," + "'displayName': 'Ruth Pettut'," + "'organizer': true," + "'responseStatus': 'accepted'" + "}" + "]" + "}", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (event)); + g_clear_error (&error); + + /* Check attendee details. */ + for (n_people = 0, l = gdata_calendar_event_get_people (event); + l != NULL; + n_people += 1, l = l->next) { + GDataGDWho *who = GDATA_GD_WHO (l->data); + gsize i; + + g_test_message ("Examining attendee: %s", + gdata_gd_who_get_email_address (who)); + + for (i = 0; i < G_N_ELEMENTS (expected); i++) { + if (g_strcmp0 (gdata_gd_who_get_email_address (who), + expected[i].email_address) == 0) { + g_assert_cmpstr (gdata_gd_who_get_relation_type (who), ==, expected[i].relation_type); + g_assert_cmpstr (gdata_gd_who_get_value_string (who), ==, expected[i].value_string); + break; + } + } + + g_assert_cmpuint (i, <, G_N_ELEMENTS (expected)); + } + + g_assert_cmpuint (n_people, ==, G_N_ELEMENTS (expected)); + + g_object_unref (event); +} + +static void +test_event_json_dates (void) +{ + guint i; + + const struct { + const gchar *json; + gboolean is_date; + gint64 start_time; + gint64 end_time; + const gchar *output_json; /* NULL if equal to @json */ + } test_vectors[] = { + /* Plain date, single day. */ + { "'start': {" + "'date': '2009-04-17'," + "'timeZone': 'UTC'" + "}," + "'end': {" + "'date': '2009-04-18'," + "'timeZone': 'UTC'" + "}", TRUE, 1239926400, 1239926400 + 86400, NULL }, + /* Full date and time. */ + { "'start': {" + "'dateTime': '2009-04-17T15:00:00Z'," + "'timeZone': 'UTC'" + "}," + "'end': {" + "'dateTime': '2009-04-17T16:00:00Z'," + "'timeZone': 'UTC'" + "}", FALSE, 1239926400 + 54000, 1239926400 + 54000 + 3600, NULL }, + /* Start and end time. */ + { "'start': {" + "'date': '2009-04-27'," + "'timeZone': 'UTC'" + "}," + "'end': {" + "'date': '20090506'," + "'timeZone': 'UTC'" + "}", TRUE, 1239926400 + 864000, 1241568000, "'start': {" + "'date': '2009-04-27'," + "'timeZone': 'UTC'" + "}," + "'end': {" + "'date': '2009-05-06'," + "'timeZone': 'UTC'" + "}" }, + }; + + for (i = 0; i < G_N_ELEMENTS (test_vectors); i++) { + gchar *json = NULL, *output_json = NULL; /* owned */ + GDataCalendarEvent *event; + GList *j; + GDataGDWhen *when; + gint64 _time; + GError *error = NULL; + + json = g_strdup_printf ("{" + "'summary': 'Tennis with Beth'," + "'description': 'Meet for a quick lesson.'," + "'kind': 'calendar#event'," + "%s" + "}", test_vectors[i].json); + output_json = g_strdup_printf ("{" + "'summary': 'Tennis with Beth'," + "'description': 'Meet for a quick lesson.'," + "'kind': 'calendar#event'," + "'guestsCanModify': false," + "'guestsCanInviteOthers': false," + "'guestsCanSeeOtherGuests': false," + "'anyoneCanAddSelf': false," + "'attendees': []," + "%s" + "}", (test_vectors[i].output_json != NULL) ? test_vectors[i].output_json : test_vectors[i].json); + + event = GDATA_CALENDAR_EVENT (gdata_parsable_new_from_json (GDATA_TYPE_CALENDAR_EVENT, json, -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (event)); + g_clear_error (&error); + + /* Check the times */ + j = gdata_calendar_event_get_times (event); + g_assert (j != NULL); + + when = GDATA_GD_WHEN (j->data); + g_assert (gdata_gd_when_is_date (when) == test_vectors[i].is_date); + _time = gdata_gd_when_get_start_time (when); + g_assert_cmpint (_time, ==, test_vectors[i].start_time); + _time = gdata_gd_when_get_end_time (when); + g_assert_cmpint (_time, ==, test_vectors[i].end_time); + g_assert (gdata_gd_when_get_value_string (when) == NULL); + g_assert (gdata_gd_when_get_reminders (when) == NULL); + + /* Should be no other times. */ + g_assert (j->next == NULL); + + /* Check the JSON */ + gdata_test_assert_json (event, output_json); + + g_object_unref (event); + g_free (output_json); + g_free (json); + } +} + +static void +test_event_json_organizer (void) +{ + GDataCalendarEvent *event; + GError *error = NULL; + + event = GDATA_CALENDAR_EVENT (gdata_parsable_new_from_json (GDATA_TYPE_CALENDAR_EVENT, "{" + "'kind': 'calendar#event'," + "'id': 'some-id'," + "'created': '2013-12-22T18:00:00.000Z'," + "'summary': 'FOSDEM GNOME Beer Event'," + "'organizer': {" + "'id': 'another-id'," + "'displayName': 'Guillaume Desmottes'" + "}," + "'attendees': [" + "{" + "'id': 'another-id'," + "'displayName': 'Guillaume Desmottes'," + "'organizer': true," + "'responseStatus': 'accepted'" + "}" + "]" + "}", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (event)); + g_clear_error (&error); + + g_object_unref (event); +} + +static void +test_event_json_recurrence (void) +{ + GDataCalendarEvent *event; + GError *error = NULL; + gchar *id, *uri; + + event = GDATA_CALENDAR_EVENT (gdata_parsable_new_from_json (GDATA_TYPE_CALENDAR_EVENT, "{" + "'id': 'https://www.googleapis.com/calendar/v3/calendars/libgdata.test@googlemail.com/events/g5928e82rrch95b25f8ud0dlsg_20090429T153000Z'," + "'updated': '2009-04-27T17:54:10.000Z'," + "'summary': 'Test daily instance event'," + "'kind': 'calendar#event'," + "'creator': {" + "'displayName': 'GData Test'," + "'email': 'libgdata.test@googlemail.com'" + "}," + "'recurringEventId': 'g5928e82rrch95b25f8ud0dlsg'," + "'originalStartTime': {" + "'dateTime': '2009-04-29T16:30:00.000+01:00'," + "'timeZone': 'UTC'" + "}," + "'guestsCanModify': false," + "'guestsCanInviteOthers': false," + "'guestsCanSeeOtherGuests': false," + "'anyoneCanAddSelf': false," + "'status': 'confirmed'," + "'visibility': 'private'," + "'transparency': 'opaque'," + "'iCalUID': 'g5928e82rrch95b25f8ud0dlsg@google.com'," + "'sequence': '0'," + "'start': {" + "'dateTime': '2009-04-29T17:30:00.000+01:00'," + "'timeZone': 'UTC'" + "}," + "'end': {" + "'dateTime': '2009-04-29T17:30:00.000+01:00'," + "'timeZone': 'UTC'" + "}," + "'reminders': {" + "'overrides': [{" + "'method': 'email'," + "'minutes': 10" + "}, {" + "'method': 'popup'," + "'minutes': 10" + "}]" + "}," + "'attendees': [" + "{" + "'email': 'libgdata.test@googlemail.com'," + "'displayName': 'GData Test'," + "'organizer': true," + "'responseStatus': 'needsAction'" + "}" + "]," + "'organizer': {" + "'email': 'libgdata.test@googlemail.com'," + "'displayName': 'GData Test'" + "}" + "}", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (event)); + g_clear_error (&error); + + /* Check the original event */ + g_assert (gdata_calendar_event_is_exception (event) == TRUE); + + gdata_calendar_event_get_original_event_details (event, &id, &uri); + g_assert_cmpstr (id, ==, "g5928e82rrch95b25f8ud0dlsg"); + g_assert_cmpstr (uri, ==, "https://www.googleapis.com/calendar/v3/events/g5928e82rrch95b25f8ud0dlsg"); + + g_free (id); + g_free (uri); + g_object_unref (event); +} + +static void +test_calendar_escaping (void) +{ + GDataCalendarCalendar *calendar; + + calendar = gdata_calendar_calendar_new (NULL); + gdata_calendar_calendar_set_timezone (calendar, ""); + + /* Check the outputted JSON is escaped properly */ + gdata_test_assert_json (calendar, "{" + "'kind': 'calendar#calendar'," + "'timeZone': ''," + "'hidden': false," + "'backgroundColor': '#000000'," + "'selected': false" + "}"); + g_object_unref (calendar); +} + +static void +test_event_escaping (void) +{ + GDataCalendarEvent *event; + + event = gdata_calendar_event_new (NULL); + gdata_calendar_event_set_status (event, "\"status\""); + gdata_calendar_event_set_visibility (event, "\"visibility\""); + gdata_calendar_event_set_transparency (event, "\"transparency\""); + gdata_calendar_event_set_uid (event, "\"uid\""); + gdata_calendar_event_set_recurrence (event, "\"recurrence\""); + + /* Check the outputted JSON is escaped properly */ + gdata_test_assert_json (event, "{" + "'kind': 'calendar#event'," + "'status': '\"status\"'," + "'transparency': '\"transparency\"'," + "'visibility': '\"visibility\"'," + "'iCalUID': '\"uid\"'," + "'recurrence': [ '\"recurrence\"' ]," + "'guestsCanModify': false," + "'guestsCanInviteOthers': false," + "'guestsCanSeeOtherGuests': false," + "'anyoneCanAddSelf': false," + "'attendees': []" + "}"); + g_object_unref (event); +} + +/* Test the event parser with the minimal number of properties specified. */ +static void +test_calendar_event_parser_minimal (void) +{ + GDataCalendarEvent *event = NULL; /* owned */ + GDataEntry *entry; /* unowned */ + GError *error = NULL; + + event = GDATA_CALENDAR_EVENT (gdata_parsable_new_from_json (GDATA_TYPE_CALENDAR_EVENT, + "{" + "\"kind\": \"calendar#event\"," + "\"etag\": \"\\\"2838230136828000\\\"\"," + "\"id\": \"hsfgtc50u68vdai81t6634u7lg\"," + "\"status\": \"confirmed\"," + "\"htmlLink\": \"https://www.google.com/calendar/event?eid=aHNmZ3RjNTB1Njh2ZGFpODF0NjYzNHU3bGcgODk5MWkzNjM0YzRzN3Nwa3NrcjNjZjVuanNAZw\"," + "\"created\": \"2014-12-20T22:37:48.000Z\"," + "\"updated\": \"2014-12-20T22:37:48.414Z\"," + "\"summary\": \"Test Event 1\"," + "\"creator\": {" + "\"email\": \"libgdata.test@googlemail.com\"," + "\"displayName\": \"GData Test\"" + "}," + "\"organizer\": {" + "\"email\": \"8991i3634c4s7spkskr3cf5njs@group.calendar.google.com\"," + "\"displayName\": \"Temp Test Calendar\"," + "\"self\": true" + "}," + "\"start\": {" + "\"dateTime\": \"2014-12-20T22:15:27Z\"," + "\"timeZone\": \"UTC\"" + "}," + "\"end\": {" + "\"dateTime\": \"2014-12-20T22:15:28Z\"," + "\"timeZone\": \"UTC\"" + "}," + "\"iCalUID\": \"hsfgtc50u68vdai81t6634u7lg@google.com\"," + "\"sequence\": 0," + "\"guestsCanInviteOthers\": false," + "\"guestsCanSeeOtherGuests\": false," + "\"reminders\": {" + "\"useDefault\": true" + "}" + "}", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CALENDAR_EVENT (event)); + gdata_test_compare_kind (GDATA_ENTRY (event), "calendar#event", NULL); + + entry = GDATA_ENTRY (event); + + /* Check the event’s properties. */ + g_assert_cmpstr (gdata_entry_get_id (entry), ==, + "hsfgtc50u68vdai81t6634u7lg"); + g_assert_cmpstr (gdata_entry_get_etag (entry), ==, + "\"2838230136828000\""); + g_assert_cmpstr (gdata_entry_get_title (entry), ==, + "Test Event 1"); + g_assert_cmpint (gdata_entry_get_updated (entry), ==, 1419115068); + + /* TODO: check everything else */ + + g_object_unref (event); +} + +static void +test_access_rule_properties (void) +{ + GDataCalendarAccessRule *rule; + const gchar *scope_type, *scope_value; + + rule = gdata_calendar_access_rule_new (NULL); + + gdata_access_rule_set_role (GDATA_ACCESS_RULE (rule), GDATA_CALENDAR_ACCESS_ROLE_EDITOR); + g_assert_cmpstr (gdata_access_rule_get_role (GDATA_ACCESS_RULE (rule)), ==, GDATA_CALENDAR_ACCESS_ROLE_EDITOR); + + gdata_access_rule_set_scope (GDATA_ACCESS_RULE (rule), GDATA_ACCESS_SCOPE_USER, "darcy@gmail.com"); + gdata_access_rule_get_scope (GDATA_ACCESS_RULE (rule), &scope_type, &scope_value); + g_assert_cmpstr (scope_type, ==, GDATA_ACCESS_SCOPE_USER); + g_assert_cmpstr (scope_value, ==, "darcy@gmail.com"); +} + +static void +test_access_rule_json (void) +{ + GDataCalendarAccessRule *rule; + + rule = gdata_calendar_access_rule_new (NULL); + + gdata_access_rule_set_role (GDATA_ACCESS_RULE (rule), GDATA_CALENDAR_ACCESS_ROLE_EDITOR); + gdata_access_rule_set_scope (GDATA_ACCESS_RULE (rule), GDATA_ACCESS_SCOPE_USER, "darcy@gmail.com"); + + /* Check the JSON */ + gdata_test_assert_json (rule, "{" + "'kind': 'calendar#aclRule'," + "'role': 'writer'," + "'scope': {" + "'type': 'user'," + "'value': 'darcy@gmail.com'" + "}" + "}"); +} + +static void +test_query_uri (void) +{ + gint64 _time; + GTimeVal time_val; + gchar *query_uri; + GDataCalendarQuery *query = gdata_calendar_query_new ("q"); + + /* Set to false or it will override our startMin below. */ + gdata_calendar_query_set_future_events (query, FALSE); + g_assert (gdata_calendar_query_get_future_events (query) == FALSE); + + gdata_calendar_query_set_order_by (query, "starttime"); + g_assert_cmpstr (gdata_calendar_query_get_order_by (query), ==, "starttime"); + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_time_val_from_iso8601 ("2009-04-17T15:00:00.000Z", &time_val); + gdata_calendar_query_set_recurrence_expansion_start (query, time_val.tv_sec); + _time = gdata_calendar_query_get_recurrence_expansion_start (query); + g_assert_cmpint (_time, ==, time_val.tv_sec); + + g_time_val_from_iso8601 ("2010-04-17T15:00:00.000Z", &time_val); + gdata_calendar_query_set_recurrence_expansion_end (query, time_val.tv_sec); + _time = gdata_calendar_query_get_recurrence_expansion_end (query); + g_assert_cmpint (_time, ==, time_val.tv_sec); +G_GNUC_END_IGNORE_DEPRECATIONS + + gdata_calendar_query_set_single_events (query, TRUE); + g_assert (gdata_calendar_query_get_single_events (query) == TRUE); + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + gdata_calendar_query_set_sort_order (query, "descending"); + g_assert_cmpstr (gdata_calendar_query_get_sort_order (query), ==, "descending"); +G_GNUC_END_IGNORE_DEPRECATIONS + + g_time_val_from_iso8601 ("2009-04-17T15:00:00.000Z", &time_val); + gdata_calendar_query_set_start_min (query, time_val.tv_sec); + _time = gdata_calendar_query_get_start_min (query); + g_assert_cmpint (_time, ==, time_val.tv_sec); + + g_time_val_from_iso8601 ("2010-04-17T15:00:00.000Z", &time_val); + gdata_calendar_query_set_start_max (query, time_val.tv_sec); + _time = gdata_calendar_query_get_start_max (query); + g_assert_cmpint (_time, ==, time_val.tv_sec); + + gdata_calendar_query_set_timezone (query, "America/Los Angeles"); + g_assert_cmpstr (gdata_calendar_query_get_timezone (query), ==, "America/Los_Angeles"); + + gdata_calendar_query_set_max_attendees (query, 15); + g_assert_cmpuint (gdata_calendar_query_get_max_attendees (query), ==, 15); + + gdata_calendar_query_set_show_deleted (query, TRUE); + g_assert (gdata_calendar_query_show_deleted (query) == TRUE); + + /* Check the built query URI with a normal feed URI */ + query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&orderBy=startTime&singleEvents=true" + "&timeMin=2009-04-17T15:00:00Z&timeMax=2010-04-17T15:00:00Z&timeZone=America%2FLos_Angeles&maxAttendees=15" + "&showDeleted=true"); + g_free (query_uri); + + /* …with a feed URI with a trailing slash */ + query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/"); + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=q&orderBy=startTime&singleEvents=true" + "&timeMin=2009-04-17T15:00:00Z&timeMax=2010-04-17T15:00:00Z&timeZone=America%2FLos_Angeles&maxAttendees=15" + "&showDeleted=true"); + g_free (query_uri); + + /* …with a feed URI with pre-existing arguments */ + query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/bar/?test=test&this=that"); + g_assert_cmpstr (query_uri, ==, "http://example.com/bar/?test=test&this=that&q=q&orderBy=startTime" + "&singleEvents=true&timeMin=2009-04-17T15:00:00Z&timeMax=2010-04-17T15:00:00Z" + "&timeZone=America%2FLos_Angeles&maxAttendees=15&showDeleted=true"); + g_free (query_uri); + + g_object_unref (query); +} + +static void +test_query_etag (void) +{ + GDataCalendarQuery *query = gdata_calendar_query_new (NULL); + + /* Test that setting any property will unset the ETag */ + g_test_bug ("613529"); + +#define CHECK_ETAG(C) \ + gdata_query_set_etag (GDATA_QUERY (query), "foobar"); \ + (C); \ + g_assert (gdata_query_get_etag (GDATA_QUERY (query)) == NULL); + + CHECK_ETAG (gdata_calendar_query_set_future_events (query, FALSE)) + CHECK_ETAG (gdata_calendar_query_set_order_by (query, "shizzle")) +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + CHECK_ETAG (gdata_calendar_query_set_recurrence_expansion_start (query, -1)) + CHECK_ETAG (gdata_calendar_query_set_recurrence_expansion_end (query, -1)) +G_GNUC_END_IGNORE_DEPRECATIONS + CHECK_ETAG (gdata_calendar_query_set_single_events (query, FALSE)) +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + CHECK_ETAG (gdata_calendar_query_set_sort_order (query, "shizzle")) +G_GNUC_END_IGNORE_DEPRECATIONS + CHECK_ETAG (gdata_calendar_query_set_start_min (query, -1)) + CHECK_ETAG (gdata_calendar_query_set_start_max (query, -1)) + CHECK_ETAG (gdata_calendar_query_set_timezone (query, "about now")) + CHECK_ETAG (gdata_calendar_query_set_max_attendees (query, 10)) + CHECK_ETAG (gdata_calendar_query_set_show_deleted (query, TRUE)) + +#undef CHECK_ETAG + + g_object_unref (query); +} + +typedef struct { + TempCalendarData parent; + GDataCalendarAccessRule *rule; +} TempCalendarAclsData; + +static void +calendar_access_rule_set_self_link (GDataCalendarCalendar *parent_calendar, + GDataCalendarAccessRule *rule) +{ + GDataLink *_link = NULL; /* owned */ + const gchar *calendar_id, *id; + gchar *uri = NULL; /* owned */ + + /* FIXME: Horrendous hack to set the self link, which is needed for + * gdata_service_delete_entry(). Unfortunately, it needs the + * ACL ID _and_ the calendar ID. + * + * Do _not_ copy this code. It needs to be fixed architecturally in + * libgdata. */ + calendar_id = gdata_entry_get_id (GDATA_ENTRY (parent_calendar)); + id = gdata_entry_get_id (GDATA_ENTRY (rule)); + uri = g_strconcat ("https://www.googleapis.com" + "/calendar/v3/calendars/", + calendar_id, "/acl/", id, NULL); + _link = gdata_link_new (uri, GDATA_LINK_SELF); + gdata_entry_add_link (GDATA_ENTRY (rule), _link); + g_object_unref (_link); + g_free (uri); +} + +static void +set_up_temp_calendar_acls (TempCalendarAclsData *data, gconstpointer service) +{ + GDataCalendarAccessRule *rule; + GDataLink *_link; + GError *error = NULL; + + /* Set up a calendar */ + set_up_temp_calendar ((TempCalendarData*) data, service); + + gdata_test_mock_server_start_trace (mock_server, "setup-temp-calendar-acls"); + + /* Add an access rule to the calendar */ + rule = gdata_calendar_access_rule_new (NULL); + + gdata_access_rule_set_role (GDATA_ACCESS_RULE (rule), GDATA_CALENDAR_ACCESS_ROLE_EDITOR); + gdata_access_rule_set_scope (GDATA_ACCESS_RULE (rule), GDATA_ACCESS_SCOPE_USER, "darcy@gmail.com"); + + /* Insert the rule */ + _link = gdata_entry_look_up_link (GDATA_ENTRY (data->parent.calendar), GDATA_LINK_ACCESS_CONTROL_LIST); + g_assert (_link != NULL); + + data->rule = GDATA_CALENDAR_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), + gdata_calendar_service_get_primary_authorization_domain (), + gdata_link_get_uri (_link), GDATA_ENTRY (rule), NULL, + &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CALENDAR_ACCESS_RULE (data->rule)); + + calendar_access_rule_set_self_link (data->parent.calendar, data->rule); + + g_object_unref (rule); + + uhm_server_end_trace (mock_server); +} + +static void +set_up_temp_calendar_acls_no_insertion (TempCalendarAclsData *data, gconstpointer service) +{ + set_up_temp_calendar ((TempCalendarData*) data, service); + data->rule = NULL; +} + +static void +tear_down_temp_calendar_acls (TempCalendarAclsData *data, gconstpointer service) +{ + /* Delete the access rule if it still exists */ + if (data->rule != NULL) { + gdata_test_mock_server_start_trace (mock_server, "teardown-temp-calendar-acls"); + + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->rule), NULL, NULL) == TRUE); + g_object_unref (data->rule); + + uhm_server_end_trace (mock_server); + } + + /* Delete the calendar */ + tear_down_temp_calendar ((TempCalendarData*) data, service); +} + +static void +test_access_rule_get (TempCalendarAclsData *data, gconstpointer service) +{ + GDataFeed *feed; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "access-rule-get"); + + /* Get the rules */ + feed = gdata_access_handler_get_rules (GDATA_ACCESS_HANDLER (data->parent.calendar), GDATA_SERVICE (service), NULL, NULL, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_FEED (feed)); + g_clear_error (&error); + + /* TODO: check rules and feed properties */ + + g_object_unref (feed); + + uhm_server_end_trace (mock_server); +} + +static void +test_access_rule_insert (TempCalendarAclsData *data, gconstpointer service) +{ + GDataCalendarAccessRule *rule, *new_rule; + const gchar *scope_type, *scope_value; + GDataCategory *category; + GDataLink *_link; + GList *categories; + gint64 edited; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "access-rule-insert"); + + rule = gdata_calendar_access_rule_new (NULL); + + gdata_access_rule_set_role (GDATA_ACCESS_RULE (rule), GDATA_CALENDAR_ACCESS_ROLE_EDITOR); + gdata_access_rule_set_scope (GDATA_ACCESS_RULE (rule), GDATA_ACCESS_SCOPE_USER, "darcy@gmail.com"); + + /* Insert the rule */ + _link = gdata_entry_look_up_link (GDATA_ENTRY (data->parent.calendar), GDATA_LINK_ACCESS_CONTROL_LIST); + g_assert (_link != NULL); + + new_rule = data->rule = GDATA_CALENDAR_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), + gdata_calendar_service_get_primary_authorization_domain (), + gdata_link_get_uri (_link), GDATA_ENTRY (rule), NULL, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ACCESS_RULE (new_rule)); + g_clear_error (&error); + + calendar_access_rule_set_self_link (data->parent.calendar, data->rule); + + /* Check the properties of the returned rule */ + g_assert_cmpstr (gdata_access_rule_get_role (GDATA_ACCESS_RULE (new_rule)), ==, GDATA_CALENDAR_ACCESS_ROLE_EDITOR); + gdata_access_rule_get_scope (GDATA_ACCESS_RULE (new_rule), &scope_type, &scope_value); + g_assert_cmpstr (scope_type, ==, GDATA_ACCESS_SCOPE_USER); + g_assert_cmpstr (scope_value, ==, "darcy@gmail.com"); + edited = gdata_access_rule_get_edited (GDATA_ACCESS_RULE (new_rule)); + g_assert_cmpuint (edited, >, 0); + + /* Check it only has the one category and that it's correct */ + categories = gdata_entry_get_categories (GDATA_ENTRY (new_rule)); + g_assert (categories != NULL); + g_assert_cmpuint (g_list_length (categories), ==, 1); + category = categories->data; + g_assert_cmpstr (gdata_category_get_term (category), ==, "calendar#aclRule"); + g_assert_cmpstr (gdata_category_get_scheme (category), ==, "http://schemas.google.com/g/2005#kind"); + g_assert (gdata_category_get_label (category) == NULL); + + /* TODO: Check more properties? */ + + g_object_unref (rule); + + uhm_server_end_trace (mock_server); +} + +static void +test_access_rule_update (TempCalendarAclsData *data, gconstpointer service) +{ + GDataCalendarAccessRule *new_rule; + const gchar *scope_type, *scope_value; + gint64 edited; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "access-rule-update"); + + /* Update the rule */ + gdata_access_rule_set_role (GDATA_ACCESS_RULE (data->rule), GDATA_CALENDAR_ACCESS_ROLE_READ); + + /* Send the update to the server */ + new_rule = GDATA_CALENDAR_ACCESS_RULE (gdata_service_update_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->rule), NULL, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ACCESS_RULE (new_rule)); + g_clear_error (&error); + + calendar_access_rule_set_self_link (data->parent.calendar, new_rule); + + /* Check the properties of the returned rule */ + g_assert_cmpstr (gdata_access_rule_get_role (GDATA_ACCESS_RULE (new_rule)), ==, GDATA_CALENDAR_ACCESS_ROLE_READ); + gdata_access_rule_get_scope (GDATA_ACCESS_RULE (new_rule), &scope_type, &scope_value); + g_assert_cmpstr (scope_type, ==, GDATA_ACCESS_SCOPE_USER); + g_assert_cmpstr (scope_value, ==, "darcy@gmail.com"); + edited = gdata_access_rule_get_edited (GDATA_ACCESS_RULE (new_rule)); + g_assert_cmpuint (edited, >, 0); + + g_object_unref (new_rule); + + uhm_server_end_trace (mock_server); +} + +static void +test_access_rule_delete (TempCalendarAclsData *data, gconstpointer service) +{ + gboolean success; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "access-rule-delete"); + + /* Delete the rule */ + success = gdata_service_delete_entry (GDATA_SERVICE (service), gdata_calendar_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->rule), NULL, &error); + g_assert_no_error (error); + g_assert (success == TRUE); + g_clear_error (&error); + + g_object_unref (data->rule); + data->rule = NULL; + + uhm_server_end_trace (mock_server); +} + +static void +mock_server_notify_resolver_cb (GObject *object, GParamSpec *pspec, gpointer user_data) +{ + UhmServer *server; + UhmResolver *resolver; + + server = UHM_SERVER (object); + + /* Set up the expected domain names here. This should technically be split up between + * the different unit test suites, but that's too much effort. */ + resolver = uhm_server_get_resolver (server); + + if (resolver != NULL) { + const gchar *ip_address = uhm_server_get_address (server); + + uhm_resolver_add_A (resolver, "www.google.com", ip_address); + uhm_resolver_add_A (resolver, "www.googleapis.com", ip_address); + uhm_resolver_add_A (resolver, + "accounts.google.com", ip_address); + } +} + +/* Set up a global GDataAuthorizer to be used for all the tests. Unfortunately, + * the Google Calendar API is limited to OAuth1 and OAuth2 authorisation, so + * this requires user interaction when online. + * + * If not online, use a dummy authoriser. */ +static GDataAuthorizer * +create_global_authorizer (void) +{ + GDataOAuth2Authorizer *authorizer = NULL; /* owned */ + gchar *authentication_uri, *authorisation_code; + GError *error = NULL; + + /* If not online, just return a dummy authoriser. */ + if (!uhm_server_get_enable_online (mock_server)) { + return GDATA_AUTHORIZER (gdata_dummy_authorizer_new (GDATA_TYPE_CALENDAR_SERVICE)); + } + + /* Otherwise, go through the interactive OAuth dance. */ + gdata_test_mock_server_start_trace (mock_server, "global-authentication"); + authorizer = gdata_oauth2_authorizer_new (CLIENT_ID, CLIENT_SECRET, + REDIRECT_URI, + GDATA_TYPE_CALENDAR_SERVICE); + + /* Get an authentication URI */ + authentication_uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, NULL, FALSE); + g_assert (authentication_uri != NULL); + + /* Get the authorisation code off the user. */ + authorisation_code = gdata_test_query_user_for_verifier (authentication_uri); + + g_free (authentication_uri); + + if (authorisation_code == NULL) { + /* Skip tests. */ + g_object_unref (authorizer); + authorizer = NULL; + goto skip_test; + } + + /* Authorise the token */ + g_assert (gdata_oauth2_authorizer_request_authorization (authorizer, authorisation_code, NULL, &error)); + g_assert_no_error (error); + +skip_test: + g_free (authorisation_code); + + uhm_server_end_trace (mock_server); + + return GDATA_AUTHORIZER (authorizer); +} + +int +main (int argc, char *argv[]) +{ + gint retval; + GDataAuthorizer *authorizer = NULL; + GDataService *service = NULL; + GFile *trace_directory; + gchar *path = NULL; + + gdata_test_init (argc, argv); + + mock_server = gdata_test_get_mock_server (); + g_signal_connect (G_OBJECT (mock_server), "notify::resolver", (GCallback) mock_server_notify_resolver_cb, NULL); + path = g_test_build_filename (G_TEST_DIST, "traces/calendar", NULL); + trace_directory = g_file_new_for_path (path); + g_free (path); + uhm_server_set_trace_directory (mock_server, trace_directory); + g_object_unref (trace_directory); + + authorizer = create_global_authorizer (); + + service = GDATA_SERVICE (gdata_calendar_service_new (authorizer)); + + g_test_add_func ("/calendar/authentication", test_authentication); + + g_test_add ("/calendar/query/all_calendars", QueryCalendarsData, service, set_up_query_calendars, test_query_all_calendars, + tear_down_query_calendars); + g_test_add ("/calendar/query/all_calendars/async", GDataAsyncTestData, service, set_up_query_calendars_async, + test_query_all_calendars_async, tear_down_query_calendars_async); + g_test_add ("/calendar/query/all_calendars/async/progress_closure", QueryCalendarsData, service, set_up_query_calendars, + test_query_all_calendars_async_progress_closure, tear_down_query_calendars); + g_test_add ("/calendar/query/all_calendars/async/cancellation", GDataAsyncTestData, service, set_up_query_calendars_async, + test_query_all_calendars_async_cancellation, tear_down_query_calendars_async); + + g_test_add ("/calendar/query/own_calendars", QueryCalendarsData, service, set_up_query_calendars, test_query_own_calendars, + tear_down_query_calendars); + g_test_add ("/calendar/query/own_calendars/async", GDataAsyncTestData, service, set_up_query_calendars_async, + test_query_own_calendars_async, tear_down_query_calendars_async); + g_test_add ("/calendar/query/own_calendars/async/progress_closure", QueryCalendarsData, service, set_up_query_calendars, + test_query_own_calendars_async_progress_closure, tear_down_query_calendars); + g_test_add ("/calendar/query/own_calendars/async/cancellation", GDataAsyncTestData, service, set_up_query_calendars_async, + test_query_own_calendars_async_cancellation, tear_down_query_calendars_async); + + g_test_add ("/calendar/query/events", QueryEventsData, service, set_up_query_events, test_query_events, tear_down_query_events); + g_test_add ("/calendar/query/events/async", GDataAsyncTestData, service, set_up_query_events_async, test_query_events_async, + tear_down_query_events_async); + g_test_add ("/calendar/query/events/async/progress_closure", QueryEventsData, service, set_up_query_events, + test_query_events_async_progress_closure, tear_down_query_events); + g_test_add ("/calendar/query/events/async/cancellation", GDataAsyncTestData, service, set_up_query_events_async, + test_query_events_async_cancellation, tear_down_query_events_async); + + g_test_add ("/calendar/event/insert", InsertEventData, service, set_up_insert_event, test_event_insert, tear_down_insert_event); + g_test_add ("/calendar/event/insert/async", GDataAsyncTestData, service, set_up_insert_event_async, test_event_insert_async, + tear_down_insert_event_async); + g_test_add ("/calendar/event/insert/async/cancellation", GDataAsyncTestData, service, set_up_insert_event_async, + test_event_insert_async_cancellation, tear_down_insert_event_async); + + g_test_add ("/calendar/access-rule/get", TempCalendarAclsData, service, set_up_temp_calendar_acls, test_access_rule_get, + tear_down_temp_calendar_acls); + g_test_add ("/calendar/access-rule/insert", TempCalendarAclsData, service, set_up_temp_calendar_acls_no_insertion, + test_access_rule_insert, tear_down_temp_calendar_acls); + g_test_add ("/calendar/access-rule/update", TempCalendarAclsData, service, set_up_temp_calendar_acls, test_access_rule_update, + tear_down_temp_calendar_acls); + g_test_add ("/calendar/access-rule/delete", TempCalendarAclsData, service, set_up_temp_calendar_acls, test_access_rule_delete, + tear_down_temp_calendar_acls); + + g_test_add_func ("/calendar/event/json", test_event_json); + g_test_add_func ("/calendar/event/json/attendees", test_event_json_attendees); + g_test_add_func ("/calendar/event/json/dates", test_event_json_dates); + g_test_add_func ("/calendar/event/json/organizer", test_event_json_organizer); + g_test_add_func ("/calendar/event/json/recurrence", test_event_json_recurrence); + g_test_add_func ("/calendar/event/escaping", test_event_escaping); + g_test_add_func ("/calendar/event/parser/minimal", + test_calendar_event_parser_minimal); + + g_test_add_func ("/calendar/calendar/escaping", test_calendar_escaping); + + g_test_add_func ("/calendar/access-rule/properties", test_access_rule_properties); + g_test_add_func ("/calendar/access-rule/json", test_access_rule_json); + + g_test_add_func ("/calendar/query/uri", test_query_uri); + g_test_add_func ("/calendar/query/etag", test_query_etag); + + retval = g_test_run (); + + if (service != NULL) + g_object_unref (service); + + return retval; +} diff --git a/gdata/tests/cert.pem b/gdata/tests/cert.pem new file mode 100644 index 0000000..2dfc433 --- /dev/null +++ b/gdata/tests/cert.pem @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID6TCCAtGgAwIBAgIJAI9hYGsc661fMA0GCSqGSIb3DQEBBQUAMIGKMQswCQYD +VQQGEwJHQjEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MREwDwYDVQQKDAhsaWJnZGF0 +YTEOMAwGA1UECwwFVGVzdHMxFzAVBgNVBAMMDmxpYmdkYXRhIHRlc3RzMSgwJgYJ +KoZIhvcNAQkBFhlsaWJnZGF0YS1tYWludEBnbm9tZS5idWdzMB4XDTEzMDcwNjE3 +NDQxNFoXDTEzMDgwNTE3NDQxNFowgYoxCzAJBgNVBAYTAkdCMRUwEwYDVQQHDAxE +ZWZhdWx0IENpdHkxETAPBgNVBAoMCGxpYmdkYXRhMQ4wDAYDVQQLDAVUZXN0czEX +MBUGA1UEAwwObGliZ2RhdGEgdGVzdHMxKDAmBgkqhkiG9w0BCQEWGWxpYmdkYXRh +LW1haW50QGdub21lLmJ1Z3MwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQDCbpdfrtWTz+ZpNaVZuxaeAAY+f/xZz4wEH1gaNBNb3u9CPEWofW+fLNB6izkn +f9qhx2K8PrM9LKHDJS4uUU9dkfQHQsrCSffRWqQTeOOnpYHjS21iDYdOt4e//f/J +erAEIyWMQAP5eqMt4hp5wrfhSh2ul9lcHz2Lv5u6H+I8ygoUaMyH15WIlEzxOsn4 +i+lXSkdmso2n1FYbiMyyMYButnnmv+EcPvOdw88PB8Y6PnCN2Ye0fo9HvcJhHEdg +GM4SKsejA/L+T8fX0FYCXrsLPYU0Ntm15ZV8nNsxCoZFGmdTs/prL8ztXaI1tYdi +lI1RKVTOVxD2DKdrCs5bnxYhAgMBAAGjUDBOMB0GA1UdDgQWBBQwhz/4hEriPnF5 +F3TDY9TQLzxlnDAfBgNVHSMEGDAWgBQwhz/4hEriPnF5F3TDY9TQLzxlnDAMBgNV +HRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAIVnySe76zjb5UHromPibgT9eL +n8oZ76aGj6+VMLucpaK8K7U7y2ONAO+BB+wUyLaq48EYb6DmpFKThAxTajYd1f/7 +14bJIew8papMEooiJHyOVfZPLOePjCldV5+hPfwsfJ3NSDL8dc+IB2PQmgp32nom +9uvQMOdD56hHSIP5zFZwNiWH75piWyUNs/+cbHKgnyVGWaoVd7z3E5dNelOMopbo +qvWk2MM3nHpiQqMZyliTkq5uD2Q8WiXBD4rPUeEU55NaPslB8xKwldmrAlcwYvIg +2SDhAsTPLcCgjNuHlr/v4VC29YsF37oYCGfmWvLwGFGufsxcxXkrVhhNr2WB +-----END CERTIFICATE----- diff --git a/gdata/tests/common.c b/gdata/tests/common.c new file mode 100644 index 0000000..25d8500 --- /dev/null +++ b/gdata/tests/common.c @@ -0,0 +1,1050 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" + +/* %TRUE if interactive tests should be skipped because we're running automatically (for example) */ +static gboolean no_interactive = TRUE; + +/* declaration of debug handler */ +static void gdata_test_debug_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data); + +/* Directory to output network trace files to, if trace output is enabled. (NULL otherwise.) */ +static GFile *trace_dir = NULL; + +/* TRUE if tests should be run online and a trace file written for each; FALSE if tests should run offline against existing trace files. */ +static gboolean write_traces = FALSE; + +/* TRUE if tests should be run online and the server's responses compared to the existing trace file for each; FALSE if tests should run offline without comparison. */ +static gboolean compare_traces = FALSE; + +/* Global mock server instance used by all tests. */ +static UhmServer *mock_server = NULL; + +void +gdata_test_init (int argc, char **argv) +{ + GTlsCertificate *cert; + GError *child_error = NULL; + gchar *cert_path = NULL, *key_path = NULL; + gint i; + + setlocale (LC_ALL, ""); + + /* Parse the custom options */ + for (i = 1; i < argc; i++) { + if (strcmp ("--no-interactive", argv[i]) == 0 || strcmp ("-ni", argv[i]) == 0) { + no_interactive = TRUE; + argv[i] = (char*) ""; + } else if (strcmp ("--interactive", argv[i]) == 0 || strcmp ("-i", argv[i]) == 0) { + no_interactive = FALSE; + argv[i] = (char*) ""; + } else if (strcmp ("--trace-dir", argv[i]) == 0 || strcmp ("-t", argv[i]) == 0) { + if (i >= argc - 1) { + fprintf (stderr, "Error: Missing directory for --trace-dir option.\n"); + exit (1); + } + + trace_dir = g_file_new_for_path (argv[i + 1]); + + argv[i] = (char*) ""; + argv[i + 1] = (char*) ""; + i++; + } else if (strcmp ("--write-traces", argv[i]) == 0 || strcmp ("-w", argv[i]) == 0) { + write_traces = TRUE; + argv[i] = (char*) ""; + } else if (strcmp ("--compare-traces", argv[i]) == 0 || strcmp ("-c", argv[i]) == 0) { + compare_traces = TRUE; + argv[i] = (char*) ""; + } else if (strcmp ("-?", argv[i]) == 0 || strcmp ("--help", argv[i]) == 0 || strcmp ("-h" , argv[i]) == 0) { + /* We have to override --help in order to document --no-interactive and the trace flags. */ + printf ("Usage:\n" + " %s [OPTION...]\n\n" + "Help Options:\n" + " -?, --help Show help options\n" + "Test Options:\n" + " -l List test cases available in a test executable\n" + " -seed=RANDOMSEED Provide a random seed to reproduce test\n" + " runs using random numbers\n" + " --verbose Run tests verbosely\n" + " -q, --quiet Run tests quietly\n" + " -p TESTPATH Execute all tests matching TESTPATH\n" + " -m {perf|slow|thorough|quick} Execute tests according modes\n" + " --debug-log Debug test logging output\n" + " -ni, --no-interactive Only execute tests which don't require user interaction\n" + " -i, --interactive Execute tests including those requiring user interaction\n" + " -t, --trace-dir [directory] Read/Write trace files in the specified directory\n" + " -w, --write-traces Work online and write trace files to --trace-dir\n" + " -c, --compare-traces Work online and compare with existing trace files in --trace-dir\n", + argv[0]); + exit (0); + } + } + + /* --[write|compare]-traces are mutually exclusive. */ + if (write_traces == TRUE && compare_traces == TRUE) { + fprintf (stderr, "Error: --write-traces and --compare-traces are mutually exclusive.\n"); + exit (1); + } + + g_test_init (&argc, &argv, NULL); + g_test_bug_base ("http://bugzilla.gnome.org/show_bug.cgi?id="); + + /* Set handler of debug information */ + g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, (GLogFunc) gdata_test_debug_handler, NULL); + + /* Enable full debugging. These options are seriously unsafe, but we don't care for test cases. */ + g_setenv ("LIBGDATA_DEBUG", "4" /* GDATA_LOG_FULL_UNREDACTED */, FALSE); + g_setenv ("G_MESSAGES_DEBUG", "libgdata", FALSE); + g_setenv ("LIBGDATA_LAX_SSL_CERTIFICATES", "1", FALSE); + + mock_server = uhm_server_new (); + uhm_server_set_enable_logging (mock_server, write_traces); + uhm_server_set_enable_online (mock_server, write_traces || compare_traces); + + /* Build the certificate. */ + cert_path = g_test_build_filename (G_TEST_DIST, "cert.pem", NULL); + key_path = g_test_build_filename (G_TEST_DIST, "key.pem", NULL); + + cert = g_tls_certificate_new_from_files (cert_path, key_path, &child_error); + g_assert_no_error (child_error); + + g_free (key_path); + g_free (cert_path); + + /* Set it as the property. */ + uhm_server_set_tls_certificate (mock_server, cert); + g_object_unref (cert); +} + +/* + * gdata_test_get_mock_server: + * + * Returns the singleton #UhmServer instance used throughout the test suite. + * + * Return value: (transfer none): the mock server + * + * Since: 0.13.4 + */ +UhmServer * +gdata_test_get_mock_server (void) +{ + return mock_server; +} + +/* + * gdata_test_interactive: + * + * Returns whether tests which require interactivity should be run. + * + * Return value: %TRUE if interactive tests should be run, %FALSE otherwise + * + * Since: 0.9.0 + */ +gboolean +gdata_test_interactive (void) +{ + return (no_interactive == FALSE) ? TRUE : FALSE; +} + +typedef struct { + GDataBatchOperation *operation; + guint op_id; + GDataBatchOperationType operation_type; + GDataEntry *entry; + GDataEntry **returned_entry; + gchar *id; + GType entry_type; + GError **error; +} BatchOperationData; + +static void +batch_operation_data_free (BatchOperationData *data) +{ + if (data->operation != NULL) + g_object_unref (data->operation); + if (data->entry != NULL) + g_object_unref (data->entry); + g_free (data->id); + + /* We don't free data->error, as it's owned by the calling code */ + + g_slice_free (BatchOperationData, data); +} + +static void +test_batch_operation_query_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) +{ + BatchOperationData *data = user_data; + + /* Mark the callback as having been run */ + g_object_set_data (G_OBJECT (data->operation), "test::called-callbacks", + GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->operation), "test::called-callbacks")) + 1)); + + /* Check that the @operation_type and @operation_id matches those stored in @data */ + g_assert_cmpuint (operation_id, ==, data->op_id); + g_assert_cmpuint (operation_type, ==, data->operation_type); + + /* If data->error is set, we're expecting the operation to fail; otherwise, we're expecting it to succeed */ + if (data->error != NULL) { + g_assert (error != NULL); + *(data->error) = g_error_copy (error); + g_assert (entry == NULL); + + if (data->returned_entry != NULL) + *(data->returned_entry) = NULL; + } else { + g_assert_no_error (error); + g_assert (entry != NULL); + g_assert (entry != data->entry); /* check that the pointers aren't the same */ + g_assert (gdata_entry_is_inserted (entry) == TRUE); + + /* Check the ID and type of the returned entry */ + /* TODO: We can't check this, because the Contacts service is stupid with IDs + * g_assert_cmpstr (gdata_entry_get_id (entry), ==, data->id); */ + g_assert (G_TYPE_CHECK_INSTANCE_TYPE (entry, data->entry_type)); + + /* Check the entries match */ + if (data->entry != NULL) { + g_assert_cmpstr (gdata_entry_get_title (entry), ==, gdata_entry_get_title (data->entry)); + g_assert_cmpstr (gdata_entry_get_summary (entry), ==, gdata_entry_get_summary (data->entry)); + g_assert_cmpstr (gdata_entry_get_content (entry), ==, gdata_entry_get_content (data->entry)); + g_assert_cmpstr (gdata_entry_get_content_uri (entry), ==, gdata_entry_get_content_uri (data->entry)); + g_assert_cmpstr (gdata_entry_get_rights (entry), ==, gdata_entry_get_rights (data->entry)); + } + + /* Copy the returned entry for the calling test code to prod later */ + if (data->returned_entry != NULL) + *(data->returned_entry) = g_object_ref (entry); + } + + /* Free the data */ + batch_operation_data_free (data); +} + +guint +gdata_test_batch_operation_query (GDataBatchOperation *operation, const gchar *id, GType entry_type, GDataEntry *entry, GDataEntry **returned_entry, + GError **error) +{ + guint op_id; + BatchOperationData *data; + + data = g_slice_new (BatchOperationData); + data->operation = g_object_ref (operation); + data->op_id = 0; + data->operation_type = GDATA_BATCH_OPERATION_QUERY; + data->entry = g_object_ref (entry); + data->returned_entry = returned_entry; + data->id = g_strdup (id); + data->entry_type = entry_type; + data->error = error; + + op_id = gdata_batch_operation_add_query (operation, id, entry_type, test_batch_operation_query_cb, data); + + data->op_id = op_id; + + /* We expect a callback to be called when the operation is run */ + g_object_set_data (G_OBJECT (operation), "test::expected-callbacks", + GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (operation), "test::expected-callbacks")) + 1)); + + return op_id; +} + +static void +test_batch_operation_insertion_update_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, + gpointer user_data) +{ + BatchOperationData *data = user_data; + + /* Mark the callback as having been run */ + g_object_set_data (G_OBJECT (data->operation), "test::called-callbacks", + GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->operation), "test::called-callbacks")) + 1)); + + /* Check that the @operation_type and @operation_id matches those stored in @data */ + g_assert_cmpuint (operation_id, ==, data->op_id); + g_assert_cmpuint (operation_type, ==, data->operation_type); + + /* If data->error is set, we're expecting the operation to fail; otherwise, we're expecting it to succeed */ + if (data->error != NULL) { + g_assert (error != NULL); + *(data->error) = g_error_copy (error); + g_assert (entry == NULL); + + if (data->returned_entry != NULL) + *(data->returned_entry) = NULL; + } else { + g_assert_no_error (error); + g_assert (entry != NULL); + g_assert (entry != data->entry); /* check that the pointers aren't the same */ + g_assert (gdata_entry_is_inserted (entry) == TRUE); + + /* Check the entries match */ + g_assert_cmpstr (gdata_entry_get_title (entry), ==, gdata_entry_get_title (data->entry)); + g_assert_cmpstr (gdata_entry_get_summary (entry), ==, gdata_entry_get_summary (data->entry)); + g_assert_cmpstr (gdata_entry_get_content (entry), ==, gdata_entry_get_content (data->entry)); + g_assert_cmpstr (gdata_entry_get_rights (entry), ==, gdata_entry_get_rights (data->entry)); + + /* Only test for differences in content URI if we had one to begin with, since the inserted entry could feasibly generate and return + * new content. */ + if (gdata_entry_get_content_uri (data->entry) != NULL) + g_assert_cmpstr (gdata_entry_get_content_uri (entry), ==, gdata_entry_get_content_uri (data->entry)); + + /* Copy the inserted entry for the calling test code to prod later */ + if (data->returned_entry != NULL) + *(data->returned_entry) = g_object_ref (entry); + } + + /* Free the data */ + batch_operation_data_free (data); +} + +guint +gdata_test_batch_operation_insertion (GDataBatchOperation *operation, GDataEntry *entry, GDataEntry **inserted_entry, GError **error) +{ + guint op_id; + BatchOperationData *data; + + data = g_slice_new (BatchOperationData); + data->operation = g_object_ref (operation); + data->op_id = 0; + data->operation_type = GDATA_BATCH_OPERATION_INSERTION; + data->entry = g_object_ref (entry); + data->returned_entry = inserted_entry; + data->id = NULL; + data->entry_type = G_TYPE_INVALID; + data->error = error; + + op_id = gdata_batch_operation_add_insertion (operation, entry, test_batch_operation_insertion_update_cb, data); + + data->op_id = op_id; + + /* We expect a callback to be called when the operation is run */ + g_object_set_data (G_OBJECT (operation), "test::expected-callbacks", + GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (operation), "test::expected-callbacks")) + 1)); + + return op_id; +} + +guint +gdata_test_batch_operation_update (GDataBatchOperation *operation, GDataEntry *entry, GDataEntry **updated_entry, GError **error) +{ + guint op_id; + BatchOperationData *data; + + data = g_slice_new (BatchOperationData); + data->operation = g_object_ref (operation); + data->op_id = 0; + data->operation_type = GDATA_BATCH_OPERATION_UPDATE; + data->entry = g_object_ref (entry); + data->returned_entry = updated_entry; + data->id = NULL; + data->entry_type = G_TYPE_INVALID; + data->error = error; + + op_id = gdata_batch_operation_add_update (operation, entry, test_batch_operation_insertion_update_cb, data); + + data->op_id = op_id; + + /* We expect a callback to be called when the operation is run */ + g_object_set_data (G_OBJECT (operation), "test::expected-callbacks", + GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (operation), "test::expected-callbacks")) + 1)); + + return op_id; +} + +static void +test_batch_operation_deletion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) +{ + BatchOperationData *data = user_data; + + /* Mark the callback as having been run */ + g_object_set_data (G_OBJECT (data->operation), "test::called-callbacks", + GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (data->operation), "test::called-callbacks")) + 1)); + + /* Check that the @operation_type and @operation_id matches those stored in @data */ + g_assert_cmpuint (operation_id, ==, data->op_id); + g_assert_cmpuint (operation_type, ==, data->operation_type); + g_assert (entry == NULL); + + /* If data->error is set, we're expecting the operation to fail; otherwise, we're expecting it to succeed */ + if (data->error != NULL) { + g_assert (error != NULL); + *(data->error) = g_error_copy (error); + } else { + g_assert_no_error (error); + } + + /* Free the data */ + batch_operation_data_free (data); +} + +guint +gdata_test_batch_operation_deletion (GDataBatchOperation *operation, GDataEntry *entry, GError **error) +{ + guint op_id; + BatchOperationData *data; + + data = g_slice_new (BatchOperationData); + data->operation = g_object_ref (operation); + data->op_id = 0; + data->operation_type = GDATA_BATCH_OPERATION_DELETION; + data->entry = g_object_ref (entry); + data->returned_entry = NULL; + data->id = NULL; + data->entry_type = G_TYPE_INVALID; + data->error = error; + + op_id = gdata_batch_operation_add_deletion (operation, entry, test_batch_operation_deletion_cb, data); + + data->op_id = op_id; + + /* We expect a callback to be called when the operation is run */ + g_object_set_data (G_OBJECT (operation), "test::expected-callbacks", + GUINT_TO_POINTER (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (operation), "test::expected-callbacks")) + 1)); + + return op_id; +} + +gboolean +gdata_test_batch_operation_run (GDataBatchOperation *operation, GCancellable *cancellable, GError **error) +{ + gboolean success = gdata_batch_operation_run (operation, cancellable, error); + + /* Assert that callbacks were called exactly once for each operation in the batch operation */ + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (operation), "test::expected-callbacks")), ==, + GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (operation), "test::called-callbacks"))); + + return success; +} + +gboolean +gdata_test_batch_operation_run_finish (GDataBatchOperation *operation, GAsyncResult *async_result, GError **error) +{ + gboolean success = gdata_batch_operation_run_finish (operation, async_result, error); + + /* Assert that callbacks were called exactly once for each operation in the batch operation */ + g_assert_cmpuint (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (operation), "test::expected-callbacks")), ==, + GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (operation), "test::called-callbacks"))); + + return success; +} + +static gboolean +compare_xml_namespaces (xmlNs *ns1, xmlNs *ns2) +{ + if (ns1 == ns2) + return TRUE; + + /* Compare various simple properties */ + if (ns1->type != ns2->type || + xmlStrcmp (ns1->href, ns2->href) != 0 || + xmlStrcmp (ns1->prefix, ns2->prefix) != 0 || + ns1->context != ns2->context) { + return FALSE; + } + + return TRUE; +} + +static gboolean compare_xml_nodes (xmlNode *node1, xmlNode *node2); + +static gboolean +compare_xml_node_lists (xmlNode *list1, xmlNode *list2) +{ + GHashTable *table; + xmlNode *child; + + /* Compare their child elements. We iterate through the first linked list and, for each child node, iterate through the second linked list + * comparing it against each node there. We keep a hashed set of nodes in the second linked list which have already been visited and compared + * successfully, both for speed and to guarantee that one element in the second linked list doesn't match more than one in the first linked + * list. We take this approach because we can't modify the second linked list in place to remove matched nodes. + * Finally, we iterate through the second node list and check that all its elements are in the hash table (i.e. they've all been visited + * exactly once). + * This approach is O(n^2) in the number of nodes in the linked lists, but since we should be dealing with fairly narrow XML trees this should + * be OK. */ + table = g_hash_table_new (g_direct_hash, g_direct_equal); + + for (child = list1; child != NULL; child = child->next) { + xmlNode *other_child; + gboolean matched = FALSE; + + for (other_child = list2; other_child != NULL; other_child = other_child->next) { + if (g_hash_table_lookup (table, other_child) != NULL) + continue; + + if (compare_xml_nodes (child, other_child) == TRUE) { + g_hash_table_insert (table, other_child, other_child); + matched = TRUE; + break; + } + } + + if (matched == FALSE) { + g_hash_table_destroy (table); + return FALSE; + } + } + + for (child = list2; child != NULL; child = child->next) { + if (g_hash_table_lookup (table, child) == NULL) { + g_hash_table_destroy (table); + return FALSE; + } + } + + g_hash_table_destroy (table); + + return TRUE; +} + +static gboolean +compare_xml_nodes (xmlNode *node1, xmlNode *node2) +{ + GHashTable *table; + xmlAttr *attr1, *attr2; + xmlNs *ns; + + if (node1 == node2) + return TRUE; + + /* Compare various simple properties */ + if (node1->type != node2->type || + xmlStrcmp (node1->name, node2->name) != 0 || + compare_xml_namespaces (node1->ns, node2->ns) == FALSE || + xmlStrcmp (node1->content, node2->content) != 0) { + return FALSE; + } + + /* Compare their attributes. This is done in document order, which isn't strictly correct, since XML specifically does not apply an ordering + * over attributes. However, it suffices for our needs. */ + for (attr1 = node1->properties, attr2 = node2->properties; attr1 != NULL && attr2 != NULL; attr1 = attr1->next, attr2 = attr2->next) { + /* Compare various simple properties */ + if (attr1->type != attr2->type || + xmlStrcmp (attr1->name, attr2->name) != 0 || + compare_xml_namespaces (attr1->ns, attr2->ns) == FALSE || + attr1->atype != attr2->atype) { + return FALSE; + } + + /* Compare their child nodes (values represented as text and entity nodes) */ + if (compare_xml_node_lists (attr1->children, attr2->children) == FALSE) + return FALSE; + } + + /* Stragglers? */ + if (attr1 != NULL || attr2 != NULL) + return FALSE; + + /* Compare their namespace definitions regardless of order. Do this by inserting all the definitions from node1 into a hash table, then running + * through the definitions in node2 and ensuring they exist in the hash table, removing each one from the table as we go. Check there aren't + * any left in the hash table afterwards. */ + table = g_hash_table_new (g_str_hash, g_str_equal); + + for (ns = node1->nsDef; ns != NULL; ns = ns->next) { + /* Prefixes should be unique, but I trust libxml about as far as I can throw it. */ + if (g_hash_table_lookup (table, ns->prefix ? ns->prefix : (gpointer) "") != NULL) { + g_hash_table_destroy (table); + return FALSE; + } + + g_hash_table_insert (table, ns->prefix ? (gpointer) ns->prefix : (gpointer) "", ns); + } + + for (ns = node2->nsDef; ns != NULL; ns = ns->next) { + xmlNs *original_ns = g_hash_table_lookup (table, ns->prefix ? ns->prefix : (gpointer) ""); + + if (original_ns == NULL || + compare_xml_namespaces (original_ns, ns) == FALSE) { + g_hash_table_destroy (table); + return FALSE; + } + + g_hash_table_remove (table, ns->prefix ? ns->prefix : (gpointer) ""); + } + + if (g_hash_table_size (table) != 0) { + g_hash_table_destroy (table); + return FALSE; + } + + g_hash_table_destroy (table); + + /* Compare their child nodes */ + if (compare_xml_node_lists (node1->children, node2->children) == FALSE) + return FALSE; + + /* Success! */ + return TRUE; +} + +gboolean +gdata_test_compare_xml_strings (const gchar *parsable_xml, const gchar *expected_xml, gboolean print_error) +{ + gboolean success; + xmlDoc *parsable_doc, *expected_doc; + + /* Parse both the XML strings */ + parsable_doc = xmlReadMemory (parsable_xml, strlen (parsable_xml), "/dev/null", NULL, 0); + expected_doc = xmlReadMemory (expected_xml, strlen (expected_xml), "/dev/null", NULL, 0); + + g_assert (parsable_doc != NULL && expected_doc != NULL); + + /* Recursively compare the two XML trees */ + success = compare_xml_nodes (xmlDocGetRootElement (parsable_doc), xmlDocGetRootElement (expected_doc)); + if (success == FALSE && print_error == TRUE) { + /* The comparison has failed, so print out the two XML strings for ease of debugging */ + g_message ("\n\nParsable: %s\n\nExpected: %s\n\n", parsable_xml, expected_xml); + } + + xmlFreeDoc (expected_doc); + xmlFreeDoc (parsable_doc); + + return success; +} + +gboolean +gdata_test_compare_xml (GDataParsable *parsable, const gchar *expected_xml, gboolean print_error) +{ + gboolean success; + gchar *parsable_xml; + + /* Get an XML string for the GDataParsable */ + parsable_xml = gdata_parsable_get_xml (parsable); + success = gdata_test_compare_xml_strings (parsable_xml, expected_xml, print_error); + g_free (parsable_xml); + + return success; +} + +static gboolean +compare_json_nodes (JsonNode *node1, JsonNode *node2) +{ + if (node1 == node2) + return TRUE; + + if (JSON_NODE_TYPE (node1) != JSON_NODE_TYPE (node2)) + return FALSE; + + switch (JSON_NODE_TYPE (node1)) { + case JSON_NODE_OBJECT: { + JsonObject *object1, *object2; + guint size1, size2; + GList *members, *i; + + object1 = json_node_get_object (node1); + object2 = json_node_get_object (node2); + + size1 = json_object_get_size (object1); + size2 = json_object_get_size (object2); + + if (size1 != size2) + return FALSE; + + /* Iterate over the first object, checking that every member is also present in the second object. */ + members = json_object_get_members (object1); + + for (i = members; i != NULL; i = i->next) { + JsonNode *child_node1, *child_node2; + + child_node1 = json_object_get_member (object1, i->data); + child_node2 = json_object_get_member (object2, i->data); + + g_assert (child_node1 != NULL); + if (child_node2 == NULL) { + g_list_free (members); + return FALSE; + } + + if (compare_json_nodes (child_node1, child_node2) == FALSE) { + g_list_free (members); + return FALSE; + } + } + + g_list_free (members); + + return TRUE; + } + case JSON_NODE_ARRAY: { + JsonArray *array1, *array2; + guint length1, length2, i; + + array1 = json_node_get_array (node1); + array2 = json_node_get_array (node2); + + length1 = json_array_get_length (array1); + length2 = json_array_get_length (array2); + + if (length1 != length2) + return FALSE; + + /* Iterate over both arrays, checking the elements at each index are identical. */ + for (i = 0; i < length1; i++) { + JsonNode *child_node1, *child_node2; + + child_node1 = json_array_get_element (array1, i); + child_node2 = json_array_get_element (array2, i); + + if (compare_json_nodes (child_node1, child_node2) == FALSE) + return FALSE; + } + + return TRUE; + } + case JSON_NODE_VALUE: { + GType type1, type2; + + type1 = json_node_get_value_type (node1); + type2 = json_node_get_value_type (node2); + + if (type1 != type2) + return FALSE; + + switch (type1) { + case G_TYPE_BOOLEAN: + return (json_node_get_boolean (node1) == json_node_get_boolean (node2)) ? TRUE : FALSE; + case G_TYPE_DOUBLE: + /* Note: This doesn't need an epsilon-based comparison because we only want to return + * true if the string representation of the two values is equal — and if it is, their + * parsed values should be binary identical too. */ + return (json_node_get_double (node1) == json_node_get_double (node2)) ? TRUE : FALSE; + case G_TYPE_INT64: + return (json_node_get_int (node1) == json_node_get_int (node2)) ? TRUE : FALSE; + case G_TYPE_STRING: + return (g_strcmp0 (json_node_get_string (node1), json_node_get_string (node2)) == 0) ? TRUE : FALSE; + default: + /* JSON doesn't support any other types. */ + g_assert_not_reached (); + } + + return TRUE; + } + case JSON_NODE_NULL: + return TRUE; + default: + g_assert_not_reached (); + } +} + +gboolean +gdata_test_compare_json_strings (const gchar *parsable_json, const gchar *expected_json, gboolean print_error) +{ + gboolean success; + JsonParser *parsable_parser, *expected_parser; + GError *child_error = NULL; + + /* Parse both strings. */ + parsable_parser = json_parser_new (); + expected_parser = json_parser_new (); + + json_parser_load_from_data (parsable_parser, parsable_json, -1, &child_error); + if (child_error != NULL) { + if (print_error == TRUE) { + g_message ("\n\nParsable: %s\n\nNot valid JSON: %s", parsable_json, child_error->message); + } + + g_error_free (child_error); + return FALSE; + } + + json_parser_load_from_data (expected_parser, expected_json, -1, &child_error); + g_assert_no_error (child_error); /* this really should never fail; or the test has encoded bad JSON */ + + /* Recursively compare the two JSON nodes. */ + success = compare_json_nodes (json_parser_get_root (parsable_parser), json_parser_get_root (expected_parser)); + if (success == FALSE && print_error == TRUE) { + /* The comparison has failed, so print out the two JSON strings for ease of debugging */ + g_message ("\n\nParsable: %s\n\nExpected: %s\n\n", parsable_json, expected_json); + } + + g_object_unref (expected_parser); + g_object_unref (parsable_parser); + + return success; +} + +gboolean +gdata_test_compare_json (GDataParsable *parsable, const gchar *expected_json, gboolean print_error) +{ + gboolean success; + gchar *parsable_json; + + /* Get a JSON string for the GDataParsable. */ + parsable_json = gdata_parsable_get_json (parsable); + success = gdata_test_compare_json_strings (parsable_json, expected_json, print_error); + g_free (parsable_json); + + return success; +} + +gboolean +gdata_test_compare_kind (GDataEntry *entry, const gchar *expected_term, const gchar *expected_label) +{ + GList *list; + + /* Check the entry's kind category is present and correct */ + for (list = gdata_entry_get_categories (entry); list != NULL; list = list->next) { + GDataCategory *category = GDATA_CATEGORY (list->data); + + if (g_strcmp0 (gdata_category_get_scheme (category), "http://schemas.google.com/g/2005#kind") == 0) { + /* Found the kind category; check its term and label. */ + return (g_strcmp0 (gdata_category_get_term (category), expected_term) == 0) && + (g_strcmp0 (gdata_category_get_label (category), expected_label) == 0); + } + } + + /* No kind! */ + return FALSE; +} + +/* Common code for tests of async query functions that have progress callbacks */ + +void +gdata_test_async_progress_callback (GDataEntry *entry, guint entry_key, guint entry_count, GDataAsyncProgressClosure *data) +{ + /* No-op */ +} + +void +gdata_test_async_progress_closure_free (GDataAsyncProgressClosure *data) +{ + /* Check that this callback is called first */ + g_assert_cmpuint (data->async_ready_notify_count, ==, 0); + data->progress_destroy_notify_count++; +} + +void +gdata_test_async_progress_finish_callback (GObject *service, GAsyncResult *res, GDataAsyncProgressClosure *data) +{ + /* Check that this callback is called second */ + g_assert_cmpuint (data->progress_destroy_notify_count, ==, 1); + data->async_ready_notify_count++; + + g_main_loop_quit (data->main_loop); +} + +gboolean +gdata_async_test_cancellation_cb (GDataAsyncTestData *async_data) +{ + g_cancellable_cancel (async_data->cancellable); + async_data->cancellation_timeout_id = 0; + return FALSE; +} + +void +gdata_set_up_async_test_data (GDataAsyncTestData *async_data, gconstpointer test_data) +{ + async_data->main_loop = g_main_loop_new (NULL, FALSE); + async_data->cancellable = g_cancellable_new (); + async_data->cancellation_timeout = 0; + async_data->cancellation_successful = FALSE; + + async_data->test_data = test_data; +} + +void +gdata_tear_down_async_test_data (GDataAsyncTestData *async_data, gconstpointer test_data) +{ + g_assert (async_data->test_data == test_data); /* sanity check */ + + g_object_unref (async_data->cancellable); + g_main_loop_unref (async_data->main_loop); +} + +/* Output a log message. Note the output is prefixed with ‘# ’ so that it + * doesn’t interfere with TAP output. */ +static void +output_commented_lines (const gchar *message) +{ + const gchar *i, *next_newline; + + for (i = message; i != NULL && *i != '\0'; i = next_newline) { + gchar *line; + + next_newline = strchr (i, '\n'); + if (next_newline != NULL) { + line = g_strndup (i, next_newline - i); + next_newline++; + } else { + line = g_strdup (i); + } + + printf ("# %s\n", line); + + g_free (line); + } +} + +static void +output_log_message (const gchar *message) +{ + if (strlen (message) > 2 && message[2] == '<') { + /* As debug string starts with direction indicator and space, t.i. "< ", */ + /* we need access string starting from third character and see if it's */ + /* looks like xml - t.i. it starts with '<' */ + xmlChar *xml_buff; + int buffer_size; + xmlDocPtr xml_doc; + /* we need to cut to the begining of XML string */ + message = message + 2; + /* create xml document and dump it to string buffer */ + xml_doc = xmlParseDoc ((const xmlChar*) message); + xmlDocDumpFormatMemory (xml_doc, &xml_buff, &buffer_size, 1); + /* print out structured xml - if it's not xml, it will get error in output */ + output_commented_lines ((gchar*) xml_buff); + /* free xml structs */ + xmlFree (xml_buff); + xmlFreeDoc (xml_doc); + } else { + output_commented_lines ((gchar*) message); + } +} + +static void +gdata_test_debug_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) +{ + output_log_message (message); + + /* Log to the trace file. */ + if ((*message == '<' || *message == '>' || *message == ' ') && *(message + 1) == ' ') { + uhm_server_received_message_chunk (mock_server, message, strlen (message), NULL); + } +} + +/** + * gdata_test_set_https_port: + * @server: a #UhmServer + * + * Sets the HTTPS port used for all future libgdata requests to that used by the given mock @server, + * effectively redirecting all client requests to the mock server. + * + * Since: 0.13.4 + */ +void +gdata_test_set_https_port (UhmServer *server) +{ + gchar *port_string = g_strdup_printf ("%u", uhm_server_get_port (server)); + g_setenv ("LIBGDATA_HTTPS_PORT", port_string, TRUE); + g_free (port_string); +} + +/** + * gdata_test_mock_server_start_trace: + * @server: a #UhmServer + * @trace_filename: filename of the trace to load + * + * Wrapper around uhm_server_start_trace() which additionally sets the LIBGDATA_HTTPS_PORT + * environment variable to redirect all libgdata requests to the mock server. + * + * Since: 0.13.4 + */ +void +gdata_test_mock_server_start_trace (UhmServer *server, const gchar *trace_filename) +{ + GError *child_error = NULL; + + uhm_server_start_trace (server, trace_filename, &child_error); + g_assert_no_error (child_error); + gdata_test_set_https_port (server); +} + +/** + * gdata_test_mock_server_handle_message_error: + * @server: a #UhmServer + * @message: the message whose response should be filled + * @client: the currently connected client + * @user_data: user data provided when connecting the signal + * + * Handler for #UhmServer::handle-message which sets the HTTP response for @message to the HTTP error status + * specified in a #GDataTestRequestErrorData structure passed to @user_data. + * + * Since: 0.13.4 + */ +gboolean +gdata_test_mock_server_handle_message_error (UhmServer *server, SoupMessage *message, SoupClientContext *client, gpointer user_data) +{ + const GDataTestRequestErrorData *data = user_data; + + soup_message_set_status_full (message, data->status_code, data->reason_phrase); + soup_message_body_append (message->response_body, SOUP_MEMORY_STATIC, data->message_body, strlen (data->message_body)); + + return TRUE; +} + +/** + * gdata_test_mock_server_handle_message_timeout: + * @server: a #UhmServer + * @message: the message whose response should be filled + * @client: the currently connected client + * @user_data: user data provided when connecting the signal + * + * Handler for #UhmServer::handle-message which waits for 2 seconds before returning a %SOUP_STATUS_REQUEST_TIMEOUT status + * and appropriate error message body. If used in conjunction with a 1 second timeout in the client code under test, this can + * simulate network error conditions and timeouts, in order to test the error handling code for such conditions. + * + * Since: 0.13.4 + */ +gboolean +gdata_test_mock_server_handle_message_timeout (UhmServer *server, SoupMessage *message, SoupClientContext *client, gpointer user_data) +{ + /* Sleep for longer than the timeout set on the client. */ + g_usleep (2 * G_USEC_PER_SEC); + + soup_message_set_status_full (message, SOUP_STATUS_REQUEST_TIMEOUT, "Request Timeout"); + soup_message_body_append (message->response_body, SOUP_MEMORY_STATIC, "Request timed out.", strlen ("Request timed out.")); + + return TRUE; +} + +/** + * gdata_test_query_user_for_verifier: + * @authentication_uri: authentication URI to present + * + * Given an authentication URI, prompt the user to go to that URI, grant access + * to the test application and enter the resulting verifier. This is to be used + * with interactive OAuth authorisation requests. + * + * Returns: (transfer full): verifier from the web page + */ +gchar * +gdata_test_query_user_for_verifier (const gchar *authentication_uri) +{ + char verifier[100]; + + /* Wait for the user to retrieve and enter the verifier */ + g_print ("Please navigate to the following URI and grant access: %s\n", authentication_uri); + g_print ("Enter verifier (EOF to skip test): "); + if (scanf ("%100s", verifier) != 1) { + /* Skip the test */ + g_test_message ("Skipping test on user request."); + return NULL; + } + + g_test_message ("Proceeding with user-provided verifier “%s”.", verifier); + + return g_strdup (verifier); +} diff --git a/gdata/tests/common.h b/gdata/tests/common.h new file mode 100644 index 0000000..92ff753 --- /dev/null +++ b/gdata/tests/common.h @@ -0,0 +1,344 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#include +#include + +#include + +#ifndef GDATA_TEST_COMMON_H +#define GDATA_TEST_COMMON_H + +G_BEGIN_DECLS + +#define CLIENT_ID "ytapi-GNOME-libgdata-444fubtt-0" +#define DOCUMENTS_USERNAME "libgdata.documents@gmail.com" + +/* These two must match */ +#define USERNAME_NO_DOMAIN "libgdata.test" +#define USERNAME USERNAME_NO_DOMAIN "@gmail.com" + +/* This must not match the above two */ +#define INCORRECT_USERNAME "libgdata.test.invalid@gmail.com" + +/* These two must not match (obviously) */ +#define PASSWORD "gdata-gdata" +#define INCORRECT_PASSWORD "bad-password" + +/* The amount of fuzziness (in seconds) used in comparisons between times which should (theoretically) be equal. + * Due to the weak consistency used in Google's servers, it's hard to guarantee that timestamps which should be equal, + * actually are. */ +#define TIME_FUZZINESS 5 + +void gdata_test_init (int argc, char **argv); + +UhmServer *gdata_test_get_mock_server (void) G_GNUC_WARN_UNUSED_RESULT; + +gboolean gdata_test_interactive (void); + +guint gdata_test_batch_operation_query (GDataBatchOperation *operation, const gchar *id, GType entry_type, + GDataEntry *entry, GDataEntry **returned_entry, GError **error); +guint gdata_test_batch_operation_insertion (GDataBatchOperation *operation, GDataEntry *entry, GDataEntry **inserted_entry, GError **error); +guint gdata_test_batch_operation_update (GDataBatchOperation *operation, GDataEntry *entry, GDataEntry **updated_entry, GError **error); +guint gdata_test_batch_operation_deletion (GDataBatchOperation *operation, GDataEntry *entry, GError **error); + +gboolean gdata_test_batch_operation_run (GDataBatchOperation *operation, GCancellable *cancellable, GError **error); +gboolean gdata_test_batch_operation_run_finish (GDataBatchOperation *operation, GAsyncResult *async_result, GError **error); + +gboolean gdata_test_compare_xml_strings (const gchar *parsable_xml, const gchar *expected_xml, gboolean print_error); +gboolean gdata_test_compare_xml (GDataParsable *parsable, const gchar *expected_xml, gboolean print_error); + +gboolean gdata_test_compare_json_strings (const gchar *parsable_json, const gchar *expected_json, gboolean print_error); +gboolean gdata_test_compare_json (GDataParsable *parsable, const gchar *expected_json, gboolean print_error); + +gboolean gdata_test_compare_kind (GDataEntry *entry, const gchar *expected_term, const gchar *expected_label); + +/* Convenience macros. */ +#define gdata_test_assert_xml(Parsable, XML) \ + G_STMT_START { \ + gboolean _test_success = gdata_test_compare_xml (GDATA_PARSABLE (Parsable), XML, TRUE); \ + g_assert (_test_success == TRUE); \ + } G_STMT_END + +#define gdata_test_assert_json(Parsable, JSON) \ + G_STMT_START { \ + gboolean _test_success = gdata_test_compare_json (GDATA_PARSABLE (Parsable), JSON, TRUE); \ + g_assert (_test_success == TRUE); \ + } G_STMT_END + +/* Common code for tests of async query functions that have progress callbacks */ +typedef struct { + guint progress_destroy_notify_count; + guint async_ready_notify_count; + GMainLoop *main_loop; +} GDataAsyncProgressClosure; +void gdata_test_async_progress_callback (GDataEntry *entry, guint entry_key, guint entry_count, GDataAsyncProgressClosure *data); +void gdata_test_async_progress_closure_free (GDataAsyncProgressClosure *data); +void gdata_test_async_progress_finish_callback (GObject *service, GAsyncResult *res, GDataAsyncProgressClosure *data); + +typedef struct { + /*< private >*/ + GMainLoop *main_loop; + GCancellable *cancellable; + guint cancellation_timeout; /* timeout period in ms */ + guint cancellation_timeout_id; /* ID of the callback source */ + gboolean cancellation_successful; + + gconstpointer test_data; +} GDataAsyncTestData; + +/** + * GDATA_ASYNC_CLOSURE_FUNCTIONS: + * @CLOSURE_NAME: the name of the closure + * @TestStructType: the type of the synchronous closure structure + * + * Defines set up and tear down functions for a version of @TestStructType which is wrapped by #GDataAsyncTestData (i.e. allocated and pointed to by + * the #GDataAsyncTestData.test_data pointer). These functions will be named set_up_CLOSURE_NAME_async + * and tear_down_CLOSURE_NAME_async. + * + * Since: 0.10.0 + */ +#define GDATA_ASYNC_CLOSURE_FUNCTIONS(CLOSURE_NAME, TestStructType) \ +static void \ +set_up_##CLOSURE_NAME##_async (GDataAsyncTestData *async_data, gconstpointer service) \ +{ \ + TestStructType *test_data = g_slice_new (TestStructType); \ + set_up_##CLOSURE_NAME (test_data, service); \ + gdata_set_up_async_test_data (async_data, test_data); \ +} \ + \ +static void \ +tear_down_##CLOSURE_NAME##_async (GDataAsyncTestData *async_data, gconstpointer service) \ +{ \ + tear_down_##CLOSURE_NAME ((TestStructType*) async_data->test_data, service); \ + g_slice_free (TestStructType, (TestStructType*) async_data->test_data); \ + gdata_tear_down_async_test_data (async_data, async_data->test_data); \ +} + +/** + * GDATA_ASYNC_STARTING_TIMEOUT: + * + * The initial timeout for cancellation tests, which will be the first timeout used after testing cancelling the operation before it's started. + * The value is in milliseconds. + * + * Since: 0.10.0 + */ +#define GDATA_ASYNC_STARTING_TIMEOUT 20 /* ms */ + +/** + * GDATA_ASYNC_TIMEOUT_MULTIPLIER: + * + * The factor by which the asynchronous cancellation timeout will be multiplied between iterations of the cancellation test. + * + * Since: 0.10.0 + */ +#define GDATA_ASYNC_TIMEOUT_MULTIPLIER 3 + +/** + * GDATA_ASYNC_MAXIMUM_TIMEOUT: + * + * The maximum timeout value for cancellation tests before they fail. i.e. If an operation takes longer than this period of time, the asynchronous + * operation test will fail. + * The value is in milliseconds. + * + * Since: 0.10.0 + */ +#define GDATA_ASYNC_MAXIMUM_TIMEOUT 43740 /* ms */ + +/** + * GDATA_ASYNC_TEST_FUNCTIONS: + * @TEST_NAME: the name of the test, excluding the “test_” prefix and the “_async” suffix + * @TestStructType: type of the closure structure to use, or void + * @TEST_BEGIN_CODE: code to execute to begin the test and start the asynchronous call + * @TEST_END_CODE: code to execute once the asynchronous call has completed, which will check the return values and any changed state + * + * Defines test and callback functions to test normal asynchronous operation and the cancellation behaviour of the given asynchronous function call. + * + * The asynchronous function call should be started in @TEST_BEGIN_CODE, using cancellable as its #GCancellable parameter, + * async_ready_callback as its #GAsyncReadyCallback parameter and async_data as its user_data + * parameter. There is no need for the code to create its own main loop: that's taken care of by the wrapper code. + * + * The code in @TEST_END_CODE will be inserted into the callback function for both the normal asynchronous test and the cancellation test, so should + * finish the asynchronous function call, using obj as the object on which the asynchronous function call was made, + * async_result as its #GAsyncResult parameter and error as its #GError parameter. The code should then check + * error: if it's %NULL, the code should assert success conditions; if it's non-%NULL, the code should assert failure conditions. + * The wrapper code will ensure that the error is a %G_IO_ERROR_CANCELLED at the appropriate times. + * + * The following functions will be defined, and should be added to the test suite using the #GAsyncTestData closure structure: + * test_TEST_NAME_async and + * test_TEST_NAME_async_cancellation. + * + * These functions assume the existence of a mock_server variable which points to the current #UhmServer instance. They + * will automatically use traces TEST_NAME-async and + * TEST_NAME-async-cancellation. + * + * Since: 0.10.0 + */ +#define GDATA_ASYNC_TEST_FUNCTIONS(TEST_NAME, TestStructType, TEST_BEGIN_CODE, TEST_END_CODE) \ +static void \ +test_##TEST_NAME##_async_cb (GObject *obj, GAsyncResult *async_result, GDataAsyncTestData *async_data) \ +{ \ + TestStructType *data = (TestStructType*) async_data->test_data; \ + GError *error = NULL; \ + \ + (void) data; /* hide potential unused variable warning */ \ + \ + { \ + TEST_END_CODE; \ + \ + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) == TRUE) { \ + g_assert (g_cancellable_is_cancelled (async_data->cancellable) == TRUE); \ + async_data->cancellation_successful = TRUE; \ + } else if (error == NULL) { \ + g_assert (g_cancellable_is_cancelled (async_data->cancellable) == FALSE || async_data->cancellation_timeout > 0); \ + async_data->cancellation_successful = FALSE; \ + } else { \ + /* Unexpected error: explode. */ \ + g_assert_no_error (error); \ + async_data->cancellation_successful = FALSE; \ + } \ + } \ + \ + g_clear_error (&error); \ + \ + g_main_loop_quit (async_data->main_loop); \ +} \ +\ +static void \ +test_##TEST_NAME##_async (GDataAsyncTestData *async_data, gconstpointer service) \ +{ \ + GAsyncReadyCallback async_ready_callback = (GAsyncReadyCallback) test_##TEST_NAME##_async_cb; \ + TestStructType *data = (TestStructType*) async_data->test_data; \ + GCancellable *cancellable = NULL; /* don't expose the cancellable, so the test proceeds as normal */ \ + \ + (void) data; /* hide potential unused variable warning */ \ + \ + /* Just run the test without doing any cancellation, and assert that it succeeds. */ \ + async_data->cancellation_timeout = 0; \ + \ + g_test_message ("Running normal operation test…"); \ + \ + gdata_test_mock_server_start_trace (mock_server, G_STRINGIFY (TEST_NAME) "-async"); \ + \ + { \ + TEST_BEGIN_CODE; \ + } \ + \ + g_main_loop_run (async_data->main_loop); \ + \ + uhm_server_end_trace (mock_server); \ +} \ + \ +static void \ +test_##TEST_NAME##_async_cancellation (GDataAsyncTestData *async_data, gconstpointer service) \ +{ \ + async_data->cancellation_timeout = 0; \ + \ + /* Starting with a short timeout, repeatedly run the async. operation, cancelling it after the timeout and increasing the timeout until + * the operation succeeds for the first time. We then finish the test. This guarantees that if, for example, the test creates an entry on + * the server, it only ever creates one; because the test only ever succeeds once. (Of course, this assumes that the server does not change + * state if we cancel the operation, which is a fairly optimistic assumption. Sigh.) */ \ + do { \ + GCancellable *cancellable = async_data->cancellable; \ + GAsyncReadyCallback async_ready_callback = (GAsyncReadyCallback) test_##TEST_NAME##_async_cb; \ + TestStructType *data = (TestStructType*) async_data->test_data; \ + \ + gdata_test_mock_server_start_trace (mock_server, G_STRINGIFY (TEST_NAME) "-async-cancellation"); \ + \ + (void) data; /* hide potential unused variable warning */ \ + \ + /* Ensure the timeout remains sane. */ \ + g_assert_cmpuint (async_data->cancellation_timeout, <=, GDATA_ASYNC_MAXIMUM_TIMEOUT); \ + \ + /* Schedule the cancellation after the timeout. */ \ + if (async_data->cancellation_timeout == 0) { \ + /* For the first test, cancel the cancellable before the test code is run */ \ + gdata_async_test_cancellation_cb (async_data); \ + } else { \ + async_data->cancellation_timeout_id = g_timeout_add (async_data->cancellation_timeout, \ + (GSourceFunc) gdata_async_test_cancellation_cb, async_data); \ + } \ + \ + /* Mark the cancellation as unsuccessful and hope we get proven wrong. */ \ + async_data->cancellation_successful = FALSE; \ + \ + g_test_message ("Running cancellation test with timeout of %u ms…", async_data->cancellation_timeout); \ + \ + { \ + TEST_BEGIN_CODE; \ + } \ + \ + g_main_loop_run (async_data->main_loop); \ + \ + /* Reset the cancellable for the next iteration and increase the timeout geometrically. */ \ + g_cancellable_reset (cancellable); \ + \ + if (async_data->cancellation_timeout == 0) { \ + async_data->cancellation_timeout = GDATA_ASYNC_STARTING_TIMEOUT; /* ms */ \ + } else { \ + async_data->cancellation_timeout *= GDATA_ASYNC_TIMEOUT_MULTIPLIER; \ + } \ + \ + uhm_server_end_trace (mock_server); \ + } while (async_data->cancellation_successful == TRUE); \ + \ + /* Clean up the last timeout callback */ \ + if (async_data->cancellation_timeout_id != 0) { \ + g_source_remove (async_data->cancellation_timeout_id); \ + } \ +} + +gboolean gdata_async_test_cancellation_cb (GDataAsyncTestData *async_data); +void gdata_set_up_async_test_data (GDataAsyncTestData *async_data, gconstpointer test_data); +void gdata_tear_down_async_test_data (GDataAsyncTestData *async_data, gconstpointer test_data); + +/** + * GDataTestRequestErrorData: + * @status_code: HTTP response status code + * @reason_phrase: HTTP response status phrase + * @message_body: HTTP response message body + * @error_domain_func: constant function returning the #GQuark for the expected error domain + * @error_code: expected error code + * + * A mapping between a HTTP response emitted by a #UhmServer and the error expected to be thrown by the HTTP client. + * This is designed for testing error handling in the client code, typically by running a single request through an array + * of these such mappings and testing the client code throws the correct error in each case. + * + * Since: 0.13.4 + */ +typedef struct { + /* HTTP response. */ + guint status_code; + const gchar *reason_phrase; + const gchar *message_body; + /* Expected GData error. */ + GQuark (*error_domain_func) (void); /* typically gdata_service_error_quark */ + gint error_code; +} GDataTestRequestErrorData; + +void gdata_test_set_https_port (UhmServer *server); +void gdata_test_mock_server_start_trace (UhmServer *server, const gchar *trace_filename); +gboolean gdata_test_mock_server_handle_message_error (UhmServer *server, SoupMessage *message, SoupClientContext *client, gpointer user_data); +gboolean gdata_test_mock_server_handle_message_timeout (UhmServer *server, SoupMessage *message, SoupClientContext *client, gpointer user_data); + +gchar *gdata_test_query_user_for_verifier (const gchar *authentication_uri) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_TEST_COMMON_H */ diff --git a/gdata/tests/contacts.c b/gdata/tests/contacts.c new file mode 100644 index 0000000..48d7011 --- /dev/null +++ b/gdata/tests/contacts.c @@ -0,0 +1,2702 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2009, 2010, 2011, 2014 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#include +#include +#include + +#include "gdata.h" +#include "common.h" +#include "gdata-dummy-authorizer.h" + +static UhmServer *mock_server = NULL; + +#undef CLIENT_ID /* from common.h */ + +#define CLIENT_ID "352818697630-nqu2cmt5quqd6lr17ouoqmb684u84l1f.apps.googleusercontent.com" +#define CLIENT_SECRET "-fA4pHQJxR3zJ-FyAMPQsikg" +#define REDIRECT_URI "urn:ietf:wg:oauth:2.0:oob" + +typedef struct { + GDataContactsContact *contact; +} TempContactData; + +static void +set_up_temp_contact (TempContactData *data, gconstpointer service) +{ + GDataContactsContact *contact; + + gdata_test_mock_server_start_trace (mock_server, "setup-temp-contact"); + + /* Create a new temporary contact to use for a single test */ + contact = gdata_contacts_contact_new (NULL); + gdata_contacts_contact_set_nickname (contact, "Test Contact Esq."); + + /* Insert the contact */ + data->contact = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, NULL); + g_assert (GDATA_IS_CONTACTS_CONTACT (data->contact)); + gdata_test_compare_kind (GDATA_ENTRY (data->contact), "http://schemas.google.com/contact/2008#contact", NULL); + + g_object_unref (contact); + + uhm_server_end_trace (mock_server); + + /* HACK. Wait for the server to propagate distributed changes. */ + if (uhm_server_get_enable_online (mock_server) == TRUE) { + sleep (10); + } +} + +static void +tear_down_temp_contact (TempContactData *data, gconstpointer service) +{ + GDataEntry *updated_contact; + + gdata_test_mock_server_start_trace (mock_server, "teardown-temp-contact"); + + /* Re-query for the contact to get any updated ETags */ + updated_contact = gdata_service_query_single_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + gdata_entry_get_id (GDATA_ENTRY (data->contact)), NULL, GDATA_TYPE_CONTACTS_CONTACT, + NULL, NULL); + g_assert (GDATA_IS_CONTACTS_CONTACT (updated_contact)); + + g_object_unref (data->contact); + + /* Delete the new/updated contact */ + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + updated_contact, NULL, NULL) == TRUE); + + g_object_unref (updated_contact); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_CLOSURE_FUNCTIONS (temp_contact, TempContactData); + +static void +test_authentication (void) +{ + GDataOAuth2Authorizer *authorizer = NULL; /* owned */ + gchar *authentication_uri, *authorisation_code; + + gdata_test_mock_server_start_trace (mock_server, "authentication"); + + authorizer = gdata_oauth2_authorizer_new (CLIENT_ID, CLIENT_SECRET, + REDIRECT_URI, + GDATA_TYPE_CONTACTS_SERVICE); + + /* Get an authentication URI. */ + authentication_uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, NULL, FALSE); + g_assert (authentication_uri != NULL); + + /* Get the authorisation code off the user. */ + if (uhm_server_get_enable_online (mock_server)) { + authorisation_code = gdata_test_query_user_for_verifier (authentication_uri); + } else { + /* Hard coded, extracted from the trace file. */ + authorisation_code = g_strdup ("4/OEX-S1iMbOA_dOnNgUlSYmGWh3TK.QrR73axcNMkWoiIBeO6P2m_su7cwkQI"); + } + + g_free (authentication_uri); + + if (authorisation_code == NULL) { + /* Skip tests. */ + goto skip_test; + } + + /* Authorise the token */ + g_assert (gdata_oauth2_authorizer_request_authorization (authorizer, authorisation_code, NULL, NULL) == TRUE); + + /* Check all is as it should be */ + g_assert (gdata_authorizer_is_authorized_for_domain (GDATA_AUTHORIZER (authorizer), + gdata_contacts_service_get_primary_authorization_domain ()) == TRUE); + +skip_test: + g_free (authorisation_code); + g_object_unref (authorizer); + + uhm_server_end_trace (mock_server); +} + +typedef struct { + GDataContactsContact *contact1; + GDataContactsContact *contact2; + GDataContactsContact *contact3; +} QueryAllContactsData; + +static void +set_up_query_all_contacts (QueryAllContactsData *data, gconstpointer service) +{ + GDataContactsContact *contact; + + gdata_test_mock_server_start_trace (mock_server, "setup-query-all-contacts"); + + /* Create new temporary contacts to use for the query all contacts tests */ + contact = gdata_contacts_contact_new (NULL); + gdata_contacts_contact_set_nickname (contact, "Test Contact 1"); + data->contact1 = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, NULL); + g_object_unref (contact); + + contact = gdata_contacts_contact_new (NULL); + gdata_contacts_contact_set_nickname (contact, "Test Contact 2"); + data->contact2 = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, NULL); + g_object_unref (contact); + + contact = gdata_contacts_contact_new (NULL); + gdata_contacts_contact_set_nickname (contact, "Test Contact 3"); + data->contact3 = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, NULL); + g_object_unref (contact); + + uhm_server_end_trace (mock_server); + + /* It takes a few seconds for the contacts to reliably propagate around Google's servers. Distributed systems are so fun. Not. + * Thankfully, we don't have to wait when running against the mock server. */ + if (uhm_server_get_enable_online (mock_server) == TRUE) { + g_usleep (G_USEC_PER_SEC * 5); + } +} + +static void +tear_down_query_all_contacts (QueryAllContactsData *data, gconstpointer service) +{ + gdata_test_mock_server_start_trace (mock_server, "teardown-query-all-contacts"); + + /* Delete the new contacts */ + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->contact1), NULL, NULL) == TRUE); + g_object_unref (data->contact1); + + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->contact2), NULL, NULL) == TRUE); + g_object_unref (data->contact2); + + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->contact3), NULL, NULL) == TRUE); + g_object_unref (data->contact3); + + uhm_server_end_trace (mock_server); +} + +static void +test_query_all_contacts (QueryAllContactsData *data, gconstpointer service) +{ + GDataFeed *feed; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "query-all-contacts"); + + feed = gdata_contacts_service_query_contacts (GDATA_CONTACTS_SERVICE (service), NULL, NULL, NULL, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_FEED (feed)); + g_clear_error (&error); + + /* TODO: check entries, kinds and feed properties */ + + g_object_unref (feed); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_CLOSURE_FUNCTIONS (query_all_contacts, QueryAllContactsData); + +GDATA_ASYNC_TEST_FUNCTIONS (query_all_contacts, QueryAllContactsData, +G_STMT_START { + gdata_contacts_service_query_contacts_async (GDATA_CONTACTS_SERVICE (service), NULL, cancellable, NULL, + NULL, NULL, async_ready_callback, async_data); +} G_STMT_END, +G_STMT_START { + GDataFeed *feed; + + feed = gdata_service_query_finish (GDATA_SERVICE (obj), async_result, &error); + + if (error == NULL) { + g_assert (GDATA_IS_FEED (feed)); + /* TODO: Tests? */ + + g_object_unref (feed); + } else { + g_assert (feed == NULL); + } +} G_STMT_END); + +static void +test_query_all_contacts_async_progress_closure (QueryAllContactsData *query_data, gconstpointer service) +{ + GDataAsyncProgressClosure *data = g_slice_new0 (GDataAsyncProgressClosure); + + gdata_test_mock_server_start_trace (mock_server, "query-all-contacts-async-progress-closure"); + + data->main_loop = g_main_loop_new (NULL, TRUE); + + gdata_contacts_service_query_contacts_async (GDATA_CONTACTS_SERVICE (service), NULL, NULL, + (GDataQueryProgressCallback) gdata_test_async_progress_callback, + data, (GDestroyNotify) gdata_test_async_progress_closure_free, + (GAsyncReadyCallback) gdata_test_async_progress_finish_callback, data); + g_main_loop_run (data->main_loop); + g_main_loop_unref (data->main_loop); + + /* Check that both callbacks were called exactly once */ + g_assert_cmpuint (data->progress_destroy_notify_count, ==, 1); + g_assert_cmpuint (data->async_ready_notify_count, ==, 1); + + g_slice_free (GDataAsyncProgressClosure, data); + + uhm_server_end_trace (mock_server); +} + +typedef struct { + GDataContactsContact *new_contact; +} InsertData; + +static void +set_up_insert (InsertData *data, gconstpointer service) +{ + data->new_contact = NULL; +} + +static void +tear_down_insert (InsertData *data, gconstpointer service) +{ + gdata_test_mock_server_start_trace (mock_server, "teardown-insert"); + + /* Delete the new contact */ + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->new_contact), NULL, NULL) == TRUE); + + g_object_unref (data->new_contact); + + uhm_server_end_trace (mock_server); +} + +static void +test_contact_insert (InsertData *data, gconstpointer service) +{ + GDataContactsContact *contact, *new_contact; + GDataGDName *name, *name2; + GDataGDEmailAddress *email_address1, *email_address2; + GDataGDPhoneNumber *phone_number1, *phone_number2; + GDataGDIMAddress *im_address; + GDataGDOrganization *org; + GDataGDPostalAddress *postal_address; + GDataGContactJot *jot; + GDataGContactRelation *relation; + GDataGContactWebsite *website; + GDataGContactEvent *event; + GDataGContactCalendar *calendar; + GDataGContactExternalID *external_id; + GDataGContactLanguage *language; + GList *list; + GDate date; + GHashTable *properties; + GTimeVal current_time; + gint64 edited, creation_time; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "contact-insert"); + + contact = gdata_contacts_contact_new (NULL); + g_get_current_time (¤t_time); + + /* Check the kind is present and correct */ + g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); + gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); + + /* Set and check the name (to check if the title of the entry is updated) */ + gdata_entry_set_title (GDATA_ENTRY (contact), "Elizabeth Bennet"); + name = gdata_contacts_contact_get_name (contact); + gdata_gd_name_set_full_name (name, "Lizzie Bennet"); + + name2 = gdata_gd_name_new ("John", "Smith"); + gdata_gd_name_set_full_name (name2, "John Smith"); + gdata_contacts_contact_set_name (contact, name2); + g_object_unref (name2); + + gdata_contacts_contact_set_nickname (contact, "Big J"); + gdata_contacts_contact_set_file_as (contact, "J, Big"); + g_date_set_dmy (&date, 1, 1, 1900); + gdata_contacts_contact_set_birthday (contact, &date, FALSE); + gdata_entry_set_content (GDATA_ENTRY (contact), "Notes"); + gdata_contacts_contact_set_billing_information (contact, "Big J Enterprises, Ltd."); + gdata_contacts_contact_set_directory_server (contact, "This is a server"); + gdata_contacts_contact_set_gender (contact, GDATA_CONTACTS_GENDER_MALE); + gdata_contacts_contact_set_initials (contact, "A. B. C."); + gdata_contacts_contact_set_maiden_name (contact, "Smith"); + gdata_contacts_contact_set_mileage (contact, "12km"); + gdata_contacts_contact_set_occupation (contact, "Professional bum"); + gdata_contacts_contact_set_priority (contact, GDATA_CONTACTS_PRIORITY_HIGH); + gdata_contacts_contact_set_sensitivity (contact, GDATA_CONTACTS_SENSITIVITY_PERSONAL); + gdata_contacts_contact_set_short_name (contact, "Jon"); + gdata_contacts_contact_set_subject (contact, "Charity work"); + + email_address1 = gdata_gd_email_address_new ("liz@gmail.com", GDATA_GD_EMAIL_ADDRESS_WORK, NULL, FALSE); + gdata_contacts_contact_add_email_address (contact, email_address1); + g_object_unref (email_address1); + + email_address2 = gdata_gd_email_address_new ("liz@example.org", GDATA_GD_EMAIL_ADDRESS_HOME, NULL, FALSE); + gdata_contacts_contact_add_email_address (contact, email_address2); + g_object_unref (email_address2); + + phone_number1 = gdata_gd_phone_number_new ("(206)555-1212", GDATA_GD_PHONE_NUMBER_WORK, NULL, NULL, TRUE); + gdata_contacts_contact_add_phone_number (contact, phone_number1); + g_object_unref (phone_number1); + + phone_number2 = gdata_gd_phone_number_new ("(206)555-1213", GDATA_GD_PHONE_NUMBER_HOME, NULL, NULL, FALSE); + gdata_contacts_contact_add_phone_number (contact, phone_number2); + g_object_unref (phone_number2); + + im_address = gdata_gd_im_address_new ("liz@gmail.com", GDATA_GD_IM_PROTOCOL_GOOGLE_TALK, GDATA_GD_IM_ADDRESS_HOME, NULL, FALSE); + gdata_contacts_contact_add_im_address (contact, im_address); + g_object_unref (im_address); + + postal_address = gdata_gd_postal_address_new (GDATA_GD_POSTAL_ADDRESS_WORK, NULL, TRUE); + gdata_gd_postal_address_set_street (postal_address, "1600 Amphitheatre Pkwy Mountain View"); + gdata_contacts_contact_add_postal_address (contact, postal_address); + g_object_unref (postal_address); + + org = gdata_gd_organization_new ("OrgCorp", "President", GDATA_GD_ORGANIZATION_WORK, NULL, FALSE); + gdata_contacts_contact_add_organization (contact, org); + g_object_unref (org); + + jot = gdata_gcontact_jot_new ("This is a jot.", GDATA_GCONTACT_JOT_OTHER); + gdata_contacts_contact_add_jot (contact, jot); + g_object_unref (jot); + + relation = gdata_gcontact_relation_new ("Brian Haddock", GDATA_GCONTACT_RELATION_FRIEND, NULL); + gdata_contacts_contact_add_relation (contact, relation); + g_object_unref (relation); + + website = gdata_gcontact_website_new ("http://example.com/", GDATA_GCONTACT_WEBSITE_PROFILE, NULL, TRUE); + gdata_contacts_contact_add_website (contact, website); + g_object_unref (website); + + event = gdata_gcontact_event_new (&date, GDATA_GCONTACT_EVENT_ANNIVERSARY, NULL); + gdata_contacts_contact_add_event (contact, event); + g_object_unref (event); + + calendar = gdata_gcontact_calendar_new ("http://calendar.example.com/", GDATA_GCONTACT_CALENDAR_HOME, NULL, TRUE); + gdata_contacts_contact_add_calendar (contact, calendar); + g_object_unref (calendar); + + external_id = gdata_gcontact_external_id_new ("Number Six", GDATA_GCONTACT_EXTERNAL_ID_ORGANIZATION, NULL); + gdata_contacts_contact_add_external_id (contact, external_id); + g_object_unref (external_id); + + gdata_contacts_contact_add_hobby (contact, "Rowing"); + + language = gdata_gcontact_language_new ("en-GB", NULL); + gdata_contacts_contact_add_language (contact, language); + g_object_unref (language); + + /* Add some extended properties */ + g_assert (gdata_contacts_contact_set_extended_property (contact, "TITLE", NULL) == TRUE); + g_assert (gdata_contacts_contact_set_extended_property (contact, "ROLE", "") == TRUE); + g_assert (gdata_contacts_contact_set_extended_property (contact, "CALURI", "http://example.com/") == TRUE); + + /* Add some user-defined fields */ + gdata_contacts_contact_set_user_defined_field (contact, "Favourite colour", "Blue"); + gdata_contacts_contact_set_user_defined_field (contact, "Owes me", "£10"); + gdata_contacts_contact_set_user_defined_field (contact, "My notes", ""); + gdata_contacts_contact_set_user_defined_field (contact, "", "Foo"); /* bgo#648058 */ + + /* Insert the contact */ + new_contact = data->new_contact = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_CONTACT (new_contact)); + gdata_test_compare_kind (GDATA_ENTRY (new_contact), "http://schemas.google.com/contact/2008#contact", NULL); + g_clear_error (&error); + + /* Check its edited date. Yes, we have to allow the edited time to possibly precede the creation time because Google's + * servers can allow this to happen. Somehow. + * This check isn't run when testing against a mock server because the dates in the trace file may be waaaay out of date. */ + edited = gdata_contacts_contact_get_edited (contact); + if (uhm_server_get_enable_online (mock_server) == TRUE) { + creation_time = gdata_contacts_contact_get_edited (new_contact); + g_assert_cmpint (creation_time + TIME_FUZZINESS, >=, edited); + g_assert_cmpint (creation_time - TIME_FUZZINESS, <=, edited); + } + + /* Various properties */ + g_assert_cmpstr (gdata_contacts_contact_get_nickname (new_contact), ==, "Big J"); + g_assert_cmpstr (gdata_contacts_contact_get_file_as (new_contact), ==, "J, Big"); + g_assert (gdata_contacts_contact_get_birthday (new_contact, &date) == FALSE); + g_assert (g_date_valid (&date) == TRUE); + g_assert_cmpuint (g_date_get_month (&date), ==, 1); + g_assert_cmpuint (g_date_get_day (&date), ==, 1); + g_assert_cmpstr (gdata_contacts_contact_get_billing_information (new_contact), ==, "Big J Enterprises, Ltd."); + g_assert_cmpstr (gdata_contacts_contact_get_directory_server (new_contact), ==, "This is a server"); + g_assert_cmpstr (gdata_contacts_contact_get_gender (new_contact), ==, GDATA_CONTACTS_GENDER_MALE); + g_assert_cmpstr (gdata_contacts_contact_get_initials (new_contact), ==, "A. B. C."); + g_assert_cmpstr (gdata_contacts_contact_get_maiden_name (new_contact), ==, "Smith"); + g_assert_cmpstr (gdata_contacts_contact_get_mileage (new_contact), ==, "12km"); + g_assert_cmpstr (gdata_contacts_contact_get_occupation (new_contact), ==, "Professional bum"); + /* FIXME: https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3662 + * g_assert_cmpstr (gdata_contacts_contact_get_priority (new_contact), ==, GDATA_CONTACTS_PRIORITY_HIGH); + * g_assert_cmpstr (gdata_contacts_contact_get_sensitivity (new_contact), ==, GDATA_CONTACTS_SENSITIVITY_PERSONAL); */ + g_assert_cmpstr (gdata_contacts_contact_get_short_name (new_contact), ==, "Jon"); + g_assert_cmpstr (gdata_contacts_contact_get_subject (new_contact), ==, "Charity work"); + + /* E-mail addresses */ + list = gdata_contacts_contact_get_email_addresses (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 2); + g_assert (GDATA_IS_GD_EMAIL_ADDRESS (list->data)); + + g_assert (gdata_contacts_contact_get_primary_email_address (new_contact) == NULL); + + /* IM addresses */ + list = gdata_contacts_contact_get_im_addresses (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GD_IM_ADDRESS (list->data)); + + g_assert (gdata_contacts_contact_get_primary_im_address (new_contact) == NULL); + + /* Phone numbers */ + list = gdata_contacts_contact_get_phone_numbers (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 2); + g_assert (GDATA_IS_GD_PHONE_NUMBER (list->data)); + + g_assert (GDATA_IS_GD_PHONE_NUMBER (gdata_contacts_contact_get_primary_phone_number (new_contact))); + + /* Postal addresses */ + list = gdata_contacts_contact_get_postal_addresses (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GD_POSTAL_ADDRESS (list->data)); + + g_assert (GDATA_IS_GD_POSTAL_ADDRESS (gdata_contacts_contact_get_primary_postal_address (new_contact))); + + /* Organizations */ + list = gdata_contacts_contact_get_organizations (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GD_ORGANIZATION (list->data)); + + g_assert (gdata_contacts_contact_get_primary_organization (new_contact) == NULL); + + /* Jots */ + list = gdata_contacts_contact_get_jots (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GCONTACT_JOT (list->data)); + + /* Relations */ + list = gdata_contacts_contact_get_relations (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GCONTACT_RELATION (list->data)); + + /* Websites */ + list = gdata_contacts_contact_get_websites (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GCONTACT_WEBSITE (list->data)); + + g_assert (GDATA_IS_GCONTACT_WEBSITE (gdata_contacts_contact_get_primary_website (new_contact))); + + /* Events */ + list = gdata_contacts_contact_get_events (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GCONTACT_EVENT (list->data)); + + /* Calendars */ + list = gdata_contacts_contact_get_calendars (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GCONTACT_CALENDAR (list->data)); + + g_assert (GDATA_IS_GCONTACT_CALENDAR (gdata_contacts_contact_get_primary_calendar (new_contact))); + + /* External IDs */ + list = gdata_contacts_contact_get_external_ids (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GCONTACT_EXTERNAL_ID (list->data)); + + /* Languages */ + list = gdata_contacts_contact_get_languages (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_GCONTACT_LANGUAGE (list->data)); + + /* Hobbies */ + list = gdata_contacts_contact_get_hobbies (new_contact); + g_assert_cmpuint (g_list_length (list), ==, 1); + g_assert_cmpstr (list->data, ==, "Rowing"); + + /* Extended properties */ + g_assert_cmpstr (gdata_contacts_contact_get_extended_property (new_contact, "CALURI"), ==, "http://example.com/"); + g_assert (gdata_contacts_contact_get_extended_property (new_contact, "non-existent") == NULL); + + properties = gdata_contacts_contact_get_extended_properties (new_contact); + g_assert (properties != NULL); + g_assert_cmpuint (g_hash_table_size (properties), ==, 1); + + /* User-defined fields */ + g_assert_cmpstr (gdata_contacts_contact_get_user_defined_field (new_contact, "Favourite colour"), ==, "Blue"); + g_assert_cmpstr (gdata_contacts_contact_get_user_defined_field (new_contact, "Owes me"), ==, "£10"); + g_assert_cmpstr (gdata_contacts_contact_get_user_defined_field (new_contact, "My notes"), ==, ""); + g_assert_cmpstr (gdata_contacts_contact_get_user_defined_field (new_contact, ""), ==, "Foo"); + + properties = gdata_contacts_contact_get_user_defined_fields (new_contact); + g_assert (properties != NULL); + g_assert_cmpuint (g_hash_table_size (properties), ==, 4); + + /* Groups */ + list = gdata_contacts_contact_get_groups (new_contact); + g_assert (list == NULL); + + /* Deleted? */ + g_assert (gdata_contacts_contact_is_deleted (new_contact) == FALSE); + + /* TODO: check entries and feed properties */ + + g_object_unref (contact); + + uhm_server_end_trace (mock_server); +} + +static void +test_contact_update (TempContactData *data, gconstpointer service) +{ + GDataContactsContact *new_contact; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "contact-update"); + + /* Update the contact's name and add an extended property */ + gdata_entry_set_title (GDATA_ENTRY (data->contact), "John Wilson"); + g_assert (gdata_contacts_contact_set_extended_property (data->contact, "contact-test", "value")); + + /* Update the contact */ + new_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), + gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->contact), NULL, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_CONTACT (new_contact)); + gdata_test_compare_kind (GDATA_ENTRY (new_contact), "http://schemas.google.com/contact/2008#contact", NULL); + g_clear_error (&error); + + /* Check a few properties */ + g_assert_cmpstr (gdata_entry_get_title (GDATA_ENTRY (new_contact)), ==, "John Wilson"); + g_assert_cmpstr (gdata_contacts_contact_get_extended_property (new_contact, "contact-test"), ==, "value"); + g_assert (gdata_contacts_contact_is_deleted (new_contact) == FALSE); + + g_object_unref (new_contact); + + uhm_server_end_trace (mock_server); +} + +typedef struct { + GDataContactsGroup *group1; + GDataContactsGroup *group2; + GDataContactsGroup *group3; +} QueryAllGroupsData; + +static void +set_up_query_all_groups (QueryAllGroupsData *data, gconstpointer service) +{ + GDataContactsGroup *group; + + gdata_test_mock_server_start_trace (mock_server, "setup-query-all-groups"); + + group = gdata_contacts_group_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (group), "Test Group 1"); + data->group1 = gdata_contacts_service_insert_group (GDATA_CONTACTS_SERVICE (service), group, NULL, NULL); + g_assert (GDATA_IS_CONTACTS_GROUP (data->group1)); + g_object_unref (group); + + group = gdata_contacts_group_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (group), "Test Group 2"); + data->group2 = gdata_contacts_service_insert_group (GDATA_CONTACTS_SERVICE (service), group, NULL, NULL); + g_assert (GDATA_IS_CONTACTS_GROUP (data->group2)); + g_object_unref (group); + + group = gdata_contacts_group_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (group), "Test Group 3"); + data->group3 = gdata_contacts_service_insert_group (GDATA_CONTACTS_SERVICE (service), group, NULL, NULL); + g_assert (GDATA_IS_CONTACTS_GROUP (data->group3)); + g_object_unref (group); + + uhm_server_end_trace (mock_server); + + /* HACK! Guess what? Distributed system inconsistency strikes again! */ + if (uhm_server_get_enable_online (mock_server) == TRUE) { + sleep (10); + } +} + +static void +tear_down_query_all_groups (QueryAllGroupsData *data, gconstpointer service) +{ + gdata_test_mock_server_start_trace (mock_server, "teardown-query-all-groups"); + + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->group1), NULL, NULL) == TRUE); + g_object_unref (data->group1); + + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->group2), NULL, NULL) == TRUE); + g_object_unref (data->group2); + + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->group3), NULL, NULL) == TRUE); + g_object_unref (data->group3); + + uhm_server_end_trace (mock_server); +} + +static void +test_query_all_groups (QueryAllGroupsData *data, gconstpointer service) +{ + GDataFeed *feed; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "query-all-groups"); + + feed = gdata_contacts_service_query_groups (GDATA_CONTACTS_SERVICE (service), NULL, NULL, NULL, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_FEED (feed)); + g_clear_error (&error); + + /* TODO: check entries, kinds and feed properties */ + + g_object_unref (feed); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_CLOSURE_FUNCTIONS (query_all_groups, QueryAllGroupsData); + +GDATA_ASYNC_TEST_FUNCTIONS (query_all_groups, QueryAllGroupsData, +G_STMT_START { + gdata_contacts_service_query_groups_async (GDATA_CONTACTS_SERVICE (service), NULL, cancellable, NULL, NULL, NULL, + async_ready_callback, async_data); +} G_STMT_END, +G_STMT_START { + GDataFeed *feed; + + feed = gdata_service_query_finish (GDATA_SERVICE (obj), async_result, &error); + + if (error == NULL) { + g_assert (GDATA_IS_FEED (feed)); + /* TODO: Tests? */ + + g_object_unref (feed); + } else { + g_assert (feed == NULL); + } +} G_STMT_END); + +static void +test_query_all_groups_async_progress_closure (QueryAllGroupsData *query_data, gconstpointer service) +{ + GDataAsyncProgressClosure *data = g_slice_new0 (GDataAsyncProgressClosure); + + gdata_test_mock_server_start_trace (mock_server, "query-all-groups-async-progress-closure"); + + data->main_loop = g_main_loop_new (NULL, TRUE); + + gdata_contacts_service_query_groups_async (GDATA_CONTACTS_SERVICE (service), NULL, NULL, + (GDataQueryProgressCallback) gdata_test_async_progress_callback, + data, (GDestroyNotify) gdata_test_async_progress_closure_free, + (GAsyncReadyCallback) gdata_test_async_progress_finish_callback, data); + + g_main_loop_run (data->main_loop); + g_main_loop_unref (data->main_loop); + + /* Check that both callbacks were called exactly once */ + g_assert_cmpuint (data->progress_destroy_notify_count, ==, 1); + g_assert_cmpuint (data->async_ready_notify_count, ==, 1); + + g_slice_free (GDataAsyncProgressClosure, data); + + uhm_server_end_trace (mock_server); +} + +typedef struct { + GDataContactsGroup *new_group; +} InsertGroupData; + +static void +set_up_insert_group (InsertGroupData *data, gconstpointer service) +{ + data->new_group = NULL; +} + +static void +tear_down_insert_group (InsertGroupData *data, gconstpointer service) +{ + /* HACK! Distributed systems suck. */ + if (uhm_server_get_enable_online (mock_server) == TRUE) { + sleep (10); + } + + gdata_test_mock_server_start_trace (mock_server, "teardown-insert-group"); + + /* Delete the group, just to be tidy */ + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->new_group), NULL, NULL) == TRUE); + g_object_unref (data->new_group); + + uhm_server_end_trace (mock_server); +} + +static void +test_group_insert (InsertGroupData *data, gconstpointer service) +{ + GDataContactsGroup *group, *new_group; + GTimeVal time_val; + GHashTable *properties; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "group-insert"); + + g_get_current_time (&time_val); + + group = gdata_contacts_group_new (NULL); + + /* Check the kind is present and correct */ + g_assert (GDATA_IS_CONTACTS_GROUP (group)); + gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); + + /* Set various properties */ + gdata_entry_set_title (GDATA_ENTRY (group), "New Group!"); + g_assert (gdata_contacts_group_set_extended_property (group, "foobar", "barfoo") == TRUE); + + /* Insert the group */ + new_group = data->new_group = gdata_contacts_service_insert_group (GDATA_CONTACTS_SERVICE (service), group, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_GROUP (new_group)); + gdata_test_compare_kind (GDATA_ENTRY (new_group), "http://schemas.google.com/contact/2008#group", NULL); + g_clear_error (&error); + + /* Check the properties. Time-based properties can't be checked when running against a mock server, since + * the trace files may be quite old. */ + if (uhm_server_get_enable_online (mock_server) == TRUE) { + g_assert_cmpint (gdata_contacts_group_get_edited (new_group), >=, time_val.tv_sec); + } + g_assert (gdata_contacts_group_is_deleted (new_group) == FALSE); + g_assert (gdata_contacts_group_get_system_group_id (new_group) == NULL); + + properties = gdata_contacts_group_get_extended_properties (new_group); + g_assert (properties != NULL); + g_assert_cmpint (g_hash_table_size (properties), ==, 1); + g_assert_cmpstr (gdata_contacts_group_get_extended_property (new_group, "foobar"), ==, "barfoo"); + + g_object_unref (group); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_CLOSURE_FUNCTIONS (insert_group, InsertGroupData); + +GDATA_ASYNC_TEST_FUNCTIONS (group_insert, InsertGroupData, +G_STMT_START { + GDataContactsGroup *group; + + group = gdata_contacts_group_new (NULL); + + /* Check the kind is present and correct */ + g_assert (GDATA_IS_CONTACTS_GROUP (group)); + gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); + + /* Set various properties */ + gdata_entry_set_title (GDATA_ENTRY (group), "New Group!"); + g_assert (gdata_contacts_group_set_extended_property (group, "foobar", "barfoo") == TRUE); + + gdata_contacts_service_insert_group_async (GDATA_CONTACTS_SERVICE (service), group, cancellable, async_ready_callback, async_data); + + g_object_unref (group); +} G_STMT_END, +G_STMT_START { + GDataEntry *entry; + + entry = gdata_service_insert_entry_finish (GDATA_SERVICE (obj), async_result, &error); + + if (error == NULL) { + g_assert (GDATA_IS_CONTACTS_GROUP (entry)); + /* TODO: Tests? */ + + data->new_group = GDATA_CONTACTS_GROUP (entry); + } else { + g_assert (entry == NULL); + } +} G_STMT_END); + +static void +test_contact_properties (void) +{ + GDataContactsContact *contact; + GDataGDName *name, *name2; + GDataGDEmailAddress *email_address1, *email_address2; + GDataGDPhoneNumber *phone_number1, *phone_number2; + GDataGDIMAddress *im_address; + GDataGDOrganization *org; + GDataGDPostalAddress *postal_address; + GDataGContactJot *jot; + GDataGContactRelation *relation; + GDataGContactWebsite *website; + GDataGContactEvent *event; + GDataGContactCalendar *calendar; + GDataGContactExternalID *external_id; + GDataGContactLanguage *language; + gchar *nickname, *file_as, *billing_information, *directory_server, *gender, *initials, *maiden_name, *mileage, *occupation; + gchar *priority, *sensitivity, *short_name, *subject, *photo_etag; + GDate date, *date2; + GTimeVal current_time; + gint64 edited; + gboolean deleted, birthday_has_year; + + contact = gdata_contacts_contact_new (NULL); + g_get_current_time (¤t_time); + + /* Check the kind is present and correct */ + g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); + gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); + + /* Set and check the name (to check if the title of the entry is updated) */ + gdata_entry_set_title (GDATA_ENTRY (contact), "Elizabeth Bennet"); + name = gdata_contacts_contact_get_name (contact); + g_assert_cmpstr (gdata_gd_name_get_full_name (name), ==, "Elizabeth Bennet"); + gdata_gd_name_set_full_name (name, "Lizzie Bennet"); + g_assert_cmpstr (gdata_entry_get_title (GDATA_ENTRY (contact)), ==, "Lizzie Bennet"); + + name2 = gdata_gd_name_new ("John", "Smith"); + gdata_gd_name_set_full_name (name2, "John Smith"); + gdata_contacts_contact_set_name (contact, name2); + g_object_unref (name2); + g_assert_cmpstr (gdata_entry_get_title (GDATA_ENTRY (contact)), ==, "John Smith"); + + gdata_contacts_contact_set_nickname (contact, "Big J"); + gdata_contacts_contact_set_file_as (contact, "J, Big"); + g_date_set_dmy (&date, 1, 1, 1900); + gdata_contacts_contact_set_birthday (contact, &date, FALSE); + gdata_entry_set_content (GDATA_ENTRY (contact), "Notes"); + gdata_contacts_contact_set_billing_information (contact, "Big J Enterprises, Ltd."); + gdata_contacts_contact_set_directory_server (contact, "This is a server"); + gdata_contacts_contact_set_gender (contact, GDATA_CONTACTS_GENDER_MALE); + gdata_contacts_contact_set_initials (contact, "A. B. C."); + gdata_contacts_contact_set_maiden_name (contact, "Smith"); + gdata_contacts_contact_set_mileage (contact, "12km"); + gdata_contacts_contact_set_occupation (contact, "Professional bum"); + gdata_contacts_contact_set_priority (contact, GDATA_CONTACTS_PRIORITY_HIGH); + gdata_contacts_contact_set_sensitivity (contact, GDATA_CONTACTS_SENSITIVITY_PERSONAL); + gdata_contacts_contact_set_short_name (contact, "Jon"); + gdata_contacts_contact_set_subject (contact, "Charity work"); + + email_address1 = gdata_gd_email_address_new ("liz@gmail.com", GDATA_GD_EMAIL_ADDRESS_WORK, NULL, FALSE); + gdata_contacts_contact_add_email_address (contact, email_address1); + g_object_unref (email_address1); + + email_address2 = gdata_gd_email_address_new ("liz@example.org", GDATA_GD_EMAIL_ADDRESS_HOME, NULL, FALSE); + gdata_contacts_contact_add_email_address (contact, email_address2); + g_object_unref (email_address2); + + phone_number1 = gdata_gd_phone_number_new ("(206)555-1212", GDATA_GD_PHONE_NUMBER_WORK, NULL, NULL, TRUE); + gdata_contacts_contact_add_phone_number (contact, phone_number1); + g_object_unref (phone_number1); + + phone_number2 = gdata_gd_phone_number_new ("(206)555-1213", GDATA_GD_PHONE_NUMBER_HOME, NULL, NULL, FALSE); + gdata_contacts_contact_add_phone_number (contact, phone_number2); + g_object_unref (phone_number2); + + im_address = gdata_gd_im_address_new ("liz@gmail.com", GDATA_GD_IM_PROTOCOL_GOOGLE_TALK, GDATA_GD_IM_ADDRESS_HOME, NULL, FALSE); + gdata_contacts_contact_add_im_address (contact, im_address); + g_object_unref (im_address); + + postal_address = gdata_gd_postal_address_new (GDATA_GD_POSTAL_ADDRESS_WORK, NULL, TRUE); + gdata_gd_postal_address_set_street (postal_address, "1600 Amphitheatre Pkwy Mountain View"); + gdata_contacts_contact_add_postal_address (contact, postal_address); + g_object_unref (postal_address); + + org = gdata_gd_organization_new ("OrgCorp", "President", GDATA_GD_ORGANIZATION_WORK, NULL, FALSE); + gdata_contacts_contact_add_organization (contact, org); + g_object_unref (org); + + jot = gdata_gcontact_jot_new ("This is a jot.", GDATA_GCONTACT_JOT_OTHER); + gdata_contacts_contact_add_jot (contact, jot); + g_object_unref (jot); + + relation = gdata_gcontact_relation_new ("Brian Haddock", GDATA_GCONTACT_RELATION_FRIEND, NULL); + gdata_contacts_contact_add_relation (contact, relation); + g_object_unref (relation); + + website = gdata_gcontact_website_new ("http://example.com/", GDATA_GCONTACT_WEBSITE_PROFILE, NULL, TRUE); + gdata_contacts_contact_add_website (contact, website); + g_object_unref (website); + + event = gdata_gcontact_event_new (&date, GDATA_GCONTACT_EVENT_ANNIVERSARY, NULL); + gdata_contacts_contact_add_event (contact, event); + g_object_unref (event); + + calendar = gdata_gcontact_calendar_new ("http://calendar.example.com/", GDATA_GCONTACT_CALENDAR_HOME, NULL, TRUE); + gdata_contacts_contact_add_calendar (contact, calendar); + g_object_unref (calendar); + + external_id = gdata_gcontact_external_id_new ("Number Six", GDATA_GCONTACT_EXTERNAL_ID_ORGANIZATION, NULL); + gdata_contacts_contact_add_external_id (contact, external_id); + g_object_unref (external_id); + + gdata_contacts_contact_add_hobby (contact, "Rowing"); + + language = gdata_gcontact_language_new ("en-GB", NULL); + gdata_contacts_contact_add_language (contact, language); + g_object_unref (language); + + /* Add some extended properties */ + g_assert (gdata_contacts_contact_set_extended_property (contact, "TITLE", NULL) == TRUE); + g_assert (gdata_contacts_contact_set_extended_property (contact, "ROLE", "") == TRUE); + g_assert (gdata_contacts_contact_set_extended_property (contact, "CALURI", "http://example.com/") == TRUE); + + /* Add some user-defined fields */ + gdata_contacts_contact_set_user_defined_field (contact, "Favourite colour", "Blue"); + gdata_contacts_contact_set_user_defined_field (contact, "Owes me", "£10"); + gdata_contacts_contact_set_user_defined_field (contact, "My notes", ""); + gdata_contacts_contact_set_user_defined_field (contact, "", "Foo"); /* bgo#648058 */ + + /* Check the properties of the object */ + g_object_get (G_OBJECT (contact), + "edited", &edited, + "deleted", &deleted, + "photo-etag", &photo_etag, + "name", &name, + "nickname", &nickname, + "file-as", &file_as, + "birthday", &date2, + "birthday-has-year", &birthday_has_year, + "billing-information", &billing_information, + "directory-server", &directory_server, + "gender", &gender, + "initials", &initials, + "maiden-name", &maiden_name, + "mileage", &mileage, + "occupation", &occupation, + "priority", &priority, + "sensitivity", &sensitivity, + "short-name", &short_name, + "subject", &subject, + NULL); + + g_assert_cmpint (edited, ==, current_time.tv_sec); + g_assert (deleted == FALSE); + g_assert (photo_etag == NULL); + g_assert (name2 == name); + g_assert_cmpstr (nickname, ==, "Big J"); + g_assert_cmpstr (file_as, ==, "J, Big"); + g_assert (g_date_valid (date2) == TRUE); + g_assert_cmpuint (g_date_get_month (date2), ==, 1); + g_assert_cmpuint (g_date_get_day (date2), ==, 1); + g_assert (birthday_has_year == FALSE); + g_assert_cmpstr (billing_information, ==, "Big J Enterprises, Ltd."); + g_assert_cmpstr (directory_server, ==, "This is a server"); + g_assert_cmpstr (gender, ==, GDATA_CONTACTS_GENDER_MALE); + g_assert_cmpstr (initials, ==, "A. B. C."); + g_assert_cmpstr (maiden_name, ==, "Smith"); + g_assert_cmpstr (mileage, ==, "12km"); + g_assert_cmpstr (occupation, ==, "Professional bum"); + g_assert_cmpstr (priority, ==, GDATA_CONTACTS_PRIORITY_HIGH); + g_assert_cmpstr (sensitivity, ==, GDATA_CONTACTS_SENSITIVITY_PERSONAL); + g_assert_cmpstr (short_name, ==, "Jon"); + g_assert_cmpstr (subject, ==, "Charity work"); + + g_object_unref (name2); + g_free (date2); + g_free (nickname); + g_free (file_as); + g_free (billing_information); + g_free (directory_server); + g_free (gender); + g_free (initials); + g_free (maiden_name); + g_free (mileage); + g_free (occupation); + g_free (priority); + g_free (sensitivity); + g_free (short_name); + g_free (subject); + g_free (photo_etag); + + /* Check the XML */ + gdata_test_assert_xml (contact, + "" + "" + "John Smith" + "Notes" + "" + "" + "John" + "Smith" + "John Smith" + "" + "" + "" + "" + "(206)555-1212" + "(206)555-1213" + "" + "1600 Amphitheatre Pkwy Mountain View" + "" + "" + "OrgCorp" + "President" + "" + "This is a jot." + "Brian Haddock" + "" + "" + "" + "" + "" + "http://example.com/" + "" + "" + "" + "" /* bgo#648058 */ + "Rowing" + "Big J" + "J, Big" + "" + "Big J Enterprises, Ltd." + "This is a server" + "" + "A. B. C." + "Smith" + "12km" + "Professional bum" + "" + "" + "Jon" + "Charity work" + ""); + + /* Try removing some things from the contact and ensure it works */ + gdata_contacts_contact_remove_all_email_addresses (contact); + g_assert (gdata_contacts_contact_get_email_addresses (contact) == NULL); + g_assert (gdata_contacts_contact_get_primary_email_address (contact) == NULL); + + gdata_contacts_contact_remove_all_im_addresses (contact); + g_assert (gdata_contacts_contact_get_im_addresses (contact) == NULL); + g_assert (gdata_contacts_contact_get_primary_im_address (contact) == NULL); + + gdata_contacts_contact_remove_all_phone_numbers (contact); + g_assert (gdata_contacts_contact_get_phone_numbers (contact) == NULL); + g_assert (gdata_contacts_contact_get_primary_phone_number (contact) == NULL); + + gdata_contacts_contact_remove_all_postal_addresses (contact); + g_assert (gdata_contacts_contact_get_postal_addresses (contact) == NULL); + g_assert (gdata_contacts_contact_get_primary_postal_address (contact) == NULL); + + gdata_contacts_contact_remove_all_organizations (contact); + g_assert (gdata_contacts_contact_get_organizations (contact) == NULL); + g_assert (gdata_contacts_contact_get_primary_organization (contact) == NULL); + + gdata_contacts_contact_remove_all_jots (contact); + g_assert (gdata_contacts_contact_get_jots (contact) == NULL); + + gdata_contacts_contact_remove_all_relations (contact); + g_assert (gdata_contacts_contact_get_relations (contact) == NULL); + + gdata_contacts_contact_remove_all_websites (contact); + g_assert (gdata_contacts_contact_get_websites (contact) == NULL); + g_assert (gdata_contacts_contact_get_primary_website (contact) == NULL); + + gdata_contacts_contact_remove_all_events (contact); + g_assert (gdata_contacts_contact_get_events (contact) == NULL); + + gdata_contacts_contact_remove_all_calendars (contact); + g_assert (gdata_contacts_contact_get_calendars (contact) == NULL); + g_assert (gdata_contacts_contact_get_primary_calendar (contact) == NULL); + + gdata_contacts_contact_remove_all_external_ids (contact); + g_assert (gdata_contacts_contact_get_external_ids (contact) == NULL); + + gdata_contacts_contact_remove_all_languages (contact); + g_assert (gdata_contacts_contact_get_languages (contact) == NULL); + + gdata_contacts_contact_remove_all_hobbies (contact); + g_assert (gdata_contacts_contact_get_hobbies (contact) == NULL); +} + +static void +test_contact_escaping (void) +{ + GDataContactsContact *contact; + + contact = gdata_contacts_contact_new (NULL); + gdata_contacts_contact_set_nickname (contact, "Nickname & stuff"); + gdata_contacts_contact_set_file_as (contact, "Stuff, & Nickname"); + gdata_contacts_contact_set_billing_information (contact, "Billing information & stuff"); + gdata_contacts_contact_set_directory_server (contact, "http://foo.com?foo&bar"); + gdata_contacts_contact_set_gender (contact, "Misc. & other"); + gdata_contacts_contact_set_initials (contact, ""); + gdata_contacts_contact_set_maiden_name (contact, "Maiden & name"); + gdata_contacts_contact_set_mileage (contact, "Over the hills & far away"); + gdata_contacts_contact_set_occupation (contact, "Occupation & stuff"); + gdata_contacts_contact_set_priority (contact, "http://foo.com?foo&priority=bar"); + gdata_contacts_contact_set_sensitivity (contact, "http://foo.com?foo&sensitivity=bar"); + gdata_contacts_contact_set_short_name (contact, "Short name & stuff"); + gdata_contacts_contact_set_subject (contact, "Subject & stuff"); + gdata_contacts_contact_add_hobby (contact, "Escaping &s"); + gdata_contacts_contact_set_extended_property (contact, "extended & prop", "Value should be a pre-escaped XML blob."); + gdata_contacts_contact_set_user_defined_field (contact, "User defined field & stuff", "Value & stuff"); + gdata_contacts_contact_add_group (contact, "http://foo.com?foo&bar"); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (contact, + "" + "" + "" + "" + "" + "" + "Value should be a pre-escaped XML blob." + "" + "" + "" + "Escaping &s" + "Nickname & stuff" + "Stuff, & Nickname" + "Billing information & stuff" + "http://foo.com?foo&bar" + "" + "<AB>" + "Maiden & name" + "Over the hills & far away" + "Occupation & stuff" + "" + "" + "Short name & stuff" + "Subject & stuff" + ""); + g_object_unref (contact); +} + +static void +test_group_escaping (void) +{ + GDataContactsGroup *group; + + group = gdata_contacts_group_new (NULL); + gdata_contacts_group_set_extended_property (group, "extended & prop", "Value should be a pre-escaped XML blob."); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (group, + "" + "" + "" + "" + "" + "Value should be a pre-escaped XML blob." + "" + ""); + g_object_unref (group); +} + +static void +test_query_uri (void) +{ + gchar *query_uri; + GDataContactsQuery *query = gdata_contacts_query_new ("q"); + + gdata_contacts_query_set_order_by (query, "lastmodified"); + g_assert_cmpstr (gdata_contacts_query_get_order_by (query), ==, "lastmodified"); + + gdata_contacts_query_set_show_deleted (query, FALSE); + g_assert (gdata_contacts_query_show_deleted (query) == FALSE); + + /* Test it with both values of show-deleted */ + query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&orderby=lastmodified&showdeleted=false"); + g_free (query_uri); + + gdata_contacts_query_set_show_deleted (query, TRUE); + g_assert (gdata_contacts_query_show_deleted (query) == TRUE); + + gdata_contacts_query_set_sort_order (query, "descending"); + g_assert_cmpstr (gdata_contacts_query_get_sort_order (query), ==, "descending"); + + gdata_contacts_query_set_group (query, "http://www.google.com/feeds/contacts/groups/jo@gmail.com/base/1234a"); + g_assert_cmpstr (gdata_contacts_query_get_group (query), ==, "http://www.google.com/feeds/contacts/groups/jo@gmail.com/base/1234a"); + + /* Check the built query URI with a normal feed URI */ + query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&orderby=lastmodified&showdeleted=true&sortorder=descending" + "&group=http%3A%2F%2Fwww.google.com%2Ffeeds%2Fcontacts%2Fgroups%2Fjo%40gmail.com%2Fbase%2F1234a"); + g_free (query_uri); + + /* …with a feed URI with a trailing slash */ + query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/"); + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=q&orderby=lastmodified&showdeleted=true&sortorder=descending" + "&group=http%3A%2F%2Fwww.google.com%2Ffeeds%2Fcontacts%2Fgroups%2Fjo%40gmail.com%2Fbase%2F1234a"); + g_free (query_uri); + + /* …with a feed URI with pre-existing arguments */ + query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/bar/?test=test&this=that"); + g_assert_cmpstr (query_uri, ==, "http://example.com/bar/?test=test&this=that&q=q&orderby=lastmodified&showdeleted=true&sortorder=descending" + "&group=http%3A%2F%2Fwww.google.com%2Ffeeds%2Fcontacts%2Fgroups%2Fjo%40gmail.com%2Fbase%2F1234a"); + g_free (query_uri); + + g_object_unref (query); +} + +static void +test_query_etag (void) +{ + GDataContactsQuery *query = gdata_contacts_query_new (NULL); + + /* Test that setting any property will unset the ETag */ + g_test_bug ("613529"); + +#define CHECK_ETAG(C) \ + gdata_query_set_etag (GDATA_QUERY (query), "foobar"); \ + (C); \ + g_assert (gdata_query_get_etag (GDATA_QUERY (query)) == NULL); + + CHECK_ETAG (gdata_contacts_query_set_order_by (query, "foobar")) + CHECK_ETAG (gdata_contacts_query_set_show_deleted (query, FALSE)) + CHECK_ETAG (gdata_contacts_query_set_sort_order (query, "shizzle")) + CHECK_ETAG (gdata_contacts_query_set_group (query, "support group")) + +#undef CHECK_ETAG + + g_object_unref (query); +} + +static void +test_query_properties (void) +{ + gchar *order_by, *sort_order, *group; + gboolean show_deleted; + guint start_index, max_results; + GDataContactsQuery *query = gdata_contacts_query_new_with_limits ("q", 1, 10); + + /* Set the properties */ + g_object_set (G_OBJECT (query), + "order-by", "lastmodified", + "show-deleted", TRUE, + "sort-order", "descending", + "group", "http://www.google.com/feeds/contacts/groups/jo@gmail.com/base/1234a", + NULL); + + /* Check the query's properties */ + g_object_get (G_OBJECT (query), + "order-by", &order_by, + "show-deleted", &show_deleted, + "sort-order", &sort_order, + "group", &group, + "start-index", &start_index, + "max-results", &max_results, + NULL); + + g_assert_cmpstr (order_by, ==, "lastmodified"); + g_assert (show_deleted == TRUE); + g_assert_cmpstr (sort_order, ==, "descending"); + g_assert_cmpstr (group, ==, "http://www.google.com/feeds/contacts/groups/jo@gmail.com/base/1234a"); + g_assert_cmpuint (start_index, ==, 1); + g_assert_cmpuint (max_results, ==, 10); + + g_free (order_by); + g_free (sort_order); + g_free (group); + + g_object_unref (query); +} + +static void +test_contact_parser_minimal (void) +{ + GDataContactsContact *contact; + GDate birthday; + GError *error = NULL; + + g_test_bug ("580330"); + + contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, + "" + "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" + "2009-04-25T15:21:53.688Z" + "2009-04-25T15:21:53.688Z" + "" + "" /* Here's where it all went wrong */ + "" + "" + "" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); + gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); + g_clear_error (&error); + + /* Check the contact's properties */ + g_assert (gdata_entry_get_title (GDATA_ENTRY (contact)) != NULL); + g_assert (*gdata_entry_get_title (GDATA_ENTRY (contact)) == '\0'); + + /* TODO: Check the other properties */ + + g_assert (gdata_contacts_contact_get_nickname (contact) == NULL); + g_assert (gdata_contacts_contact_get_file_as (contact) == NULL); + g_assert (gdata_contacts_contact_get_birthday (contact, &birthday) == FALSE); + g_assert (g_date_valid (&birthday) == FALSE); + g_assert (gdata_contacts_contact_get_billing_information (contact) == NULL); + g_assert (gdata_contacts_contact_get_directory_server (contact) == NULL); + g_assert (gdata_contacts_contact_get_gender (contact) == NULL); + g_assert (gdata_contacts_contact_get_initials (contact) == NULL); + g_assert (gdata_contacts_contact_get_maiden_name (contact) == NULL); + g_assert (gdata_contacts_contact_get_mileage (contact) == NULL); + g_assert (gdata_contacts_contact_get_occupation (contact) == NULL); + g_assert (gdata_contacts_contact_get_priority (contact) == NULL); + g_assert (gdata_contacts_contact_get_sensitivity (contact) == NULL); + g_assert (gdata_contacts_contact_get_short_name (contact) == NULL); + g_assert (gdata_contacts_contact_get_subject (contact) == NULL); + g_assert (gdata_contacts_contact_get_jots (contact) == NULL); + g_assert (gdata_contacts_contact_get_relations (contact) == NULL); + g_assert (gdata_contacts_contact_get_websites (contact) == NULL); + g_assert (gdata_contacts_contact_get_primary_website (contact) == NULL); + g_assert (gdata_contacts_contact_get_events (contact) == NULL); + g_assert (gdata_contacts_contact_get_calendars (contact) == NULL); + g_assert (gdata_contacts_contact_get_primary_calendar (contact) == NULL); + g_assert (gdata_contacts_contact_get_external_ids (contact) == NULL); + g_assert (gdata_contacts_contact_get_languages (contact) == NULL); + g_assert (gdata_contacts_contact_get_hobbies (contact) == NULL); + + g_object_unref (contact); +} + +static void +test_contact_parser_normal (void) +{ + GDataContactsContact *contact; + GDate date; + GList *list; + GError *error = NULL; + + contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, + "" + "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" + "2009-04-25T15:21:53.688Z" + "2009-04-25T15:21:53.688Z" + "" + "" /* Here's where it all went wrong */ + "" + "" + "" + "" + "" /* https://bugzilla.gnome.org/show_bug.cgi?id=734863 */ + "" + "" + "" + "" + "" + "Agent Smith" + "Smith, Agent" + "" + "Foo & Bar Inc." + "Directory & server" + "" + "X. Y. Z." + "Foo" + "15km" + "Occupied" + "" + "" + "Smith" + "Film buddy" + "Moved house on 2010-02-14 to the North Pole." + "Owes me ten pounds." + "" /* Empty on purpose */ + "Darth Vader" + "Rob Halford" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "Programming" + "Heavy metal" + "Heavy metal" /* Test that duplicates get merged */ + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); + gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); + g_clear_error (&error); + + /* TODO: Check the other properties */ + + g_assert_cmpstr (gdata_contacts_contact_get_nickname (contact), ==, "Agent Smith"); + g_assert_cmpstr (gdata_contacts_contact_get_file_as (contact), ==, "Smith, Agent"); + g_assert_cmpstr (gdata_contacts_contact_get_billing_information (contact), ==, "Foo & Bar Inc."); + g_assert_cmpstr (gdata_contacts_contact_get_directory_server (contact), ==, "Directory & server"); + g_assert_cmpstr (gdata_contacts_contact_get_gender (contact), ==, GDATA_CONTACTS_GENDER_FEMALE); + g_assert_cmpstr (gdata_contacts_contact_get_initials (contact), ==, "X. Y. Z."); + g_assert_cmpstr (gdata_contacts_contact_get_maiden_name (contact), ==, "Foo"); + g_assert_cmpstr (gdata_contacts_contact_get_mileage (contact), ==, "15km"); + g_assert_cmpstr (gdata_contacts_contact_get_occupation (contact), ==, "Occupied"); + g_assert_cmpstr (gdata_contacts_contact_get_priority (contact), ==, GDATA_CONTACTS_PRIORITY_LOW); + g_assert_cmpstr (gdata_contacts_contact_get_sensitivity (contact), ==, GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL); + g_assert_cmpstr (gdata_contacts_contact_get_short_name (contact), ==, "Smith"); + g_assert_cmpstr (gdata_contacts_contact_get_subject (contact), ==, "Film buddy"); + + /* Birthday */ + g_assert (gdata_contacts_contact_get_birthday (contact, &date) == TRUE); + g_assert (g_date_valid (&date) == TRUE); + g_assert_cmpuint (g_date_get_year (&date), ==, 2010); + g_assert_cmpuint (g_date_get_month (&date), ==, 12); + g_assert_cmpuint (g_date_get_day (&date), ==, 3); + + /* Jots */ + list = gdata_contacts_contact_get_jots (contact); + g_assert_cmpuint (g_list_length (list), ==, 3); + + g_assert (GDATA_IS_GCONTACT_JOT (list->data)); + g_assert_cmpstr (gdata_gcontact_jot_get_content (GDATA_GCONTACT_JOT (list->data)), ==, "Moved house on 2010-02-14 to the North Pole."); + g_assert_cmpstr (gdata_gcontact_jot_get_relation_type (GDATA_GCONTACT_JOT (list->data)), ==, GDATA_GCONTACT_JOT_HOME); + + list = list->next; + g_assert (GDATA_IS_GCONTACT_JOT (list->data)); + g_assert_cmpstr (gdata_gcontact_jot_get_content (GDATA_GCONTACT_JOT (list->data)), ==, "Owes me ten pounds."); + g_assert_cmpstr (gdata_gcontact_jot_get_relation_type (GDATA_GCONTACT_JOT (list->data)), ==, GDATA_GCONTACT_JOT_USER); + + list = list->next; + g_assert (GDATA_IS_GCONTACT_JOT (list->data)); + g_assert (gdata_gcontact_jot_get_content (GDATA_GCONTACT_JOT (list->data)) == NULL); + g_assert_cmpstr (gdata_gcontact_jot_get_relation_type (GDATA_GCONTACT_JOT (list->data)), ==, GDATA_GCONTACT_JOT_OTHER); + + /* Relations */ + list = gdata_contacts_contact_get_relations (contact); + g_assert_cmpuint (g_list_length (list), ==, 2); + + g_assert (GDATA_IS_GCONTACT_RELATION (list->data)); + g_assert_cmpstr (gdata_gcontact_relation_get_name (GDATA_GCONTACT_RELATION (list->data)), ==, "Darth Vader"); + g_assert_cmpstr (gdata_gcontact_relation_get_relation_type (GDATA_GCONTACT_RELATION (list->data)), ==, GDATA_GCONTACT_RELATION_FATHER); + g_assert (gdata_gcontact_relation_get_label (GDATA_GCONTACT_RELATION (list->data)) == NULL); + + list = list->next; + g_assert (GDATA_IS_GCONTACT_RELATION (list->data)); + g_assert_cmpstr (gdata_gcontact_relation_get_name (GDATA_GCONTACT_RELATION (list->data)), ==, "Rob Halford"); + g_assert (gdata_gcontact_relation_get_relation_type (GDATA_GCONTACT_RELATION (list->data)) == NULL); + g_assert_cmpstr (gdata_gcontact_relation_get_label (GDATA_GCONTACT_RELATION (list->data)), ==, "Favourite singer"); + + /* Websites */ + list = gdata_contacts_contact_get_websites (contact); + g_assert_cmpuint (g_list_length (list), ==, 3); + + g_assert (GDATA_IS_GCONTACT_WEBSITE (list->data)); + g_assert_cmpstr (gdata_gcontact_website_get_uri (GDATA_GCONTACT_WEBSITE (list->data)), ==, "http://example.com"); + g_assert_cmpstr (gdata_gcontact_website_get_relation_type (GDATA_GCONTACT_WEBSITE (list->data)), ==, GDATA_GCONTACT_WEBSITE_HOME_PAGE); + g_assert_cmpstr (gdata_gcontact_website_get_label (GDATA_GCONTACT_WEBSITE (list->data)), ==, "Home tab #1"); + g_assert (gdata_gcontact_website_is_primary (GDATA_GCONTACT_WEBSITE (list->data)) == TRUE); + + g_assert (gdata_contacts_contact_get_primary_website (contact) == list->data); + + list = list->next; + g_assert (GDATA_IS_GCONTACT_WEBSITE (list->data)); + g_assert_cmpstr (gdata_gcontact_website_get_uri (GDATA_GCONTACT_WEBSITE (list->data)), ==, "http://example.com"); + g_assert_cmpstr (gdata_gcontact_website_get_relation_type (GDATA_GCONTACT_WEBSITE (list->data)), ==, GDATA_GCONTACT_WEBSITE_WORK); + g_assert (gdata_gcontact_website_get_label (GDATA_GCONTACT_WEBSITE (list->data)) == NULL); + g_assert (gdata_gcontact_website_is_primary (GDATA_GCONTACT_WEBSITE (list->data)) == FALSE); + + list = list->next; + g_assert (GDATA_IS_GCONTACT_WEBSITE (list->data)); + g_assert_cmpstr (gdata_gcontact_website_get_uri (GDATA_GCONTACT_WEBSITE (list->data)), ==, "http://bar.com"); + g_assert_cmpstr (gdata_gcontact_website_get_relation_type (GDATA_GCONTACT_WEBSITE (list->data)), ==, GDATA_GCONTACT_WEBSITE_PROFILE); + g_assert (gdata_gcontact_website_get_label (GDATA_GCONTACT_WEBSITE (list->data)) == NULL); + g_assert (gdata_gcontact_website_is_primary (GDATA_GCONTACT_WEBSITE (list->data)) == FALSE); + + /* Events */ + list = gdata_contacts_contact_get_events (contact); + g_assert_cmpuint (g_list_length (list), ==, 2); + + g_assert (GDATA_IS_GCONTACT_EVENT (list->data)); + gdata_gcontact_event_get_date (GDATA_GCONTACT_EVENT (list->data), &date); + g_assert (g_date_valid (&date) == TRUE); + g_assert_cmpuint (g_date_get_year (&date), ==, 2010); + g_assert_cmpuint (g_date_get_month (&date), ==, 3); + g_assert_cmpuint (g_date_get_day (&date), ==, 4); + g_assert_cmpstr (gdata_gcontact_event_get_relation_type (GDATA_GCONTACT_EVENT (list->data)), ==, GDATA_GCONTACT_EVENT_ANNIVERSARY); + g_assert (gdata_gcontact_event_get_label (GDATA_GCONTACT_EVENT (list->data)) == NULL); + + list = list->next; + g_assert (GDATA_IS_GCONTACT_EVENT (list->data)); + gdata_gcontact_event_get_date (GDATA_GCONTACT_EVENT (list->data), &date); + g_assert (g_date_valid (&date) == TRUE); + g_assert_cmpuint (g_date_get_year (&date), ==, 1900); + g_assert_cmpuint (g_date_get_month (&date), ==, 1); + g_assert_cmpuint (g_date_get_day (&date), ==, 1); + g_assert (gdata_gcontact_event_get_relation_type (GDATA_GCONTACT_EVENT (list->data)) == NULL); + g_assert_cmpstr (gdata_gcontact_event_get_label (GDATA_GCONTACT_EVENT (list->data)), ==, "Foobar"); + + /* Calendars */ + list = gdata_contacts_contact_get_calendars (contact); + g_assert_cmpuint (g_list_length (list), ==, 3); + + g_assert (GDATA_IS_GCONTACT_CALENDAR (list->data)); + g_assert_cmpstr (gdata_gcontact_calendar_get_uri (GDATA_GCONTACT_CALENDAR (list->data)), ==, "http://example.com/"); + g_assert_cmpstr (gdata_gcontact_calendar_get_relation_type (GDATA_GCONTACT_CALENDAR (list->data)), ==, GDATA_GCONTACT_CALENDAR_FREE_BUSY); + g_assert (gdata_gcontact_calendar_get_label (GDATA_GCONTACT_CALENDAR (list->data)) == NULL); + g_assert (gdata_gcontact_calendar_is_primary (GDATA_GCONTACT_CALENDAR (list->data)) == TRUE); + + g_assert (gdata_contacts_contact_get_primary_calendar (contact) == list->data); + + list = list->next; + g_assert (GDATA_IS_GCONTACT_CALENDAR (list->data)); + g_assert_cmpstr (gdata_gcontact_calendar_get_uri (GDATA_GCONTACT_CALENDAR (list->data)), ==, "http://example.com/"); + g_assert (gdata_gcontact_calendar_get_relation_type (GDATA_GCONTACT_CALENDAR (list->data)) == NULL); + g_assert_cmpstr (gdata_gcontact_calendar_get_label (GDATA_GCONTACT_CALENDAR (list->data)), ==, "Gig list"); + g_assert (gdata_gcontact_calendar_is_primary (GDATA_GCONTACT_CALENDAR (list->data)) == FALSE); + + list = list->next; + g_assert (GDATA_IS_GCONTACT_CALENDAR (list->data)); + g_assert_cmpstr (gdata_gcontact_calendar_get_uri (GDATA_GCONTACT_CALENDAR (list->data)), ==, "http://foo.com/calendar"); + g_assert_cmpstr (gdata_gcontact_calendar_get_relation_type (GDATA_GCONTACT_CALENDAR (list->data)), ==, GDATA_GCONTACT_CALENDAR_HOME); + g_assert (gdata_gcontact_calendar_get_label (GDATA_GCONTACT_CALENDAR (list->data)) == NULL); + g_assert (gdata_gcontact_calendar_is_primary (GDATA_GCONTACT_CALENDAR (list->data)) == FALSE); + + /* External IDs */ + list = gdata_contacts_contact_get_external_ids (contact); + g_assert_cmpuint (g_list_length (list), ==, 2); + + g_assert (GDATA_IS_GCONTACT_EXTERNAL_ID (list->data)); + g_assert (GDATA_IS_GCONTACT_EXTERNAL_ID (list->next->data)); + + /* Languages */ + list = gdata_contacts_contact_get_languages (contact); + g_assert_cmpuint (g_list_length (list), ==, 2); + + g_assert (GDATA_IS_GCONTACT_LANGUAGE (list->data)); + g_assert (GDATA_IS_GCONTACT_LANGUAGE (list->next->data)); + + /* Hobbies */ + list = gdata_contacts_contact_get_hobbies (contact); + g_assert_cmpuint (g_list_length (list), ==, 2); + + g_assert_cmpstr (list->data, ==, "Programming"); + g_assert_cmpstr (list->next->data, ==, "Heavy metal"); + + g_object_unref (contact); +} + +static void +test_contact_parser_error_handling (void) +{ + GDataContactsContact *contact; + GError *error = NULL; + +#define TEST_XML_ERROR_HANDLING(x) \ + contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT,\ + ""\ + x\ + "", -1, &error));\ + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ + g_assert (contact == NULL);\ + g_clear_error (&error) + + /* app:edited */ + TEST_XML_ERROR_HANDLING ("this shouldn't parse"); + + /* gd:name */ + TEST_XML_ERROR_HANDLING ("SpartacusSpartacus"); + + /* gd:email */ + TEST_XML_ERROR_HANDLING ("neither should this"); + + /* gd:im */ + TEST_XML_ERROR_HANDLING ("nor this"); + + /* gd:phoneNumber */ + TEST_XML_ERROR_HANDLING (""); + + /* gd:structuredPostalAddress */ + TEST_XML_ERROR_HANDLING (""); + + /* gd:organization */ + TEST_XML_ERROR_HANDLING (""); + + /* gd:extendedProperty */ + TEST_XML_ERROR_HANDLING (""); + + /* gContact:userDefinedField */ + TEST_XML_ERROR_HANDLING (""); /* no key or value */ + TEST_XML_ERROR_HANDLING (""); /* no value */ + TEST_XML_ERROR_HANDLING (""); /* no key */ + + /* gContact:groupMembershipInfo */ + TEST_XML_ERROR_HANDLING (""); + TEST_XML_ERROR_HANDLING (""); + + /* gContact:nickname */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("Nickname 1Duplicate!"); /* duplicate */ + + /* gContact:fileAs */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("File As 1Duplicate!"); /* duplicate */ + + /* gContact:birthday */ + TEST_XML_ERROR_HANDLING (""); /* missing "when" attribute */ + TEST_XML_ERROR_HANDLING (""); /* invalid date */ + TEST_XML_ERROR_HANDLING (""); /* duplicate */ + + /* gContact:billingInformation */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("foo" + "Dupe!"); /* duplicate */ + + /* gContact:directoryServer */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("foo" + "Dupe!"); /* duplicate */ + + /* gContact:gender */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING (""); /* duplicate */ + + /* gContact:initials */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("AB"); /* duplicate */ + + /* gContact:maidenName */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("AB"); /* duplicate */ + + /* gContact:mileage */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("12 mi12 mi"); /* duplicate */ + + /* gContact:occupation */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("FooBar"); /* duplicate */ + + /* gContact:priority */ + TEST_XML_ERROR_HANDLING (""); /* missing rel param */ + TEST_XML_ERROR_HANDLING (""); /* empty rel param */ + TEST_XML_ERROR_HANDLING (""); /* duplicate */ + + /* gContact:sensitivity */ + TEST_XML_ERROR_HANDLING (""); /* missing rel param */ + TEST_XML_ERROR_HANDLING (""); /* empty rel param */ + TEST_XML_ERROR_HANDLING (""); /* duplicate */ + + /* gContact:shortName */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("FooBar"); /* duplicate */ + + /* gContact:subject */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("FooBar"); /* duplicate */ + + /* gContact:jot */ + TEST_XML_ERROR_HANDLING (""); + + /* gContact:relation */ + TEST_XML_ERROR_HANDLING (""); + + /* gContact:website */ + TEST_XML_ERROR_HANDLING (""); + + /* gContact:event */ + TEST_XML_ERROR_HANDLING (""); + + /* gContact:calendar */ + TEST_XML_ERROR_HANDLING (""); + + /* gContact:externalId */ + TEST_XML_ERROR_HANDLING (""); + + /* gContact:language */ + TEST_XML_ERROR_HANDLING (""); + + /* gContact:hobby */ + TEST_XML_ERROR_HANDLING (""); + +#undef TEST_XML_ERROR_HANDLING +} + +static void +test_group_properties (void) +{ + GDataContactsGroup *group; + GTimeVal time_val; + GHashTable *properties; + gint64 edited; + gboolean deleted; + gchar *system_group_id; + + group = gdata_contacts_group_new (NULL); + + /* Check the kind is present and correct */ + g_assert (GDATA_IS_CONTACTS_GROUP (group)); + gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); + + /* Set various properties */ + gdata_entry_set_title (GDATA_ENTRY (group), "New Group!"); + g_assert (gdata_contacts_group_set_extended_property (group, "foobar", "barfoo") == TRUE); + + /* Check various properties */ + g_get_current_time (&time_val); + g_assert_cmpint (gdata_contacts_group_get_edited (group), ==, time_val.tv_sec); + g_assert (gdata_contacts_group_is_deleted (group) == FALSE); + g_assert (gdata_contacts_group_get_system_group_id (group) == NULL); + + properties = gdata_contacts_group_get_extended_properties (group); + g_assert (properties != NULL); + g_assert_cmpint (g_hash_table_size (properties), ==, 1); + g_assert_cmpstr (gdata_contacts_group_get_extended_property (group, "foobar"), ==, "barfoo"); + + /* Check the properties a different way */ + g_object_get (G_OBJECT (group), + "edited", &edited, + "deleted", &deleted, + "system-group-id", &system_group_id, + NULL); + + g_assert_cmpint (edited, ==, time_val.tv_sec); + g_assert (deleted == FALSE); + g_assert (system_group_id == NULL); + + g_free (system_group_id); + + /* Check the XML */ + gdata_test_assert_xml (group, + "" + "" + "New Group!" + "New Group!" + "" + "barfoo" + ""); + + g_object_unref (group); +} + +static void +test_group_parser_normal (void) +{ + GDataContactsGroup *group; + GHashTable *properties; + GError *error = NULL; + + group = GDATA_CONTACTS_GROUP (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_GROUP, + "" + "" + "http://www.google.com/feeds/groups/jo%40gmail.com/base/1234" + "2005-01-18T21:00:00Z" + "2006-01-01T00:00:00Z" + "2006-01-01T00:00:00Z" + "Salsa class members" + "" + "" + "" + "Some text." + "" + "Foobar." + "" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_GROUP (group)); + gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); + g_clear_error (&error); + + g_assert_cmpint (gdata_contacts_group_get_edited (group), ==, 1136073600); + g_assert (gdata_contacts_group_is_deleted (group) == TRUE); + g_assert (gdata_contacts_group_get_system_group_id (group) == NULL); + + g_assert_cmpstr (gdata_contacts_group_get_extended_property (group, "more info"), ==, "Some text."); + g_assert_cmpstr (gdata_contacts_group_get_extended_property (group, "extra info"), ==, "Foobar."); + + properties = gdata_contacts_group_get_extended_properties (group); + g_assert_cmpint (g_hash_table_size (properties), ==, 2); + + g_object_unref (group); +} + +static void +test_group_parser_system (void) +{ + GDataContactsGroup *group; + GError *error = NULL; + + group = GDATA_CONTACTS_GROUP (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_GROUP, + "" + "" + "http://www.google.com/feeds/groups/jo%40gmail.com/base/1234" + "2005-01-18T21:00:00Z" + "2006-01-01T00:00:00Z" + "2006-01-01T00:00:00Z" + "Salsa class members" + "" + "" + "" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_GROUP (group)); + gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); + g_clear_error (&error); + + g_assert_cmpint (gdata_contacts_group_get_edited (group), ==, 1136073600); + g_assert (gdata_contacts_group_is_deleted (group) == FALSE); + g_assert_cmpstr (gdata_contacts_group_get_system_group_id (group), ==, GDATA_CONTACTS_GROUP_CONTACTS); + + g_object_unref (group); +} + +static void +test_group_parser_error_handling (void) +{ + GDataContactsGroup *group; + GError *error = NULL; + +#define TEST_XML_ERROR_HANDLING(x) \ + group = GDATA_CONTACTS_GROUP (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_GROUP,\ + ""\ + x\ + "", -1, &error));\ + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ + g_assert (group == NULL);\ + g_clear_error (&error) + + /* app:edited */ + TEST_XML_ERROR_HANDLING ("this shouldn't parse"); + + /* gd:deleted */ + TEST_XML_ERROR_HANDLING (""); + + /* gd:extendedProperty */ + TEST_XML_ERROR_HANDLING (""); + + /* gContact:systemGroup */ + TEST_XML_ERROR_HANDLING (""); + TEST_XML_ERROR_HANDLING (""); + +#undef TEST_XML_ERROR_HANDLING +} + +static void +test_photo_has_photo (gconstpointer service) +{ + GDataContactsContact *contact; + gsize length = 0; + gchar *content_type = NULL; + GError *error = NULL; + + contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, + "" + "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" + "2009-04-25T15:21:53.688Z" + "" + "" /* Here's where it all went wrong */ + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); + gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); + g_clear_error (&error); + + /* Check for no photo */ + g_assert (gdata_contacts_contact_get_photo_etag (contact) == NULL); + g_assert (gdata_contacts_contact_get_photo (contact, GDATA_CONTACTS_SERVICE (service), &length, &content_type, NULL, &error) == NULL); + g_assert_cmpint (length, ==, 0); + g_assert (content_type == NULL); + g_assert_no_error (error); + + g_clear_error (&error); + g_free (content_type); + g_object_unref (contact); + + /* Try again with a photo */ + contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, + "" + "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" + "2009-04-25T15:21:53.688Z" + "" + "" /* Here's where it all went wrong */ + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); + gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); + g_clear_error (&error); + + g_assert (gdata_contacts_contact_get_photo_etag (contact) != NULL); + g_object_unref (contact); +} + +static void +test_photo_add (TempContactData *data, gconstpointer service) +{ + guint8 *photo_data; + gsize length; + gboolean retval; + gchar *path = NULL; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "photo-add"); + + /* Get the photo */ + path = g_test_build_filename (G_TEST_DIST, "photo.jpg", NULL); + g_assert (g_file_get_contents (path, (gchar**) &photo_data, &length, NULL) == TRUE); + g_free (path); + + /* Add it to the contact */ + retval = gdata_contacts_contact_set_photo (data->contact, GDATA_CONTACTS_SERVICE (service), photo_data, length, "image/jpeg", NULL, &error); + g_assert_no_error (error); + g_assert (retval == TRUE); + + g_clear_error (&error); + g_free (photo_data); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_TEST_FUNCTIONS (photo_add, TempContactData, +G_STMT_START { + guint8 *photo_data; + gsize length; + gchar *path = NULL; + + /* Get the photo */ + path = g_test_build_filename (G_TEST_DIST, "photo.jpg", NULL); + g_assert (g_file_get_contents (path, (gchar**) &photo_data, &length, NULL) == TRUE); + g_free (path); + + /* Add it to the contact asynchronously */ + gdata_contacts_contact_set_photo_async (data->contact, GDATA_CONTACTS_SERVICE (service), photo_data, length, "image/jpeg", cancellable, + async_ready_callback, async_data); + + g_free (photo_data); +} G_STMT_END, +G_STMT_START { + GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (obj); + gboolean success; + + success = gdata_contacts_contact_set_photo_finish (contact, async_result, &error); + + if (error == NULL) { + g_assert (success == TRUE); + g_assert (gdata_contacts_contact_get_photo_etag (contact) != NULL); + } else { + g_assert (success == FALSE); + /*g_assert (gdata_contacts_contact_get_photo_etag (contact) == NULL);*/ + + /* Bail out on a conflict error, since it means the addition went through + * (but not fast enough for libgdata to return success rather than cancellation). */ + if (g_error_matches (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_CONFLICT) == TRUE) { + g_clear_error (&error); + async_data->cancellation_successful = FALSE; + } + } +} G_STMT_END); + +static void +add_photo_to_contact (GDataContactsService *service, GDataContactsContact **contact) +{ + guint8 *photo_data; + gsize length; + GDataEntry *updated_contact; + gchar *path = NULL; + + /* Get the photo and add it to the contact */ + path = g_test_build_filename (G_TEST_DIST, "photo.jpg", NULL); + g_assert (g_file_get_contents (path, (gchar**) &photo_data, &length, NULL) == TRUE); + g_assert (gdata_contacts_contact_set_photo (*contact, service, photo_data, length, "image/jpeg", NULL, NULL) == TRUE); + + g_free (path); + g_free (photo_data); + + /* HACK: It fairly consistently seems to take the Google servers about 4 seconds to process uploaded photos. Before this + * time, a query for the photo will return an error. So let's wait for 10. + * Helps: bgo#679072 */ + if (uhm_server_get_enable_online (mock_server) == TRUE) { + sleep (10); + } + + /* Re-query for the contact to get any updated ETags. */ + updated_contact = gdata_service_query_single_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + gdata_entry_get_id (GDATA_ENTRY (*contact)), NULL, GDATA_TYPE_CONTACTS_CONTACT, + NULL, NULL); + g_assert (GDATA_IS_CONTACTS_CONTACT (updated_contact)); + + g_object_unref (*contact); + *contact = GDATA_CONTACTS_CONTACT (updated_contact); +} + +typedef TempContactData TempContactWithPhotoData; + +static void +set_up_temp_contact_with_photo (TempContactWithPhotoData *data, gconstpointer service) +{ + set_up_temp_contact ((TempContactData*) data, service); + + gdata_test_mock_server_start_trace (mock_server, "setup-temp-contact-with-photo"); + add_photo_to_contact (GDATA_CONTACTS_SERVICE (service), &data->contact); + uhm_server_end_trace (mock_server); +} + +static void +tear_down_temp_contact_with_photo (TempContactWithPhotoData *data, gconstpointer service) +{ + tear_down_temp_contact ((TempContactData*) data, service); +} + +GDATA_ASYNC_CLOSURE_FUNCTIONS (temp_contact_with_photo, TempContactWithPhotoData); + +static void +test_photo_get (TempContactData *data, gconstpointer service) +{ + guint8 *photo_data; + gchar *content_type = NULL; + gsize length = 0; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "photo-get"); + + g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); + + /* Get the photo from the network */ + photo_data = gdata_contacts_contact_get_photo (data->contact, GDATA_CONTACTS_SERVICE (service), &length, &content_type, NULL, &error); + g_assert_no_error (error); + g_assert (photo_data != NULL); + g_assert (length != 0); + g_assert_cmpstr (content_type, ==, "image/jpeg"); + + g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); + + g_free (content_type); + g_free (photo_data); + g_clear_error (&error); + + uhm_server_end_trace (mock_server); +} + +GDATA_ASYNC_TEST_FUNCTIONS (photo_get, TempContactData, +G_STMT_START { + g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); + + /* Get the photo from the network asynchronously */ + gdata_contacts_contact_get_photo_async (data->contact, GDATA_CONTACTS_SERVICE (service), cancellable, async_ready_callback, async_data); +} G_STMT_END, +G_STMT_START { + GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (obj); + guint8 *photo_data; + gsize length; + gchar *content_type; + + /* Finish getting the photo */ + photo_data = gdata_contacts_contact_get_photo_finish (contact, async_result, &length, &content_type, &error); + + if (error == NULL) { + g_assert (photo_data != NULL); + g_assert (length != 0); + g_assert_cmpstr (content_type, ==, "image/jpeg"); + + g_assert (gdata_contacts_contact_get_photo_etag (contact) != NULL); + } else { + g_assert (photo_data == NULL); + g_assert (length == 0); + g_assert (content_type == NULL); + } + + g_free (content_type); + g_free (photo_data); +} G_STMT_END); + +static void +test_photo_delete (TempContactData *data, gconstpointer service) +{ + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "photo-delete"); + + g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); + + /* Remove the contact's photo */ + g_assert (gdata_contacts_contact_set_photo (data->contact, GDATA_CONTACTS_SERVICE (service), NULL, 0, NULL, NULL, &error) == TRUE); + g_assert_no_error (error); + + g_assert (gdata_contacts_contact_get_photo_etag (data->contact) == NULL); + + g_clear_error (&error); + + uhm_server_end_trace (mock_server); +} + +static void +test_photo_delete_async_cancellation (GDataAsyncTestData *data, + gconstpointer service) __attribute__((unused)); + +GDATA_ASYNC_TEST_FUNCTIONS (photo_delete, TempContactData, +G_STMT_START { + g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); + + /* Delete it from the contact asynchronously */ + gdata_contacts_contact_set_photo_async (data->contact, GDATA_CONTACTS_SERVICE (service), NULL, 0, NULL, cancellable, + async_ready_callback, async_data); +} G_STMT_END, +G_STMT_START { + GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (obj); + gboolean success; + + success = gdata_contacts_contact_set_photo_finish (contact, async_result, &error); + + if (error == NULL) { + g_assert (success == TRUE); + g_assert (gdata_contacts_contact_get_photo_etag (contact) == NULL); + } else { + g_assert (success == FALSE); + g_assert (gdata_contacts_contact_get_photo_etag (contact) != NULL); + } +} G_STMT_END); + +static void +test_batch (gconstpointer service) +{ + GDataBatchOperation *operation; + GDataService *service2; + GDataContactsContact *contact, *contact2, *contact3; + GDataEntry *inserted_entry, *inserted_entry2, *inserted_entry3; + gchar *feed_uri; + guint op_id, op_id2, op_id3; + GError *error = NULL, *entry_error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "batch"); + + /* Here we hardcode the feed URI, but it should really be extracted from a contacts feed, as the GDATA_LINK_BATCH link */ + operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), + "https://www.google.com/m8/feeds/contacts/default/full/batch"); + + /* Check the properties of the operation */ + g_assert (gdata_batch_operation_get_service (operation) == service); + g_assert_cmpstr (gdata_batch_operation_get_feed_uri (operation), ==, "https://www.google.com/m8/feeds/contacts/default/full/batch"); + + g_object_get (operation, + "service", &service2, + "feed-uri", &feed_uri, + NULL); + + g_assert (service2 == service); + g_assert_cmpstr (feed_uri, ==, "https://www.google.com/m8/feeds/contacts/default/full/batch"); + + g_object_unref (service2); + g_free (feed_uri); + + /* Run a singleton batch operation to insert a new entry */ + contact = gdata_contacts_contact_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (contact), "Fooish Bar"); + + gdata_test_batch_operation_insertion (operation, GDATA_ENTRY (contact), &inserted_entry, NULL); + g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); + g_assert_no_error (error); + + g_clear_error (&error); + g_object_unref (operation); + g_object_unref (contact); + + /* Run another batch operation to insert another entry and query the previous one */ + contact2 = gdata_contacts_contact_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (contact2), "Brian"); + + operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), + "https://www.google.com/m8/feeds/contacts/default/full/batch"); + op_id = gdata_test_batch_operation_insertion (operation, GDATA_ENTRY (contact2), &inserted_entry2, NULL); + op_id2 = gdata_test_batch_operation_query (operation, gdata_entry_get_id (inserted_entry), GDATA_TYPE_CONTACTS_CONTACT, inserted_entry, NULL, + NULL); + g_assert_cmpuint (op_id, !=, op_id2); + + g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); + g_assert_no_error (error); + + g_clear_error (&error); + g_object_unref (operation); + g_object_unref (contact2); + + /* Run another batch operation to delete the first entry and a fictitious one to test error handling, and update the second entry */ + gdata_entry_set_title (inserted_entry2, "Toby"); + contact3 = gdata_contacts_contact_new ("foobar"); + + operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), + "https://www.google.com/m8/feeds/contacts/default/full/batch"); + op_id = gdata_test_batch_operation_deletion (operation, inserted_entry, NULL); + op_id2 = gdata_test_batch_operation_deletion (operation, GDATA_ENTRY (contact3), &entry_error); + op_id3 = gdata_test_batch_operation_update (operation, inserted_entry2, &inserted_entry3, NULL); + g_assert_cmpuint (op_id, !=, op_id2); + g_assert_cmpuint (op_id, !=, op_id3); + g_assert_cmpuint (op_id2, !=, op_id3); + + g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); + g_assert_no_error (error); + + g_assert_error (entry_error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR); + + g_clear_error (&error); + g_clear_error (&entry_error); + g_object_unref (operation); + g_object_unref (inserted_entry); + g_object_unref (contact3); + + /* Run another batch operation to update the second entry with the wrong ETag (i.e. pass the old version of the entry to the batch operation + * to test error handling */ +#if 0 + operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), + "https://www.google.com/m8/feeds/contacts/default/full/batch"); + gdata_test_batch_operation_update (operation, inserted_entry2, NULL, &entry_error); + g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); + g_assert_no_error (error); + + g_assert_error (entry_error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_CONFLICT); +#endif + g_clear_error (&error); + g_clear_error (&entry_error); +/* g_object_unref (operation);*/ + g_object_unref (inserted_entry2); + + /* Run a final batch operation to delete the second entry */ +/* operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), + "https://www.google.com/m8/feeds/contacts/default/full/batch"); + gdata_test_batch_operation_deletion (operation, inserted_entry3, NULL); + g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); + g_assert_no_error (error); +*/ + g_clear_error (&error); + /*g_object_unref (operation);*/ + g_object_unref (inserted_entry3); + + uhm_server_end_trace (mock_server); +} + +typedef struct { + GDataContactsContact *new_contact; +} BatchAsyncData; + +static void +setup_batch_async (BatchAsyncData *data, gconstpointer service) +{ + GDataContactsContact *contact; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "setup-batch-async"); + + /* Insert a new contact which we can query asyncly */ + contact = gdata_contacts_contact_new (NULL); + gdata_entry_set_title (GDATA_ENTRY (contact), "Fooish Bar"); + + data->new_contact = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, &error); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_CONTACT (data->new_contact)); + g_clear_error (&error); + + g_object_unref (contact); + + uhm_server_end_trace (mock_server); +} + +static void +test_batch_async_cb (GDataBatchOperation *operation, GAsyncResult *async_result, GMainLoop *main_loop) +{ + GError *error = NULL; + + /* Clear all pending events (such as callbacks for the operations) */ + while (g_main_context_iteration (NULL, FALSE) == TRUE); + + g_assert (gdata_test_batch_operation_run_finish (operation, async_result, &error) == TRUE); + g_assert_no_error (error); + g_clear_error (&error); + + g_main_loop_quit (main_loop); +} + +static void +test_batch_async (BatchAsyncData *data, gconstpointer service) +{ + GDataBatchOperation *operation; + GMainLoop *main_loop; + + gdata_test_mock_server_start_trace (mock_server, "batch-async"); + + /* Run an async query operation on the contact */ + operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), + "https://www.google.com/m8/feeds/contacts/default/full/batch"); + gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_contact)), GDATA_TYPE_CONTACTS_CONTACT, + GDATA_ENTRY (data->new_contact), NULL, NULL); + + main_loop = g_main_loop_new (NULL, TRUE); + + gdata_batch_operation_run_async (operation, NULL, (GAsyncReadyCallback) test_batch_async_cb, main_loop); + g_main_loop_run (main_loop); + + g_main_loop_unref (main_loop); + g_object_unref (operation); + + uhm_server_end_trace (mock_server); +} + +static void +test_batch_async_cancellation_cb (GDataBatchOperation *operation, GAsyncResult *async_result, GMainLoop *main_loop) +{ + GError *error = NULL; + + /* Clear all pending events (such as callbacks for the operations) */ + while (g_main_context_iteration (NULL, FALSE) == TRUE); + + g_assert (gdata_test_batch_operation_run_finish (operation, async_result, &error) == FALSE); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); + g_clear_error (&error); + + g_main_loop_quit (main_loop); +} + +static void +test_batch_async_cancellation (BatchAsyncData *data, gconstpointer service) +{ + GDataBatchOperation *operation; + GMainLoop *main_loop; + GCancellable *cancellable; + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "batch-async-cancellation"); + + /* Run an async query operation on the contact */ + operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), + "https://www.google.com/m8/feeds/contacts/default/full/batch"); + gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_contact)), GDATA_TYPE_CONTACTS_CONTACT, + GDATA_ENTRY (data->new_contact), NULL, &error); + + main_loop = g_main_loop_new (NULL, TRUE); + cancellable = g_cancellable_new (); + + gdata_batch_operation_run_async (operation, cancellable, (GAsyncReadyCallback) test_batch_async_cancellation_cb, main_loop); + g_cancellable_cancel (cancellable); /* this should cancel the operation before it even starts, as we haven't run the main loop yet */ + + g_main_loop_run (main_loop); + + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); + g_clear_error (&error); + + g_main_loop_unref (main_loop); + g_object_unref (cancellable); + g_object_unref (operation); + + uhm_server_end_trace (mock_server); +} + +static void +teardown_batch_async (BatchAsyncData *data, gconstpointer service) +{ + GError *error = NULL; + + gdata_test_mock_server_start_trace (mock_server, "teardown-batch-async"); + + /* Delete the contact */ + g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), + GDATA_ENTRY (data->new_contact), NULL, &error) == TRUE); + g_assert_no_error (error); + g_clear_error (&error); + + g_object_unref (data->new_contact); + + uhm_server_end_trace (mock_server); +} + +static void +test_group_membership (void) +{ + GDataContactsContact *contact; + GList *groups; + + /* Create a new contact with no groups */ + contact = gdata_contacts_contact_new (NULL); + g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); + g_assert (gdata_contacts_contact_get_groups (contact) == NULL); + g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://notagroup.com/") == FALSE); + + /* Add a group */ + gdata_contacts_contact_add_group (contact, "http://foo.com/group1"); + g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://foo.com/group1") == FALSE); + + groups = gdata_contacts_contact_get_groups (contact); + g_assert_cmpint (g_list_length (groups), ==, 1); + g_assert_cmpstr (groups->data, ==, "http://foo.com/group1"); + + /* Add another group */ + gdata_contacts_contact_add_group (contact, "http://foo.com/group2"); + g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://foo.com/group1") == FALSE); + g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://foo.com/group2") == FALSE); + + groups = gdata_contacts_contact_get_groups (contact); + g_assert_cmpint (g_list_length (groups), ==, 2); + if (strcmp (groups->data, "http://foo.com/group1") == 0) + g_assert_cmpstr (groups->next->data, ==, "http://foo.com/group2"); + else if (strcmp (groups->data, "http://foo.com/group2") == 0) + g_assert_cmpstr (groups->next->data, ==, "http://foo.com/group1"); + else + g_assert_not_reached (); + + /* Remove the first group */ + gdata_contacts_contact_remove_group (contact, "http://foo.com/group1"); + g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://foo.com/group1") == FALSE); /* hasn't been propagated to the server */ + + groups = gdata_contacts_contact_get_groups (contact); + g_assert_cmpint (g_list_length (groups), ==, 1); + g_assert_cmpstr (groups->data, ==, "http://foo.com/group2"); + + g_object_unref (contact); +} + +static void +test_contact_id (void) +{ + GDataContactsContact *contact; + GError *error = NULL; + + /* Check that IDs are changed to the full projection when creating a new contact… */ + contact = gdata_contacts_contact_new ("http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b"); + g_assert_cmpstr (gdata_entry_get_id (GDATA_ENTRY (contact)), ==, + "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/full/1b46cdd20bfbee3b"); + g_object_unref (contact); + + /* …and when creating one from XML. */ + contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, + "" + "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" + "2009-04-25T15:21:53.688Z" + "" + "Foobar" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); + g_clear_error (&error); + + g_assert_cmpstr (gdata_entry_get_id (GDATA_ENTRY (contact)), ==, + "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/full/1b46cdd20bfbee3b"); + + g_object_unref (contact); +} + +static void +mock_server_notify_resolver_cb (GObject *object, GParamSpec *pspec, gpointer user_data) +{ + UhmServer *server; + UhmResolver *resolver; + + server = UHM_SERVER (object); + + /* Set up the expected domain names here. This should technically be split up between + * the different unit test suites, but that's too much effort. */ + resolver = uhm_server_get_resolver (server); + + if (resolver != NULL) { + const gchar *ip_address = uhm_server_get_address (server); + + uhm_resolver_add_A (resolver, "www.google.com", ip_address); + uhm_resolver_add_A (resolver, + "accounts.google.com", ip_address); + } +} + +/* Set up a global GDataAuthorizer to be used for all the tests. Unfortunately, + * the Google Contacts API is effectively limited to OAuth1 and OAuth2 + * authorisation, so this requires user interaction when online. + * + * If not online, use a dummy authoriser. */ +static GDataAuthorizer * +create_global_authorizer (void) +{ + GDataOAuth2Authorizer *authorizer = NULL; /* owned */ + gchar *authentication_uri, *authorisation_code; + GError *error = NULL; + + /* If not online, just return a dummy authoriser. */ + if (!uhm_server_get_enable_online (mock_server)) { + return GDATA_AUTHORIZER (gdata_dummy_authorizer_new (GDATA_TYPE_CONTACTS_SERVICE)); + } + + /* Otherwise, go through the interactive OAuth dance. */ + gdata_test_mock_server_start_trace (mock_server, "global-authentication"); + authorizer = gdata_oauth2_authorizer_new (CLIENT_ID, CLIENT_SECRET, + REDIRECT_URI, + GDATA_TYPE_CONTACTS_SERVICE); + + /* Get an authentication URI */ + authentication_uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, NULL, FALSE); + g_assert (authentication_uri != NULL); + + /* Get the authorisation code off the user. */ + authorisation_code = gdata_test_query_user_for_verifier (authentication_uri); + + g_free (authentication_uri); + + if (authorisation_code == NULL) { + /* Skip tests. */ + g_object_unref (authorizer); + authorizer = NULL; + goto skip_test; + } + + /* Authorise the token */ + g_assert (gdata_oauth2_authorizer_request_authorization (authorizer, authorisation_code, NULL, &error)); + g_assert_no_error (error); + +skip_test: + g_free (authorisation_code); + + uhm_server_end_trace (mock_server); + + return GDATA_AUTHORIZER (authorizer); +} + +int +main (int argc, char *argv[]) +{ + gint retval; + GDataAuthorizer *authorizer = NULL; /* owned */ + GDataService *service = NULL; /* owned */ + GFile *trace_directory = NULL; /* owned */ + gchar *path = NULL; /* owned */ + + gdata_test_init (argc, argv); + + mock_server = gdata_test_get_mock_server (); + g_signal_connect (G_OBJECT (mock_server), "notify::resolver", + (GCallback) mock_server_notify_resolver_cb, NULL); + path = g_test_build_filename (G_TEST_DIST, "traces/contacts", NULL); + trace_directory = g_file_new_for_path (path); + g_free (path); + uhm_server_set_trace_directory (mock_server, trace_directory); + g_object_unref (trace_directory); + + authorizer = create_global_authorizer (); + service = GDATA_SERVICE (gdata_contacts_service_new (authorizer)); + + g_test_add_func ("/contacts/authentication", test_authentication); + + g_test_add ("/contacts/contact/insert", InsertData, service, set_up_insert, test_contact_insert, tear_down_insert); + g_test_add ("/contacts/contact/update", TempContactData, service, set_up_temp_contact, test_contact_update, tear_down_temp_contact); + + g_test_add ("/contacts/query/all_contacts", QueryAllContactsData, service, set_up_query_all_contacts, test_query_all_contacts, + tear_down_query_all_contacts); + g_test_add ("/contacts/query/all_contacts/async", GDataAsyncTestData, service, set_up_query_all_contacts_async, + test_query_all_contacts_async, tear_down_query_all_contacts_async); + g_test_add ("/contacts/query/all_contacts/async/progress_closure", QueryAllContactsData, service, + set_up_query_all_contacts, test_query_all_contacts_async_progress_closure, tear_down_query_all_contacts); + g_test_add ("/contacts/query/all_contacts/cancellation", GDataAsyncTestData, service, set_up_query_all_contacts_async, + test_query_all_contacts_async_cancellation, tear_down_query_all_contacts_async); + + g_test_add_data_func ("/contacts/photo/has_photo", service, test_photo_has_photo); + g_test_add ("/contacts/photo/add", TempContactData, service, set_up_temp_contact, test_photo_add, tear_down_temp_contact); + g_test_add ("/contacts/photo/add/async", GDataAsyncTestData, service, set_up_temp_contact_async, test_photo_add_async, + tear_down_temp_contact_async); + g_test_add ("/contacts/photo/add/async/cancellation", GDataAsyncTestData, service, set_up_temp_contact_async, + test_photo_add_async_cancellation, tear_down_temp_contact_async); + g_test_add ("/contacts/photo/get", TempContactData, service, set_up_temp_contact_with_photo, test_photo_get, tear_down_temp_contact); + g_test_add ("/contacts/photo/get/async", GDataAsyncTestData, service, set_up_temp_contact_with_photo_async, test_photo_get_async, + tear_down_temp_contact_with_photo_async); + g_test_add ("/contacts/photo/get/async/cancellation", GDataAsyncTestData, service, set_up_temp_contact_with_photo_async, + test_photo_get_async_cancellation, tear_down_temp_contact_with_photo_async); + + g_test_add ("/contacts/photo/delete", TempContactData, service, set_up_temp_contact_with_photo, test_photo_delete, + tear_down_temp_contact); + g_test_add ("/contacts/photo/delete/async", GDataAsyncTestData, service, set_up_temp_contact_with_photo_async, + test_photo_delete_async, tear_down_temp_contact_with_photo_async); +/* + Too broken to continue running at the moment. + g_test_add ("/contacts/photo/delete/async/cancellation", GDataAsyncTestData, service, set_up_temp_contact_with_photo_async, + test_photo_delete_async_cancellation, tear_down_temp_contact_with_photo_async); +*/ + + g_test_add_data_func ("/contacts/batch", service, test_batch); + g_test_add ("/contacts/batch/async", BatchAsyncData, service, setup_batch_async, test_batch_async, teardown_batch_async); + g_test_add ("/contacts/batch/async/cancellation", BatchAsyncData, service, setup_batch_async, test_batch_async_cancellation, + teardown_batch_async); + + g_test_add ("/contacts/group/query", QueryAllGroupsData, service, set_up_query_all_groups, test_query_all_groups, + tear_down_query_all_groups); + g_test_add ("/contacts/group/query/async", GDataAsyncTestData, service, set_up_query_all_groups_async, + test_query_all_groups_async, tear_down_query_all_groups_async); + g_test_add ("/contacts/group/query/async/progress_closure", QueryAllGroupsData, service, set_up_query_all_groups, + test_query_all_groups_async_progress_closure, tear_down_query_all_groups); + g_test_add ("/contacts/group/query/async/cancellation", GDataAsyncTestData, service, set_up_query_all_groups_async, + test_query_all_groups_async_cancellation, tear_down_query_all_groups_async); + + g_test_add ("/contacts/group/insert", InsertGroupData, service, set_up_insert_group, test_group_insert, tear_down_insert_group); + g_test_add ("/contacts/group/insert/async", GDataAsyncTestData, service, set_up_insert_group_async, test_group_insert_async, + tear_down_insert_group_async); + g_test_add ("/contacts/group/insert/async/cancellation", GDataAsyncTestData, service, set_up_insert_group_async, + test_group_insert_async_cancellation, tear_down_insert_group_async); + + g_test_add_func ("/contacts/contact/properties", test_contact_properties); + g_test_add_func ("/contacts/contact/escaping", test_contact_escaping); + g_test_add_func ("/contacts/contact/parser/minimal", test_contact_parser_minimal); + g_test_add_func ("/contacts/contact/parser/normal", test_contact_parser_normal); + g_test_add_func ("/contacts/contact/parser/error_handling", test_contact_parser_error_handling); + g_test_add_func ("/contacts/contact/id", test_contact_id); + + g_test_add_func ("/contacts/query/uri", test_query_uri); + g_test_add_func ("/contacts/query/etag", test_query_etag); + g_test_add_func ("/contacts/query/properties", test_query_properties); + + g_test_add_func ("/contacts/group/properties", test_group_properties); + g_test_add_func ("/contacts/group/escaping", test_group_escaping); + g_test_add_func ("/contacts/group/parser/normal", test_group_parser_normal); + g_test_add_func ("/contacts/group/parser/system", test_group_parser_system); + g_test_add_func ("/contacts/group/parser/error_handling", test_group_parser_error_handling); + g_test_add_func ("/contacts/group/membership", test_group_membership); + + retval = g_test_run (); + + g_clear_object (&service); + g_clear_object (&authorizer); + + return retval; +} diff --git a/gdata/tests/gdata-dummy-authorizer.c b/gdata/tests/gdata-dummy-authorizer.c new file mode 100644 index 0000000..5a73cc2 --- /dev/null +++ b/gdata/tests/gdata-dummy-authorizer.c @@ -0,0 +1,222 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2014 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +/* + * SECTION:gdata-dummy-authorizer + * @short_description: GData dummy authorization interface + * @stability: Stable + * @include: tests/gdata-dummy-authorizer.h + * + * #GDataDummyAuthorizer is a dummy #GDataAuthorizer implementation intended for + * use in prototyping and testing code. It should not be used in production + * code. + * + * It adds a constant ‘Authorization’ header to all requests it processes whose + * domain is in the set of domains the authorizer was initialised with. All + * requests for other domains have no header added, and are considered + * non-authorized. + * + * Since: 0.16.0 + */ + +#include +#include +#include +#include + +#include "gdata-dummy-authorizer.h" +#include "gdata-private.h" + +static void authorizer_init (GDataAuthorizerInterface *iface); +static void finalize (GObject *object); + +static void process_request (GDataAuthorizer *self, + GDataAuthorizationDomain *domain, + SoupMessage *message); +static gboolean is_authorized_for_domain (GDataAuthorizer *self, + GDataAuthorizationDomain *domain); + +struct _GDataDummyAuthorizerPrivate { + GMutex mutex; /* mutex for authorization_domains */ + + /* Mapping from GDataAuthorizationDomain to itself; a set of domains + * which are authorised. */ + GHashTable *authorization_domains; +}; + +G_DEFINE_TYPE_WITH_CODE (GDataDummyAuthorizer, gdata_dummy_authorizer, + G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GDATA_TYPE_AUTHORIZER, + authorizer_init)) + +static void +gdata_dummy_authorizer_class_init (GDataDummyAuthorizerClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GDataDummyAuthorizerPrivate)); + + gobject_class->finalize = finalize; +} + +static void +authorizer_init (GDataAuthorizerInterface *iface) +{ + iface->process_request = process_request; + iface->is_authorized_for_domain = is_authorized_for_domain; +} + +static void +gdata_dummy_authorizer_init (GDataDummyAuthorizer *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + GDATA_TYPE_DUMMY_AUTHORIZER, + GDataDummyAuthorizerPrivate); + + /* Set up the authorizer's mutex */ + g_mutex_init (&(self->priv->mutex)); + self->priv->authorization_domains = g_hash_table_new_full (g_direct_hash, + g_direct_equal, + g_object_unref, + NULL); +} + +static void +finalize (GObject *object) +{ + GDataDummyAuthorizerPrivate *priv = GDATA_DUMMY_AUTHORIZER (object)->priv; + + g_hash_table_destroy (priv->authorization_domains); + g_mutex_clear (&(priv->mutex)); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (gdata_dummy_authorizer_parent_class)->finalize (object); +} + +static void +process_request (GDataAuthorizer *self, GDataAuthorizationDomain *domain, + SoupMessage *message) +{ + GDataDummyAuthorizerPrivate *priv = GDATA_DUMMY_AUTHORIZER (self)->priv; + + /* Set the authorisation header */ + g_mutex_lock (&(priv->mutex)); + + if (g_hash_table_lookup (priv->authorization_domains, domain) != NULL) { + soup_message_headers_replace (message->request_headers, + "Authorization", "dummy"); + } + + g_mutex_unlock (&(priv->mutex)); +} + +static gboolean +is_authorized_for_domain (GDataAuthorizer *self, + GDataAuthorizationDomain *domain) +{ + GDataDummyAuthorizerPrivate *priv = GDATA_DUMMY_AUTHORIZER (self)->priv; + gpointer result; + + g_mutex_lock (&(priv->mutex)); + result = g_hash_table_lookup (priv->authorization_domains, domain); + g_mutex_unlock (&(priv->mutex)); + + /* Sanity check */ + g_assert (result == NULL || result == domain); + + return (result != NULL); +} + +/* + * gdata_dummy_authorizer_new: + * @service_type: the #GType of a #GDataService subclass which the + * #GDataDummyAuthorizer will be used with + * + * Creates a new #GDataDummyAuthorizer. + * + * The #GDataAuthorizationDomains for the given @service_type (i.e. as + * returned by gdata_service_get_authorization_domains()) will be authorized, + * and all others will not. + * + * Return value: (transfer full): a new #GDataDummyAuthorizer; unref with + * g_object_unref() + * + * Since: 0.16.0 + */ +GDataDummyAuthorizer * +gdata_dummy_authorizer_new (GType service_type) +{ + GList/**/ *domains; /* owned */ + GDataDummyAuthorizer *retval = NULL; /* owned */ + + g_return_val_if_fail (g_type_is_a (service_type, GDATA_TYPE_SERVICE), + NULL); + + domains = gdata_service_get_authorization_domains (service_type); + retval = gdata_dummy_authorizer_new_for_authorization_domains (domains); + g_list_free (domains); + + return retval; +} + +/* + * gdata_dummy_authorizer_new_for_authorization_domains: + * @authorization_domains: (element-type GDataAuthorizationDomain) (transfer none): + * a non-empty list of #GDataAuthorizationDomains to be authorized + * against by the #GDataDummyAuthorizer + * + * Creates a new #GDataDummyAuthorizer. This function is intended to be used + * only when the default authorization domain list for a single #GDataService, + * as used by gdata_dummy_authorizer_new(), isn't suitable. For example, this + * could be because the #GDataDummyAuthorizer will be used with multiple + * #GDataService subclasses, or because the client requires a specific set of + * authorization domains. + * + * Return value: (transfer full): a new #GDataDummyAuthorizer; unref with + * g_object_unref() + * + * Since: 0.16.0 + */ +GDataDummyAuthorizer * +gdata_dummy_authorizer_new_for_authorization_domains (GList *authorization_domains) +{ + GList *i; + GDataDummyAuthorizer *authorizer; + + g_return_val_if_fail (authorization_domains != NULL, NULL); + + authorizer = GDATA_DUMMY_AUTHORIZER (g_object_new (GDATA_TYPE_DUMMY_AUTHORIZER, + NULL)); + + /* Register all the domains with the authorizer */ + for (i = authorization_domains; i != NULL; i = i->next) { + GDataAuthorizationDomain *domain; + + g_return_val_if_fail (GDATA_IS_AUTHORIZATION_DOMAIN (i->data), + NULL); + + /* We don't have to lock the authoriser's mutex here as no other + * code has seen the authoriser yet */ + domain = GDATA_AUTHORIZATION_DOMAIN (i->data); + g_hash_table_insert (authorizer->priv->authorization_domains, + g_object_ref (domain), domain); + } + + return authorizer; +} diff --git a/gdata/tests/gdata-dummy-authorizer.h b/gdata/tests/gdata-dummy-authorizer.h new file mode 100644 index 0000000..de797f9 --- /dev/null +++ b/gdata/tests/gdata-dummy-authorizer.h @@ -0,0 +1,76 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2014 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#ifndef GDATA_DUMMY_AUTHORIZER_H +#define GDATA_DUMMY_AUTHORIZER_H + +#include +#include + +#include "gdata-authorizer.h" + +G_BEGIN_DECLS + +#define GDATA_TYPE_DUMMY_AUTHORIZER (gdata_dummy_authorizer_get_type ()) +#define GDATA_DUMMY_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DUMMY_AUTHORIZER, GDataDummyAuthorizer)) +#define GDATA_DUMMY_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DUMMY_AUTHORIZER, GDataDummyAuthorizerClass)) +#define GDATA_IS_DUMMY_AUTHORIZER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DUMMY_AUTHORIZER)) +#define GDATA_IS_DUMMY_AUTHORIZER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DUMMY_AUTHORIZER)) +#define GDATA_DUMMY_AUTHORIZER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DUMMY_AUTHORIZER, GDataDummyAuthorizerClass)) + +typedef struct _GDataDummyAuthorizerPrivate GDataDummyAuthorizerPrivate; + +/** + * GDataDummyAuthorizer: + * + * All the fields in the #GDataDummyAuthorizer structure are private and should never be accessed directly. + * + * Since: 0.16.0 + */ +typedef struct { + /*< private >*/ + GObject parent; + GDataDummyAuthorizerPrivate *priv; +} GDataDummyAuthorizer; + +/** + * GDataDummyAuthorizerClass: + * + * All the fields in the #GDataDummyAuthorizerClass structure are private and should never be accessed directly. + * + * Since: 0.16.0 + */ +typedef struct { + /*< private >*/ + GObjectClass parent; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved0) (void); + void (*_g_reserved1) (void); +} GDataDummyAuthorizerClass; + +GType gdata_dummy_authorizer_get_type (void) G_GNUC_CONST; + +GDataDummyAuthorizer *gdata_dummy_authorizer_new (GType service_type) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; +GDataDummyAuthorizer *gdata_dummy_authorizer_new_for_authorization_domains (GList *authorization_domains) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* !GDATA_DUMMY_AUTHORIZER_H */ diff --git a/gdata/tests/general.c b/gdata/tests/general.c new file mode 100644 index 0000000..da531fe --- /dev/null +++ b/gdata/tests/general.c @@ -0,0 +1,4902 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* + * GData Client + * Copyright (C) Philip Withnall 2008–2010 + * + * GData Client is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GData Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GData Client. If not, see . + */ + +#include +#include + +#include "gdata.h" +#include "common.h" + +static void +test_xml_comparison (void) +{ + GDataAccessRule *rule; + + /* Since we've written the XML comparison function used across all the test suites, it's necessary to test that it actually works before we + * blindly assert that its results are correct. */ + rule = gdata_access_rule_new ("an-id"); + gdata_access_rule_set_role (rule, GDATA_ACCESS_ROLE_NONE); + gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_USER, "foo@example.com"); + + /* Check a valid comparison */ + gdata_test_assert_xml (rule, + "" + "" + "none" + "an-id" + "" + "" + "" + ""); + + /* Check a valid comparison with namespaces swapped */ + gdata_test_assert_xml (rule, + "" + "" + "none" + "an-id" + "" + "" + "" + ""); + + /* Check a valid comparison with elements swapped */ + gdata_test_assert_xml (rule, + "" + "" + "an-id" + "none" + "" + "" + "" + ""); + + /* Missing namespace (still valid XML, just not what's expected) */ + g_assert (gdata_test_compare_xml (GDATA_PARSABLE (rule), + "" + "" + "none" + "an-id" + "" + "" + "" + "", FALSE) == FALSE); + + /* Extra namespace */ + g_assert (gdata_test_compare_xml (GDATA_PARSABLE (rule), + "" + "" + "none" + "an-id" + "" + "" + "" + "", FALSE) == FALSE); + + /* Missing element */ + g_assert (gdata_test_compare_xml (GDATA_PARSABLE (rule), + "" + "" + "an-id" + "" + "" + "" + "", FALSE) == FALSE); + + /* Extra element */ + g_assert (gdata_test_compare_xml (GDATA_PARSABLE (rule), + "" + "" + "none" + "bar" + "an-id" + "" + "" + "" + "", FALSE) == FALSE); + + /* Incorrect namespace on element */ + g_assert (gdata_test_compare_xml (GDATA_PARSABLE (rule), + "" + "" + "none" + "an-id" + "" + "" + "" + "", FALSE) == FALSE); + + /* Mis-valued content */ + g_assert (gdata_test_compare_xml (GDATA_PARSABLE (rule), + "" + "" + "none" + "an-other-id" + "" + "" + "" + "", FALSE) == FALSE); + + /* Missing attribute */ + g_assert (gdata_test_compare_xml (GDATA_PARSABLE (rule), + "" + "" + "none" + "an-id" + "" + "" + "" + "", FALSE) == FALSE); + + /* Extra attribute */ + g_assert (gdata_test_compare_xml (GDATA_PARSABLE (rule), + "" + "" + "none" + "an-id" + "" + "" + "" + "", FALSE) == FALSE); + + /* Mis-valued attribute */ + g_assert (gdata_test_compare_xml (GDATA_PARSABLE (rule), + "" + "" + "none" + "an-id" + "" + "" + "" + "", FALSE) == FALSE); + + g_object_unref (rule); +} + +static void +test_entry_get_xml (void) +{ + gint64 updated, published, updated2, published2, updated3, published3; + GDataEntry *entry, *entry2; + GDataCategory *category; + GDataLink *_link; /* stupid unistd.h */ + GDataAuthor *author; + gchar *xml, *title, *summary, *id, *etag, *content, *content_uri, *rights; + gboolean is_inserted; + GList *list; + GError *error = NULL; + + entry = gdata_entry_new (NULL); + + /* Test setting properties directly */ + g_object_set (G_OBJECT (entry), + "title", "First testing title & escaping", + "summary", "Test summary & escaping.", + "content", "Test & escaping.", + "rights", "Philip Withnall ", + NULL); + + g_assert_cmpstr (gdata_entry_get_title (entry), ==, "First testing title & escaping"); + g_assert_cmpstr (gdata_entry_get_summary (entry), ==, "Test summary & escaping."); + g_assert_cmpstr (gdata_entry_get_content (entry), ==, "Test & escaping."); + g_assert (gdata_entry_get_content_uri (entry) == NULL); + g_assert_cmpstr (gdata_entry_get_rights (entry), ==, "Philip Withnall "); + + /* Set the properties more conventionally */ + gdata_entry_set_title (entry, "Testing title & escaping"); + gdata_entry_set_summary (entry, NULL); + gdata_entry_set_content (entry, "This is some sample content testing, amongst other things, & odd characters‽"); + gdata_entry_set_rights (entry, NULL); + + /* Content URI */ + g_object_set (G_OBJECT (entry), "content-uri", "http://foo.com/", NULL); + + g_assert (gdata_entry_get_content (entry) == NULL); + g_assert_cmpstr (gdata_entry_get_content_uri (entry), ==, "http://foo.com/"); + + gdata_entry_set_content_uri (entry, "http://bar.com/"); + + /* Check the generated XML's OK */ + gdata_test_assert_xml (entry, + "" + "" + "Testing title & escaping" + "" + ""); + + /* Reset the content */ + gdata_entry_set_content (entry, "This is some sample content testing, amongst other things, & odd characters‽"); + + /* Categories */ + category = gdata_category_new ("test", NULL, NULL); + gdata_entry_add_category (entry, category); + g_object_unref (category); + category = gdata_category_new ("example", NULL, "Example stuff"); + gdata_entry_add_category (entry, category); + g_object_unref (category); + category = gdata_category_new ("Film", "http://gdata.youtube.com/schemas/2007/categories.cat", "Film & Animation"); + gdata_entry_add_category (entry, category); + g_object_unref (category); + + /* Links */ + _link = gdata_link_new ("http://test.com/", GDATA_LINK_SELF); + gdata_link_set_content_type (_link, "application/atom+xml"); + gdata_entry_add_link (entry, _link); + g_object_unref (_link); + _link = gdata_link_new ("http://example.com/", NULL); + gdata_entry_add_link (entry, _link); + g_object_unref (_link); + _link = gdata_link_new ("http://test.mn/", GDATA_LINK_RELATED); + gdata_link_set_content_type (_link, "text/html"); + gdata_link_set_language (_link, "mn"); + gdata_link_set_title (_link, "A treatise on Mongolian test websites & other stuff."); + gdata_link_set_length (_link, 5010); + gdata_entry_add_link (entry, _link); + g_object_unref (_link); + _link = gdata_link_new ("http://example.com/", "http://foobar.link"); + gdata_entry_add_link (entry, _link); + g_object_unref (_link); + _link = gdata_link_new ("http://example2.com/", "http://foobar.link"); + gdata_entry_add_link (entry, _link); + g_object_unref (_link); + + /* Authors */ + author = gdata_author_new ("Joe Bloggs", "http://example.com/", "joe@example.com"); + gdata_entry_add_author (entry, author); + g_object_unref (author); + author = gdata_author_new ("John Smith", NULL, "smith.john@example.com"); + gdata_entry_add_author (entry, author); + g_object_unref (author); + author = gdata_author_new ("F. Barr؟", NULL, NULL); + gdata_entry_add_author (entry, author); + g_object_unref (author); + + /* Check the generated XML's OK */ + gdata_test_assert_xml (entry, + "" + "" + "Testing title & escaping" + "This is some sample content testing, amongst other things, <markup> & odd characters\342\200\275" + "" + "" + "" + "" + "" + "" + "" + "" + "F. Barr\330\237" + "John Smithsmith.john@example.com" + "Joe Bloggshttp://example.com/joe@example.com" + ""); + + /* Check again by re-parsing the XML to a GDataEntry */ + xml = gdata_parsable_get_xml (GDATA_PARSABLE (entry)); + entry2 = GDATA_ENTRY (gdata_parsable_new_from_xml (GDATA_TYPE_ENTRY, xml, -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (entry2)); + g_clear_error (&error); + g_free (xml); + + g_assert_cmpstr (gdata_entry_get_title (entry), ==, gdata_entry_get_title (entry2)); + g_assert_cmpstr (gdata_entry_get_id (entry), ==, gdata_entry_get_id (entry2)); /* should both be NULL */ + g_assert_cmpstr (gdata_entry_get_content (entry), ==, gdata_entry_get_content (entry2)); + g_assert_cmpstr (gdata_entry_get_content_uri (entry), ==, gdata_entry_get_content_uri (entry2)); /* should both be NULL */ + + updated = gdata_entry_get_updated (entry); + updated2 = gdata_entry_get_updated (entry2); + g_assert_cmpuint (updated, ==, updated2); + + published = gdata_entry_get_published (entry); + published2 = gdata_entry_get_published (entry2); + g_assert_cmpuint (published, ==, published2); + + /* Check links */ + _link = gdata_entry_look_up_link (entry, GDATA_LINK_SELF); + g_assert (_link != NULL); + g_assert_cmpstr (gdata_link_get_uri (_link), ==, "http://test.com/"); + g_assert_cmpstr (gdata_link_get_relation_type (_link), ==, GDATA_LINK_SELF); + g_assert_cmpstr (gdata_link_get_content_type (_link), ==, "application/atom+xml"); + + _link = gdata_entry_look_up_link (entry, "http://link.not.exist"); + g_assert (_link == NULL); + + list = gdata_entry_look_up_links (entry, "http://foobar.link"); + g_assert (list != NULL); + g_assert_cmpint (g_list_length (list), ==, 2); + + _link = GDATA_LINK (list->data); + g_assert (_link != NULL); + g_assert_cmpstr (gdata_link_get_uri (_link), ==, "http://example2.com/"); + g_assert_cmpstr (gdata_link_get_relation_type (_link), ==, "http://foobar.link"); + + _link = GDATA_LINK (list->next->data); + g_assert (_link != NULL); + g_assert_cmpstr (gdata_link_get_uri (_link), ==, "http://example.com/"); + g_assert_cmpstr (gdata_link_get_relation_type (_link), ==, "http://foobar.link"); + + g_list_free (list); + + /* Check authors */ + list = gdata_entry_get_authors (entry); + g_assert_cmpuint (g_list_length (list), ==, 3); + + author = GDATA_AUTHOR (list->data); + g_assert (author != NULL); + g_assert_cmpstr (gdata_author_get_name (author), ==, "F. Barr؟"); + g_assert (gdata_author_get_uri (author) == NULL); + g_assert (gdata_author_get_email_address (author) == NULL); + + author = GDATA_AUTHOR (list->next->data); + g_assert (author != NULL); + g_assert_cmpstr (gdata_author_get_name (author), ==, "John Smith"); + g_assert (gdata_author_get_uri (author) == NULL); + g_assert_cmpstr (gdata_author_get_email_address (author), ==, "smith.john@example.com"); + + author = GDATA_AUTHOR (list->next->next->data); + g_assert (author != NULL); + g_assert_cmpstr (gdata_author_get_name (author), ==, "Joe Bloggs"); + g_assert_cmpstr (gdata_author_get_uri (author), ==, "http://example.com/"); + g_assert_cmpstr (gdata_author_get_email_address (author), ==, "joe@example.com"); + + /* Check categories */ + list = gdata_entry_get_categories (entry); + g_assert (list != NULL); + g_assert_cmpint (g_list_length (list), ==, 3); + + category = GDATA_CATEGORY (list->data); + g_assert (category != NULL); + g_assert_cmpstr (gdata_category_get_term (category), ==, "Film"); + g_assert_cmpstr (gdata_category_get_scheme (category), ==, "http://gdata.youtube.com/schemas/2007/categories.cat"); + g_assert_cmpstr (gdata_category_get_label (category), ==, "Film & Animation"); + + category = GDATA_CATEGORY (list->next->data); + g_assert (category != NULL); + g_assert_cmpstr (gdata_category_get_term (category), ==, "example"); + g_assert (gdata_category_get_scheme (category) == NULL); + g_assert_cmpstr (gdata_category_get_label (category), ==, "Example stuff"); + + category = GDATA_CATEGORY (list->next->next->data); + g_assert (category != NULL); + g_assert_cmpstr (gdata_category_get_term (category), ==, "test"); + g_assert (gdata_category_get_scheme (category) == NULL); + g_assert (gdata_category_get_label (category) == NULL); + + /* TODO: Check authors */ + + /* Check properties a different way */ + g_object_get (G_OBJECT (entry2), + "title", &title, + "summary", &summary, + "id", &id, + "etag", &etag, + "updated", &updated3, + "published", &published3, + "content", &content, + "content-uri", &content_uri, + "is-inserted", &is_inserted, + "rights", &rights, + NULL); + + g_assert_cmpstr (title, ==, gdata_entry_get_title (entry)); + g_assert_cmpstr (summary, ==, gdata_entry_get_summary (entry)); + g_assert_cmpstr (id, ==, gdata_entry_get_id (entry)); + g_assert_cmpstr (etag, ==, gdata_entry_get_etag (entry)); + g_assert_cmpint (updated3, ==, updated); + g_assert_cmpint (published3, ==, published); + g_assert_cmpstr (content, ==, gdata_entry_get_content (entry)); + g_assert_cmpstr (content_uri, ==, gdata_entry_get_content_uri (entry)); + g_assert (is_inserted == FALSE); + g_assert_cmpstr (rights, ==, gdata_entry_get_rights (entry)); + + g_free (title); + g_free (summary); + g_free (id); + g_free (etag); + g_free (content); + g_free (content_uri); + g_free (rights); + + /* Set the content URI and check that */ + gdata_entry_set_content_uri (entry, "http://baz.net/"); + + g_object_get (G_OBJECT (entry), + "content", &content, + "content-uri", &content_uri, + NULL); + + g_assert_cmpstr (content, ==, gdata_entry_get_content (entry)); + g_assert_cmpstr (content_uri, ==, gdata_entry_get_content_uri (entry)); + + g_free (content); + g_free (content_uri); + + g_object_unref (entry); + g_object_unref (entry2); +} + +static void +test_entry_get_json (void) +{ + gint64 updated, published, updated2, published2; + GDataEntry *entry, *entry2; + gchar *json; + GError *error = NULL; + + entry = gdata_entry_new (NULL); + + /* Set the properties more conventionally */ + gdata_entry_set_title (entry, "Testing title & \"escaping\""); + gdata_entry_set_summary (entry, NULL); + gdata_entry_set_content (entry, NULL); + gdata_entry_set_rights (entry, NULL); + + /* Check the generated JSON's OK */ + gdata_test_assert_json (entry, + "{" + "\"title\":\"Testing title & \\\"escaping\\\"\"" + "}"); + + /* Check again by re-parsing the JSON to a GDataEntry. */ + json = gdata_parsable_get_json (GDATA_PARSABLE (entry)); + entry2 = GDATA_ENTRY (gdata_parsable_new_from_json (GDATA_TYPE_ENTRY, json, -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (entry2)); + g_clear_error (&error); + g_free (json); + + g_assert_cmpstr (gdata_entry_get_title (entry), ==, gdata_entry_get_title (entry2)); + g_assert_cmpstr (gdata_entry_get_id (entry), ==, gdata_entry_get_id (entry2)); /* should both be NULL */ + g_assert_cmpstr (gdata_entry_get_content (entry), ==, gdata_entry_get_content (entry2)); + g_assert_cmpstr (gdata_entry_get_content_uri (entry), ==, gdata_entry_get_content_uri (entry2)); /* should both be NULL */ + + updated = gdata_entry_get_updated (entry); + updated2 = gdata_entry_get_updated (entry2); + g_assert_cmpuint (updated, ==, updated2); + + published = gdata_entry_get_published (entry); + published2 = gdata_entry_get_published (entry2); + g_assert_cmpuint (published, ==, published2); + + g_object_unref (entry); + g_object_unref (entry2); +} + +static void +test_entry_parse_xml (void) +{ + GDataEntry *entry; + GError *error = NULL; + + /* Create an entry from XML with unhandled elements */ + entry = GDATA_ENTRY (gdata_parsable_new_from_xml (GDATA_TYPE_ENTRY, + "" + "Testing unhandled XML" + "2009-01-25T14:07:37Z" + "2009-01-23T14:06:37Z" + "Here we test unhandled XML elements." + "Test!" + "" + "How about some characters‽" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (entry)); + g_clear_error (&error); + + /* Now check the outputted XML from the entry still has the unhandled elements */ + gdata_test_assert_xml (entry, + "" + "" + "Testing unhandled XML" + "2009-01-25T14:07:37Z" + "2009-01-23T14:06:37Z" + "Here we test unhandled XML elements." + "Test!" + "" + "How about some characters‽" + ""); + g_object_unref (entry); +} + +static void +test_entry_parse_xml_kind_category (void) +{ + GDataEntry *entry; + GError *error = NULL; + + g_test_bug ("707477"); + + /* Create an entry from XML with a ‘kind’ category with extra attributes. */ + entry = GDATA_ENTRY (gdata_parsable_new_from_xml (GDATA_TYPE_ENTRY, + "" + "Testing kind categories" + "2009-01-25T14:07:37Z" + "2009-01-23T14:06:37Z" + "Here we test kind categories." + "" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (entry)); + g_clear_error (&error); + + /* Now check the outputted XML from the entry still has the extra attributes */ + gdata_test_assert_xml (entry, + "" + "" + "Testing kind categories" + "2009-01-25T14:07:37Z" + "2009-01-23T14:06:37Z" + "Here we test kind categories." + "" + "" + ""); + g_object_unref (entry); +} + +static void +test_entry_parse_json (void) +{ + GDataEntry *entry; + GError *error = NULL; + + /* Create an entry from JSON with unhandled nodes. */ + entry = GDATA_ENTRY (gdata_parsable_new_from_json (GDATA_TYPE_ENTRY, + "{" + "\"title\":\"A title\"," + "\"updated\":\"2009-01-25T14:07:37Z\"," + "\"selfLink\":\"http://example.com/\"," + "\"etag\":\"some-etag\"," + "\"id\":\"some-id\"," + "\"kind\":\"kind#kind\"," + "\"unhandled-boolean\":false," + "\"unhandled-string\":\"this-is-a-string---sometimes\"," + "\"unhandled-int\":15," + "\"unhandled-double\":42.42," + "\"unhandled-object\":{" + "\"a\":true," + "\"b\":true" + "}," + "\"unhandled-array\":[" + "1," + "2," + "3" + "]," + "\"unhandled-null\":null" + "}", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (entry)); + + /* Now check the outputted JSON from the entry still has the unhandled nodes. */ + gdata_test_assert_json (entry, + "{" + "\"title\":\"A title\"," + "\"id\":\"some-id\"," + "\"updated\":\"2009-01-25T14:07:37Z\"," + "\"etag\":\"some-etag\"," + "\"selfLink\":\"http://example.com/\"," + "\"kind\":\"kind#kind\"," + "\"unhandled-boolean\":false," + "\"unhandled-string\":\"this-is-a-string---sometimes\"," + "\"unhandled-int\":15," + "\"unhandled-double\":42.42," + "\"unhandled-object\":{" + "\"a\":true," + "\"b\":true" + "}," + "\"unhandled-array\":[" + "1," + "2," + "3" + "]," + "\"unhandled-null\":null" + "}"); + g_object_unref (entry); + + /* Test parsing of empty titles. */ + entry = GDATA_ENTRY (gdata_parsable_new_from_json (GDATA_TYPE_ENTRY, + "{" + "\"title\":\"\"" + "}", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (entry)); + g_object_unref (entry); +} + +static void +test_entry_error_handling_xml (void) +{ + GDataEntry *entry; + GError *error = NULL; + +#define TEST_XML_ERROR_HANDLING(x) entry = GDATA_ENTRY (gdata_parsable_new_from_xml (GDATA_TYPE_ENTRY,\ + ""\ + x\ + "", -1, &error));\ + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ + g_assert (entry == NULL);\ + g_clear_error (&error) + + /* updated */ + TEST_XML_ERROR_HANDLING ("not a date"); /* invalid date */ + + /* published */ + TEST_XML_ERROR_HANDLING ("also not a date"); /* invalid date */ + + /* category */ + TEST_XML_ERROR_HANDLING (""); /* invalid category */ + + /* link */ + TEST_XML_ERROR_HANDLING (""); /* invalid link */ + + /* author */ + TEST_XML_ERROR_HANDLING (""); /* invalid author */ + +#undef TEST_XML_ERROR_HANDLING +} + +static void +test_entry_error_handling_json (void) +{ + GDataEntry *entry; + GError *error = NULL; + +#define TEST_JSON_ERROR_HANDLING(x) \ + entry = GDATA_ENTRY (gdata_parsable_new_from_json (GDATA_TYPE_ENTRY,x, -1, &error));\ + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ + g_assert (entry == NULL);\ + g_clear_error (&error) +#define TEST_JSON_ERROR_HANDLING_PARSER(x) \ + entry = GDATA_ENTRY (gdata_parsable_new_from_json (GDATA_TYPE_ENTRY,x, -1, &error));\ + g_assert_error (error, GDATA_PARSER_ERROR, GDATA_PARSER_ERROR_PARSING_STRING);\ + g_assert (entry == NULL);\ + g_clear_error (&error) + + /* General structure. */ + TEST_JSON_ERROR_HANDLING_PARSER ("[true,false,true]"); /* root node is not an object */ + TEST_JSON_ERROR_HANDLING_PARSER ("false"); /* root node is not an object */ + TEST_JSON_ERROR_HANDLING_PARSER ("invalid json"); /* totally invalid JSON */ + + /* id */ + TEST_JSON_ERROR_HANDLING ("{\"id\":\"\"}"); /* empty */ + TEST_JSON_ERROR_HANDLING ("{\"id\":null}"); /* invalid type */ + + /* updated */ + TEST_JSON_ERROR_HANDLING ("{\"updated\":\"not correct\"}"); /* incorrect format */ + TEST_JSON_ERROR_HANDLING ("{\"updated\":false}"); /* invalid type */ + TEST_JSON_ERROR_HANDLING ("{\"updated\":\"\"}"); /* empty */ + + /* title */ + TEST_JSON_ERROR_HANDLING ("{\"title\":false}"); /* invalid type */ + + /* etag */ + TEST_JSON_ERROR_HANDLING ("{\"etag\":\"\"}"); /* empty */ + TEST_JSON_ERROR_HANDLING ("{\"etag\":false}"); /* invalid type */ + + /* selfLink */ + TEST_JSON_ERROR_HANDLING ("{\"selfLink\":\"\"}"); /* empty */ + TEST_JSON_ERROR_HANDLING ("{\"selfLink\":false}"); /* invalid type */ + + /* kind */ + TEST_JSON_ERROR_HANDLING ("{\"kind\":\"\"}"); /* empty */ + TEST_JSON_ERROR_HANDLING ("{\"kind\":false}"); /* invalid type */ + +#undef TEST_JSON_ERROR_HANDLING_PARSER +#undef TEST_JSON_ERROR_HANDLING +} + +static void +test_entry_escaping (void) +{ + GDataEntry *entry; + GError *error = NULL; + + /* Since we can't construct a GDataEntry directly, we need to parse it from XML */ + entry = GDATA_ENTRY (gdata_parsable_new_from_xml (GDATA_TYPE_ENTRY, + "" + "" + "Escaped content & stuff" + "http://foo.com/?foo&bar" + "2010-12-10T17:21:24Z" + "2010-12-10T17:21:24Z" + "Summary & stuff" + "Free & open source" + "Content & things." + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (entry)); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (entry, + "" + "" + "Escaped content & stuff" + "http://foo.com/?foo&bar" + "2010-12-10T17:21:24Z" + "2010-12-10T17:21:24Z" + "Summary & stuff" + "Free & open source" + "Content & things." + ""); + g_object_unref (entry); + + /* Repeat with content given by a URI */ + entry = GDATA_ENTRY (gdata_parsable_new_from_xml (GDATA_TYPE_ENTRY, + "" + "" + "Escaped content & stuff" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (entry)); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (entry, + "" + "" + "Escaped content & stuff" + "" + ""); + g_object_unref (entry); +} + +static void +test_entry_links_remove (void) +{ + GDataEntry *entry; + GDataLink *link_, *link2_; + GError *error = NULL; + + /* Since we can't construct a GDataEntry directly, we need to parse it from XML. */ + entry = GDATA_ENTRY (gdata_parsable_new_from_xml (GDATA_TYPE_ENTRY, + "" + "" + "Escaped content & stuff" + "http://foo.com/?foo&bar" + "2010-12-10T17:21:24Z" + "2010-12-10T17:21:24Z" + "Summary & stuff" + "Free & open source" + "Content & things." + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ENTRY (entry)); + + link_ = gdata_link_new ("http://example.com/", GDATA_LINK_RELATED); + + /* Add a link. */ + gdata_entry_add_link (entry, link_); + g_assert (gdata_entry_look_up_link (entry, GDATA_LINK_RELATED) == link_); + + /* Remove the link. */ + g_assert (gdata_entry_remove_link (entry, link_) == TRUE); + g_assert (gdata_entry_look_up_link (entry, GDATA_LINK_RELATED) == NULL); + + /* Attempt to remove a non-existent link. */ + link2_ = gdata_link_new ("http://foobar.com/", GDATA_LINK_SELF); + g_assert (gdata_entry_remove_link (entry, link2_) == FALSE); + + g_object_unref (link2_); + g_object_unref (link_); + g_object_unref (entry); +} + +static void +test_feed_parse_xml (void) +{ + GDataFeed *feed; + GDataEntry *entry; + GDataLink *_link; /* stupid unistd.h */ + GList *list; + gchar *title, *subtitle, *id, *etag, *logo, *icon, *rights; + gint64 updated, updated2; + GDataGenerator *generator; + guint items_per_page, start_index, total_results; + GError *error = NULL; + + feed = GDATA_FEED (gdata_parsable_new_from_xml (GDATA_TYPE_FEED, + "" + "http://example.com/id" + "2009-02-25T14:07:37.880860Z" + "Test feed" + "Test subtitle" + "http://example.com/logo.png" + "http://example.com/icon.png" + "" + "" + "" + "" + "" + "public" + "" + "Joe Smith" + "j.smith@example.com" + "" + "Example Generator" + "2" + "1" + "50" + "" + "entry1" + "Testing unhandled XML" + "2009-01-25T14:07:37.880860Z" + "2009-01-23T14:06:37.880860Z" + "Here we test unhandled XML elements." + "" + "" + "entry2" + "Testing unhandled XML 2" + "2009-02-25T14:07:37.880860Z" + "2009-02-23T14:06:37.880860Z" + "Here we test unhandled XML elements again." + "" + "Test unhandled elements!" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_FEED (feed)); + g_clear_error (&error); + + /* Check the feed's properties */ + g_object_get (G_OBJECT (feed), + "title", &title, + "subtitle", &subtitle, + "id", &id, + "etag", &etag, + "updated", &updated, + "logo", &logo, + "icon", &icon, + "generator", &generator, + "rights", &rights, + "items-per-page", &items_per_page, + "start-index", &start_index, + "total-results", &total_results, + NULL); + + g_assert_cmpstr (title, ==, "Test feed"); + g_assert_cmpstr (subtitle, ==, "Test subtitle"); + g_assert_cmpstr (id, ==, "http://example.com/id"); + g_assert_cmpstr (etag, ==, "W/\"D08FQn8-eil7ImA9WxZbFEw.\""); + + g_assert_cmpint (updated, ==, 1235570857); + + g_assert_cmpstr (logo, ==, "http://example.com/logo.png"); + g_assert_cmpstr (icon, ==, "http://example.com/icon.png"); + g_assert_cmpstr (rights, ==, "public"); + + g_assert (GDATA_IS_GENERATOR (generator)); + g_assert_cmpstr (gdata_generator_get_name (generator), ==, "Example Generator"); + g_assert_cmpstr (gdata_generator_get_uri (generator), ==, "http://example.com/"); + g_assert_cmpstr (gdata_generator_get_version (generator), ==, "0.6"); + + g_assert_cmpuint (items_per_page, ==, 50); + g_assert_cmpuint (start_index, ==, 1); + g_assert_cmpuint (total_results, ==, 2); + + g_free (title); + g_free (subtitle); + g_free (id); + g_free (etag); + g_free (logo); + g_free (icon); + g_free (rights); + g_object_unref (generator); + + /* Check the entries */ + entry = gdata_feed_look_up_entry (feed, "entry1"); + g_assert (GDATA_IS_ENTRY (entry)); + + entry = gdata_feed_look_up_entry (feed, "this doesn't exist"); + g_assert (entry == NULL); + + entry = gdata_feed_look_up_entry (feed, "entry2"); + g_assert (GDATA_IS_ENTRY (entry)); + + /* Check the categories */ + list = gdata_feed_get_categories (feed); + g_assert (list != NULL); + g_assert_cmpint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_CATEGORY (list->data)); + + /* Check the links */ + list = gdata_feed_get_links (feed); + g_assert (list != NULL); + g_assert_cmpint (g_list_length (list), ==, 4); + g_assert (GDATA_IS_LINK (list->data)); + g_assert (GDATA_IS_LINK (list->next->data)); + g_assert (GDATA_IS_LINK (list->next->next->data)); + g_assert (GDATA_IS_LINK (list->next->next->next->data)); + + _link = gdata_feed_look_up_link (feed, GDATA_LINK_ALTERNATE); + g_assert (GDATA_IS_LINK (_link)); + + _link = gdata_feed_look_up_link (feed, "this doesn't exist"); + g_assert (_link == NULL); + + _link = gdata_feed_look_up_link (feed, "http://schemas.google.com/g/2005#feed"); + g_assert (GDATA_IS_LINK (_link)); + + _link = gdata_feed_look_up_link (feed, "http://schemas.google.com/g/2005#post"); + g_assert (GDATA_IS_LINK (_link)); + + _link = gdata_feed_look_up_link (feed, GDATA_LINK_SELF); + g_assert (GDATA_IS_LINK (_link)); + + /* Check the authors */ + list = gdata_feed_get_authors (feed); + g_assert (list != NULL); + g_assert_cmpint (g_list_length (list), ==, 1); + g_assert (GDATA_IS_AUTHOR (list->data)); + + /* Check the other properties again, the more normal way this time */ + g_assert_cmpstr (gdata_feed_get_title (feed), ==, "Test feed"); + g_assert_cmpstr (gdata_feed_get_subtitle (feed), ==, "Test subtitle"); + g_assert_cmpstr (gdata_feed_get_id (feed), ==, "http://example.com/id"); + g_assert_cmpstr (gdata_feed_get_etag (feed), ==, "W/\"D08FQn8-eil7ImA9WxZbFEw.\""); + + updated2 = gdata_feed_get_updated (feed); + g_assert_cmpint (updated2, ==, 1235570857); + + g_assert_cmpstr (gdata_feed_get_logo (feed), ==, "http://example.com/logo.png"); + g_assert_cmpstr (gdata_feed_get_icon (feed), ==, "http://example.com/icon.png"); + g_assert_cmpstr (gdata_feed_get_rights (feed), ==, "public"); + + generator = gdata_feed_get_generator (feed); + g_assert (GDATA_IS_GENERATOR (generator)); + g_assert_cmpstr (gdata_generator_get_name (generator), ==, "Example Generator"); + g_assert_cmpstr (gdata_generator_get_uri (generator), ==, "http://example.com/"); + g_assert_cmpstr (gdata_generator_get_version (generator), ==, "0.6"); + + g_assert_cmpuint (gdata_feed_get_items_per_page (feed), ==, 50); + g_assert_cmpuint (gdata_feed_get_start_index (feed), ==, 1); + g_assert_cmpuint (gdata_feed_get_total_results (feed), ==, 2); + + g_object_unref (feed); +} + +static void +test_feed_error_handling (void) +{ + GDataFeed *feed; + GError *error = NULL; + +#define TEST_XML_ERROR_HANDLING(x) feed = GDATA_FEED (gdata_parsable_new_from_xml (GDATA_TYPE_FEED, \ + ""\ + x\ + "", -1, &error));\ + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ + g_assert (feed == NULL);\ + g_clear_error (&error) + + /* entry */ + TEST_XML_ERROR_HANDLING ("this isn't a date"); /* invalid entry */ + + /* title */ + TEST_XML_ERROR_HANDLING ("First titleSecond title"); /* duplicate title */ +#if 0 + /* FIXME: Removed due to the YouTube comments feed not being a valid Atom feed. + * See: https://code.google.com/p/gdata-issues/issues/detail?id=2908 + * and: https://bugzilla.gnome.org/show_bug.cgi?id=679072 */ + TEST_XML_ERROR_HANDLING ("ID2009-01-25T14:07:37.880860Z"); /* missing title */ +#endif + + /* subtitle */ + TEST_XML_ERROR_HANDLING ("First subtitleSecond subtitle"); /* duplicate subtitle */ + + /* id */ + TEST_XML_ERROR_HANDLING ("First IDSecond ID"); /* duplicate ID */ + TEST_XML_ERROR_HANDLING ("Title2009-01-25T14:07:37.880860Z"); /* missing ID */ + + /* updated */ + TEST_XML_ERROR_HANDLING ("2009-01-25T14:07:37.880860Z" + "2009-01-25T14:07:37.880860Z"); /* duplicate updated */ + TEST_XML_ERROR_HANDLING ("not a date"); /* invalid date */ + TEST_XML_ERROR_HANDLING ("TitleID"); /* missing updated */ + + /* category */ + TEST_XML_ERROR_HANDLING (""); /* invalid category */ + + /* logo */ + TEST_XML_ERROR_HANDLING ("First logoSecond logo"); /* duplicate logo */ + + /* icon */ + TEST_XML_ERROR_HANDLING ("First iconSecond icon"); /* duplicate icon */ + + /* link */ + TEST_XML_ERROR_HANDLING (""); /* invalid link */ + + /* author */ + TEST_XML_ERROR_HANDLING (""); /* invalid author */ + + /* generator */ + TEST_XML_ERROR_HANDLING ("First generatorSecond generator"); /* duplicate generator */ + TEST_XML_ERROR_HANDLING (""); /* invalid generator */ + + /* openSearch:totalResults */ + TEST_XML_ERROR_HANDLING ("5" + "3"); /* duplicate totalResults */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("this isn't a number!"); /* invalid number */ + + /* openSearch:startIndex */ + TEST_XML_ERROR_HANDLING ("5" + "3"); /* duplicate startIndex */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("this isn't a number!"); /* invalid number */ + + /* openSearch:itemsPerPage */ + TEST_XML_ERROR_HANDLING ("5" + "3"); /* duplicate itemsPerPage */ + TEST_XML_ERROR_HANDLING (""); /* missing content */ + TEST_XML_ERROR_HANDLING ("this isn't a number!"); /* invalid number */ + +#undef TEST_XML_ERROR_HANDLING +} + +static void +test_feed_escaping (void) +{ + GDataFeed *feed; + GError *error = NULL; + + /* Since we can't construct a GDataEntry directly, we need to parse it from XML */ + feed = GDATA_FEED (gdata_parsable_new_from_xml (GDATA_TYPE_FEED, + "" + "" + "http://foo.com?foo&bar" + "2010-12-10T17:49:15Z" + "Test feed & stuff." + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_FEED (feed)); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (feed, + "" + "" + "Test feed & stuff." + "http://foo.com?foo&bar" + "2010-12-10T17:49:15Z" + ""); + g_object_unref (feed); +} + +static void +test_query_categories (void) +{ + GDataQuery *query; + gchar *query_uri; + + query = gdata_query_new ("foobar"); + + /* AND */ + gdata_query_set_categories (query, "Fritz/Laurie"); + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com/-/Fritz/Laurie?q=foobar"); + g_free (query_uri); + + /* OR */ + gdata_query_set_categories (query, "Fritz|Laurie"); + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com/-/Fritz%7CLaurie?q=foobar"); + g_free (query_uri); + + /* Combination */ + gdata_query_set_categories (query, "A|-{urn:google.com}B/-C"); + query_uri = gdata_query_get_query_uri (query, "http://example.com/gdata_test"); + g_assert_cmpstr (query_uri, ==, "http://example.com/gdata_test/-/A%7C-%7Burn%3Agoogle.com%7DB/-C?q=foobar"); + g_free (query_uri); + + /* Same combination without q param */ + gdata_query_set_q (query, NULL); + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com/-/A%7C-%7Burn%3Agoogle.com%7DB/-C"); + g_free (query_uri); + + g_object_unref (query); +} + +static void +test_query_dates (void) +{ + GDataQuery *query; + gchar *query_uri; + + query = gdata_query_new ("baz"); + + /* updated-min */ + gdata_query_set_updated_min (query, 1373280114); /* 2013-07-08T10:41:54Z */ + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-min=2013-07-08T10:41:54Z"); + g_free (query_uri); + gdata_query_set_updated_min (query, -1); + + /* updated-max */ + gdata_query_set_updated_max (query, 1373280114); /* 2013-07-08T10:41:54Z */ + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-max=2013-07-08T10:41:54Z"); + g_free (query_uri); + gdata_query_set_updated_max (query, -1); + + /* published-min */ + gdata_query_set_published_min (query, 1373280114); /* 2013-07-08T10:41:54Z */ + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-min=2013-07-08T10:41:54Z"); + g_free (query_uri); + gdata_query_set_published_min (query, -1); + + /* published-max */ + gdata_query_set_published_max (query, 1373280114); /* 2013-07-08T10:41:54Z */ + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-max=2013-07-08T10:41:54Z"); + g_free (query_uri); + gdata_query_set_published_max (query, -1); + + g_object_unref (query); +} + +static void +test_query_strict (void) +{ + GDataQuery *query; + gchar *query_uri; + + query = gdata_query_new ("bar"); + + gdata_query_set_is_strict (query, TRUE); + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=bar&strict=true"); + g_free (query_uri); + + gdata_query_set_is_strict (query, FALSE); + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=bar"); + g_free (query_uri); + + g_object_unref (query); +} + +static void +test_query_pagination (void) +{ + GDataQuery *query; + gchar *query_uri; + + query = gdata_query_new ("test"); + gdata_query_set_max_results (query, 15); + gdata_query_set_etag (query, "etag"); /* this should be cleared by pagination */ + + query_uri = gdata_query_get_query_uri (query, "http://example.com/"); + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=test&max-results=15"); + g_free (query_uri); + + /* Try the next and previous pages. */ + gdata_query_next_page (query); + g_assert (gdata_query_get_etag (query) == NULL); + + query_uri = gdata_query_get_query_uri (query, "http://example.com/"); + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=test&start-index=16&max-results=15"); + g_free (query_uri); + + gdata_query_set_etag (query, "etag"); + g_assert (gdata_query_previous_page (query) == TRUE); + g_assert (gdata_query_get_etag (query) == NULL); + + query_uri = gdata_query_get_query_uri (query, "http://example.com/"); + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=test&max-results=15"); + g_free (query_uri); + + /* Try another previous page. This should fail, and the ETag should be untouched. */ + gdata_query_set_etag (query, "etag"); + g_assert (gdata_query_previous_page (query) == FALSE); + g_assert_cmpstr (gdata_query_get_etag (query), ==, "etag"); + + g_object_unref (query); + + /* Try the alternate constructor. */ + query = gdata_query_new_with_limits ("test", 40, 10); + + query_uri = gdata_query_get_query_uri (query, "http://example.com/"); + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=test&start-index=40&max-results=10"); + g_free (query_uri); + + /* Try the next and previous pages again. */ + gdata_query_next_page (query); + + query_uri = gdata_query_get_query_uri (query, "http://example.com/"); + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=test&start-index=50&max-results=10"); + g_free (query_uri); + + g_assert (gdata_query_previous_page (query) == TRUE); + + query_uri = gdata_query_get_query_uri (query, "http://example.com/"); + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=test&start-index=40&max-results=10"); + g_free (query_uri); + + g_assert (gdata_query_previous_page (query) == TRUE); + + query_uri = gdata_query_get_query_uri (query, "http://example.com/"); + g_assert_cmpstr (query_uri, ==, "http://example.com/?q=test&start-index=30&max-results=10"); + g_free (query_uri); + + g_object_unref (query); +} + +static void +notify_cb (GObject *obj, GParamSpec *pspec, gpointer user_data) +{ + gboolean *notification_received = user_data; + g_assert (*notification_received == FALSE); + *notification_received = TRUE; +} + +static void +test_query_properties (void) +{ + GDataQuery *query; + gboolean notification_received = FALSE; + gulong handler_id; + + query = gdata_query_new ("default"); + +#define CHECK_PROPERTY(cmptype, name_hyphens, name_underscores, default_val, new_val, new_val2, val_type, free_val) \ + { \ + val_type val; \ + \ + handler_id = g_signal_connect (query, "notify::" name_hyphens, (GCallback) notify_cb, ¬ification_received); \ + \ + g_assert_##cmptype (gdata_query_get_##name_underscores (query), ==, default_val); \ + g_object_get (query, name_hyphens, &val, NULL); \ + g_assert_##cmptype (val, ==, default_val); \ + if (free_val == TRUE) { \ + g_free ((gpointer) ((guintptr) val)); \ + } \ + \ + notification_received = FALSE; \ + gdata_query_set_##name_underscores (query, new_val); \ + g_assert (notification_received == TRUE); \ + \ + g_assert_##cmptype (gdata_query_get_##name_underscores (query), ==, new_val); \ + \ + notification_received = FALSE; \ + g_object_set (query, name_hyphens, (val_type) new_val2, NULL); \ + g_assert (notification_received == TRUE); \ + \ + g_assert_##cmptype (gdata_query_get_##name_underscores (query), ==, new_val2); \ + \ + g_signal_handler_disconnect (query, handler_id); \ + } +#define CHECK_PROPERTY_STR(name_hyphens, name_underscores, default_val) \ + CHECK_PROPERTY (cmpstr, name_hyphens, name_underscores, default_val, "new", "new2", gchar*, TRUE) +#define CHECK_PROPERTY_INT64(name_hyphens, name_underscores, default_val) \ + CHECK_PROPERTY (cmpint, name_hyphens, name_underscores, default_val, 123, 5134132, gint64, FALSE) +#define CHECK_PROPERTY_UINT(name_hyphens, name_underscores, default_val) \ + CHECK_PROPERTY (cmpuint, name_hyphens, name_underscores, default_val, 535, 123, guint, FALSE) +#define CHECK_PROPERTY_BOOLEAN(name_hyphens, name_underscores, default_val) \ + CHECK_PROPERTY (cmpuint, name_hyphens, name_underscores, default_val, TRUE, FALSE, gboolean, FALSE) + + CHECK_PROPERTY_STR ("q", q, "default"); + CHECK_PROPERTY_STR ("categories", categories, NULL); + CHECK_PROPERTY_STR ("author", author, NULL); + CHECK_PROPERTY_INT64 ("updated-min", updated_min, -1); + CHECK_PROPERTY_INT64 ("updated-max", updated_max, -1); + CHECK_PROPERTY_INT64 ("published-min", published_min, -1); + CHECK_PROPERTY_INT64 ("published-max", published_max, -1); + CHECK_PROPERTY_UINT ("start-index", start_index, 0); +#define gdata_query_get_is_strict gdata_query_is_strict + CHECK_PROPERTY_BOOLEAN ("is-strict", is_strict, FALSE); +#undef gdata_query_get_is_strict + CHECK_PROPERTY_UINT ("max-results", max_results, 0); + CHECK_PROPERTY_STR ("etag", etag, NULL); + +#undef CHECK_PROPERTY_BOOLEAN +#undef CHECK_PROPERTY_UINT +#undef CHECK_PROPERTY_INT64 +#undef CHECK_PROPERTY_STR +#undef CHECK_PROPERTY + + g_object_unref (query); +} + +static void +test_query_unicode (void) +{ + GDataQuery *query; + gchar *query_uri; + + g_test_bug ("602497"); + + /* Simple query */ + query = gdata_query_new ("fööbar‽"); + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com?q=f%C3%B6%C3%B6bar%E2%80%BD"); + g_free (query_uri); + + /* Categories */ + gdata_query_set_categories (query, "Ümlauts|¿Questions‽"); + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com/-/%C3%9Cmlauts%7C%C2%BFQuestions%E2%80%BD?q=f%C3%B6%C3%B6bar%E2%80%BD"); + g_free (query_uri); + + /* Author */ + gdata_query_set_author (query, "Lørd Brïan Bleßêd"); + query_uri = gdata_query_get_query_uri (query, "http://example.com"); + g_assert_cmpstr (query_uri, ==, "http://example.com/-/%C3%9Cmlauts%7C%C2%BFQuestions%E2%80%BD?q=f%C3%B6%C3%B6bar%E2%80%BD&author=L%C3%B8rd%20Br%C3%AFan%20Ble%C3%9F%C3%AAd"); + g_free (query_uri); + + g_object_unref (query); +} + +static void +test_query_etag (void) +{ + GDataQuery *query = gdata_query_new (NULL); + + /* Test that setting any property will unset the ETag */ + g_test_bug ("613529"); + + /* Also check that setting the ETag doesn't unset the ETag! */ + gdata_query_set_etag (query, "foobar"); + g_assert_cmpstr (gdata_query_get_etag (query), ==, "foobar"); + +#define CHECK_ETAG(C) \ + gdata_query_set_etag (query, "foobar"); \ + C; \ + g_assert (gdata_query_get_etag (query) == NULL); + + CHECK_ETAG (gdata_query_set_q (query, "q")) + CHECK_ETAG (gdata_query_set_categories (query, "shizzle,foobar")) + CHECK_ETAG (gdata_query_set_author (query, "John Smith")) + CHECK_ETAG (gdata_query_set_updated_min (query, -1)) + CHECK_ETAG (gdata_query_set_updated_max (query, -1)) + CHECK_ETAG (gdata_query_set_published_min (query, -1)) + CHECK_ETAG (gdata_query_set_published_max (query, -1)) + CHECK_ETAG (gdata_query_set_start_index (query, 5)) + CHECK_ETAG (gdata_query_set_is_strict (query, TRUE)) + CHECK_ETAG (gdata_query_set_max_results (query, 1000)) + CHECK_ETAG (gdata_query_next_page (query)) + CHECK_ETAG (g_assert (gdata_query_previous_page (query))) + +#undef CHECK_ETAG + + g_object_unref (query); +} + +static void +test_service_network_error (void) +{ + GDataService *service; +#if 0 + SoupURI *proxy_uri; +#endif + GError *error = NULL; + + /* This is a little hacky, but it should work */ + service = g_object_new (GDATA_TYPE_SERVICE, NULL); + + /* Try a query which should always fail due to errors resolving the hostname */ + g_assert (gdata_service_query (service, NULL, "https://thisshouldnotexist.invalid", NULL, GDATA_TYPE_ENTRY, + NULL, NULL, NULL, &error) == NULL); + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NETWORK_ERROR); + g_clear_error (&error); + + /* TODO: We have to disable this test, as libsoup 2.30.2 < x <= 2.32.0 doesn't return SOUP_STATUS_CANT_RESOLVE_PROXY properly any more. + * Filed as bgo#632354. */ +#if 0 + /* Try one with a bad proxy set */ + proxy_uri = soup_uri_new ("https://thisshouldalsonotexist.invalid/proxy"); + gdata_service_set_proxy_uri (service, proxy_uri); + soup_uri_free (proxy_uri); + + g_assert (gdata_service_query (service, "https://google.com", NULL, GDATA_TYPE_ENTRY, NULL, NULL, NULL, &error) == NULL); + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROXY_ERROR); + g_clear_error (&error); +#endif + + g_object_unref (service); +} + +static void +test_service_locale (void) +{ + GDataService *service; + gchar *locale; + + /* This is a little hacky, but it should work */ + service = g_object_new (GDATA_TYPE_SERVICE, NULL); + + /* Just test setting and getting the locale */ + g_assert (gdata_service_get_locale (service) == NULL); + gdata_service_set_locale (service, "en_GB"); + g_assert_cmpstr (gdata_service_get_locale (service), ==, "en_GB"); + + g_object_get (service, "locale", &locale, NULL); + g_assert_cmpstr (locale, ==, "en_GB"); + g_free (locale); + + g_object_unref (service); +} + +static void +test_access_rule_get_xml (void) +{ + GDataAccessRule *rule, *rule2; + const gchar *content_type; + gchar *xml, *role, *scope_type3, *scope_value3, *key; + gint64 edited, edited2; + const gchar *scope_type, *scope_value, *scope_type2, *scope_value2; + GError *error = NULL; + + rule = gdata_access_rule_new ("an-id"); + + /* Test setting properties directly */ + g_object_set (G_OBJECT (rule), + "role", "A role", + "scope-type", "A scope type", + "scope-value", "A scope value", + NULL); + + g_assert_cmpstr (gdata_access_rule_get_role (rule), ==, "A role"); + gdata_access_rule_get_scope (rule, &scope_type, &scope_value); + g_assert_cmpstr (scope_type, ==, "A scope type"); + g_assert_cmpstr (scope_value, ==, "A scope value"); + edited = gdata_access_rule_get_edited (rule); + g_assert_cmpuint (edited, >, 0); /* current time */ + g_assert_cmpstr (gdata_access_rule_get_key (rule), ==, NULL); + + /* Set the properties more conventionally */ + gdata_access_rule_set_role (rule, GDATA_ACCESS_ROLE_NONE); + gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_USER, "foo@example.com"); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (rule)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the generated XML's OK */ + gdata_test_assert_xml (rule, + "" + "" + "none" + "an-id" + "" + "" + "" + ""); + + /* Check again by re-parsing the XML to a GDataAccessRule */ + xml = gdata_parsable_get_xml (GDATA_PARSABLE (rule)); + rule2 = GDATA_ACCESS_RULE (gdata_parsable_new_from_xml (GDATA_TYPE_ACCESS_RULE, xml, -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ACCESS_RULE (rule2)); + g_clear_error (&error); + g_free (xml); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (rule2)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + g_assert_cmpstr (gdata_access_rule_get_role (rule), ==, gdata_access_rule_get_role (rule2)); + gdata_access_rule_get_scope (rule, &scope_type, &scope_value); + gdata_access_rule_get_scope (rule2, &scope_type2, &scope_value2); + g_assert_cmpstr (scope_type, ==, scope_type2); + g_assert_cmpstr (scope_value, ==, scope_value2); + edited = gdata_access_rule_get_edited (rule2); + g_assert_cmpuint (edited, ==, -1); /* unspecified in XML */ + g_assert_cmpstr (gdata_access_rule_get_key (rule), ==, gdata_access_rule_get_key (rule2)); + + /* Check properties a different way */ + g_object_get (G_OBJECT (rule2), + "role", &role, + "scope-type", &scope_type3, + "scope-value", &scope_value3, + "edited", &edited2, + "key", &key, + NULL); + + g_assert_cmpstr (role, ==, gdata_access_rule_get_role (rule)); + g_assert_cmpstr (scope_type, ==, scope_type3); + g_assert_cmpstr (scope_value, ==, scope_value3); + g_assert_cmpuint (edited2, ==, -1); + g_assert_cmpstr (key, ==, NULL); + + g_free (role); + g_free (scope_type3); + g_free (scope_value3); + + /* Test that the GDataAccessRule:role and GDataEntry:title properties are linked */ + gdata_entry_set_title (GDATA_ENTRY (rule), "Another role"); + g_assert_cmpstr (gdata_access_rule_get_role (rule), ==, "Another role"); + gdata_access_rule_set_role (rule, GDATA_ACCESS_ROLE_NONE); + g_assert_cmpstr (gdata_entry_get_title (GDATA_ENTRY (rule)), ==, "none"); + + g_object_unref (rule); + g_object_unref (rule2); + + /* Check that a rule with scope type 'default' doesn't have a value. + * See: https://developers.google.com/google-apps/calendar/v2/reference#gacl_reference */ + rule = gdata_access_rule_new ("another-id"); + gdata_access_rule_set_role (rule, GDATA_ACCESS_ROLE_NONE); + gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_DEFAULT, NULL); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (rule)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the generated XML's OK */ + gdata_test_assert_xml (rule, + "" + "" + "none" + "another-id" + "" + "" + "" + ""); + + /* Check by re-parsing the XML to a GDataAccessRule */ + xml = gdata_parsable_get_xml (GDATA_PARSABLE (rule)); + rule2 = GDATA_ACCESS_RULE (gdata_parsable_new_from_xml (GDATA_TYPE_ACCESS_RULE, xml, -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ACCESS_RULE (rule2)); + g_clear_error (&error); + g_free (xml); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (rule2)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + g_assert_cmpstr (gdata_access_rule_get_role (rule), ==, gdata_access_rule_get_role (rule2)); + gdata_access_rule_get_scope (rule, &scope_type, &scope_value); + gdata_access_rule_get_scope (rule2, &scope_type2, &scope_value2); + g_assert_cmpstr (scope_type, ==, scope_type2); + g_assert_cmpstr (scope_value, ==, scope_value2); + edited = gdata_access_rule_get_edited (rule2); + g_assert_cmpuint (edited, ==, -1); /* unspecified in XML */ + + g_object_unref (rule); + g_object_unref (rule2); +} + +static void +test_access_rule_get_xml_with_key (void) +{ + GDataAccessRule *rule; + gint64 edited; + const gchar *content_type, *scope_type, *scope_value; + GError *error = NULL; + + rule = GDATA_ACCESS_RULE (gdata_parsable_new_from_xml (GDATA_TYPE_ACCESS_RULE, + "" + "" + "none" + "an-id" + "" + "" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_ACCESS_RULE (rule)); + + /* Check the properties. */ + g_assert_cmpstr (gdata_access_rule_get_role (rule), ==, "none"); + gdata_access_rule_get_scope (rule, &scope_type, &scope_value); + g_assert_cmpstr (scope_type, ==, "user"); + g_assert_cmpstr (scope_value, ==, "foo@example.com"); + edited = gdata_access_rule_get_edited (rule); + g_assert_cmpuint (edited, >, 0); /* current time */ + g_assert_cmpstr (gdata_access_rule_get_key (rule), ==, "asdasd"); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (rule)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same. */ + gdata_test_assert_xml (rule, + "" + "" + "none" + "an-id" + "" + "" + "" + ""); + + g_object_unref (rule); +} + +static void +test_access_rule_error_handling (void) +{ + GDataAccessRule *rule; + GError *error = NULL; + +#define TEST_XML_ERROR_HANDLING(x) rule = GDATA_ACCESS_RULE (gdata_parsable_new_from_xml (GDATA_TYPE_ACCESS_RULE,\ + ""\ + x\ + "", -1, &error));\ + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ + g_assert (rule == NULL);\ + g_clear_error (&error) + + /* role */ + TEST_XML_ERROR_HANDLING (""); /* missing value */ + + /* scope */ + TEST_XML_ERROR_HANDLING (""); /* missing type */ + TEST_XML_ERROR_HANDLING (""); /* missing value */ + TEST_XML_ERROR_HANDLING (""); /* missing value */ + + /* edited */ + TEST_XML_ERROR_HANDLING (""); /* missing date */ + TEST_XML_ERROR_HANDLING ("not a date"); /* bad date */ + + /* withKey */ + TEST_XML_ERROR_HANDLING (""); /* missing key */ + TEST_XML_ERROR_HANDLING (""); /* missing role */ + TEST_XML_ERROR_HANDLING (""); /* missing role */ + +#undef TEST_XML_ERROR_HANDLING +} + +static void +test_access_rule_escaping (void) +{ + GDataAccessRule *rule; + + rule = gdata_access_rule_new (NULL); + gdata_access_rule_set_role (rule, ""); + gdata_access_rule_set_scope (rule, "", ""); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (rule, + "" + "" + "<role>" + "" + "" + "" + ""); + g_object_unref (rule); +} + +static void +test_comparable (void) +{ + GDataComparable *category = GDATA_COMPARABLE (gdata_category_new ("term", "http://scheme", "label")); + + /* Test the NULL comparisons */ + g_assert_cmpint (gdata_comparable_compare (category, NULL), ==, 1); + g_assert_cmpint (gdata_comparable_compare (NULL, category), ==, -1); + g_assert_cmpint (gdata_comparable_compare (NULL, NULL), ==, 0); + g_assert_cmpint (gdata_comparable_compare (category, category), ==, 0); + + g_object_unref (category); +} + +static void +test_color_parsing (void) +{ + GDataColor color; + + /* With hash */ + g_assert (gdata_color_from_hexadecimal ("#F99Ff0", &color) == TRUE); + g_assert_cmpuint (color.red, ==, 249); + g_assert_cmpuint (color.green, ==, 159); + g_assert_cmpuint (color.blue, ==, 240); + + /* Without hash */ + g_assert (gdata_color_from_hexadecimal ("F99Ff0", &color) == TRUE); + g_assert_cmpuint (color.red, ==, 249); + g_assert_cmpuint (color.green, ==, 159); + g_assert_cmpuint (color.blue, ==, 240); + + /* Invalid, but correct length */ + g_assert (gdata_color_from_hexadecimal ("foobar", &color) == FALSE); + + /* Wildly invalid */ + g_assert (gdata_color_from_hexadecimal ("this is not a real colour!", &color) == FALSE); +} + +static void +test_color_output (void) +{ + GDataColor color; + gchar *color_string; + + /* General test */ + g_assert (gdata_color_from_hexadecimal ("#F99Ff0", &color) == TRUE); + color_string = gdata_color_to_hexadecimal (&color); + g_assert_cmpstr (color_string, ==, "#f99ff0"); + g_free (color_string); + + /* Boundary tests */ + g_assert (gdata_color_from_hexadecimal ("#ffffff", &color) == TRUE); + color_string = gdata_color_to_hexadecimal (&color); + g_assert_cmpstr (color_string, ==, "#ffffff"); + g_free (color_string); + + g_assert (gdata_color_from_hexadecimal ("#000000", &color) == TRUE); + color_string = gdata_color_to_hexadecimal (&color); + g_assert_cmpstr (color_string, ==, "#000000"); + g_free (color_string); +} + +/*static void +test_media_thumbnail_parse_time (const gchar *locale) +{ + g_test_bug ("584737"); + + g_test_message ("Testing gdata_media_thumbnail_parse_time in the \"%s\" locale...", locale); + g_assert_cmpstr (setlocale (LC_ALL, locale), ==, locale); + + g_assert_cmpint (gdata_media_thumbnail_parse_time ("00:01:42.500"), ==, 102500); + g_assert_cmpint (gdata_media_thumbnail_parse_time ("00:02:45"), ==, 165000); + g_assert_cmpint (gdata_media_thumbnail_parse_time ("12:00:15.000"), ==, 43215000); + g_assert_cmpint (gdata_media_thumbnail_parse_time ("00:00:00"), ==, 0); + g_assert_cmpint (gdata_media_thumbnail_parse_time ("foobar"), ==, -1); + + setlocale (LC_ALL, ""); +}*/ + +static void +test_atom_author (void) +{ + GDataAuthor *author, *author2; + const gchar *content_type; + gchar *name, *uri, *email_address; + GError *error = NULL; + + author = GDATA_AUTHOR (gdata_parsable_new_from_xml (GDATA_TYPE_AUTHOR, + "" + "John Smöth" + "http://example.com/" + "john@example.com" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_AUTHOR (author)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_author_get_name (author), ==, "John Smöth"); + g_assert_cmpstr (gdata_author_get_uri (author), ==, "http://example.com/"); + g_assert_cmpstr (gdata_author_get_email_address (author), ==, "john@example.com"); + + /* Compare it against another identical author */ + author2 = gdata_author_new ("John Smöth", "http://example.com/", "john@example.com"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (author), GDATA_COMPARABLE (author2)), ==, 0); + g_object_unref (author2); + + /* …and a different author */ + author2 = gdata_author_new ("Brian Blessed", NULL, NULL); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (author), GDATA_COMPARABLE (author2)), !=, 0); + g_object_unref (author2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (author)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (author, + "" + "" + "John Smöth" + "http://example.com/" + "john@example.com" + ""); + + /* Check the properties */ + g_object_get (G_OBJECT (author), + "name", &name, + "uri", &uri, + "email-address", &email_address, + NULL); + + g_assert_cmpstr (name, ==, "John Smöth"); + g_assert_cmpstr (uri, ==, "http://example.com/"); + g_assert_cmpstr (email_address, ==, "john@example.com"); + + g_free (name); + g_free (uri); + g_free (email_address); + g_object_unref (author); + + /* Now parse an author with little information available */ + author = GDATA_AUTHOR (gdata_parsable_new_from_xml (GDATA_TYPE_AUTHOR, + "" + "James Johnson" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_AUTHOR (author)); + g_clear_error (&error); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (author)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the properties */ + g_assert_cmpstr (gdata_author_get_name (author), ==, "James Johnson"); + g_assert (gdata_author_get_uri (author) == NULL); + g_assert (gdata_author_get_email_address (author) == NULL); + + g_object_unref (author); +} + +static void +test_atom_author_error_handling (void) +{ + GDataAuthor *author; + GError *error = NULL; + +#define TEST_XML_ERROR_HANDLING(x) author = GDATA_AUTHOR (gdata_parsable_new_from_xml (GDATA_TYPE_AUTHOR,\ + ""\ + x\ + "", -1, &error));\ + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ + g_assert (author == NULL);\ + g_clear_error (&error) + + /* name */ + TEST_XML_ERROR_HANDLING ("John SmöthNot John Smöth"); /* duplicated name */ + TEST_XML_ERROR_HANDLING (""); /* empty name */ + TEST_XML_ERROR_HANDLING ("http://example.com/john@example.com"); /* missing name */ + + /* uri */ + TEST_XML_ERROR_HANDLING ("http://example.com/http://another-example.com/"); /* duplicated URI */ + + /* email */ + TEST_XML_ERROR_HANDLING ("john@example.comjohn@another-example.com"); /* duplicated e-mail address */ + +#undef TEST_XML_ERROR_HANDLING +} + +static void +test_atom_author_escaping (void) +{ + GDataAuthor *author; + + author = gdata_author_new ("First & Last Name", "http://foo.com?foo&bar", "John Smith "); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (author, + "" + "" + "First & Last Name" + "http://foo.com?foo&bar" + "John Smith <john.smith@gmail.com>" + ""); + g_object_unref (author); +} + +static void +test_atom_category (void) +{ + GDataCategory *category, *category2; + const gchar *content_type; + gchar *term, *scheme, *label; + GError *error = NULL; + + category = GDATA_CATEGORY (gdata_parsable_new_from_xml (GDATA_TYPE_CATEGORY, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CATEGORY (category)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_category_get_term (category), ==, "jokes"); + g_assert_cmpstr (gdata_category_get_scheme (category), ==, "http://foobar.com#categories"); + g_assert_cmpstr (gdata_category_get_label (category), ==, "Jokes & Trivia"); + + /* Compare it against another identical category */ + category2 = gdata_category_new ("jokes", "http://foobar.com#categories", "Jokes & Trivia"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (category), GDATA_COMPARABLE (category2)), ==, 0); + g_object_unref (category2); + + /* …and a different category */ + category2 = gdata_category_new ("sports", "http://foobar.com#categories", NULL); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (category), GDATA_COMPARABLE (category2)), !=, 0); + g_object_unref (category2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (category)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (category, + "" + ""); + + /* Check the properties */ + g_object_get (G_OBJECT (category), + "term", &term, + "scheme", &scheme, + "label", &label, + NULL); + + g_assert_cmpstr (term, ==, "jokes"); + g_assert_cmpstr (scheme, ==, "http://foobar.com#categories"); + g_assert_cmpstr (label, ==, "Jokes & Trivia"); + + g_free (term); + g_free (scheme); + g_free (label); + g_object_unref (category); + + /* Now parse a category with less information available */ + category = GDATA_CATEGORY (gdata_parsable_new_from_xml (GDATA_TYPE_CATEGORY, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CATEGORY (category)); + g_clear_error (&error); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (category)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the properties */ + g_assert_cmpstr (gdata_category_get_term (category), ==, "sports"); + g_assert (gdata_category_get_scheme (category) == NULL); + g_assert (gdata_category_get_label (category) == NULL); + g_object_unref (category); + + /* Try a category with custom content */ + category = GDATA_CATEGORY (gdata_parsable_new_from_xml (GDATA_TYPE_CATEGORY, + "" + "" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_CATEGORY (category)); + g_clear_error (&error); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (category)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML contains the unknown XML */ + gdata_test_assert_xml (category, + "" + "" + "" + "" + ""); + g_object_unref (category); +} + +static void +test_atom_category_error_handling (void) +{ + GDataCategory *category; + GError *error = NULL; + + /* Missing term */ + category = GDATA_CATEGORY (gdata_parsable_new_from_xml (GDATA_TYPE_CATEGORY, "", -1, &error)); + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR); + g_assert (category == NULL); + g_clear_error (&error); +} + +static void +test_atom_category_escaping (void) +{ + GDataCategory *category; + + category = gdata_category_new ("", "http://foo.com?foo&bar", "Label & Stuff"); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (category, + "" + ""); + g_object_unref (category); +} + +static void +test_atom_generator (void) +{ + GDataGenerator *generator, *generator2; + const gchar *content_type; + gchar *name, *uri, *version; + GError *error = NULL; + + generator = GDATA_GENERATOR (gdata_parsable_new_from_xml (GDATA_TYPE_GENERATOR, + "Bach & Son's Generator", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GENERATOR (generator)); + g_clear_error (&error); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (generator)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Compare it against another identical generator */ + generator2 = GDATA_GENERATOR (gdata_parsable_new_from_xml (GDATA_TYPE_GENERATOR, + "Bach & Son's Generator", -1, NULL)); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (generator), GDATA_COMPARABLE (generator2)), ==, 0); + g_object_unref (generator2); + + /* …and a different generator */ + generator2 = GDATA_GENERATOR (gdata_parsable_new_from_xml (GDATA_TYPE_GENERATOR, + "Different generator", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GENERATOR (generator)); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (generator), GDATA_COMPARABLE (generator2)), !=, 0); + g_object_unref (generator2); + + /* Check the properties */ + g_assert_cmpstr (gdata_generator_get_name (generator), ==, "Bach & Son's Generator"); + g_assert_cmpstr (gdata_generator_get_uri (generator), ==, "http://example.com/"); + g_assert_cmpstr (gdata_generator_get_version (generator), ==, "15"); + + /* Check them a different way too */ + g_object_get (G_OBJECT (generator), + "name", &name, + "uri", &uri, + "version", &version, + NULL); + + g_assert_cmpstr (name, ==, "Bach & Son's Generator"); + g_assert_cmpstr (uri, ==, "http://example.com/"); + g_assert_cmpstr (version, ==, "15"); + + g_free (name); + g_free (uri); + g_free (version); + g_object_unref (generator); + + /* Now parse a generator with less information available */ + generator = GDATA_GENERATOR (gdata_parsable_new_from_xml (GDATA_TYPE_GENERATOR, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GENERATOR (generator)); + g_clear_error (&error); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (generator)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the properties */ + g_assert (gdata_generator_get_name (generator) == NULL); + g_assert (gdata_generator_get_uri (generator) == NULL); + g_assert (gdata_generator_get_version (generator) == NULL); + g_object_unref (generator); +} + +static void +test_atom_generator_error_handling (void) +{ + GDataGenerator *generator; + GError *error = NULL; + + /* Empty URI */ + generator = GDATA_GENERATOR (gdata_parsable_new_from_xml (GDATA_TYPE_GENERATOR, "", -1, &error)); + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR); + g_assert (generator == NULL); + g_clear_error (&error); +} + +static void +test_atom_link (void) +{ + GDataLink *link1, *link2; + gchar *uri, *relation_type, *content_type, *language, *title; + gint length; + GError *error = NULL; + + link1 = GDATA_LINK (gdata_parsable_new_from_xml (GDATA_TYPE_LINK, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_LINK (link1)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_link_get_uri (link1), ==, "http://example.com/"); + g_assert_cmpstr (gdata_link_get_relation_type (link1), ==, "http://test.com#link-type"); + g_assert_cmpstr (gdata_link_get_content_type (link1), ==, "text/plain"); + g_assert_cmpstr (gdata_link_get_language (link1), ==, "de"); + g_assert_cmpstr (gdata_link_get_title (link1), ==, "All About Angle Brackets: <, >"); + g_assert_cmpint (gdata_link_get_length (link1), ==, 2000); + + /* Compare it against another identical link */ + link2 = gdata_link_new ("http://example.com/", "http://test.com#link-type"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (link1), GDATA_COMPARABLE (link2)), ==, 0); + gdata_link_set_content_type (link2, "text/plain"); + gdata_link_set_language (link2, "de"); + gdata_link_set_title (link2, "All About Angle Brackets: <, >"); + gdata_link_set_length (link2, 2000); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (link1), GDATA_COMPARABLE (link2)), ==, 0); + + /* Try with a dissimilar link */ + gdata_link_set_uri (link2, "http://gnome.org/"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (link1), GDATA_COMPARABLE (link2)), !=, 0); + g_object_unref (link2); + + g_assert_cmpstr (gdata_parsable_get_content_type (GDATA_PARSABLE (link1)), ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (link1, + "" + ""); + + /* Set some of the properties */ + g_object_set (G_OBJECT (link1), + "uri", "http://another-example.com/", + "relation-type", "http://test.com#link-type2", + "content-type", "text/html", + "language", "sv", + "title", "This & That About ", + "length", -1, + NULL); + + /* Check the properties */ + g_object_get (G_OBJECT (link1), + "uri", &uri, + "relation-type", &relation_type, + "content-type", &content_type, + "language", &language, + "title", &title, + "length", &length, + NULL); + + g_assert_cmpstr (uri, ==, "http://another-example.com/"); + g_assert_cmpstr (relation_type, ==, "http://test.com#link-type2"); + g_assert_cmpstr (content_type, ==, "text/html"); + g_assert_cmpstr (language, ==, "sv"); + g_assert_cmpstr (title, ==, "This & That About "); + g_assert_cmpint (length, ==, -1); + + g_free (uri); + g_free (relation_type); + g_free (content_type); + g_free (language); + g_free (title); + g_object_unref (link1); + + /* Now parse a link with less information available */ + link1 = GDATA_LINK (gdata_parsable_new_from_xml (GDATA_TYPE_LINK, + "Test Content", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_LINK (link1)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_link_get_uri (link1), ==, "http://shizzle.com"); + g_assert_cmpstr (gdata_link_get_relation_type (link1), ==, "http://www.iana.org/assignments/relation/alternate"); + g_assert (gdata_link_get_content_type (link1) == NULL); + g_assert (gdata_link_get_language (link1) == NULL); + g_assert (gdata_link_get_title (link1) == NULL); + g_assert (gdata_link_get_length (link1) == -1); + + g_assert_cmpstr (gdata_parsable_get_content_type (GDATA_PARSABLE (link1)), ==, "application/atom+xml"); + + /* Check the outputted XML contains the unknown XML */ + gdata_test_assert_xml (link1, + "" + "" + "Test Content"); + g_object_unref (link1); +} + +static void +test_atom_link_error_handling (void) +{ + GDataLink *_link; /* stupid unistd.h */ + GError *error = NULL; + +#define TEST_XML_ERROR_HANDLING(x) _link = GDATA_LINK (gdata_parsable_new_from_xml (GDATA_TYPE_LINK,\ + "", -1, &error));\ + g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ + g_assert (_link == NULL);\ + g_clear_error (&error) + + /* href */ + TEST_XML_ERROR_HANDLING (""); /* missing href */ + TEST_XML_ERROR_HANDLING ("href=''"); /* empty href */ + + /* rel */ + TEST_XML_ERROR_HANDLING ("href='http://example.com/' rel=''"); /* empty rel */ + + /* type */ + TEST_XML_ERROR_HANDLING ("href='http://example.com/' type=''"); /* empty type */ + + /* hreflang */ + TEST_XML_ERROR_HANDLING ("href='http://example.com/' hreflang=''"); /* empty hreflang */ + +#undef TEST_XML_ERROR_HANDLING +} + +static void +test_atom_link_escaping (void) +{ + GDataLink *_link; + + _link = gdata_link_new ("http://foo.com?foo&bar", "http://foo.com?foo&relation=bar"); + gdata_link_set_content_type (_link, ""); + gdata_link_set_language (_link, ""); + gdata_link_set_title (_link, "Title & stuff"); + + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (_link, + "" + ""); + g_object_unref (_link); +} + +static void +test_app_categories (void) +{ + GDataAPPCategories *categories; + GList *_categories; + gboolean fixed; + const gchar *content_type; + GError *error = NULL; + + categories = GDATA_APP_CATEGORIES (gdata_parsable_new_from_json (GDATA_TYPE_APP_CATEGORIES, + "{" + "'kind': 'youtube#videoCategoryListResponse'," + "'etag': '\"tbWC5XrSXxe1WOAx6MK9z4hHSU8/1v2mrzYSYG6onNLt2qTj13hkQZk\"'," + "'items': [" + "{" + "'kind': 'youtube#videoCategory'," + "'etag': '\"tbWC5XrSXxe1WOAx6MK9z4hHSU8/Xy1mB4_yLrHy_BmKmPBggty2mZQ\"'," + "'id': '1'," + "'snippet': {" + "'channelId': 'UCBR8-60-B28hp2BmDPdntcQ'," + "'title': 'Film & Animation'," + "'assignable': true" + "}" + "}," + "{" + "'kind': 'youtube#videoCategory'," + "'etag': '\"tbWC5XrSXxe1WOAx6MK9z4hHSU8/UZ1oLIIz2dxIhO45ZTFR3a3NyTA\"'," + "'id': '2'," + "'snippet': {" + "'channelId': 'UCBR8-60-B28hp2BmDPdntcQ'," + "'title': 'Autos & Vehicles'," + "'assignable': true" + "}" + "}" + "]" + "}", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_APP_CATEGORIES (categories)); + g_clear_error (&error); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (categories)); + g_assert_cmpstr (content_type, ==, "application/json"); + + /* Check the properties */ + g_assert (gdata_app_categories_is_fixed (categories) == FALSE); + + /* Check them a different way too */ + g_object_get (G_OBJECT (categories), "is-fixed", &fixed, NULL); + g_assert (fixed == FALSE); + + /* Check the categories and scheme inheritance */ + _categories = gdata_app_categories_get_categories (categories); + g_assert_cmpint (g_list_length (_categories), ==, 2); + + g_assert (GDATA_IS_CATEGORY (_categories->data)); + g_assert_cmpstr (gdata_category_get_scheme (GDATA_CATEGORY (_categories->data)), ==, NULL); + g_assert_cmpstr (gdata_category_get_label (GDATA_CATEGORY (_categories->data)), ==, "Film & Animation"); + + g_assert (GDATA_IS_CATEGORY (_categories->next->data)); + g_assert_cmpstr (gdata_category_get_scheme (GDATA_CATEGORY (_categories->next->data)), ==, NULL); + g_assert_cmpstr (gdata_category_get_label (GDATA_CATEGORY (_categories->next->data)), ==, "Autos & Vehicles"); + + g_object_unref (categories); + + /* Now parse one with less information available */ + categories = GDATA_APP_CATEGORIES (gdata_parsable_new_from_json (GDATA_TYPE_APP_CATEGORIES, + "{" + "'kind': 'youtube#videoCategoryListResponse'," + "'items': []" + "}", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_APP_CATEGORIES (categories)); + g_clear_error (&error); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (categories)); + g_assert_cmpstr (content_type, ==, "application/json"); + + /* Check the properties */ + g_assert (gdata_app_categories_is_fixed (categories) == FALSE); + g_object_unref (categories); +} + +static void +test_gd_email_address (void) +{ + GDataGDEmailAddress *email, *email2; + GError *error = NULL; + const gchar *content_type; + + email = GDATA_GD_EMAIL_ADDRESS (gdata_parsable_new_from_xml (GDATA_TYPE_GD_EMAIL_ADDRESS, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_EMAIL_ADDRESS (email)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_email_address_get_address (email), ==, "fubar@gmail.com"); + g_assert_cmpstr (gdata_gd_email_address_get_relation_type (email), ==, GDATA_GD_EMAIL_ADDRESS_HOME); + g_assert_cmpstr (gdata_gd_email_address_get_label (email), ==, "Personal & Private"); + g_assert_cmpstr (gdata_gd_email_address_get_display_name (email), ==, ""); + g_assert (gdata_gd_email_address_is_primary (email) == TRUE); + + /* Compare it against another identical address */ + email2 = gdata_gd_email_address_new ("fubar@gmail.com", GDATA_GD_EMAIL_ADDRESS_HOME, "Personal & Private", TRUE); + gdata_gd_email_address_set_display_name (email2, ""); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (email), GDATA_COMPARABLE (email2)), ==, 0); + + /* …and a different one */ + gdata_gd_email_address_set_address (email2, "test@example.com"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (email), GDATA_COMPARABLE (email2)), !=, 0); + g_object_unref (email2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (email)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (email, + "" + ""); + g_object_unref (email); + + /* Now parse an address with less information available */ + email = GDATA_GD_EMAIL_ADDRESS (gdata_parsable_new_from_xml (GDATA_TYPE_GD_EMAIL_ADDRESS, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_EMAIL_ADDRESS (email)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_email_address_get_address (email), ==, "test@example.com"); + g_assert (gdata_gd_email_address_get_relation_type (email) == NULL); + g_assert (gdata_gd_email_address_get_label (email) == NULL); + g_assert (gdata_gd_email_address_get_display_name (email) == NULL); + g_assert (gdata_gd_email_address_is_primary (email) == FALSE); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (email)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML contains the unknown XML */ + gdata_test_assert_xml (email, + "" + ""); + g_object_unref (email); +} + +static void +test_gd_email_address_escaping (void) +{ + GDataGDEmailAddress *email; + + g_test_bug ("630350"); + + email = gdata_gd_email_address_new ("Fubar ", GDATA_GD_EMAIL_ADDRESS_HOME "?foo&bar", "Personal & Private", TRUE); + gdata_gd_email_address_set_display_name (email, ""); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (email, + "" + ""); + g_object_unref (email); +} + +static void +test_gd_email_address_comparison (void) +{ + GDataGDEmailAddress *email1, *email2; + + /* Should only compare equal if addresses are equal. */ + email1 = gdata_gd_email_address_new ("foo@example.com", NULL, NULL, TRUE); + email2 = gdata_gd_email_address_new ("foo@example.com", NULL, "label", FALSE); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (email1), GDATA_COMPARABLE (email2)), ==, 0); + + gdata_gd_email_address_set_address (email1, "bar@example.com"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (email1), GDATA_COMPARABLE (email2)), !=, 0); + + g_object_unref (email2); + g_object_unref (email1); +} + +static void +test_gd_im_address (void) +{ + GDataGDIMAddress *im, *im2; + GError *error = NULL; + const gchar *content_type; + + im = GDATA_GD_IM_ADDRESS (gdata_parsable_new_from_xml (GDATA_TYPE_GD_IM_ADDRESS, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_IM_ADDRESS (im)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_im_address_get_address (im), ==, "foo@bar.msn.com"); + g_assert_cmpstr (gdata_gd_im_address_get_protocol (im), ==, GDATA_GD_IM_PROTOCOL_LIVE_MESSENGER); + g_assert_cmpstr (gdata_gd_im_address_get_relation_type (im), ==, GDATA_GD_IM_ADDRESS_HOME); + g_assert (gdata_gd_im_address_get_label (im) == NULL); + g_assert (gdata_gd_im_address_is_primary (im) == TRUE); + + /* Compare it against another identical address */ + im2 = gdata_gd_im_address_new ("foo@bar.msn.com", GDATA_GD_IM_PROTOCOL_LIVE_MESSENGER, GDATA_GD_IM_ADDRESS_HOME, NULL, TRUE); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (im), GDATA_COMPARABLE (im2)), ==, 0); + + /* …and a different one */ + gdata_gd_im_address_set_protocol (im2, GDATA_GD_IM_PROTOCOL_GOOGLE_TALK); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (im), GDATA_COMPARABLE (im2)), !=, 0); + g_object_unref (im2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (im)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (im, + "" + ""); + g_object_unref (im); + + /* Now parse an address with less information available */ + im = GDATA_GD_IM_ADDRESS (gdata_parsable_new_from_xml (GDATA_TYPE_GD_IM_ADDRESS, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_IM_ADDRESS (im)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_im_address_get_address (im), ==, "foo@baz.example.com"); + g_assert (gdata_gd_im_address_get_protocol (im) == NULL); + g_assert (gdata_gd_im_address_get_relation_type (im) == NULL); + g_assert_cmpstr (gdata_gd_im_address_get_label (im), ==, "Other & Miscellaneous"); + g_assert (gdata_gd_im_address_is_primary (im) == FALSE); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (im)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML contains the unknown XML */ + gdata_test_assert_xml (im, + "" + ""); + g_object_unref (im); +} + +static void +test_gd_im_address_escaping (void) +{ + GDataGDIMAddress *im; + + im = gdata_gd_im_address_new ("Fubar ", GDATA_GD_IM_PROTOCOL_GOOGLE_TALK "?foo&bar", GDATA_GD_IM_ADDRESS_HOME "?foo&bar", + "Personal & Private", TRUE); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (im, + "" + ""); + g_object_unref (im); +} + +static void +test_gd_im_address_comparison (void) +{ + GDataGDIMAddress *im_address1, *im_address2; + + /* Should only compare equal if address and protocol are both equal. */ + im_address1 = gdata_gd_im_address_new ("foo@example.com", GDATA_GD_IM_PROTOCOL_LIVE_MESSENGER, NULL, NULL, TRUE); + im_address2 = gdata_gd_im_address_new ("foo@example.com", GDATA_GD_IM_PROTOCOL_LIVE_MESSENGER, NULL, "label", FALSE); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (im_address1), GDATA_COMPARABLE (im_address2)), ==, 0); + + /* Different addresses, same protocol. */ + gdata_gd_im_address_set_address (im_address1, "bar@example.com"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (im_address1), GDATA_COMPARABLE (im_address2)), !=, 0); + + /* Same address, different protocols. */ + gdata_gd_im_address_set_address (im_address1, "foo@example.com"); + gdata_gd_im_address_set_protocol (im_address1, GDATA_GD_IM_PROTOCOL_JABBER); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (im_address1), GDATA_COMPARABLE (im_address2)), !=, 0); + + g_object_unref (im_address2); + g_object_unref (im_address1); +} + +static void +test_gd_name (void) +{ + GDataGDName *name, *name2; + GError *error = NULL; + const gchar *content_type; + + name = GDATA_GD_NAME (gdata_parsable_new_from_xml (GDATA_TYPE_GD_NAME, + "" + "Brian" + "Charles" + "Blessed" + "Mr" + "ABC" + "Mr Brian Charles Blessed, ABC" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_NAME (name)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_name_get_given_name (name), ==, "Brian"); + g_assert_cmpstr (gdata_gd_name_get_additional_name (name), ==, "Charles"); + g_assert_cmpstr (gdata_gd_name_get_family_name (name), ==, "Blessed"); + g_assert_cmpstr (gdata_gd_name_get_prefix (name), ==, "Mr"); + g_assert_cmpstr (gdata_gd_name_get_suffix (name), ==, "ABC"); + g_assert_cmpstr (gdata_gd_name_get_full_name (name), ==, "Mr Brian Charles Blessed, ABC"); + + /* Compare it against another identical name */ + name2 = gdata_gd_name_new ("Brian", "Blessed"); + gdata_gd_name_set_additional_name (name2, "Charles"); + gdata_gd_name_set_prefix (name2, "Mr"); + gdata_gd_name_set_suffix (name2, "ABC"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (name), GDATA_COMPARABLE (name2)), ==, 0); + + /* …and a different one */ + gdata_gd_name_set_prefix (name2, "Mrs"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (name), GDATA_COMPARABLE (name2)), !=, 0); + g_object_unref (name2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (name)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (name, + "" + "" + "Brian" + "Charles" + "Blessed" + "Mr" + "ABC" + "Mr Brian Charles Blessed, ABC" + ""); + g_object_unref (name); + + /* Now parse an address with less information available */ + name = GDATA_GD_NAME (gdata_parsable_new_from_xml (GDATA_TYPE_GD_NAME, + "Bob", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_NAME (name)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_name_get_given_name (name), ==, "Bob"); + g_assert (gdata_gd_name_get_additional_name (name) == NULL); + g_assert (gdata_gd_name_get_family_name (name) == NULL); + g_assert (gdata_gd_name_get_prefix (name) == NULL); + g_assert (gdata_gd_name_get_suffix (name) == NULL); + g_assert (gdata_gd_name_get_full_name (name) == NULL); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (name)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is still correct */ + gdata_test_assert_xml (name, + "" + "" + "Bob" + ""); + g_object_unref (name); +} + +static void +test_gd_name_empty_strings (void) +{ + GDataGDName *name; + GError *error = NULL; + + g_test_bug ("662290"); + + /* Test that empty full names get treated as NULL correctly. */ + name = GDATA_GD_NAME (gdata_parsable_new_from_xml (GDATA_TYPE_GD_NAME, + "" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_NAME (name)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_name_get_given_name (name), ==, NULL); + g_assert_cmpstr (gdata_gd_name_get_additional_name (name), ==, NULL); + g_assert_cmpstr (gdata_gd_name_get_family_name (name), ==, NULL); + g_assert_cmpstr (gdata_gd_name_get_prefix (name), ==, NULL); + g_assert_cmpstr (gdata_gd_name_get_suffix (name), ==, NULL); + g_assert_cmpstr (gdata_gd_name_get_full_name (name), ==, NULL); + + g_object_unref (name); + + /* Build a name with an empty string full name and check the serialisation */ + name = gdata_gd_name_new ("Georgey", "Porgey"); + gdata_gd_name_set_full_name (name, ""); + + g_assert_cmpstr (gdata_gd_name_get_full_name (name), ==, NULL); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (name, + "" + "" + "Georgey" + "Porgey" + ""); + + g_object_unref (name); +} + +static void +test_gd_name_comparison (void) +{ + GDataGDName *name1, *name2; + + /* Names are only equal if the given, additional and family names are all equal, and the prefixes are equal too. */ + name1 = gdata_gd_name_new ("Given", "Family"); + gdata_gd_name_set_additional_name (name1, "Additional"); + gdata_gd_name_set_prefix (name1, "Mrs"); + name2 = gdata_gd_name_new ("Given", "Family"); + gdata_gd_name_set_additional_name (name2, "Additional"); + gdata_gd_name_set_prefix (name2, "Mrs"); + + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (name1), GDATA_COMPARABLE (name2)), ==, 0); + + /* Different given names. */ + gdata_gd_name_set_given_name (name1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (name1), GDATA_COMPARABLE (name2)), !=, 0); + + /* Different additional names. */ + gdata_gd_name_set_given_name (name1, "Given"); + gdata_gd_name_set_additional_name (name1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (name1), GDATA_COMPARABLE (name2)), !=, 0); + + /* Different family names. */ + gdata_gd_name_set_additional_name (name1, "Additional"); + gdata_gd_name_set_family_name (name1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (name1), GDATA_COMPARABLE (name2)), !=, 0); + + /* Different prefixes. */ + gdata_gd_name_set_family_name (name1, "Family"); + gdata_gd_name_set_prefix (name1, "Mr"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (name1), GDATA_COMPARABLE (name2)), !=, 0); + + g_object_unref (name2); + g_object_unref (name1); +} + +static void +test_gd_organization (void) +{ + GDataGDOrganization *org, *org2; + GDataGDWhere *location; + GError *error = NULL; + const gchar *content_type; + + org = GDATA_GD_ORGANIZATION (gdata_parsable_new_from_xml (GDATA_TYPE_GD_ORGANIZATION, + "" + "Google, Inc." + "<Angle Bracketeer>" + "Finance" + "Doing stuff." + "FOO" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_ORGANIZATION (org)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_organization_get_name (org), ==, "Google, Inc."); + g_assert_cmpstr (gdata_gd_organization_get_title (org), ==, ""); + g_assert_cmpstr (gdata_gd_organization_get_relation_type (org), ==, GDATA_GD_ORGANIZATION_WORK); + g_assert_cmpstr (gdata_gd_organization_get_label (org), ==, "Work & Occupation"); + g_assert_cmpstr (gdata_gd_organization_get_department (org), ==, "Finance"); + g_assert_cmpstr (gdata_gd_organization_get_job_description (org), ==, "Doing stuff."); + g_assert_cmpstr (gdata_gd_organization_get_symbol (org), ==, "FOO"); + location = gdata_gd_organization_get_location (org); + g_assert (GDATA_IS_GD_WHERE (location)); + g_assert (gdata_gd_organization_is_primary (org) == TRUE); + + /* Compare it against another identical organization */ + org2 = gdata_gd_organization_new ("Google, Inc.", "", GDATA_GD_ORGANIZATION_WORK, "Work & Occupation", TRUE); + gdata_gd_organization_set_department (org2, "Finance"); + gdata_gd_organization_set_location (org2, location); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (org), GDATA_COMPARABLE (org2)), ==, 0); + + /* …and a different one */ + gdata_gd_organization_set_title (org2, "Demoted!"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (org), GDATA_COMPARABLE (org2)), !=, 0); + g_object_unref (org2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (org)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (org, + "" + "" + "Google, Inc." + "<Angle Bracketeer>" + "Finance" + "Doing stuff." + "FOO" + "" + ""); + g_object_unref (org); + + /* Now parse an organization with less information available */ + org = GDATA_GD_ORGANIZATION (gdata_parsable_new_from_xml (GDATA_TYPE_GD_ORGANIZATION, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_ORGANIZATION (org)); + g_clear_error (&error); + + /* Check the properties */ + g_assert (gdata_gd_organization_get_name (org) == NULL); + g_assert (gdata_gd_organization_get_title (org) == NULL); + g_assert (gdata_gd_organization_get_relation_type (org) == NULL); + g_assert (gdata_gd_organization_get_label (org) == NULL); + g_assert (gdata_gd_organization_is_primary (org) == FALSE); + g_assert (gdata_gd_organization_get_department (org) == NULL); + g_assert (gdata_gd_organization_get_job_description (org) == NULL); + g_assert (gdata_gd_organization_get_symbol (org) == NULL); + g_assert (gdata_gd_organization_get_location (org) == NULL); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (org)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML contains the unknown XML */ + gdata_test_assert_xml (org, + "" + ""); + g_object_unref (org); +} + +static void +test_gd_organization_escaping (void) +{ + GDataGDOrganization *org; + + org = gdata_gd_organization_new ("Steptoe & Son", "Title & Stuff", GDATA_GD_ORGANIZATION_WORK "?foo&bar", "Personal & Private", TRUE); + gdata_gd_organization_set_department (org, "Department & Stuff"); + gdata_gd_organization_set_job_description (org, "Escaping ."); + gdata_gd_organization_set_symbol (org, "<&>"); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (org, + "" + "" + "Steptoe & Son" + "Title & Stuff" + "Department & Stuff" + "Escaping <brackets>." + "<&>" + ""); + g_object_unref (org); +} + +static void +test_gd_organization_comparison (void) +{ + GDataGDOrganization *org1, *org2; + + /* Organisation positions are equal if the name, title and department are all equal. */ + org1 = gdata_gd_organization_new ("Name", "Title", NULL, NULL, TRUE); + gdata_gd_organization_set_department (org1, "Department"); + org2 = gdata_gd_organization_new ("Name", "Title", NULL, "label", FALSE); + gdata_gd_organization_set_department (org2, "Department"); + + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (org1), GDATA_COMPARABLE (org2)), ==, 0); + + /* Different name. */ + gdata_gd_organization_set_name (org1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (org1), GDATA_COMPARABLE (org2)), !=, 0); + + /* Different title. */ + gdata_gd_organization_set_name (org1, "Name"); + gdata_gd_organization_set_title (org1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (org1), GDATA_COMPARABLE (org2)), !=, 0); + + /* Different department. */ + gdata_gd_organization_set_title (org1, "Title"); + gdata_gd_organization_set_department (org1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (org1), GDATA_COMPARABLE (org2)), !=, 0); + + g_object_unref (org2); + g_object_unref (org1); +} + +static void +test_gd_phone_number (void) +{ + GDataGDPhoneNumber *phone, *phone2; + GError *error = NULL; + const gchar *content_type; + + phone = GDATA_GD_PHONE_NUMBER (gdata_parsable_new_from_xml (GDATA_TYPE_GD_PHONE_NUMBER, + "+1 206 555 1212", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_PHONE_NUMBER (phone)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_phone_number_get_number (phone), ==, "+1 206 555 1212"); + g_assert_cmpstr (gdata_gd_phone_number_get_uri (phone), ==, "tel:+12065551212"); + g_assert_cmpstr (gdata_gd_phone_number_get_relation_type (phone), ==, GDATA_GD_PHONE_NUMBER_MOBILE); + g_assert_cmpstr (gdata_gd_phone_number_get_label (phone), ==, "Personal & business calls only"); + g_assert (gdata_gd_phone_number_is_primary (phone) == FALSE); + + /* Compare it against another identical number */ + phone2 = gdata_gd_phone_number_new ("+1 206 555 1212", GDATA_GD_PHONE_NUMBER_MOBILE, "Personal & business calls only", + "tel:+12065551212", FALSE); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (phone), GDATA_COMPARABLE (phone2)), ==, 0); + + /* …and a different one */ + gdata_gd_phone_number_set_number (phone2, "+1 206 555 1212 666"); + gdata_gd_phone_number_set_uri (phone2, NULL); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (phone), GDATA_COMPARABLE (phone2)), !=, 0); + g_object_unref (phone2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (phone)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (phone, + "" + "+1 206 555 1212"); + + /* Check we trim whitespace properly, and respect Unicode characters */ + gdata_gd_phone_number_set_number (phone, " 0123456 (789) ëxt 300 "); + g_assert_cmpstr (gdata_gd_phone_number_get_number (phone), ==, "0123456 (789) ëxt 300"); + g_object_unref (phone); + + /* Now parse a phone number with less information available, but some extraneous whitespace */ + phone = GDATA_GD_PHONE_NUMBER (gdata_parsable_new_from_xml (GDATA_TYPE_GD_PHONE_NUMBER, + " (425) 555-8080 ext. 72585 \n ", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_PHONE_NUMBER (phone)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_phone_number_get_number (phone), ==, "(425) 555-8080 ext. 72585"); + g_assert (gdata_gd_phone_number_get_uri (phone) == NULL); + g_assert (gdata_gd_phone_number_get_relation_type (phone) == NULL); + g_assert (gdata_gd_phone_number_get_label (phone) == NULL); + g_assert (gdata_gd_phone_number_is_primary (phone) == FALSE); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (phone)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML contains the unknown XML */ + gdata_test_assert_xml (phone, + "" + "(425) 555-8080 ext. 72585"); + g_object_unref (phone); +} + +static void +test_gd_phone_number_escaping (void) +{ + GDataGDPhoneNumber *phone; + + phone = gdata_gd_phone_number_new ("0123456789 <54>", GDATA_GD_PHONE_NUMBER_WORK_MOBILE "?foo&bar", "Personal & Private", + "tel:+012345678954?foo&bar", TRUE); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (phone, + "" + "0123456789 <54>"); + g_object_unref (phone); +} + +static void +test_gd_phone_number_comparison (void) +{ + GDataGDPhoneNumber *phone1, *phone2; + + /* Phone numbers are equal if the number or the URI matches (NULL URIs cannot match). */ + phone1 = gdata_gd_phone_number_new ("123", NULL, NULL, "phone://123", TRUE); + phone2 = gdata_gd_phone_number_new ("123", NULL, "label", "phone://123", FALSE); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (phone1), GDATA_COMPARABLE (phone2)), ==, 0); + + /* Same numbers, different URIs. */ + gdata_gd_phone_number_set_uri (phone1, "phone://+44123"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (phone1), GDATA_COMPARABLE (phone2)), ==, 0); + + /* Different numbers, same URIs. */ + gdata_gd_phone_number_set_uri (phone1, "phone://123"); + gdata_gd_phone_number_set_number (phone1, "+44123"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (phone1), GDATA_COMPARABLE (phone2)), ==, 0); + + /* Different numbers and URIs. */ + gdata_gd_phone_number_set_number (phone1, "456"); + gdata_gd_phone_number_set_uri (phone1, "phone://456"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (phone1), GDATA_COMPARABLE (phone2)), !=, 0); + + /* Different numbers, NULL URIs. */ + gdata_gd_phone_number_set_uri (phone1, NULL); + gdata_gd_phone_number_set_uri (phone2, NULL); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (phone1), GDATA_COMPARABLE (phone2)), !=, 0); + + /* Same numbers, NULL URIs. */ + gdata_gd_phone_number_set_number (phone1, "123"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (phone1), GDATA_COMPARABLE (phone2)), ==, 0); + + g_object_unref (phone2); + g_object_unref (phone1); +} + +static void +test_gd_postal_address (void) +{ + GDataGDPostalAddress *postal, *postal2; + GError *error = NULL; + const gchar *content_type; + + postal = GDATA_GD_POSTAL_ADDRESS (gdata_parsable_new_from_xml (GDATA_TYPE_GD_POSTAL_ADDRESS, + "" + "500 West 45th Street" + "New York" + "NY 10036" + "United States" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_POSTAL_ADDRESS (postal)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_postal_address_get_street (postal), ==, "500 West 45th Street"); + g_assert_cmpstr (gdata_gd_postal_address_get_city (postal), ==, "New York"); + g_assert_cmpstr (gdata_gd_postal_address_get_postcode (postal), ==, "NY 10036"); + g_assert_cmpstr (gdata_gd_postal_address_get_relation_type (postal), ==, GDATA_GD_POSTAL_ADDRESS_HOME); + g_assert_cmpstr (gdata_gd_postal_address_get_label (postal), ==, "Home & Safe House"); + g_assert_cmpstr (gdata_gd_postal_address_get_country (postal), ==, "United States"); + g_assert_cmpstr (gdata_gd_postal_address_get_country_code (postal), ==, "US"); + g_assert (gdata_gd_postal_address_is_primary (postal) == TRUE); + + /* Compare it against another identical address */ + postal2 = gdata_gd_postal_address_new (GDATA_GD_POSTAL_ADDRESS_HOME, "Home & Safe House", TRUE); + gdata_gd_postal_address_set_street (postal2, "500 West 45th Street"); + gdata_gd_postal_address_set_city (postal2, "New York"); + gdata_gd_postal_address_set_postcode (postal2, "NY 10036"); + gdata_gd_postal_address_set_country (postal2, "United States", "US"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (postal), GDATA_COMPARABLE (postal2)), ==, 0); + + /* …and a different one */ + gdata_gd_postal_address_set_city (postal2, "Atlas Mountains"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (postal), GDATA_COMPARABLE (postal2)), !=, 0); + g_object_unref (postal2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (postal)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (postal, + "" + "" + "500 West 45th Street" + "New York" + "NY 10036" + "United States" + ""); + + /* Check we trim whitespace properly, and respect Unicode characters */ + gdata_gd_postal_address_set_address (postal, " Schöne Grüße Straße\nGermany "); + g_assert_cmpstr (gdata_gd_postal_address_get_address (postal), ==, "Schöne Grüße Straße\nGermany"); + g_object_unref (postal); + + /* Now parse an address with less information available */ + postal = GDATA_GD_POSTAL_ADDRESS (gdata_parsable_new_from_xml (GDATA_TYPE_GD_POSTAL_ADDRESS, + "f", + -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_POSTAL_ADDRESS (postal)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_postal_address_get_street (postal), ==, "f"); + g_assert (gdata_gd_postal_address_get_relation_type (postal) == NULL); + g_assert (gdata_gd_postal_address_get_label (postal) == NULL); + g_assert (gdata_gd_postal_address_is_primary (postal) == FALSE); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (postal)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML contains the unknown XML */ + gdata_test_assert_xml (postal, + "" + "" + "f"); + g_object_unref (postal); +} + +static void +test_gd_postal_address_escaping (void) +{ + GDataGDPostalAddress *address; + + address = gdata_gd_postal_address_new (GDATA_GD_POSTAL_ADDRESS_WORK "?foo&bar", "Personal & Private", TRUE); + gdata_gd_postal_address_set_address (address, "
"); + gdata_gd_postal_address_set_mail_class (address, GDATA_GD_MAIL_CLASS_BOTH "?foo&bar"); + gdata_gd_postal_address_set_usage (address, GDATA_GD_ADDRESS_USAGE_GENERAL "?foo&bar"); + gdata_gd_postal_address_set_agent (address, ""); + gdata_gd_postal_address_set_house_name (address, "House & House"); + gdata_gd_postal_address_set_street (address, "Church & Main Street"); + gdata_gd_postal_address_set_po_box (address, "<515>"); + gdata_gd_postal_address_set_neighborhood (address, ""); + gdata_gd_postal_address_set_city (address, "City <17>"); + gdata_gd_postal_address_set_subregion (address, "Subregion <5>"); + gdata_gd_postal_address_set_region (address, ""); + gdata_gd_postal_address_set_postcode (address, "Postcode & stuff"); + gdata_gd_postal_address_set_country (address, "", ""); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (address, + "" + "" + "<agent>" + "House & House" + "Church & Main Street" + "<515>" + "<neighbourhood>" + "City <17>" + "Subregion <5>" + "<region>" + "Postcode & stuff" + "<foo>" + "<address>" + ""); + g_object_unref (address); +} + +static void +test_gd_postal_address_comparison (void) +{ + GDataGDPostalAddress *address1, *address2; + + /* Postal addresses compare equal if the street, city, PO box and postcode are all equal. */ + address1 = gdata_gd_postal_address_new (NULL, NULL, TRUE); + gdata_gd_postal_address_set_street (address1, "Street"); + gdata_gd_postal_address_set_city (address1, "City"); + gdata_gd_postal_address_set_po_box (address1, "PO box"); + gdata_gd_postal_address_set_postcode (address1, "Postcode"); + address2 = gdata_gd_postal_address_new (NULL, "label", FALSE); + gdata_gd_postal_address_set_street (address2, "Street"); + gdata_gd_postal_address_set_city (address2, "City"); + gdata_gd_postal_address_set_po_box (address2, "PO box"); + gdata_gd_postal_address_set_postcode (address2, "Postcode"); + + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (address1), GDATA_COMPARABLE (address2)), ==, 0); + + /* Different streets. */ + gdata_gd_postal_address_set_street (address1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (address1), GDATA_COMPARABLE (address2)), !=, 0); + + /* Different cities. */ + gdata_gd_postal_address_set_street (address1, "Street"); + gdata_gd_postal_address_set_city (address1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (address1), GDATA_COMPARABLE (address2)), !=, 0); + + /* Different PO box. */ + gdata_gd_postal_address_set_city (address1, "City"); + gdata_gd_postal_address_set_po_box (address1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (address1), GDATA_COMPARABLE (address2)), !=, 0); + + /* Different postcode. */ + gdata_gd_postal_address_set_po_box (address1, "PO box"); + gdata_gd_postal_address_set_postcode (address1, "Different"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (address1), GDATA_COMPARABLE (address2)), !=, 0); + + g_object_unref (address2); + g_object_unref (address1); +} + +static void +test_gd_reminder (void) +{ + GDataGDReminder *reminder, *reminder2; + gint64 _time; + GError *error = NULL; + const gchar *content_type; + + reminder = GDATA_GD_REMINDER (gdata_parsable_new_from_xml (GDATA_TYPE_GD_REMINDER, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_REMINDER (reminder)); + g_clear_error (&error); + + /* Check the properties */ + g_assert (gdata_gd_reminder_get_method (reminder) == NULL); + g_assert (gdata_gd_reminder_is_absolute_time (reminder) == FALSE); + g_assert_cmpint (gdata_gd_reminder_get_relative_time (reminder), ==, 15 * 24 * 60); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (reminder)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML */ + gdata_test_assert_xml (reminder, + "" + ""); + g_object_unref (reminder); + + /* Try again with a different property */ + reminder = GDATA_GD_REMINDER (gdata_parsable_new_from_xml (GDATA_TYPE_GD_REMINDER, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_REMINDER (reminder)); + g_clear_error (&error); + + /* Check the properties */ + g_assert (gdata_gd_reminder_get_method (reminder) == NULL); + g_assert (gdata_gd_reminder_is_absolute_time (reminder) == FALSE); + g_assert_cmpint (gdata_gd_reminder_get_relative_time (reminder), ==, 15 * 60); + + /* Compare to another reminder */ + reminder2 = gdata_gd_reminder_new (NULL, -1, 15 * 60); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (reminder), GDATA_COMPARABLE (reminder2)), ==, 0); + g_object_unref (reminder2); + g_object_unref (reminder); + + /* …and another */ + reminder = GDATA_GD_REMINDER (gdata_parsable_new_from_xml (GDATA_TYPE_GD_REMINDER, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_REMINDER (reminder)); + g_clear_error (&error); + + /* Check the properties */ + g_assert (gdata_gd_reminder_get_method (reminder) == NULL); + g_assert (gdata_gd_reminder_is_absolute_time (reminder) == FALSE); + g_assert_cmpint (gdata_gd_reminder_get_relative_time (reminder), ==, 15); + g_object_unref (reminder); + + /* Try again with an absolute time and a method */ + reminder = GDATA_GD_REMINDER (gdata_parsable_new_from_xml (GDATA_TYPE_GD_REMINDER, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_REMINDER (reminder)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_reminder_get_method (reminder), ==, GDATA_GD_REMINDER_ALERT); + g_assert (gdata_gd_reminder_is_absolute_time (reminder) == TRUE); + _time = gdata_gd_reminder_get_absolute_time (reminder); + g_assert_cmpint (_time, ==, 1118105700); + + /* Compare to another reminder */ + reminder2 = gdata_gd_reminder_new (GDATA_GD_REMINDER_ALERT, _time, -1); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (reminder), GDATA_COMPARABLE (reminder2)), ==, 0); + g_object_unref (reminder2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (reminder)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML */ + gdata_test_assert_xml (reminder, + "" + ""); + g_object_unref (reminder); +} + +static void +test_gd_reminder_escaping (void) +{ + GDataGDReminder *reminder; + + reminder = gdata_gd_reminder_new (GDATA_GD_REMINDER_ALERT "?foo&bar", -1, 15); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (reminder, + "" + ""); + g_object_unref (reminder); +} + +static void +test_gd_reminder_comparison (void) +{ + GDataGDReminder *reminder1, *reminder2; + +#define ASSERT_COMPARISON(op) \ + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (reminder1), GDATA_COMPARABLE (reminder2)), op, 0) + + /* Check for equality. */ + reminder1 = gdata_gd_reminder_new (GDATA_GD_REMINDER_ALERT, -1, 15); + reminder2 = gdata_gd_reminder_new (GDATA_GD_REMINDER_ALERT, -1, 15); + ASSERT_COMPARISON(==); + + /* Different methods, same time type, same time. */ + gdata_gd_reminder_set_method (reminder1, GDATA_GD_REMINDER_SMS); + ASSERT_COMPARISON(>); + + /* Same method, different time type, same time. */ + gdata_gd_reminder_set_method (reminder1, GDATA_GD_REMINDER_ALERT); + gdata_gd_reminder_set_relative_time (reminder1, -1); + gdata_gd_reminder_set_absolute_time (reminder1, 5); + ASSERT_COMPARISON(>); + + /* Same method, same time type, different time. */ + gdata_gd_reminder_set_absolute_time (reminder1, -1); + gdata_gd_reminder_set_relative_time (reminder1, 20); + ASSERT_COMPARISON(>); + + g_object_unref (reminder2); + g_object_unref (reminder1); + +#undef ASSERT_COMPARISON +} + +static void +test_gd_when (void) +{ + GDataGDWhen *when, *when2; + GDataGDReminder *reminder; + GList *reminders; + gint64 _time, _time2; + GError *error = NULL; + const gchar *content_type; + + when = GDATA_GD_WHEN (gdata_parsable_new_from_xml (GDATA_TYPE_GD_WHEN, + "", + -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_WHEN (when)); + g_clear_error (&error); + + /* Check the properties */ + _time = gdata_gd_when_get_start_time (when); + g_assert_cmpint (_time, ==, 1118106000); + _time2 = gdata_gd_when_get_end_time (when); + g_assert_cmpint (_time2, ==, 1118109600); + g_assert (gdata_gd_when_is_date (when) == FALSE); + g_assert (gdata_gd_when_get_value_string (when) == NULL); + g_assert (gdata_gd_when_get_reminders (when) == NULL); + + /* Compare it against another identical time */ + when2 = gdata_gd_when_new (_time, _time2, FALSE); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (when), GDATA_COMPARABLE (when2)), ==, 0); + + /* …and a different one */ + _time2 = 100; + gdata_gd_when_set_end_time (when2, _time2); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (when), GDATA_COMPARABLE (when2)), !=, 0); + g_object_unref (when2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (when)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (when, + "" + ""); + g_object_unref (when); + + /* Now parse a time with different information */ + when = GDATA_GD_WHEN (gdata_parsable_new_from_xml (GDATA_TYPE_GD_WHEN, + "" + "" + "" + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_WHEN (when)); + g_clear_error (&error); + + /* Check the properties */ + _time = gdata_gd_when_get_start_time (when); + g_assert_cmpint (_time, ==, 1118016000); + _time2 = gdata_gd_when_get_end_time (when); + g_assert_cmpint (_time2, ==, 1118188800); + g_assert (gdata_gd_when_is_date (when) == TRUE); + g_assert_cmpstr (gdata_gd_when_get_value_string (when), ==, "This weekend"); + + reminders = gdata_gd_when_get_reminders (when); + g_assert (reminders != NULL); + g_assert (GDATA_IS_GD_REMINDER (reminders->data)); + g_assert (reminders->next == NULL); + g_assert (gdata_gd_reminder_is_absolute_time (GDATA_GD_REMINDER (reminders->data)) == FALSE); + g_assert_cmpint (gdata_gd_reminder_get_relative_time (GDATA_GD_REMINDER (reminders->data)), ==, 15); + + /* Add another reminder */ + reminder = gdata_gd_reminder_new (GDATA_GD_REMINDER_ALERT, _time, -1); + gdata_gd_when_add_reminder (when, reminder); + g_object_unref (reminder); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (when)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is correct */ + gdata_test_assert_xml (when, + "" + "" + "" + "" + "" + ""); + g_object_unref (when); +} + +static void +test_gd_when_escaping (void) +{ + GDataGDWhen *when; + GTimeVal start_time; + + g_time_val_from_iso8601 ("2005-06-07T01:00:00Z", &start_time); + when = gdata_gd_when_new (start_time.tv_sec, -1, FALSE); + gdata_gd_when_set_value_string (when, "Value string & stuff!"); + + /* Check the outputted XML is escaped properly */ + gdata_test_assert_xml (when, + "" + ""); + g_object_unref (when); +} + +static void +test_gd_when_comparison (void) +{ + GDataGDWhen *when1, *when2; + + /* Whens are non-equal if one is a date and the other isn't, if their start times differ, or if their end times differ. */ + when1 = gdata_gd_when_new (0, 1000, FALSE); + when2 = gdata_gd_when_new (0, 1000, FALSE); + + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (when1), GDATA_COMPARABLE (when2)), ==, 0); + + /* Different date/time type. */ + gdata_gd_when_set_is_date (when1, TRUE); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (when1), GDATA_COMPARABLE (when2)), !=, 0); + + /* Different start time. */ + gdata_gd_when_set_is_date (when1, FALSE); + gdata_gd_when_set_start_time (when1, 500); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (when1), GDATA_COMPARABLE (when2)), !=, 0); + + /* Different end time. */ + gdata_gd_when_set_start_time (when1, 0); + gdata_gd_when_set_end_time (when1, 15000); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (when1), GDATA_COMPARABLE (when2)), !=, 0); + + g_object_unref (when2); + g_object_unref (when1); +} + +static void +test_gd_where (void) +{ + GDataGDWhere *where, *where2; + GError *error = NULL; + const gchar *content_type; + + where = GDATA_GD_WHERE (gdata_parsable_new_from_xml (GDATA_TYPE_GD_WHERE, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_WHERE (where)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_where_get_relation_type (where), ==, GDATA_GD_WHERE_EVENT_ALTERNATE); + g_assert_cmpstr (gdata_gd_where_get_value_string (where), ==, "Metropolis"); + g_assert_cmpstr (gdata_gd_where_get_label (where), ==, "New York Location "); + + /* Compare it against another identical place */ + where2 = gdata_gd_where_new (GDATA_GD_WHERE_EVENT_ALTERNATE, "Metropolis", "New York Location "); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (where), GDATA_COMPARABLE (where2)), ==, 0); + + /* …and a different one */ + gdata_gd_where_set_label (where2, "Atlas Mountains"); + g_assert_cmpint (gdata_comparable_compare (GDATA_COMPARABLE (where), GDATA_COMPARABLE (where2)), !=, 0); + g_object_unref (where2); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (where)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML is the same */ + gdata_test_assert_xml (where, + "" + ""); + g_object_unref (where); + + /* Now parse a place with less information available */ + where = GDATA_GD_WHERE (gdata_parsable_new_from_xml (GDATA_TYPE_GD_WHERE, + "", -1, &error)); + g_assert_no_error (error); + g_assert (GDATA_IS_GD_WHERE (where)); + g_clear_error (&error); + + /* Check the properties */ + g_assert_cmpstr (gdata_gd_where_get_value_string (where), ==, "Google Cafeteria "); + g_assert (gdata_gd_where_get_relation_type (where) == NULL); + g_assert (gdata_gd_where_get_label (where) == NULL); + + content_type = gdata_parsable_get_content_type (GDATA_PARSABLE (where)); + g_assert_cmpstr (content_type, ==, "application/atom+xml"); + + /* Check the outputted XML contains the unknown XML */ + gdata_test_assert_xml (where, + "" + ""); + g_object_unref (where); +} + +static void +test_gd_where_escaping (void) +{ + GDataGDWhere *where; + + where = gdata_gd_where_new (GDATA_GD_WHERE_EVENT "?foo&bar", "Value string & stuff!", "